ADMB Documentation  11.1.2397
 All Classes Files Functions Variables Typedefs Friends Defines
d3arr1.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: d3arr1.cpp 1921 2014-04-23 18:47:05Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include "fvar.hpp"
00012 #include "admb_messages.h"
00013 
00014 #ifndef OPT_LIB
00015 
00019     double& d3_array::operator () (int k, int i, int j)
00020     {
00021         if (k<slicemin())
00022         {
00023          ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- slice index too low",
00024          "dmatrix& d3_array::operator() (int k, int i, int j)",
00025          slicemin(), slicemax(), k);
00026         }
00027         if (k>slicemax())
00028         {
00029         ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- slice index too high",
00030         "dmatrix& d3_array::operator() (int k, int i, int j)",
00031         slicemin(), slicemax(), k);
00032         }
00033       return ( (elem(k))(i,j) );
00034     }
00035 
00040     dvector& d3_array::operator () (int k, int i)
00041     {
00042         if (k<slicemin())
00043         {
00044          ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- slice index too low",
00045          "dmatrix& d3_array::operator() (int k, int i)",
00046          slicemin(), slicemax(), k);
00047         }
00048         if (k>slicemax())
00049         {
00050          ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- slice index too high",
00051          "dmatrix& d3_array::operator() (int k, int i)",
00052          slicemin(), slicemax(), k);
00053         }
00054       return ( (elem(k))(i) );
00055     }
00056 
00061  dmatrix& d3_array::operator[] (int i)
00062  {
00063      if (i<slicemin())
00064      {
00065        ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
00066        "dmatrix& d3_array::operator[] (int i)", indexmin(), indexmax(), i);
00067      }
00068      if (i>slicemax())
00069      {
00070        ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
00071        "dmatrix& d3_array::operator[] (int i)", indexmin(), indexmax(), i);
00072      }
00073    return(t[i]);
00074  }
00075 
00080  dmatrix& d3_array::operator() (int i)
00081  {
00082      if (i<slicemin())
00083      {
00084        ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
00085        "dmatrix& d3_array::operator() (int i)", indexmin(), indexmax(), i);
00086      }
00087      if (i>slicemax())
00088      {
00089        ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
00090        "dmatrix& d3_array::operator() (int i)", indexmin(), indexmax(), i);
00091      }
00092    return(t[i]);
00093  }
00094 #endif