00001 /* 00002 * $Id$ 00003 * 00004 * Author: David Fournier 00005 * Copyright (c) 2008-2012 Regents of the University of California 00006 */ 00011 #include <admodel.h> 00012 00017 int initial_params::nvarcalc_all() 00018 { 00019 int nvar=0; 00020 for (int i=0;i<num_initial_params;i++) 00021 { 00022 nvar+= (varsptr[i])->size_count(); 00023 } 00024 return nvar; 00025 } 00026 00031 void initial_params::xinit_all(const dvector& _x) 00032 { 00033 dvector& x=(dvector&) _x; 00034 int ii=1; 00035 for (int i=0;i<num_initial_params;i++) 00036 { 00037 (varsptr[i])->set_value_inv(x,ii); 00038 } 00039 } 00040 00045 dvariable initial_params::reset_all(const dvar_vector& x,const dvector& __pen) 00046 { 00047 dvector& _pen=(dvector&) __pen; 00048 int ii=1; 00049 dvariable pen=0.0; 00050 dvariable pen1; 00051 for (int i=0;i<num_initial_params;i++) 00052 { 00053 (varsptr[i])->set_value(x,ii,pen1); 00054 _pen(ii-1)=value(pen1); 00055 pen+=pen1; 00056 } 00057 return pen; 00058 }
Generated on Tue Mar 8 2016 19:51:35 for ADMB Documentation by 1.8.0 |