diff options
Diffstat (limited to 'src/lib/netlist/solver/nld_ms_w.h')
-rw-r--r-- | src/lib/netlist/solver/nld_ms_w.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/netlist/solver/nld_ms_w.h b/src/lib/netlist/solver/nld_ms_w.h index 33e94a207c3..55d9d630224 100644 --- a/src/lib/netlist/solver/nld_ms_w.h +++ b/src/lib/netlist/solver/nld_ms_w.h @@ -60,7 +60,7 @@ class matrix_solver_w_t: public matrix_solver_t friend class matrix_solver_t; public: - matrix_solver_w_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const int size); + matrix_solver_w_t(netlist_t &anetlist, const pstring &name, const solver_parameters_t *params, const unsigned size); virtual ~matrix_solver_w_t(); @@ -68,8 +68,8 @@ public: virtual void reset() override { matrix_solver_t::reset(); } protected: - virtual int vsolve_non_dynamic(const bool newton_raphson) override; - int solve_non_dynamic(const bool newton_raphson); + virtual unsigned vsolve_non_dynamic(const bool newton_raphson) override; + unsigned solve_non_dynamic(const bool newton_raphson); inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } @@ -164,12 +164,12 @@ void matrix_solver_w_t<m_N, storage_N>::LE_invert() /* FIXME: Singular matrix? */ const nl_double f = 1.0 / W(i,i); const auto * RESTRICT const p = m_terms[i]->m_nzrd.data(); - const unsigned e = m_terms[i]->m_nzrd.size(); + const size_t e = m_terms[i]->m_nzrd.size(); /* Eliminate column i from row j */ const auto * RESTRICT const pb = m_terms[i]->m_nzbd.data(); - const unsigned eb = m_terms[i]->m_nzbd.size(); + const size_t eb = m_terms[i]->m_nzbd.size(); for (unsigned jb = 0; jb < eb; jb++) { const auto j = pb[jb]; @@ -184,11 +184,11 @@ void matrix_solver_w_t<m_N, storage_N>::LE_invert() } } /* up */ - for (int i = kN - 1; i >= 0; i--) + for (unsigned i = kN; i-- > 0; ) { /* FIXME: Singular matrix? */ const nl_double f = 1.0 / W(i,i); - for (int j = i - 1; j>=0; j--) + for (unsigned j = i; j-- > 0; ) { const nl_double f1 = - W(j,i) * f; if (f1 != 0.0) @@ -227,7 +227,7 @@ void matrix_solver_w_t<m_N, storage_N>::LE_compute_x( template <unsigned m_N, unsigned storage_N> -int matrix_solver_w_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_w_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) { const auto iN = N(); @@ -320,7 +320,7 @@ int matrix_solver_w_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphs /* Back substitution */ //inv(H) w = t w = H t nl_double t[storage_N]; // FIXME: convert to member - for (int j = rowcount - 1; j >= 0; j--) + for (unsigned j = rowcount; j-- > 0; ) { nl_double tmp = 0; const nl_double *pj = &H[j][j+1]; @@ -373,7 +373,7 @@ int matrix_solver_w_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphs } template <unsigned m_N, unsigned storage_N> -inline int matrix_solver_w_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +inline unsigned matrix_solver_w_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) { build_LE_A<matrix_solver_w_t>(); build_LE_RHS<matrix_solver_w_t>(); @@ -387,7 +387,7 @@ inline int matrix_solver_w_t<m_N, storage_N>::vsolve_non_dynamic(const bool newt template <unsigned m_N, unsigned storage_N> matrix_solver_w_t<m_N, storage_N>::matrix_solver_w_t(netlist_t &anetlist, const pstring &name, - const solver_parameters_t *params, const int size) + const solver_parameters_t *params, const unsigned size) : matrix_solver_t(anetlist, name, NOSORT, params) ,m_cnt(0) , m_dim(size) |