3
|
1 // Bounds.h -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (_Bounds_h) |
|
25 #define _Bounds_h 1 |
|
26 |
238
|
27 class ostream; |
3
|
28 |
|
29 #include "Matrix.h" |
|
30 |
|
31 #ifndef Vector |
|
32 #define Vector ColumnVector |
|
33 #endif |
|
34 |
|
35 class Bounds |
|
36 { |
|
37 public: |
|
38 |
|
39 Bounds (void); |
|
40 Bounds (int n); |
|
41 Bounds (const Vector lb, const Vector ub); |
|
42 Bounds (const Bounds& a); |
|
43 |
|
44 Bounds& operator = (const Bounds& a); |
|
45 |
|
46 Bounds& resize (int n); |
|
47 |
|
48 double lower_bound (int index) const; |
|
49 double upper_bound (int index) const; |
|
50 |
|
51 Vector lower_bounds (void) const; |
|
52 Vector upper_bounds (void) const; |
|
53 |
|
54 int size (void) const; |
|
55 |
|
56 Bounds& set_bound (int index, double low, double high); |
|
57 |
|
58 Bounds& set_bounds (double low, double high); |
|
59 Bounds& set_bounds (const Vector lb, const Vector ub); |
|
60 |
|
61 Bounds& set_lower_bound (int index, double low); |
|
62 Bounds& set_upper_bound (int index, double high); |
|
63 |
|
64 Bounds& set_lower_bounds (double low); |
|
65 Bounds& set_upper_bounds (double high); |
|
66 |
|
67 Bounds& set_lower_bounds (const Vector lb); |
|
68 Bounds& set_upper_bounds (const Vector ub); |
|
69 |
|
70 friend ostream& operator << (ostream& os, const Bounds& b); |
|
71 |
|
72 protected: |
|
73 |
|
74 Vector lb; |
|
75 Vector ub; |
|
76 |
|
77 int nb; |
|
78 |
|
79 private: |
|
80 |
|
81 void error (const char *msg); |
|
82 |
|
83 }; |
|
84 |
|
85 #endif |
|
86 |
|
87 /* |
|
88 ;;; Local Variables: *** |
|
89 ;;; mode: C++ *** |
|
90 ;;; page-delimiter: "^/\\*" *** |
|
91 ;;; End: *** |
|
92 */ |