ADMB Documentation  11.1.1913
 All Classes Files Functions Variables Typedefs Friends Defines
f3arr12.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: f3arr12.cpp 1131 2013-08-02 22:51:34Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include "fvar.hpp"
00012 #ifndef OPT_LIB
00013 
00018 const prevariable dvar3_array::operator()(int k, int i, int j) const
00019     {
00020       #ifdef SAFE_ARRAYS
00021         if (k<slicemin())
00022         {
00023           cerr << "array bound exceeded -- slice index too"
00024            " low in d3_array::operator(int,int,int)\n"
00025            " mimumum bound is " << slicemin() << "  you have "
00026            << k << "\n";
00027           ad_exit(1);
00028         }
00029         if (k>slicemax())
00030         {
00031           cerr << "array bound exceeded -- slice index too"
00032            " high in d3_array::operator(int,int,int)\n"
00033            " maximum bound is " << slicemax() << "  you have "
00034            << k << "\n";
00035           ad_exit(1);
00036         }
00037         return ( ((t[k].m[i]).va)+j );
00038       #else
00039         return ( ((t[k].m[i]).va)+j );
00040       #endif
00041     }
00042 
00047 const dvar_vector& dvar3_array::operator()(int k, int i) const
00048     {
00049       #ifdef SAFE_ARRAYS
00050         if (k<slicemin())
00051         {
00052           cerr << "array bound exceeded -- slice index too"
00053            " low in d3_array::operator(int,int)\n"
00054            " mimumum bound is " << slicemin() << "  you have "
00055            << k << "\n";
00056           ad_exit(1);
00057         }
00058         if (k>slicemax())
00059         {
00060           cerr << "array bound exceeded -- slice index too"
00061            " high in d3_array::operator(int,int)\n"
00062            " maximum bound is " << slicemax() << "  you have "
00063            << k << "\n";
00064           ad_exit(1);
00065         }
00066       #endif
00067       return ( t[k].m[i]);
00068     }
00069 #endif