Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nonlinz.cpp: use eigen instead of sparse13 (#2623)
* 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