ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lvec1.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
11 #include "fvar.hpp"
12 #include "admb_messages.h"
13 
14 #ifdef __TURBOC__
15  #pragma hdrstop
16  #include <iostream.h>
17 #endif
18 
19 #ifdef __ZTC__
20  #include <iostream.hpp>
21 #endif
22 
23 #include <stdlib.h>
24 
25 #ifndef OPT_LIB
26 
31  {
32  if (i>indexmax())
33  {
34  ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- index too high",
35  "AD_LONG_INT& lvector::operator() (int i)", indexmin(), indexmax(), i);
36  }
37 
38  if (i<indexmin())
39  {
40  ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- index too low",
41  "AD_LONG_INT& lvector::operator() (int i)", indexmin(), indexmax(), i);
42  }
43  return(*(v+i));
44  }
45 
51  {
52  if (i>indexmax())
53  {
54  ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- index too high",
55  "AD_LONG_INT& lvector::operator() (int i)", indexmin(), indexmax(), i);
56  }
57  if (i<indexmin())
58  {
59  ADMB_ARRAY_BOUNDS_ERROR("array bound exceeded -- index too low",
60  "AD_LONG_INT& lvector::operator() (int i)", indexmin(), indexmax(), i);
61  }
62  return(*(v+i));
63  }
64 #endif
AD_LONG_INT * v
Definition: fvar.hpp:658
int indexmin() const
Definition: fvar.hpp:676
int indexmax() const
Definition: fvar.hpp:681
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
AD_LONG_INT & operator[](int i)
Definition: fvar.hpp:742
#define ADMB_ARRAY_BOUNDS_ERROR(message, function, lower_bounds, upper_bounds, index)
Definition: admb_messages.h:47
AD_LONG_INT & operator()(int i)
Definition: fvar.hpp:746
#define AD_LONG_INT
Definition: fvar.hpp:81