Skip to content

Commit

Permalink
OcSparseMatrix => OcMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
alkino committed Nov 7, 2024
1 parent 8fb9cb0 commit 03d5c4b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/nrnoc/extcelln.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/nrnoc/membfunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> _nrn_mechanism_get_area_handle(Node* node) {
Expand Down
4 changes: 2 additions & 2 deletions src/nrnoc/multicore.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ actual_v, etc.
#include "membfunc.h"

#include <cstddef>
class OcSparseMatrix;
class OcMatrix;

typedef struct NrnThreadMembList { /* patterned after CvMembList in cvodeobj.h */
struct NrnThreadMembList* next;
Expand Down Expand Up @@ -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_ */
Expand Down
8 changes: 4 additions & 4 deletions src/nrnoc/treeset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 03d5c4b

Please sign in to comment.