Revision 1921 trunk/src/linad99/f4arr.cpp
f4arr.cpp (revision 1921)  

125  125 
*/ 
126  126 
dvar3_array& dvar4_array::operator ( ) (int i) 
127  127 
{ 
128 
#ifdef SAFE_ARRAYS 

129  128 
if (i < hslicemin()  i > hslicemax()) 
130  129 
{ 
131  130 
ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds", 
132  131 
"dvar3_array& dvar4_array::operator() (int i)", 
133  132 
hslicemin(), hslicemax(), i); 
134  133 
} 
135 
#endif 

136  134 
return t[i]; 
137  135 
} 
138  136  
...  ...  
142  140 
*/ 
143  141 
dvar3_array& dvar4_array::operator [] (int i) 
144  142 
{ 
145 
#ifdef SAFE_ARRAYS 

146  143 
if (i < hslicemin()  i > hslicemax()) 
147  144 
{ 
148  145 
ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds", 
149  146 
"dvar3_array& dvar4_array::operator[] (int i)", 
150  147 
hslicemin(), hslicemax(), i); 
151  148 
} 
152 
#endif 

153  149 
return t[i]; 
154  150 
} 
155  151  
...  ...  
159  155 
*/ 
160  156 
dvar_matrix& dvar4_array::operator ( ) (int i ,int j) 
161  157 
{ 
162 
#ifdef SAFE_ARRAYS 

163  158 
if (i < hslicemin()  i > hslicemax()) 
164  159 
{ 
165  160 
ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds", 
166  161 
"dvar_matrix& dvar4_array::operator() (int i, int j)", 
167  162 
hslicemin(), hslicemax(), i); 
168  163 
} 
169 
#endif 

170  164 
return ((*this)(i))(j); 
171  165 
} 
172  166  
...  ...  
176  170 
*/ 
177  171 
dvar_vector& dvar4_array::operator ( ) (int i,int j,int k) 
178  172 
{ 
179 
#ifdef SAFE_ARRAYS 

180  173 
if (i < hslicemin()  i > hslicemax()) 
181  174 
{ 
182  175 
ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds", 
183  176 
"dvar_vector& dvar4_array::operator() (int i, int j, int k)", 
184  177 
hslicemin(), hslicemax(), i); 
185  178 
} 
186 
#endif 

187  179 
return (((*this)(i,j))(k)); 
188  180 
} 
189  181  
...  ...  
193  185 
*/ 
194  186 
prevariable dvar4_array::operator ( ) (int i,int j,int k,int l) 
195  187 
{ 
196 
#ifdef SAFE_ARRAYS 

197  188 
if (i < hslicemin()  i > hslicemax()) 
198  189 
{ 
199  190 
ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds", 
200  191 
"prevariable& dvar4_array::operator() (int i, int j, int k)", 
201  192 
hslicemin(), hslicemax(), i); 
202  193 
} 
203 
#endif 

204  194 
return ( ((*this)(i,j,k))(l)); 
205  195 
} 
206  196  
...  ...  
210  200 
*/ 
211  201 
const dvar3_array& dvar4_array::operator()(int i) const 
212  202 
{ 
213 
#ifdef SAFE_ARRAYS 

214  203 
if (i<hslicemin()i>hslicemax()) 
215  204 
{ cerr << "Error hslice index out of bounds in\n" 
216  205 
"dvar3_array& dvar4_array::operator ( )" << endl; 
217  206 
ad_exit(1); 
218  207 
} 
219 
#endif 

220  208 
return t[i]; 
221  209 
} 
222  210  
...  ...  
226  214 
*/ 
227  215 
const dvar3_array& dvar4_array::operator[](int i) const 
228  216 
{ 
229 
#ifdef SAFE_ARRAYS 

230  217 
if (i<hslicemin()i>hslicemax()) 
231  218 
{ cerr << "Error hslice index out of bounds in\n" 
232  219 
"dvar3_array& dvar4_array::operator ( )" << endl; 
Also available in: Unified diff