ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
imat4.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
7 #ifdef __TURBOC__
8  #pragma hdrstop
9 #endif
10 
11 #ifndef OPT_LIB
12 
20 {
21  if (i < rowmin())
22  {
23  cerr << "matrix bound exceeded -- row index too low in "
24  "imatrix::operator[i] value was \"" << i << "\".\n";
25  ad_exit(1);
26  }
27  if (i > rowmax())
28  {
29  cerr << "matrix bound exceeded -- row index too high in "
30  "imatrix::operator[i] value was \"" << i << "\".\n";
31  ad_exit(1);
32  }
33  return m[i];
34 }
41 const ivector& imatrix::operator[](int i) const
42 {
43  if (i < rowmin())
44  {
45  cerr << "matrix bound exceeded -- row index too low in "
46  "imatrix::operator[i] value was \"" << i << "\".\n";
47  ad_exit(1);
48  }
49  if (i > rowmax())
50  {
51  cerr << "matrix bound exceeded -- row index too high in "
52  "imatrix::operator[i] value was \"" << i << "\".\n";
53  ad_exit(1);
54  }
55  return m[i];
56 }
57 #endif
ivector * m
Definition: imatrix.h:74
ivector & operator[](int)
Definition: imatrix.h:213
int rowmin() const
Definition: imatrix.h:146
exitptr ad_exit
Definition: gradstrc.cpp:53
Array of integers(int) with indexes from index_min to indexmax.
Definition: ivector.h:50
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int rowmax() const
Definition: imatrix.h:150