39 using Index = Eigen::Index;
40 using Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>;
41 using MapConstVec = Eigen::Map<const Vector>;
42 using MapVec = Eigen::Map<Vector>;
43 using Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
44 using SparseMatrix = Eigen::SparseMatrix<Scalar, Flags, StorageIndex>;
45 using ConstGenericSparseMatrix =
const Eigen::Ref<const SparseMatrix>;
47 ConstGenericSparseMatrix m_mat;
57 template <
typename Derived>
62 static_cast<int>(Derived::PlainObject::IsRowMajor) ==
static_cast<int>(SparseMatrix::IsRowMajor),
63 "SparseGenMatProd: the \"Flags\" template parameter does not match the input matrix (Eigen::ColMajor/Eigen::RowMajor)");
69 Index
rows()
const {
return m_mat.rows(); }
73 Index
cols()
const {
return m_mat.cols(); }
84 MapConstVec x(x_in, m_mat.cols());
85 MapVec y(y_out, m_mat.rows());
86 y.noalias() = m_mat * x;
92 Matrix
operator*(
const Eigen::Ref<const Matrix>& mat_in)
const
94 return m_mat * mat_in;
92 Matrix
operator*(
const Eigen::Ref<const Matrix>& mat_in)
const {
…}
102 return m_mat.coeff(i, j);