csaps-cpp
csaps-cpp copied to clipboard
Issue with Eigen?
Im trying to create a smoothing spline with a dataset (it worked successfully in Matlab), but for some reason i keep getting this error when trying to create it:
Assertion failed: (m_factorizationIsOk && "The matrix should be factorized first"), function _solve_impl, file ./eigen-3.4.0/Eigen/src/SparseLU/SparseLU.h, line 317.
Do you know what could be causing a dataset to cause this error?
Hello @Amit-Nayak-2000,
I think in your case the factorization does not work for some reason.
https://github.com/espdev/csaps-cpp/blob/41a67952e7ea71c05f76b6cb1f178825c576a981/src/csaps.cpp#L107-L121
See also notes from the documentation:
Unlike the initial SuperLU implementation, there is no step to equilibrate the matrix. For badly scaled matrices, this step can be useful to reduce the pivoting during factorization. If this is the case for your matrices, you can try the basic scaling method at "unsupported/Eigen/src/IterativeSolvers/Scaling.h"