ADMB Documentation  11.1.1927
 All Classes Files Functions Variables Typedefs Friends Defines
lmat6.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: lmat6.cpp 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  */
00012 #include "fvar.hpp"
00013 
00014 
00019 void lmatrix::allocate(const lmatrix& dm)
00020 {
00021   int nrl=dm.rowmin();
00022   int nrh=dm.rowmax();
00023   int ncl=dm.colmin();
00024   int nch=dm.colmax();
00025 
00026   if ( (shape = new mat_shape(nrl,nrh,ncl,nch))== 0)
00027   {
00028     cerr << " Error allocating memory in imatrix contructor" << endl;
00029     ad_exit(21);
00030   }
00031 
00032   int rs=rowsize();
00033   if ( (m = new lvector [rs]) == 0)
00034   {
00035     cerr << " Error allocating memory in imatrix contructor" << endl;
00036     ad_exit(21);
00037   }
00038   m -= rowmin();
00039   for (int i=rowmin(); i<=rowmax(); i++)
00040   {
00041     m[i].allocate(dm(i));
00042   }
00043 }
00044