From 03d5c4bcdfc53502e358b4743ce03375cfd89d2b Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Thu, 7 Nov 2024 17:06:11 +0100 Subject: [PATCH] OcSparseMatrix => OcMatrix --- src/nrnoc/extcelln.cpp | 4 ++-- src/nrnoc/membfunc.cpp | 2 +- src/nrnoc/multicore.h | 4 ++-- src/nrnoc/treeset.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/nrnoc/extcelln.cpp b/src/nrnoc/extcelln.cpp index 9ef904fdd7..9380924a1a 100644 --- a/src/nrnoc/extcelln.cpp +++ b/src/nrnoc/extcelln.cpp @@ -432,7 +432,7 @@ void nrn_setup_ext(NrnThread* _nt) { /* i.e. (cm/dt + di/dvm - dis/dvi)*[dvi] and (dis/dvi)*[dvx] */ for (i = 0; i < cnt; ++i) { - OcSparseMatrix& m = *_nt->_sp13mat; + OcMatrix& m = *_nt->_sp13mat; nd = ndlist[i]; int index = nd->eqn_index_; nde = nd->extnode; @@ -450,7 +450,7 @@ void nrn_setup_ext(NrnThread* _nt) { } /* series resistance, capacitance, and axial terms. */ for (i = 0; i < cnt; ++i) { - OcSparseMatrix& m = *_nt->_sp13mat; + OcMatrix& m = *_nt->_sp13mat; nd = ndlist[i]; int index = nd->eqn_index_; nde = nd->extnode; diff --git a/src/nrnoc/membfunc.cpp b/src/nrnoc/membfunc.cpp index e6eeaf2970..7d48a0ee0b 100644 --- a/src/nrnoc/membfunc.cpp +++ b/src/nrnoc/membfunc.cpp @@ -54,7 +54,7 @@ int _nrn_mechanism_access_index(const Node* node) { return node->eqn_index_; } double& _nrn_mechanism_get_matrix_elem(NrnThread* nt, int i, int j) { - OcSparseMatrix& m = *nt->_sp13mat; + OcMatrix& m = *nt->_sp13mat; return m.coeff(i, j); } neuron::container::data_handle _nrn_mechanism_get_area_handle(Node* node) { diff --git a/src/nrnoc/multicore.h b/src/nrnoc/multicore.h index ac8d27b718..0511fbb33b 100644 --- a/src/nrnoc/multicore.h +++ b/src/nrnoc/multicore.h @@ -29,7 +29,7 @@ actual_v, etc. #include "membfunc.h" #include -class OcSparseMatrix; +class OcMatrix; typedef struct NrnThreadMembList { /* patterned after CvMembList in cvodeobj.h */ struct NrnThreadMembList* next; @@ -92,7 +92,7 @@ struct NrnThread { Node** _v_parent; double* _sp13_rhs; /* rhs matrix for sparse13 solver. updates to and from this vector need to be transfered to actual_rhs */ - OcSparseMatrix* _sp13mat; /* handle to general sparse matrix */ + OcMatrix* _sp13mat; /* handle to general sparse matrix */ Memb_list* _ecell_memb_list; /* normally nullptr */ Node** _ecell_children; /* nodes with no extcell but parent has it */ void* _vcv; /* replaces old cvode_instance and nrn_cvode_ */ diff --git a/src/nrnoc/treeset.cpp b/src/nrnoc/treeset.cpp index d32f75b83c..3694e8a25a 100644 --- a/src/nrnoc/treeset.cpp +++ b/src/nrnoc/treeset.cpp @@ -353,7 +353,7 @@ void update_sp13_rhs_based_on_actual_rhs(NrnThread* nt) { void update_actual_d_based_on_sp13_mat(NrnThread* nt) { for (int i = 0; i < nt->end; ++i) { const int index = nt->_v_node[i]->eqn_index_; - OcSparseMatrix& m = *nt->_sp13mat; + OcMatrix& m = *nt->_sp13mat; nt->actual_d(i) = m.getval(index - 1, index - 1); } } @@ -364,7 +364,7 @@ void update_actual_d_based_on_sp13_mat(NrnThread* nt) { void update_sp13_mat_based_on_actual_d(NrnThread* nt) { for (int i = 0; i < nt->end; ++i) { const int index = nt->_v_node[i]->eqn_index_; - OcSparseMatrix& m = *nt->_sp13mat; + OcMatrix& m = *nt->_sp13mat; m(index - 1, index - 1) = nt->actual_d(i); } } @@ -573,7 +573,7 @@ void nrn_lhs(neuron::model_sorted_token const& sorted_token, NrnThread& nt) { update_sp13_mat_based_on_actual_d(_nt); // just because of activclamp_lhs for (i = i2; i < i3; ++i) { // note i2 Node* nd = _nt->_v_node[i]; - OcSparseMatrix& m = *_nt->_sp13mat; + OcMatrix& m = *_nt->_sp13mat; auto const parent_i = _nt->_v_parent_index[i]; auto* const parent_nd = _nt->_v_node[parent_i]; auto const nd_a = NODEA(nd); @@ -1904,7 +1904,7 @@ static void nrn_matrix_node_alloc(void) { /*printf(" %d extracellular nodes\n", extn);*/ neqn += extn; nt->_sp13_rhs = (double*) ecalloc(neqn + 1, sizeof(double)); - nt->_sp13mat = new OcSparseMatrix(neqn, neqn); + nt->_sp13mat = OcMatrix::instance(neqn, neqn, OcMatrix::MSPARSE); for (in = 0, i = 1; in < nt->end; ++in, ++i) { nt->_v_node[in]->eqn_index_ = i; if (nt->_v_node[in]->extnode) {