Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -7,10 +7,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.67 2002/04/09 12:04:21 geraint +## Replaced ios:: with std::ios:: for g++-3.0 compatability. +## ## Revision 1.66 2002/03/26 11:58:58 geraint ## Added cputime monitoring. ## ## Revision 1.65 2001/11/15 06:24:11 geraint ## Updated (-i dassl) residual function to use new DAEFunc (octave-2.1.35). @@ -1058,19 +1061,19 @@ default: usage("${sys}_ode2odes (x par simpar)", nargin); error("aborting."); } #endif // STANDALONE - static ColumnVector dx (MTTNX); - static ColumnVector x (MTTNX); - static ColumnVector u (MTTNU); - static ColumnVector y (MTTNY); - - static Matrix AA (MTTNX, MTTNX); - static ColumnVector AAx (MTTNX); - - static ColumnVector open_switches (MTTNX); + static ColumnVector dx (MTTNX, 0.0); + static ColumnVector x (MTTNX, 0.0); + static ColumnVector u (MTTNU, 0.0); + static ColumnVector y (MTTNY, 0.0); + + static Matrix AA (MTTNX, MTTNX, 0.0); + static ColumnVector AAx (MTTNX, 0.0); + + static ColumnVector open_switches (MTTNX, 0.0); register double t = 0.0; const double ddt = dt / stepfactor; const int ilast = static_cast (round ((last - first) / ddt)) + 1; Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -10,10 +10,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.38 2001/07/23 23:43:15 gawthrop +## header only version does not need to compute sizes from _def.r +## ## Revision 1.37 2001/07/13 04:54:04 geraint ## Branch merge: numerical-algebraic-solution back to main. ## ## Revision 1.36 2001/07/12 04:00:51 gawthrop ## Now zeros y correctly - ie Ny NOT Nx elements @@ -604,55 +607,55 @@ { arg_name=${1:-""} case ${arg_name} in mtta | mtte) arg_type="Matrix" - arg_size="(MTTNX,MTTNX)" + arg_init="(MTTNX,MTTNX,0.0)" ;; mttb) arg_type="Matrix" - arg_size="(MTTNX,MTTNU)" + arg_init="(MTTNX,MTTNU,0.0)" ;; mttc) arg_type="Matrix" - arg_size="(MTTNY,MTTNX)" + arg_init="(MTTNY,MTTNX,0.0)" ;; mttd) arg_type="Matrix" - arg_size="(MTTNY,MTTNU)" + arg_init="(MTTNY,MTTNU,0.0)" ;; mttax | mttdx | mttedx | mttx | mttopen) arg_type="ColumnVector" - arg_size="(MTTNX)" + arg_init="(MTTNX,0.0)" ;; mttpar) arg_type="ColumnVector" - arg_size="(MTTNPAR)" + arg_init="(MTTNPAR,0.0)" ;; mttsimpar_map) arg_type="Octave_map" - arg_size=""; + arg_init=""; ;; mttu) arg_type="ColumnVector" - arg_size="(MTTNU)" + arg_init="(MTTNU,0.0)" ;; mttyz) arg_type="ColumnVector" - arg_size="(MTTNYZ)" + arg_init="(MTTNYZ,0.0)" ;; mtty) arg_type="ColumnVector" - arg_size="(MTTNY)" + arg_init="(MTTNY,0.0)" ;; mttt) arg_type="const double" - arg_size="" + arg_init="" ;; nil) arg_type="void *" - arg_size="(0x0)" + arg_init="(0x0)" ;; *) echo "Argument ${arg} not supported - sorry"; exit 1 esac } @@ -765,11 +768,11 @@ i=0 while [ ${i} -lt ${c} ]; do i=`expr ${i} + 1` w=`get_field ${s} ${i}` # argument name get_arg_specific_stuff ${w} - printf " ${arg_type}\t${w}\t${arg_size};\n" + printf " static ${arg_type}\t${w}\t${arg_init};\n" done } return_DLD_outputs () @@ -868,11 +871,11 @@ undeclared=`get_extra_fields ${args:-"nil"} ${output:-"nil"}` declare_DLD_outputs ${undeclared} array2constant case ${arg_type} in Matrix) - printf " ${w}\t\t\t= zeros ${arg_size};\n" + printf " ${w}\t\t\t= zeros ${arg_init};\n" ;; *) ;; esac