59 const Eigen::MatrixBase<Derived> & y,
60 const Eigen::MatrixBase<Derived> & w,
61 const Eigen::SparseMatrix<typename Derived::PlainObject::Scalar> & lambdaDTD
66 static_assert(Derived::IsVectorAtCompileTime,
"Error: y and w are not vector.");
68 using Scalar =
typename Derived::PlainObject::Scalar;
71 Eigen::SparseMatrix<typename Derived::PlainObject::Scalar> W;
72 Eigen::SimplicialCholesky< Eigen::SparseMatrix<Scalar> > solver;
75 solver.compute(W + lambdaDTD);
77 if(solver.info() != Eigen::Success) {
78 throw std::runtime_error(
"Whittaker(): solver calculation fails.");
81 z = solver.solve(W * y);
const std::vector< double > Whittaker(const std::vector< double > &y, const std::vector< double > &w, const double lambda, const unsigned int s)
Performs Whittaker smoothing (std::vector<double> version, with weights).