00001 /* 00002 * $Id$ 00003 * 00004 * Author: David Fournier 00005 * Copyright (c) 2008-2012 Regents of the University of California 00006 */ 00011 #include "fvar.hpp" 00012 00017 void dmatrix::allocate(const dvar_matrix& dm) 00018 { 00019 int nrl=dm.rowmin(); 00020 int nrh=dm.rowmax(); 00021 00022 index_min=nrl; 00023 index_max=nrh; 00024 if ( (m = new dvector [rowsize()]) == 0) 00025 { 00026 cerr << " Error allocating memory in dmatrix contructor\n"; 00027 ad_exit(21); 00028 } 00029 if ( (shape = new mat_shapex(m))== 0) 00030 { 00031 cerr << " Error allocating memory in dmatrix contructor\n"; 00032 ad_exit(21); 00033 } 00034 00035 m -= rowmin(); 00036 for (int i=rowmin(); i<=rowmax(); i++) 00037 { 00038 m[i].allocate(dm(i)); 00039 } 00040 }
Generated on Tue Mar 8 2016 19:51:33 for ADMB Documentation by 1.8.0 |