Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -13,10 +13,14 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.301 2001/04/05 03:46:12 geraint +## Added mtt_prepend.sh, -p preserves time attribute of base file +## - eliminates error in dependencies due to update of ese.r by modpar.r. +## ## Revision 1.300 2001/04/04 10:06:49 gawthrop ## New ssim (sensitiveity simulation) rep ## ## Revision 1.299 2001/04/03 14:49:42 gawthrop ## Revised to incorporate new ssim (sensitivity simulation) @@ -2517,10 +2521,12 @@ ifeq ($stdin,stdin) $1_input.m : $1_def.r make_stdin $1 m $1_input.p : $1_def.r make_stdin $1 p +$1_input.cc: + make_stdin $1 cc else $1_input.m: $1_input.txt $1_sympars.txt mtt_txt2m $1 input $1_input.p : $1_def.r $1_input.m mtt_m2p $1_input.m Index: mttroot/mtt/bin/trans/make_stdin ================================================================== --- mttroot/mtt/bin/trans/make_stdin +++ mttroot/mtt/bin/trans/make_stdin @@ -63,27 +63,93 @@ } make_cc() { +## Check octave version +case `$MATRIX --version | awk -F\. '{print $2}'` in + 0) vector_value="vector_value";; # stable + 1) vector_value="column_vector_value";; # development + *) vector_value="column_vector_value";; +esac + cat > $outfile < +#include "${Sys}_def.h" + +void strip_comments (istream &str) +{ + char c; + c = str.peek (); + while (c == '#') + { + str.unsetf(ios::skipws); + while (c != '\n') + { + str >> c; + } + str.setf(ios::skipws); + c = str.peek (); + } +} + +ColumnVector F${Sys}_input ( + ColumnVector &mttx, + ColumnVector &mtty, + const double &mttt, + ColumnVector &mttpar +) +{ +#endif // STANDALONE +#ifndef STANDALONE +#include +#include #include "${Sys}_def.h" -DEFUN_DLD (sidRC_input, args, , -"Usage: [mttu] = sidRC_input(mttx,mtty,mttt,mttpar) -Octave input representation of system sidRC"); - -{ - static ColumnVector u (MTTNU); - static Matrix mtt_input; - octave_value_list retval; - - mtt_input = octave_value (get_global_value ("MTT_input")); - - retval (0) = octave_value (mtt_input); +DEFUN_DLD (${Sys}_input, args, , +"Usage: [mttu] = ${Sys}_input() +Octave input (-stdin) representation of system ${Sys} +Generated by MTT on `date`") +{ + + octave_value_list retval; +#endif // ! STANDALONE + + ColumnVector mttu (MTTNU); + + // Set up the mttu vector +#ifndef STANDALONE + mttu = get_global_value ("MTT_input").${vector_value}(); +#else + double t, u; + strip_comments (cin); + cin >> t; + for (register int i = 0; i < MTTNU; i++) + { + cin >> u; + mttu(i) = u; + } +#endif + + +#ifndef STANDALONE + retval (0) = octave_value (mttu); return (retval); } +#endif // ! STANDALONE +#ifdef STANDALONE + return mttu; +} +#endif // STANDALONE EOF } case $lang in p)