ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
d3arr1.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 #include "admb_messages.h"
7 
8 #ifndef OPT_LIB
9 
16 double& d3_array::operator()(int i, int j, int k)
17 {
18  if (i < slicemin())
19  {
20  ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- slice index too low",
21  "dmatrix& d3_array::operator() (int i, int j, int k)",
22  slicemin(), slicemax(), i);
23  }
24  if (i > slicemax())
25  {
26  ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- slice index too high",
27  "dmatrix& d3_array::operator() (int i, int j, int k)",
28  slicemin(), slicemax(), i);
29  }
30  return (elem(i))(j, k);
31 }
39 dvector& d3_array::operator()(int i, int j)
40 {
41  if (i < slicemin())
42  {
43  ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- slice index too low",
44  "dmatrix& d3_array::operator()(int i, int j)",
45  slicemin(), slicemax(), i);
46  }
47  if (i > slicemax())
48  {
49  ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- slice index too high",
50  "dmatrix& d3_array::operator()(int i, int j)",
51  slicemin(), slicemax(), i);
52  }
53  return (elem(i))(j);
54 }
61 {
62  if (i < slicemin())
63  {
64  ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
65  "dmatrix& d3_array::operator[] (int i)", indexmin(), indexmax(), i);
66  }
67  if (i > slicemax())
68  {
69  ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
70  "dmatrix& d3_array::operator[] (int i)", indexmin(), indexmax(), i);
71  }
72  return t[i];
73 }
80 {
81  if (i < slicemin())
82  {
83  ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
84  "dmatrix& d3_array::operator()(int i)", indexmin(), indexmax(), i);
85  }
86  if (i > slicemax())
87  {
88  ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
89  "dmatrix& d3_array::operator()(int i)", indexmin(), indexmax(), i);
90  }
91  return t[i];
92 }
93 #endif
int indexmax() const
Definition: fvar.hpp:3822
Vector of double precision numbers.
Definition: dvector.h:50
dmatrix * t
Definition: fvar.hpp:3729
int slicemax() const
Definition: fvar.hpp:3830
int j
Definition: fvar.hpp:3636
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int slicemin() const
Definition: fvar.hpp:3826
Description not yet available.
Definition: fvar.hpp:2819
#define ADMB_ARRAY_BOUNDS_ERROR(message, function, lower_bounds, upper_bounds, index)
Definition: admb_messages.h:47
dmatrix & operator[](int i)
Definition: fvar.hpp:3934
double & operator()(int k, int i, int j)
Definition: fvar.hpp:3922
int indexmin() const
Definition: fvar.hpp:3818
dmatrix & elem(int k)
Definition: fvar.hpp:3870