ADMB Documentation  11.1.2496
 All Classes Files Functions Variables Typedefs Friends Defines
f3arr12.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: f3arr12.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 #ifndef OPT_LIB
00013 
00018 const prevariable dvar3_array::operator()(int k, int i, int j) const
00019     {
00020         if (k<slicemin())
00021         {
00022           cerr << "array bound exceeded -- slice index too"
00023            " low in d3_array::operator(int,int,int)\n"
00024            " mimumum bound is " << slicemin() << "  you have "
00025            << k << "\n";
00026           ad_exit(1);
00027         }
00028         if (k>slicemax())
00029         {
00030           cerr << "array bound exceeded -- slice index too"
00031            " high in d3_array::operator(int,int,int)\n"
00032            " maximum bound is " << slicemax() << "  you have "
00033            << k << "\n";
00034           ad_exit(1);
00035         }
00036         return ( ((t[k].m[i]).va)+j );
00037     }
00038 
00043 const dvar_vector& dvar3_array::operator()(int k, int i) const
00044     {
00045         if (k<slicemin())
00046         {
00047           cerr << "array bound exceeded -- slice index too"
00048            " low in d3_array::operator(int,int)\n"
00049            " mimumum bound is " << slicemin() << "  you have "
00050            << k << "\n";
00051           ad_exit(1);
00052         }
00053         if (k>slicemax())
00054         {
00055           cerr << "array bound exceeded -- slice index too"
00056            " high in d3_array::operator(int,int)\n"
00057            " maximum bound is " << slicemax() << "  you have "
00058            << k << "\n";
00059           ad_exit(1);
00060         }
00061       return ( t[k].m[i]);
00062     }
00063 #endif