Mercurial > octave
changeset 30067:fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
* DASPK.cc, DASRT.cc, DASSL.cc, LSODE.cc, ODES.cc, ODES.h, base-dae.h,
base-de.h: Use "m_" prefix for member variables in base-de.h and base-dae.h.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 29 Aug 2021 20:16:10 -0700 |
parents | 11dc1156b9d0 |
children | 97378503ee0a |
files | liboctave/numeric/DASPK.cc liboctave/numeric/DASRT.cc liboctave/numeric/DASSL.cc liboctave/numeric/LSODE.cc liboctave/numeric/ODES.cc liboctave/numeric/ODES.h liboctave/numeric/base-dae.h liboctave/numeric/base-de.h |
diffstat | 8 files changed, 202 insertions(+), 197 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/numeric/DASPK.cc Sun Aug 29 20:11:05 2021 -0700 +++ b/liboctave/numeric/DASPK.cc Sun Aug 29 20:16:10 2021 -0700 @@ -144,9 +144,10 @@ ColumnVector retval; - if (! m_initialized || restart || DAEFunc::m_reset || DASPK_options::m_reset) + if (! m_initialized || m_restart || DAEFunc::m_reset + || DASPK_options::m_reset) { - integration_error = false; + m_integration_error = false; m_initialized = true; @@ -161,9 +162,9 @@ m_info(0) = 0; - if (stop_time_set) + if (m_stop_time_set) { - m_rwork(0) = stop_time; + m_rwork(0) = m_stop_time; m_info(3) = 1; } else @@ -178,15 +179,15 @@ { octave_idx_type ires = 0; - ColumnVector res = (*user_fun) (x, xdot, t, ires); + ColumnVector res = (*user_fun) (m_x, m_xdot, m_t, ires); - if (res.numel () != x.numel ()) + if (res.numel () != m_x.numel ()) { // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: inconsistent sizes for state and residual vectors"); - integration_error = true; + m_integration_error = true; return retval; } } @@ -196,7 +197,7 @@ (*current_liboctave_error_handler) ("daspk: no user supplied RHS subroutine!"); - integration_error = true; + m_integration_error = true; return retval; } @@ -243,7 +244,7 @@ (*current_liboctave_error_handler) ("daspk: inconsistent sizes for tolerance arrays"); - integration_error = true; + m_integration_error = true; return retval; } @@ -278,7 +279,7 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: invalid value for maximum order"); - integration_error = true; + m_integration_error = true; return retval; } } @@ -302,7 +303,7 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: invalid value for inequality constraint type"); - integration_error = true; + m_integration_error = true; return retval; } m_iwork(40+i) = val; @@ -313,7 +314,7 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: inequality constraint types size mismatch"); - integration_error = true; + m_integration_error = true; return retval; } } @@ -328,7 +329,7 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: invalid value for enforce inequality constraints option"); - integration_error = true; + m_integration_error = true; return retval; } @@ -362,7 +363,7 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: algebraic variables size mismatch"); - integration_error = true; + m_integration_error = true; return retval; } } @@ -371,7 +372,7 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: invalid value for compute consistent initial condition option"); - integration_error = true; + m_integration_error = true; return retval; } @@ -424,7 +425,7 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: invalid initial condition heuristics option"); - integration_error = true; + m_integration_error = true; return retval; } @@ -444,18 +445,18 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: invalid value for print initial condition info option"); - integration_error = true; + m_integration_error = true; return retval; break; } DASPK_options::m_reset = false; - restart = false; + m_restart = false; } - double *px = x.fortran_vec (); - double *pxdot = xdot.fortran_vec (); + double *px = m_x.fortran_vec (); + double *pxdot = m_xdot.fortran_vec (); F77_INT *pinfo = m_info.fortran_vec (); @@ -468,16 +469,16 @@ double *dummy = nullptr; F77_INT *idummy = nullptr; - F77_INT tmp_istate = octave::to_f77_int (istate); + F77_INT tmp_istate = octave::to_f77_int (m_istate); - F77_XFCN (ddaspk, DDASPK, (ddaspk_f, nn, t, px, pxdot, tout, pinfo, + F77_XFCN (ddaspk, DDASPK, (ddaspk_f, nn, m_t, px, pxdot, tout, pinfo, prel_tol, pabs_tol, tmp_istate, prwork, m_lrw, piwork, m_liw, dummy, idummy, ddaspk_j, ddaspk_psol)); - istate = tmp_istate; + m_istate = tmp_istate; - switch (istate) + switch (m_istate) { case 1: // A step was successfully taken in intermediate-output // mode. The code has not yet reached TOUT. @@ -490,8 +491,8 @@ // INFO(11) > 0, was successful, and INFO(14) = 1. // No integration steps were taken, and the solution // is not considered to have been started. - retval = x; - t = tout; + retval = m_x; + m_t = tout; break; case -1: // A large amount of work has been expended. (~500 steps). @@ -521,14 +522,14 @@ // recover. A message is printed explaining the trouble // and control is returned to the calling program. For // example, this occurs when invalid input is detected. - integration_error = true; + m_integration_error = true; break; default: - integration_error = true; + m_integration_error = true; (*current_liboctave_error_handler) - ("unrecognized value of istate (= %" OCTAVE_IDX_TYPE_FORMAT ") " - "returned from ddaspk", istate); + ("unrecognized value of m_istate (= %" OCTAVE_IDX_TYPE_FORMAT ") " + "returned from ddaspk", m_istate); break; } @@ -557,21 +558,21 @@ for (F77_INT i = 0; i < n; i++) { - retval.elem (0, i) = x.elem (i); - xdot_out.elem (0, i) = xdot.elem (i); + retval.elem (0, i) = m_x.elem (i); + xdot_out.elem (0, i) = m_xdot.elem (i); } for (octave_idx_type j = 1; j < n_out; j++) { ColumnVector x_next = do_integrate (tout.elem (j)); - if (integration_error) + if (m_integration_error) return retval; for (F77_INT i = 0; i < n; i++) { retval.elem (j, i) = x_next.elem (i); - xdot_out.elem (j, i) = xdot.elem (i); + xdot_out.elem (j, i) = m_xdot.elem (i); } } } @@ -602,8 +603,8 @@ for (F77_INT i = 0; i < n; i++) { - retval.elem (0, i) = x.elem (i); - xdot_out.elem (0, i) = xdot.elem (i); + retval.elem (0, i) = m_x.elem (i); + xdot_out.elem (0, i) = m_xdot.elem (i); } octave_idx_type n_crit = tcrit.numel (); @@ -662,7 +663,7 @@ ColumnVector x_next = do_integrate (t_out); - if (integration_error) + if (m_integration_error) return retval; if (save_output) @@ -670,7 +671,7 @@ for (F77_INT i = 0; i < n; i++) { retval.elem (i_out-1, i) = x_next.elem (i); - xdot_out.elem (i_out-1, i) = xdot.elem (i); + xdot_out.elem (i_out-1, i) = m_xdot.elem (i); } } @@ -682,7 +683,7 @@ { retval = integrate (tout, xdot_out); - if (integration_error) + if (m_integration_error) return retval; } } @@ -696,10 +697,10 @@ std::string retval; std::ostringstream buf; - buf << t; + buf << m_t; std::string t_curr = buf.str (); - switch (istate) + switch (m_istate) { case 1: retval = "a step was successfully taken in intermediate-output mode.";
--- a/liboctave/numeric/DASRT.cc Sun Aug 29 20:11:05 2021 -0700 +++ b/liboctave/numeric/DASRT.cc Sun Aug 29 20:16:10 2021 -0700 @@ -142,10 +142,10 @@ // call, or if anything about the problem has changed, we should // start completely fresh. - if (! m_initialized || restart + if (! m_initialized || m_restart || DAEFunc::m_reset || DAERTFunc::m_reset || DASRT_options::m_reset) { - integration_error = false; + m_integration_error = false; m_initialized = true; @@ -164,7 +164,7 @@ if (user_csub) { - ColumnVector tmp = (*user_csub) (x, t); + ColumnVector tmp = (*user_csub) (m_x, m_t); m_ng = octave::to_f77_int (tmp.numel ()); } else @@ -182,7 +182,7 @@ { (*current_liboctave_error_handler) ("dassl: invalid value for maximum order"); - integration_error = true; + m_integration_error = true; return; } } @@ -195,15 +195,15 @@ m_info(0) = 0; - if (stop_time_set) + if (m_stop_time_set) { m_info(3) = 1; - m_rwork(0) = stop_time; + m_rwork(0) = m_stop_time; } else m_info(3) = 0; - restart = false; + m_restart = false; // DAEFunc @@ -214,14 +214,14 @@ { octave_idx_type ires = 0; - ColumnVector fval = (*user_fsub) (x, xdot, t, ires); + ColumnVector fval = (*user_fsub) (m_x, m_xdot, m_t, ires); - if (fval.numel () != x.numel ()) + if (fval.numel () != m_x.numel ()) { (*current_liboctave_error_handler) ("dasrt: inconsistent sizes for state and residual vectors"); - integration_error = true; + m_integration_error = true; return; } } @@ -230,7 +230,7 @@ (*current_liboctave_error_handler) ("dasrt: no user supplied RHS subroutine!"); - integration_error = true; + m_integration_error = true; return; } @@ -290,15 +290,15 @@ (*current_liboctave_error_handler) ("dasrt: inconsistent sizes for tolerance arrays"); - integration_error = true; + m_integration_error = true; return; } DASRT_options::m_reset = false; } - double *px = x.fortran_vec (); - double *pxdot = xdot.fortran_vec (); + double *px = m_x.fortran_vec (); + double *pxdot = m_xdot.fortran_vec (); F77_INT *pinfo = m_info.fortran_vec (); @@ -313,16 +313,16 @@ double *dummy = nullptr; F77_INT *idummy = nullptr; - F77_INT tmp_istate = octave::to_f77_int (istate); + F77_INT tmp_istate = octave::to_f77_int (m_istate); - F77_XFCN (ddasrt, DDASRT, (ddasrt_f, nn, t, px, pxdot, tout, pinfo, + F77_XFCN (ddasrt, DDASRT, (ddasrt_f, nn, m_t, px, pxdot, tout, pinfo, prel_tol, pabs_tol, tmp_istate, prwork, m_lrw, piwork, m_liw, dummy, idummy, ddasrt_j, ddasrt_g, m_ng, pjroot)); - istate = tmp_istate; + m_istate = tmp_istate; - switch (istate) + switch (m_istate) { case 1: // A step was successfully taken in intermediate-output // mode. The code has not yet reached TOUT. @@ -331,7 +331,7 @@ case 3: // The integration to TOUT was successfully completed // (T=TOUT) by stepping past TOUT. Y(*) is obtained by // interpolation. YPRIME(*) is obtained by interpolation. - t = tout; + m_t = tout; break; case 4: // The integration was successfully completed @@ -360,14 +360,14 @@ // recover. A message is printed explaining the trouble // and control is returned to the calling program. For // example, this occurs when invalid input is detected. - integration_error = true; + m_integration_error = true; break; default: - integration_error = true; + m_integration_error = true; (*current_liboctave_error_handler) ("unrecognized value of istate (= %" OCTAVE_IDX_TYPE_FORMAT ") " - "returned from ddasrt", istate); + "returned from ddasrt", m_istate); break; } } @@ -391,32 +391,32 @@ for (F77_INT i = 0; i < n; i++) { - x_out(0,i) = x(i); - xdot_out(0,i) = xdot(i); + x_out(0,i) = m_x(i); + xdot_out(0,i) = m_xdot(i); } for (octave_idx_type j = 1; j < n_out; j++) { integrate (tout(j)); - if (integration_error) + if (m_integration_error) { retval = DASRT_result (x_out, xdot_out, t_out); return retval; } - if (istate == 4) - t_out(j) = t; + if (m_istate == 4) + t_out(j) = m_t; else t_out(j) = tout(j); for (F77_INT i = 0; i < n; i++) { - x_out(j,i) = x(i); - xdot_out(j,i) = xdot(i); + x_out(j,i) = m_x(i); + xdot_out(j,i) = m_xdot(i); } - if (istate == 4) + if (m_istate == 4) { x_out.resize (j+1, n); xdot_out.resize (j+1, n); @@ -504,26 +504,26 @@ integrate (t_out); - if (integration_error) + if (m_integration_error) { retval = DASRT_result (x_out, xdot_out, t_outs); return retval; } - if (istate == 4) - t_out = t; + if (m_istate == 4) + t_out = m_t; if (save_output) { for (F77_INT i = 0; i < n; i++) { - x_out(i_out-1,i) = x(i); - xdot_out(i_out-1,i) = xdot(i); + x_out(i_out-1,i) = m_x(i); + xdot_out(i_out-1,i) = m_xdot(i); } t_outs(i_out-1) = t_out; - if (istate == 4) + if (m_istate == 4) { x_out.resize (i_out, n); xdot_out.resize (i_out, n); @@ -542,7 +542,7 @@ { retval = integrate (tout); - if (integration_error) + if (m_integration_error) return retval; } } @@ -556,10 +556,10 @@ std::string retval; std::ostringstream buf; - buf << t; + buf << m_t; std::string t_curr = buf.str (); - switch (istate) + switch (m_istate) { case 1: retval = "a step was successfully taken in intermediate-output mode.";
--- a/liboctave/numeric/DASSL.cc Sun Aug 29 20:11:05 2021 -0700 +++ b/liboctave/numeric/DASSL.cc Sun Aug 29 20:16:10 2021 -0700 @@ -125,9 +125,10 @@ { ColumnVector retval; - if (! m_initialized || restart || DAEFunc::m_reset || DASSL_options::m_reset) + if (! m_initialized || m_restart || DAEFunc::m_reset + || DASSL_options::m_reset) { - integration_error = false; + m_integration_error = false; m_initialized = true; @@ -148,15 +149,15 @@ m_info(0) = 0; - if (stop_time_set) + if (m_stop_time_set) { - m_rwork(0) = stop_time; + m_rwork(0) = m_stop_time; m_info(3) = 1; } else m_info(3) = 0; - restart = false; + m_restart = false; // DAEFunc @@ -167,14 +168,14 @@ { octave_idx_type ires = 0; - ColumnVector res = (*user_fun) (x, xdot, t, ires); + ColumnVector res = (*user_fun) (m_x, m_xdot, m_t, ires); - if (res.numel () != x.numel ()) + if (res.numel () != m_x.numel ()) { (*current_liboctave_error_handler) ("dassl: inconsistent sizes for state and residual vectors"); - integration_error = true; + m_integration_error = true; return retval; } } @@ -183,7 +184,7 @@ (*current_liboctave_error_handler) ("dassl: no user supplied RHS subroutine!"); - integration_error = true; + m_integration_error = true; return retval; } @@ -234,7 +235,7 @@ (*current_liboctave_error_handler) ("dassl: invalid value for maximum order: %" OCTAVE_F77_INT_TYPE_FORMAT, maxord); - integration_error = true; + m_integration_error = true; return retval; } } @@ -264,15 +265,15 @@ (*current_liboctave_error_handler) ("dassl: inconsistent sizes for tolerance arrays"); - integration_error = true; + m_integration_error = true; return retval; } DASSL_options::m_reset = false; } - double *px = x.fortran_vec (); - double *pxdot = xdot.fortran_vec (); + double *px = m_x.fortran_vec (); + double *pxdot = m_xdot.fortran_vec (); F77_INT *pinfo = m_info.fortran_vec (); @@ -285,15 +286,15 @@ double *dummy = nullptr; F77_INT *idummy = nullptr; - F77_INT tmp_istate = octave::to_f77_int (istate); + F77_INT tmp_istate = octave::to_f77_int (m_istate); - F77_XFCN (ddassl, DDASSL, (ddassl_f, nn, t, px, pxdot, tout, pinfo, + F77_XFCN (ddassl, DDASSL, (ddassl_f, nn, m_t, px, pxdot, tout, pinfo, prel_tol, pabs_tol, tmp_istate, prwork, m_lrw, piwork, m_liw, dummy, idummy, ddassl_j)); - istate = tmp_istate; + m_istate = tmp_istate; - switch (istate) + switch (m_istate) { case 1: // A step was successfully taken in intermediate-output // mode. The code has not yet reached TOUT. @@ -302,8 +303,8 @@ case 3: // The integration to TOUT was successfully completed // (T=TOUT) by stepping past TOUT. Y(*) is obtained by // interpolation. YPRIME(*) is obtained by interpolation. - retval = x; - t = tout; + retval = m_x; + m_t = tout; break; case -1: // A large amount of work has been expended. (~500 steps). @@ -328,14 +329,14 @@ // recover. A message is printed explaining the trouble // and control is returned to the calling program. For // example, this occurs when invalid input is detected. - integration_error = true; + m_integration_error = true; break; default: - integration_error = true; + m_integration_error = true; (*current_liboctave_error_handler) ("unrecognized value of istate (= %" OCTAVE_IDX_TYPE_FORMAT ") " - "returned from ddassl", istate); + "returned from ddassl", m_istate); break; } @@ -364,21 +365,21 @@ for (F77_INT i = 0; i < n; i++) { - retval.elem (0, i) = x.elem (i); - xdot_out.elem (0, i) = xdot.elem (i); + retval.elem (0, i) = m_x.elem (i); + xdot_out.elem (0, i) = m_xdot.elem (i); } for (octave_idx_type j = 1; j < n_out; j++) { ColumnVector x_next = do_integrate (tout.elem (j)); - if (integration_error) + if (m_integration_error) return retval; for (F77_INT i = 0; i < n; i++) { retval.elem (j, i) = x_next.elem (i); - xdot_out.elem (j, i) = xdot.elem (i); + xdot_out.elem (j, i) = m_xdot.elem (i); } } } @@ -409,8 +410,8 @@ for (F77_INT i = 0; i < n; i++) { - retval.elem (0, i) = x.elem (i); - xdot_out.elem (0, i) = xdot.elem (i); + retval.elem (0, i) = m_x.elem (i); + xdot_out.elem (0, i) = m_xdot.elem (i); } octave_idx_type n_crit = tcrit.numel (); @@ -469,7 +470,7 @@ ColumnVector x_next = do_integrate (t_out); - if (integration_error) + if (m_integration_error) return retval; if (save_output) @@ -477,7 +478,7 @@ for (F77_INT i = 0; i < n; i++) { retval.elem (i_out-1, i) = x_next.elem (i); - xdot_out.elem (i_out-1, i) = xdot.elem (i); + xdot_out.elem (i_out-1, i) = m_xdot.elem (i); } } @@ -489,7 +490,7 @@ { retval = integrate (tout, xdot_out); - if (integration_error) + if (m_integration_error) return retval; } } @@ -503,10 +504,10 @@ std::string retval; std::ostringstream buf; - buf << t; + buf << m_t; std::string t_curr = buf.str (); - switch (istate) + switch (m_istate) { case 1: retval = "a step was successfully taken in intermediate-output mode.";
--- a/liboctave/numeric/LSODE.cc Sun Aug 29 20:11:05 2021 -0700 +++ b/liboctave/numeric/LSODE.cc Sun Aug 29 20:16:10 2021 -0700 @@ -105,13 +105,14 @@ static F77_INT nn = 0; - if (! m_initialized || restart || ODEFunc::m_reset || LSODE_options::m_reset) + if (! m_initialized || m_restart || ODEFunc::m_reset + || LSODE_options::m_reset) { - integration_error = false; + m_integration_error = false; m_initialized = true; - istate = 1; + m_istate = 1; F77_INT n = octave::to_f77_int (size ()); @@ -165,15 +166,15 @@ // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("lsode: invalid value for maximum order"); - integration_error = true; + m_integration_error = true; return retval; } } - if (stop_time_set) + if (m_stop_time_set) { m_itask = 4; - m_rwork(0) = stop_time; + m_rwork(0) = m_stop_time; m_iopt = 1; } else @@ -181,7 +182,7 @@ m_itask = 1; } - restart = false; + m_restart = false; // ODEFunc @@ -189,20 +190,20 @@ // In that case we have to create a temporary vector object // and copy. - tmp_x = &x; + tmp_x = &m_x; user_fun = function (); user_jac = jacobian_function (); - ColumnVector xdot = (*user_fun) (x, t); + ColumnVector m_xdot = (*user_fun) (m_x, m_t); - if (x.numel () != xdot.numel ()) + if (m_x.numel () != m_xdot.numel ()) { // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("lsode: inconsistent sizes for state and derivative vectors"); - integration_error = true; + m_integration_error = true; return retval; } @@ -225,7 +226,7 @@ (*current_liboctave_error_handler) ("lsode: inconsistent sizes for state and absolute tolerance vectors"); - integration_error = true; + m_integration_error = true; return retval; } @@ -260,27 +261,27 @@ LSODE_options::m_reset = false; } - double *px = x.fortran_vec (); + double *px = m_x.fortran_vec (); double *pabs_tol = m_abs_tol.fortran_vec (); F77_INT *piwork = m_iwork.fortran_vec (); double *prwork = m_rwork.fortran_vec (); - F77_INT tmp_istate = octave::to_f77_int (istate); + F77_INT tmp_istate = octave::to_f77_int (m_istate); - F77_XFCN (dlsode, DLSODE, (lsode_f, nn, px, t, tout, m_itol, m_rel_tol, + F77_XFCN (dlsode, DLSODE, (lsode_f, nn, px, m_t, tout, m_itol, m_rel_tol, pabs_tol, m_itask, tmp_istate, m_iopt, prwork, m_lrw, piwork, m_liw, lsode_j, m_method_flag)); - istate = tmp_istate; + m_istate = tmp_istate; - switch (istate) + switch (m_istate) { case 1: // prior to initial integration step. case 2: // lsode was successful. - retval = x; - t = tout; + retval = m_x; + m_t = tout; break; case -1: // excess work done on this call (perhaps wrong mf). @@ -292,14 +293,14 @@ case -6: // error weight became zero during problem. (solution // component i vanished, and atol or atol(i) = 0.) case -13: // return requested in user-supplied function. - integration_error = true; + m_integration_error = true; break; default: - integration_error = true; + m_integration_error = true; (*current_liboctave_error_handler) ("unrecognized value of istate (= %" OCTAVE_IDX_TYPE_FORMAT ") " - "returned from lsode", istate); + "returned from lsode", m_istate); break; } @@ -312,10 +313,10 @@ std::string retval; std::ostringstream buf; - buf << t; + buf << m_t; std::string t_curr = buf.str (); - switch (istate) + switch (m_istate) { case 1: retval = "prior to initial integration step"; @@ -383,13 +384,13 @@ retval.resize (n_out, n); for (F77_INT i = 0; i < n; i++) - retval.elem (0, i) = x.elem (i); + retval.elem (0, i) = m_x.elem (i); for (octave_idx_type j = 1; j < n_out; j++) { ColumnVector x_next = do_integrate (tout.elem (j)); - if (integration_error) + if (m_integration_error) return retval; for (F77_INT i = 0; i < n; i++) @@ -413,7 +414,7 @@ retval.resize (n_out, n); for (F77_INT i = 0; i < n; i++) - retval.elem (0, i) = x.elem (i); + retval.elem (0, i) = m_x.elem (i); octave_idx_type n_crit = tcrit.numel (); @@ -471,7 +472,7 @@ ColumnVector x_next = do_integrate (t_out); - if (integration_error) + if (m_integration_error) return retval; if (save_output) @@ -488,7 +489,7 @@ { retval = do_integrate (tout); - if (integration_error) + if (m_integration_error) return retval; } }
--- a/liboctave/numeric/ODES.cc Sun Aug 29 20:11:05 2021 -0700 +++ b/liboctave/numeric/ODES.cc Sun Aug 29 20:16:10 2021 -0700 @@ -33,7 +33,7 @@ ODES::initialize (const ColumnVector& xx, double tt) { base_diff_eqn::initialize (xx, tt); - xdot = ColumnVector (xx.numel (), 0.0); + m_xdot = ColumnVector (xx.numel (), 0.0); } void @@ -41,6 +41,6 @@ const ColumnVector& xtheta) { base_diff_eqn::initialize (xx, tt); - xdot = ColumnVector (xx.numel (), 0.0); - theta = xtheta; + m_xdot = ColumnVector (xx.numel (), 0.0); + m_theta = xtheta; }
--- a/liboctave/numeric/ODES.h Sun Aug 29 20:11:05 2021 -0700 +++ b/liboctave/numeric/ODES.h Sun Aug 29 20:16:10 2021 -0700 @@ -37,18 +37,20 @@ public: ODES (void) - : base_diff_eqn (), ODESFunc (), xdot (), theta () { } + : base_diff_eqn (), ODESFunc (), m_xdot (), m_theta () { } ODES (const ColumnVector& s, double tm, ODESFunc& f) - : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.numel (), 0.0), theta () { } + : base_diff_eqn (s, tm), ODESFunc (f), m_xdot (s.numel (), 0.0), m_theta () + { } ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm, ODESFunc& f) - : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.numel (), 0.0), - theta (xtheta) { } + : base_diff_eqn (s, tm), ODESFunc (f), m_xdot (s.numel (), 0.0), + m_theta (xtheta) { } ODES (const ODES& a) - : base_diff_eqn (a), ODESFunc (a), xdot (a.xdot), theta (a.theta) { } + : base_diff_eqn (a), ODESFunc (a), m_xdot (a.m_xdot), m_theta (a.m_theta) + { } ODES& operator = (const ODES& a) { @@ -57,15 +59,15 @@ base_diff_eqn::operator = (a); ODESFunc::operator = (a); - xdot = a.xdot; - theta = a.theta; + m_xdot = a.m_xdot; + m_theta = a.m_theta; } return *this; } ~ODES (void) = default; - ColumnVector parameter_vector (void) { return theta; } + ColumnVector parameter_vector (void) { return m_theta; } OCTAVE_API void initialize (const ColumnVector& x, double t); @@ -75,10 +77,10 @@ protected: // State vector time derivatives. - ColumnVector xdot; + ColumnVector m_xdot; // Parameter vector. - ColumnVector theta; + ColumnVector m_theta; }; #endif
--- a/liboctave/numeric/base-dae.h Sun Aug 29 20:11:05 2021 -0700 +++ b/liboctave/numeric/base-dae.h Sun Aug 29 20:16:10 2021 -0700 @@ -36,17 +36,17 @@ public: base_diff_alg_eqn (void) - : base_diff_eqn (), xdot () { } + : base_diff_eqn (), m_xdot () { } base_diff_alg_eqn (const ColumnVector& xx, double tt) - : base_diff_eqn (xx, tt), xdot (xx.numel (), 0.0) { } + : base_diff_eqn (xx, tt), m_xdot (xx.numel (), 0.0) { } base_diff_alg_eqn (const ColumnVector& xx, const ColumnVector& xxdot, double tt) - : base_diff_eqn (xx, tt), xdot (xxdot) { } + : base_diff_eqn (xx, tt), m_xdot (xxdot) { } base_diff_alg_eqn (const base_diff_alg_eqn& a) - : base_diff_eqn (a), xdot (a.xdot) { } + : base_diff_eqn (a), m_xdot (a.m_xdot) { } virtual ~base_diff_alg_eqn (void) = default; @@ -55,7 +55,7 @@ if (this != &a) { base_diff_eqn::operator = (a); - xdot = a.xdot; + m_xdot = a.m_xdot; } return *this; } @@ -63,21 +63,21 @@ void initialize (const ColumnVector& x0, double t0) { base_diff_eqn::initialize (x0, t0); - xdot = ColumnVector (x0.numel (), 0.0); + m_xdot = ColumnVector (x0.numel (), 0.0); } void initialize (const ColumnVector& x0, const ColumnVector& xdot0, double t0) { base_diff_eqn::initialize (x0, t0); - xdot = xdot0; + m_xdot = xdot0; } - ColumnVector state_derivative (void) { return xdot; } + ColumnVector state_derivative (void) { return m_xdot; } protected: - ColumnVector xdot; + ColumnVector m_xdot; }; #endif
--- a/liboctave/numeric/base-de.h Sun Aug 29 20:11:05 2021 -0700 +++ b/liboctave/numeric/base-de.h Sun Aug 29 20:16:10 2021 -0700 @@ -38,16 +38,16 @@ public: base_diff_eqn (void) - : x (), t (0.0), stop_time (0.0), stop_time_set (false), - restart (true), integration_error (false), istate (0) { } + : m_x (), m_t (0.0), m_stop_time (0.0), m_stop_time_set (false), + m_restart (true), m_integration_error (false), m_istate (0) { } base_diff_eqn (const ColumnVector& xx, double tt) - : x (xx), t (tt), stop_time (0.0), stop_time_set (false), - restart (true), integration_error (false), istate (0) { } + : m_x (xx), m_t (tt), m_stop_time (0.0), m_stop_time_set (false), + m_restart (true), m_integration_error (false), m_istate (0) { } base_diff_eqn (const base_diff_eqn& a) - : x (a.x), t (a.t), stop_time (0.0), stop_time_set (false), - restart (true), integration_error (false), istate (0) { } + : m_x (a.m_x), m_t (a.m_t), m_stop_time (0.0), m_stop_time_set (false), + m_restart (true), m_integration_error (false), m_istate (0) { } virtual ~base_diff_eqn (void) = default; @@ -55,13 +55,13 @@ { if (this != &a) { - x = a.x; - t = a.t; - stop_time = a.stop_time; - stop_time_set = a.stop_time_set; - restart = a.restart; - integration_error = a.integration_error; - istate = a.istate; + m_x = a.m_x; + m_t = a.m_t; + m_stop_time = a.m_stop_time; + m_stop_time_set = a.m_stop_time_set; + m_restart = a.m_restart; + m_integration_error = a.m_integration_error; + m_istate = a.m_istate; } return *this; @@ -69,55 +69,55 @@ void initialize (const ColumnVector& x0, double t0) { - x = x0; - t = t0; - integration_error = false; - istate = 0; + m_x = x0; + m_t = t0; + m_integration_error = false; + m_istate = 0; force_restart (); } - octave_idx_type size (void) const { return x.numel (); } + octave_idx_type size (void) const { return m_x.numel (); } - ColumnVector state (void) const { return x; } + ColumnVector state (void) const { return m_x; } - double time (void) const { return t; } + double time (void) const { return m_t; } void set_stop_time (double tt) { - stop_time_set = true; - stop_time = tt; + m_stop_time_set = true; + m_stop_time = tt; force_restart (); } void clear_stop_time (void) { - stop_time_set = false; + m_stop_time_set = false; force_restart (); } - virtual void force_restart (void) { restart = true; } + virtual void force_restart (void) { m_restart = true; } - bool integration_ok (void) const { return ! integration_error; } + bool integration_ok (void) const { return ! m_integration_error; } - octave_idx_type integration_state (void) const { return istate; } + octave_idx_type integration_state (void) const { return m_istate; } virtual std::string error_message (void) const = 0; protected: - ColumnVector x; + ColumnVector m_x; - double t; + double m_t; - double stop_time; + double m_stop_time; - bool stop_time_set; + bool m_stop_time_set; - bool restart; + bool m_restart; - bool integration_error; + bool m_integration_error; - octave_idx_type istate; + octave_idx_type m_istate; }; #endif