ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lmat1.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 #if !defined(OPT_LIB)
18 
23 {
24  if (i < rowmin())
25  {
26  ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too low",
27  "lvector& lmatrix::operator() (int i)", rowmin(), rowmax(), i);
28  }
29  if (i > rowmax())
30  {
31  ADMB_ARRAY_BOUNDS_ERROR("matrix bound exceeded -- row index too high",
32  "lvector& lmatrix::operator() (int i)", rowmin(), rowmax(), i);
33  }
34  return m[i];
35 }
36 
41 const lvector& lmatrix::operator()(int i) const
42 {
43  if (i < rowmin())
44  {
45  cerr << "matrix bound exceeded -- row index too low in "
46  "lmatrix::operator[]" << "value was" << i;
47  ad_exit(21);
48  }
49  if (i > rowmax())
50  {
51  cerr << "matrix bound exceeded -- row index too high in "
52  "lmatrix::operator[]" << "value was" << i;
53  ad_exit(22);
54  }
55  return m[i];
56 }
57 #endif
Description not yet available.
Definition: fvar.hpp:656
int rowmax(void) const
Definition: fvar.hpp:7596
exitptr ad_exit
Definition: gradstrc.cpp:53
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
lvector & operator()(int i)
Definition: fvar.hpp:7547