ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
imat_a.cpp
Go to the documentation of this file.
1 
5 #include "fvar.hpp"
6 
13 {
14  if (position.row_min != position.lb.indexmin()
15  || position.row_max != position.lb.indexmax()
16  || position.row_min != position.ub.indexmin()
17  || position.row_max != position.ub.indexmax())
18  {
19  cerr << "Incompatible array bounds"
20  << " in imatrix::imatrix(const imatrix_position&)\n";
21  ad_exit(1);
22  }
23 
24  allocate(position.row_min, position.row_max);
25 
26 #ifdef DIAG
27  cerr << "Created a imatrix with adress "<< farptr_tolong(m)<<"\n";
28 #endif
29 
30  for (int i = rowmin(); i <= rowmax(); ++i)
31  {
32  elem(i).allocate(position.lb(i), position.ub(i));
33  }
34 }
ivector * m
Definition: imatrix.h:74
ivector & elem(int i)
Definition: imatrix.h:233
void allocate(void)
Does not allocate, but initializes imatrix members.
Definition: imat.cpp:138
ivector ub
Definition: imatrix.h:54
Description not yet available.
Definition: imatrix.h:48
int rowmin() const
Definition: imatrix.h:146
exitptr ad_exit
Definition: gradstrc.cpp:53
ivector lb
Definition: imatrix.h:53
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int indexmin() const
Definition: ivector.h:99
int indexmax() const
Definition: ivector.h:104
imatrix(void)
Default constructor.
Definition: imat.cpp:238
int rowmax() const
Definition: imatrix.h:150
void allocate(const ad_integer &ncl, const index_type &ncu)
Allocate vector of integers with dimension [_ncl to _nch].
Definition: indextyp.cpp:488