ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lmat4.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 #ifdef __TURBOC__
14  #pragma hdrstop
15 #endif
16 
17 #ifndef OPT_LIB
18 
24  {
25  if (i < rowmin())
26  {
27  ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
28  "lvector& lmatrix::operator[] (int i)", rowmin(), rowmax(), i);
29  }
30  if (i > rowmax())
31  {
32  ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
33  "lvector& lmatrix::operator[] (int i)", rowmin(), rowmax(), i);
34  }
35  return m[i];
36  }
37 
42 const lvector& lmatrix::operator[](int i) const
43  {
44  if (i<rowmin())
45  {
46  cerr << "matrix bound exceeded -- row index too low in "
47  "imatrix::operator[]" << "value was" << i;
48  ad_exit(21);
49  }
50  if (i > rowmax())
51  {
52  cerr << "matrix bound exceeded -- row index too high in "
53  "imatrix::operator[]" << "value was" << i;
54  ad_exit(22);
55  }
56  return m[i];
57  }
58 #endif
Description not yet available.
Definition: fvar.hpp:656
int rowmax(void) const
Definition: fvar.hpp:7596
exitptr ad_exit
Definition: gradstrc.cpp:53
lvector & operator[](int i)
Definition: fvar.hpp:7555
int rowmin(void) const
Definition: fvar.hpp:7592
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
#define ADMB_ARRAY_BOUNDS_ERROR(message, function, lower_bounds, upper_bounds, index)
Definition: admb_messages.h:47
lvector * m
Definition: fvar.hpp:7503