60 const Eigen::MatrixBase<Derived> & y,
61 const Eigen::MatrixBase<Derived> & w,
62 const Eigen::SparseMatrix<typename Derived::PlainObject::Scalar> & lambdaDTD
67 static_assert(Derived::IsVectorAtCompileTime,
"Error: y and w are not vector.");
69 using Scalar =
typename Derived::PlainObject::Scalar;
72 Eigen::SparseMatrix<typename Derived::PlainObject::Scalar> W;
73 Eigen::SimplicialCholesky< Eigen::SparseMatrix<Scalar> > solver;
76 solver.compute(W + lambdaDTD);
78 if(solver.info() != Eigen::Success) {
79 throw std::runtime_error(
"Whittaker(): solver calculation fails.");
82 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).