7 #ifndef DENSE_SYM_SHIFT_SOLVE_H 8 #define DENSE_SYM_SHIFT_SOLVE_H 13 #include "../LinAlg/BKLDLT.h" 14 #include "../Util/CompInfo.h" 25 template <
typename Scalar,
int Uplo = Eigen::Lower>
50 m_mat(mat), m_n(mat.
rows())
52 if (mat.rows() != mat.cols())
53 throw std::invalid_argument(
"DenseSymShiftSolve: matrix must be square");
70 m_solver.
compute(m_mat, Uplo, sigma);
72 throw std::invalid_argument(
"DenseSymShiftSolve: factorization failed with the given shift");
84 MapConstVec
x(x_in, m_n);
86 y.noalias() = m_solver.
solve(x);
92 #endif // DENSE_SYM_SHIFT_SOLVE_H Vector solve(ConstGenericVector &b) const
void compute(ConstGenericMatrix &mat, int uplo=Eigen::Lower, const Scalar &shift=Scalar(0))
Eigen::Map< const Vector > MapConstVec
A matrix or vector expression mapping an existing array of data.
static const double sigma
Eigen::Map< Vector > MapVec
Computation was successful.
void set_shift(Scalar sigma)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
BKLDLT< Scalar > m_solver
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
const Eigen::Ref< const Matrix > ConstGenericMatrix
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
DenseSymShiftSolve(ConstGenericMatrix &mat)
void perform_op(const Scalar *x_in, Scalar *y_out) const