ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lvec2.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 
13 #ifdef __TURBOC__
14  #pragma hdrstop
15  #include <iostream.h>
16 #endif
17 
18 #ifdef __ZTC__
19  #include <iostream.hpp>
20 #endif
21 
22 #include <stdlib.h>
23 
24 #ifndef OPT_LIB
25 
30 const AD_LONG_INT& lvector::operator[](int i) const
31  {
32  if (i>indexmax())
33  {
34  cerr << "array bound exceeded -- index too high in lvector::operator[]";
35  ad_exit(1);
36  }
37 
38  if (i<indexmin())
39  {
40  cerr << "array bound exceeded -- index too low in lvector::operator[]";
41  ad_exit(1);
42  }
43  return(*(v+i));
44  }
45 
50 const AD_LONG_INT& lvector::operator()(int i) const
51  {
52  if (i>indexmax())
53  {
54  cerr << "array bound exceeded -- index too high in lvector::operator[]";
55  ad_exit(1);
56  }
57 
58  if (i<indexmin())
59  {
60  cerr << "array bound exceeded -- index too low in lvector::operator[]";
61  ad_exit(1);
62  }
63  return(*(v+i));
64  }
65 #endif
AD_LONG_INT * v
Definition: fvar.hpp:658
int indexmin() const
Definition: fvar.hpp:676
exitptr ad_exit
Definition: gradstrc.cpp:53
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
AD_LONG_INT & operator()(int i)
Definition: fvar.hpp:746
#define AD_LONG_INT
Definition: fvar.hpp:81