ADMB Documentation  11.1.2503
 All Classes Files Functions Variables Typedefs Friends Defines
model49.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: model49.cpp 2181 2014-07-14 18:17:17Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00011 #include <admodel.h>
00012 #include "admb_messages.h"
00013 
00014 
00015 #if !defined(OPT_LIB)
00016 
00021    param_init_vector& param_init_vector_vector::operator [] (int i)
00022    {
00023      if (i<indexmin()) {
00024        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00025        "param_init_vector& param_init_vector_vector::operator [] (int i)",
00026        indexmin(), indexmax(), i);
00027      }
00028      if (i>indexmax()) {
00029        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00030        "param_init_vector& param_init_vector_vector::operator [] (int i)",
00031        indexmin(), indexmax(), i);
00032      }
00033      return v[i];
00034    }
00035 
00040    param_init_vector& param_init_vector_vector::operator () (int i)
00041    {
00042      if (i<indexmin()) {
00043        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00044        "param_init_vector& param_init_vector_vector::operator () (int i)",
00045        indexmin(), indexmax(), i);
00046      }
00047      if (i>indexmax()) {
00048        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00049        "param_init_vector& param_init_vector_vector::operator () (int i)",
00050        indexmin(), indexmax(), i);
00051      }
00052      return v[i];
00053    }
00054 
00059    prevariable param_init_vector_vector::operator () (int i,int j)
00060    {
00061      if (i<indexmin()) {
00062        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00063        "prevariable param_init_vector_vector::operator () (int i, int j)",
00064         indexmin(), indexmax(), i);
00065      }
00066      if (i>indexmax()) {
00067        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00068        "prevariable param_init_vector_vector::operator () (int i, int j)",
00069        indexmin(), indexmax(), i);
00070      }
00071      return v[i][j];
00072    }
00073 
00078    param_init_matrix& param_init_matrix_vector::operator [] (int i)
00079    {
00080      if (i<indexmin()) {
00081        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00082  "param_init_matrix& prevariable param_init_vector_vector::operator[](int i)",
00083        indexmin(), indexmax(), i);
00084      }
00085      if (i>indexmax()) {
00086        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00087 "param_init_matrix& prevariable param_init_vector_vector::operator[](int i)",
00088        indexmin(), indexmax(), i);
00089      }
00090      return v[i];
00091    }
00092 
00097    param_init_matrix& param_init_matrix_vector::operator () (int i)
00098    {
00099      if (i<indexmin()) {
00100        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00101 "param_init_matrix& param_init_matrix_vector::operator () (int i)",
00102        indexmin(), indexmax(), i);
00103      }
00104      if (i>indexmax()) {
00105        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00106 "param_init_matrix& param_init_matrix_vector::operator () (int i)",
00107        indexmin(), indexmax(), i);
00108      }
00109      return v[i];
00110    }
00111 
00116    dvar_vector& param_init_matrix_vector::operator () (int i,int j)
00117    {
00118      if (i<indexmin()) {
00119        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00120 "dvar_vector& param_init_matrix_vector::operator () (int i, int j)",
00121        indexmin(), indexmax(), i);
00122      }
00123      if (i>indexmax()) {
00124        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00125  "dvar_vector& param_init_matrix_vector::operator () (int i, int j)",
00126        indexmin(), indexmax(), i);
00127      }
00128      return v[i][j];
00129    }
00130 
00135    prevariable param_init_matrix_vector::operator () (int i,int j,int k)
00136    {
00137      if (i<indexmin()) {
00138        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00139  "prevariable param_init_matrix_vector::operator () (int i, int j, int k)",
00140        indexmin(), indexmax(), i);
00141      }
00142      if (i>indexmax()) {
00143        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00144  "prevariable param_init_matrix_vector::operator () (int i, int j, int k)",
00145        indexmin(), indexmax(), i);
00146      }
00147      return v[i](j,k);
00148    }
00149 
00154 param_init_bounded_vector& param_init_bounded_vector_vector::operator[](int i)
00155    {
00156      if (i<indexmin()) {
00157        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00158        "param_init_bounded_vector_vector::operator [] (int i)",
00159        indexmin(), indexmax(), i);
00160      }
00161      if (i>indexmax()) {
00162        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00163        "param_init_bounded_vector_vector::operator [] (int i)",
00164        indexmin(), indexmax(), i);
00165      }
00166      return v[i];
00167    }
00168 
00173 param_init_bounded_vector& param_init_bounded_vector_vector::operator()(int i)
00174    {
00175      if (i<indexmin()) {
00176        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00177        "param_init_bounded_vector_vector::operator () (int i)",
00178         indexmin(), indexmax(), i);
00179      }
00180      if (i>indexmax()) {
00181        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00182        "param_init_bounded_vector_vector::operator () (int i)",
00183        indexmin(), indexmax(), i);
00184      }
00185      return v[i];
00186    }
00187 
00192    prevariable param_init_bounded_vector_vector::operator () (int i,int j)
00193    {
00194      if (i<indexmin()) {
00195        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00196        "prevariable param_init_bounded_vector_vector::operator()(int i, int j)",
00197        indexmin(), indexmax(), i);
00198      }
00199      if (i>indexmax()) {
00200        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00201        "param_init_bounded_vector_vector::operator () (int i, int j)",
00202        indexmin(), indexmax(), i);
00203      }
00204      return v[i][j];
00205    }
00206 
00211 param_init_bounded_matrix& param_init_bounded_matrix_vector::operator[](int i)
00212    {
00213      if (i<indexmin()) {
00214        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00215        "param_init_bounded_matrix_vector::operator [] (int i)",
00216        indexmin(), indexmax(), i);
00217      }
00218      if (i>indexmax()) {
00219        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00220        "param_init_bounded_matrix_vector::operator [] (int i)",
00221        indexmin(), indexmax(), i);
00222      }
00223      return v[i];
00224    }
00225 
00230 param_init_bounded_matrix& param_init_bounded_matrix_vector::operator()(int i)
00231    {
00232      if (i<indexmin()) {
00233        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00234        "param_init_bounded_matrix_vector::operator()(int i)",
00235        indexmin(), indexmax(), i);
00236      }
00237      if (i>indexmax()) {
00238        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00239        "param_init_bounded_matrix_vector::operator () (int i)",
00240        indexmin(), indexmax(), i);
00241      }
00242      return v[i];
00243    }
00244 
00249    dvar_vector& param_init_bounded_matrix_vector::operator () (int i,int j)
00250    {
00251      if (i<indexmin()) {
00252        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00253        "param_init_bounded_matrix_vector::operator () (int i, int j)",
00254        indexmin(), indexmax(), i);
00255      }
00256      if (i>indexmax()) {
00257        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00258        "param_init_bounded_matrix_vector::operator () (int i, int j)",
00259        indexmin(), indexmax(), i);
00260      }
00261      return v[i][j];
00262    }
00263 
00268 prevariable param_init_bounded_matrix_vector::operator()(int i,int j,int k)
00269    {
00270      if (i<indexmin()) {
00271        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00272        "param_init_bounded_matrix_vector::operator () (int i, int j, int k)",
00273        indexmin(), indexmax(), i);
00274      }
00275      if (i>indexmax()) {
00276        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00277        "param_init_bounded_matrix_vector::operator () (int i, int j, int k)",
00278        indexmin(), indexmax(), i);
00279      }
00280      return v[i](j,k);
00281    }
00282 
00287    param_init_number& param_init_number_vector::operator [] (int i)
00288    {
00289      if (i<indexmin()) {
00290        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00291        "param_init_number_vector::operator [] (int i)",
00292        indexmin(), indexmax(), i);
00293      }
00294      if (i>indexmax()) {
00295        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00296        "param_init_number_vector::operator [] (int i)",
00297        indexmin(), indexmax(), i);
00298      }
00299      return v[i];
00300    }
00301 
00306    param_init_number& param_init_number_vector::operator () (int i)
00307    {
00308      if (i<indexmin()) {
00309        ADMB_ARRAY_BOUNDS_ERROR("Index too low",
00310        "param_init_number_vector::operator () (int i)",
00311        indexmin(), indexmax(), i);
00312      }
00313      if (i>indexmax()) {
00314        ADMB_ARRAY_BOUNDS_ERROR("Index too high",
00315        "param_init_number& param_init_number_vector::operator () (int i)",
00316        indexmin(), indexmax(), i);
00317      }
00318      return v[i];
00319    }
00320 
00325 param_init_bounded_number& param_init_bounded_number_vector::operator[](int i)
00326 {
00327   if (!v)
00328   {
00329     cerr << "Error: param_init_bounded_number_vector was not allocated.\n";
00330     ad_exit(1);
00331   }
00332   if (i < indexmin() || indexmax() < i) {
00333     ADMB_ARRAY_BOUNDS_ERROR("Invalid index",
00334       "param_init_number_vector::operator[](int i)",
00335       indexmin(), indexmax(), i);
00336   }
00337   return v[i];
00338 }
00343 param_init_bounded_number& param_init_bounded_number_vector::operator()(int i)
00344 {
00345   if (!v)
00346   {
00347     cerr << "Error: param_init_bounded_number_vector was not allocated.\n";
00348     ad_exit(1);
00349   }
00350   if (i < indexmin() || indexmax() < i) {
00351     ADMB_ARRAY_BOUNDS_ERROR("Invalid index",
00352       "param_init_number_vector::operator()(int i)",
00353       indexmin(), indexmax(), i);
00354   }
00355   return v[i];
00356 }
00357 #endif