csaps-cpp icon indicating copy to clipboard operation
csaps-cpp copied to clipboard

Issue with Eigen?

Open Amit-Nayak-2000 opened this issue 3 years ago • 1 comments

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?

Amit-Nayak-2000 avatar Jul 04 '22 21:07 Amit-Nayak-2000

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"

espdev avatar Jul 06 '22 10:07 espdev