ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
i3arr1.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id$
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 //#include "i3_array.h"
00014 
00015 #ifndef OPT_LIB
00016 
00021     int& i3_array::operator () (int k, int i, int j)
00022     {
00023       if (k < slicemin())
00024       {
00025         ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
00026         "ivector& i3_array::operator() (int k, int i, int j)",
00027         slicemin(), slicemax(), k);
00028       }
00029       if (k > slicemax())
00030       {
00031         ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
00032         "ivector& i3_array::operator() (int k, int i, int j)",
00033         slicemin(), slicemax(), k);
00034       }
00035       return ( (elem(k))(i,j) );
00036     }
00037 
00042     ivector& i3_array::operator () (int k, int i)
00043     {
00044       if (k < slicemin())
00045       {
00046         ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
00047         "ivector& i3_array::operator() (int k, int i)",
00048         slicemin(), slicemax(), k);
00049       }
00050       if (k > slicemax())
00051       {
00052         ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
00053         "ivector& i3_array::operator() (int k, int i)",
00054         slicemin(), slicemax(), k);
00055       }
00056       return ( (elem(k))(i) );
00057     }
00058 
00063  imatrix& i3_array::operator[] (int i)
00064  {
00065    if (i < slicemin())
00066    {
00067      ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
00068      "imatrix& i3_array::operator[] (int i)", slicemin(), slicemax(), i);
00069    }
00070    if (i > slicemax())
00071    {
00072      ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
00073      "imatrix& i3_array::operator[] (int i)", slicemin(), slicemax(), i);
00074    }
00075    return(t[i]);
00076  }
00077 
00082  imatrix& i3_array::operator() (int i)
00083  {
00084    if (i < slicemin())
00085    {
00086      ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
00087      "imatrix& i3_array::operator() (int i)", slicemin(), slicemax(), i);
00088    }
00089    if (i > slicemax())
00090    {
00091      ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
00092      "imatrix& i3_array::operator() (int i)", slicemin(), slicemax(), i);
00093    }
00094    return(t[i]);
00095  }
00096 #endif