Skip to content

Commit

Permalink
nonlinz.cpp: use eigen instead of sparse13 (#2623)
Browse files Browse the repository at this point in the history
* diag_ have been removed. Those was pointer for direct access to the diagonal elements, but Eigen can relocate matrix and invalidate pointers.
* double* rv_ (real v_) and double* jv_ (imag v_), have been changed to std::vector<double> v_.
* char* m_ (the sparse13 matrix) have been changed to a Eigen::SparseMatrix<std::complex<double>> m_. The solver Eigen::SparseLU lu_ have been added. One of the main difference is that sparse13 is 1-indexed and Eigen: 0-indexed.
* The whole complex version of sparse13 have been removed because this was the last use.
* transfer_amp, input_amp, transfer_phase, input_phase and ratio_amp have all been simplified by using standard functions of std::complex instead of computing by ourself.
* v_index have been removed because this was a vector i -> i + 1. Now that Eigen is 0-indexed it becomes really useless.
* In the file partrans.cpp the function pargag_jacob_rhs has been modified to support std::complex<double>, so know we do only one call of the function (before one with real and one with complex part), but inside we loop twice on real and complex because the algorithm is hard to understand to do everything in once.
  • Loading branch information
Nicolas Cornu authored Jan 16, 2024
1 parent 45cdea7 commit d6b9955
Show file tree
Hide file tree
Showing 13 changed files with 183 additions and 305 deletions.
2 changes: 0 additions & 2 deletions cmake/NeuronFileLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ set(HEADER_FILES_TO_INSTALL
scopmath/sparse_thread.hpp
scopmath/ssimplic.hpp
scopmath/ssimplic_thread.hpp
sparse13/cspmatrix.h
sparse13/cspredef.h
sparse13/spconfig.h
sparse13/spmatrix.h)

Expand Down
Loading

0 comments on commit d6b9955

Please sign in to comment.