5 #if (__cplusplus > 199711L)
21 #if (__cplusplus <= 199711L)
30 auto end = begin + darray.
size();
31 std::for_each(begin, end, [&total](
const d4_array& darray)
61 cerr <<
"Warning -- Unable to shallow copy an unallocated d5_array.\n";
86 cerr <<
"Warning -- Unable to deallocate an unallocated d5_array.\n";
106 cerr <<
"Incompatible bounds in"
107 <<
" d5_array& d5_array::operator=(const d5_array&).\n";
110 for (
int i = min; i <=
max; ++i)
119 #if (__cplusplus <= 199711L)
125 if (
operator!() ==
false)
128 auto end = begin +
size();
129 std::for_each(begin, end, [](
d4_array& darray)
156 d4_array& d5_array::operator ( ) (
int i)
158 if (i < indexmin() || i > indexmax())
161 "d4_array& d5_array::operator()(int i)", indexmin(), indexmax(), i);
185 d3_array& d5_array::operator ( ) (
int i,
int j)
187 if (i < indexmin() || i > indexmax())
190 "d3_array& d5_array::operator[](int i, int j)",
191 indexmin(), indexmax(), i);
200 dmatrix& d5_array::operator ( ) (
int i,
int j,
int k)
202 if (i < indexmin() || i > indexmax())
205 "dmatrix& d5_array::operator[](int i, int j, int k)",
206 indexmin(), indexmax(), i);
215 dvector& d5_array::operator ( ) (
int i,
int j,
int k,
int l)
217 if (i < indexmin() || i > indexmax())
220 "dvector& d5_array::operator[](int i, int j, int k, int l)",
221 indexmin(), indexmax(), i);
223 return elem(i)(
j,k,l);
230 double& d5_array::operator ( ) (
int i,
int j,
int k,
int l,
int m)
232 if (i < indexmin() || i > indexmax())
235 "double& d5_array::operator[](int i, int j, int k, int l, int m)",
236 indexmin(), indexmax(), i);
238 return elem(i)(
j,k,l,m);
248 { cerr <<
"Error index out of bounds in\n"
249 "d4_array& d5_array::operator ( )" <<
endl;
262 { cerr <<
"Error index out of bounds in\n"
263 "d4_array& d5_array::operator []" <<
endl;
276 { cerr <<
"Error index out of bounds in\n"
277 "d3_array& d5_array::operator ( )" <<
endl;
290 { cerr <<
"Error index out of bounds in\n"
291 "d3_array& d5_array::operator ( )" <<
endl;
304 { cerr <<
"Error hslice index out of bounds in\n"
305 "dvector& d5_array::operator ( )" <<
endl;
308 return elem(i)(
j,k,l);
318 { cerr <<
"Error hslice index out of bounds in\n"
319 "dvector& d5_array::operator ( )" <<
endl;
322 return elem(i)(
j,k,l,m);
332 int nrh,
int ncl,
int nch,
int l5,
int u5)
334 allocate(hsl,hsu,sl,sh,nrl,nrh,ncl,nch,l5,u5);
346 allocate(hsl,hsu,sl,sh,nrl,nrh,ncl,nch,l5,u5);
353 int nrh,
int ncl,
int nch,
int l5,
int u5)
357 cerr <<
" Error allocating memory in d5_array contructor\n";
360 unsigned int ss =
size();
363 cerr <<
" Error allocating memory in d5_array contructor\n";
367 for (
int i = hsl; i <= hsu; ++i)
369 t[i].
allocate(sl, sh, nrl, nrh, ncl, nch, l5, u5);
392 cerr <<
" Error allocating memory in d5_array contructor\n";
395 unsigned int ss =
size();
398 cerr <<
" Error allocating memory in d5_array contructor\n";
414 cerr <<
" Error allocating memory in d5_array contructor\n";
416 unsigned int ss =
size();
419 cerr <<
" Error allocating memory in d5_array contructor\n";
425 for (
int i = il; i <= iu; ++i)
428 ncl(i),nch(i), l5(i),u5(i));
Uses polymorphism to get index information from various data types to be used in constructing and all...
void allocate(int hsl, int hsu, int sl, int sh, int nrl, int nrh, int ncl, int nch)
Allocate arrays with dimension [hsl to hsu] x [sl to sh] x [nrl to nrh] x [ncl to nch]...
Description not yet available.
Vector of double precision numbers.
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d5_array & operator=(const d5_array &)
Assigns element values from other to d5_array.
Description not yet available.
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d5_array()
Description not yet available.
Description not yet available.
#define ADMB_ARRAY_BOUNDS_ERROR(message, function, lower_bounds, upper_bounds, index)
void deallocate(void)
Deallocate d5_array memory.
void shallow_copy(const d5_array &)
Shallow copy pointers from other data structure.
void initialize()
Description not yet available.
d4_array & operator[](int i)
void allocate(void)
Description not yet available.
void initialize()
Initialize all elements of d5_array to zero.
Description not yet available.
d4_array & operator()(int i)
Description not yet available.
unsigned int size() const