Index: mttroot/mtt/lib/cc/mtt_implicit.cc ================================================================== --- mttroot/mtt/lib/cc/mtt_implicit.cc +++ mttroot/mtt/lib/cc/mtt_implicit.cc @@ -13,22 +13,22 @@ #else // !STANDALONE DEFUN_DLD (mtt_implicit, args, , "implicit integration method") { #ifdef OCTAVE_DEV - static ColumnVector x = args(0).column_vector_value (); - static ColumnVector dx = args(1).column_vector_value (); - static Matrix AA = args(2).matrix_value (); - static ColumnVector AAx = args(3).column_vector_value (); + ColumnVector x = args(0).column_vector_value (); + ColumnVector dx = args(1).column_vector_value (); + Matrix AA = args(2).matrix_value (); + ColumnVector AAx = args(3).column_vector_value (); const double t = args(4).double_value (); const int Nx = (int) (args(5).double_value ()); const ColumnVector openx = args(6).column_vector_value (); #else // !OCTAVE_DEV - static ColumnVector x = args(0).vector_value (); - static ColumnVector dx = args(1).vector_value (); - static Matrix AA = args(2).matrix_value (); - static ColumnVector AAx = args(3).vector_value (); + ColumnVector x = args(0).vector_value (); + ColumnVector dx = args(1).vector_value (); + Matrix AA = args(2).matrix_value (); + ColumnVector AAx = args(3).vector_value (); const double t = args(4).double_value (); const int Nx = (int) (args(5).double_value ()); const ColumnVector openx = args(6).vector_value (); #endif // OCTAVE_DEV #endif // STANDALONE @@ -47,11 +47,19 @@ AA (col,row) = 0.0; } } } - x = static_cast (xleftdiv (AA, static_cast(static_cast(AAx + dx * t)))); +#ifdef OCTAVE_DEV + x = static_cast (xleftdiv (AA, static_cast(AAx + dx * t))); +#else // !OCTAVE_DEV + Matrix tmp = xleftdiv (AA, static_cast(static_cast(AAx + dx * t))); + for (row = 0; row < Nx; row++) + { + x (row) = tmp (row,0); + } +#endif // OCTAVE_DEV for (row = 0; row < Nx; row++) { if (openx (row) > 0.5) {