ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lmat6.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  */
12 #include "fvar.hpp"
13 
14 
19 void lmatrix::allocate(const lmatrix& dm)
20 {
21  int nrl=dm.rowmin();
22  int nrh=dm.rowmax();
23  int ncl=dm.colmin();
24  int nch=dm.colmax();
25 
26  if ( (shape = new mat_shape(nrl,nrh,ncl,nch))== 0)
27  {
28  cerr << " Error allocating memory in imatrix contructor" << endl;
29  ad_exit(21);
30  }
31 
32  size_t rs=rowsize();
33  if ( (m = new lvector [rs]) == 0)
34  {
35  cerr << " Error allocating memory in imatrix contructor" << endl;
36  ad_exit(21);
37  }
38  m -= rowmin();
39  for (int i=rowmin(); i<=rowmax(); i++)
40  {
41  m[i].allocate(dm(i));
42  }
43 }
44 
int colmax(void) const
Definition: fvar.hpp:7588
Description not yet available.
Definition: fvar.hpp:656
int rowmax(void) const
Definition: fvar.hpp:7596
exitptr ad_exit
Definition: gradstrc.cpp:53
unsigned int rowsize() const
Definition: fvar.hpp:7601
Description not yet available.
Definition: fvar.hpp:7500
int rowmin(void) const
Definition: fvar.hpp:7592
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int colmin(void) const
Definition: fvar.hpp:7584
Description not yet available.
Definition: fvar.hpp:2001
mat_shape * shape
Definition: fvar.hpp:7504
lvector * m
Definition: fvar.hpp:7503
void allocate(int ncl, int ncu)
Allocate vector of AD_LONG_INT.
Definition: lvector.cpp:156
void allocate(const lmatrix &dm)
Description not yet available.
Definition: lmat6.cpp:19