Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nonlinz.cpp: use eigen instead of sparse13 #2623

Merged
merged 20 commits into from
Jan 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/nrniv/nonlinz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class NonLinImpRep final {
void dsds();
int gapsolve();

Eigen::SparseMatrix<std::complex<double>, Eigen::RowMajor> m_{};
std::unique_ptr<Eigen::SparseLU<decltype(m_)>> lu_{};
Eigen::SparseMatrix<std::complex<double>> m_{};
std::unique_ptr<Eigen::SparseLU<Eigen::SparseMatrix<std::complex<double>>>> lu_{};
alkino marked this conversation as resolved.
Show resolved Hide resolved
int scnt_; // structure_change
int n_v_, n_ext_, n_lin_, n_ode_, neq_v_, neq_;
std::vector<neuron::container::data_handle<double>> pv_, pvdot_;
Expand Down Expand Up @@ -146,8 +146,8 @@ void NonLinImp::compute(double omega, double deltafac, int maxiter) {
// Now that the matrix is filled we can compressed it (mandatory for SparseLU)
alkino marked this conversation as resolved.
Show resolved Hide resolved
rep_->m_.makeCompressed();

rep_->lu_ = std::make_unique<Eigen::SparseLU<decltype(rep_->m_)>>(rep_->m_);
rep_->lu_->compute(rep_->m_);
rep_->lu_ = std::make_unique<Eigen::SparseLU<Eigen::SparseMatrix<std::complex<double>>>>(
rep_->m_);
auto info = rep_->lu_->info();
switch (info) {
case Eigen::NumericalIssue:
Expand Down