comparison liboctave/Bounds.h @ 5275:23b37da9fd5b

[project @ 2005-04-08 16:07:35 by jwe]
author jwe
date Fri, 08 Apr 2005 16:07:37 +0000
parents e35b034d3523
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
5274:eae7b40388e9 5275:23b37da9fd5b
33 public: 33 public:
34 34
35 Bounds (void) 35 Bounds (void)
36 : lb (), ub () { } 36 : lb (), ub () { }
37 37
38 Bounds (int n) 38 Bounds (octave_idx_type n)
39 : lb (n, 0.0), ub (n, 0.0) { } 39 : lb (n, 0.0), ub (n, 0.0) { }
40 40
41 Bounds (const ColumnVector l, const ColumnVector u) 41 Bounds (const ColumnVector l, const ColumnVector u)
42 : lb (l), ub (u) 42 : lb (l), ub (u)
43 { 43 {
61 return *this; 61 return *this;
62 } 62 }
63 63
64 ~Bounds (void) { } 64 ~Bounds (void) { }
65 65
66 Bounds& resize (int n) 66 Bounds& resize (octave_idx_type n)
67 { 67 {
68 lb.resize (n); 68 lb.resize (n);
69 ub.resize (n); 69 ub.resize (n);
70 70
71 return *this; 71 return *this;
72 } 72 }
73 73
74 double lower_bound (int index) const { return lb.elem (index); } 74 double lower_bound (octave_idx_type index) const { return lb.elem (index); }
75 double upper_bound (int index) const { return ub.elem (index); } 75 double upper_bound (octave_idx_type index) const { return ub.elem (index); }
76 76
77 ColumnVector lower_bounds (void) const { return lb; } 77 ColumnVector lower_bounds (void) const { return lb; }
78 ColumnVector upper_bounds (void) const { return ub; } 78 ColumnVector upper_bounds (void) const { return ub; }
79 79
80 int size (void) const { return lb.capacity (); } 80 octave_idx_type size (void) const { return lb.capacity (); }
81 81
82 Bounds& set_bound (int index, double low, double high) 82 Bounds& set_bound (octave_idx_type index, double low, double high)
83 { 83 {
84 lb.elem (index) = low; 84 lb.elem (index) = low;
85 ub.elem (index) = high; 85 ub.elem (index) = high;
86 return *this; 86 return *this;
87 } 87 }
93 return *this; 93 return *this;
94 } 94 }
95 95
96 Bounds& set_bounds (const ColumnVector lb, const ColumnVector ub); 96 Bounds& set_bounds (const ColumnVector lb, const ColumnVector ub);
97 97
98 Bounds& set_lower_bound (int index, double low) 98 Bounds& set_lower_bound (octave_idx_type index, double low)
99 { 99 {
100 lb.elem (index) = low; 100 lb.elem (index) = low;
101 return *this; 101 return *this;
102 } 102 }
103 103
104 Bounds& set_upper_bound (int index, double high) 104 Bounds& set_upper_bound (octave_idx_type index, double high)
105 { 105 {
106 ub.elem (index) = high; 106 ub.elem (index) = high;
107 return *this; 107 return *this;
108 } 108 }
109 109