SparseGenMatProd.h
Go to the documentation of this file.
1 // Copyright (C) 2016-2019 Yixuan Qiu <yixuan.qiu@cos.name>
2 //
3 // This Source Code Form is subject to the terms of the Mozilla
4 // Public License v. 2.0. If a copy of the MPL was not distributed
5 // with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 
7 #ifndef SPARSE_GEN_MAT_PROD_H
8 #define SPARSE_GEN_MAT_PROD_H
9 
10 #include <Eigen/Core>
11 #include <Eigen/SparseCore>
12 
13 namespace Spectra {
14 
23 template <typename Scalar, int Flags = 0, typename StorageIndex = int>
25 {
26 private:
33 
35 
36 public:
45  m_mat(mat)
46  {}
47 
51  Index rows() const { return m_mat.rows(); }
55  Index cols() const { return m_mat.cols(); }
56 
63  // y_out = A * x_in
64  void perform_op(const Scalar* x_in, Scalar* y_out) const
65  {
66  MapConstVec x(x_in, m_mat.cols());
67  MapVec y(y_out, m_mat.rows());
68  y.noalias() = m_mat * x;
69  }
70 };
71 
72 } // namespace Spectra
73 
74 #endif // SPARSE_GEN_MAT_PROD_H
Eigen::SparseMatrix
A versatible sparse matrix representation.
Definition: SparseMatrix.h:96
x
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
Definition: gnuplot_common_settings.hh:12
Spectra::SparseGenMatProd::SparseGenMatProd
SparseGenMatProd(ConstGenericSparseMatrix &mat)
Definition: SparseGenMatProd.h:44
mat
MatrixXf mat
Definition: Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
Spectra::SparseGenMatProd::ConstGenericSparseMatrix
const typedef Eigen::Ref< const SparseMatrix > ConstGenericSparseMatrix
Definition: SparseGenMatProd.h:32
Spectra::SparseGenMatProd::cols
Index cols() const
Definition: SparseGenMatProd.h:55
Spectra::SparseGenMatProd::MapVec
Eigen::Map< Vector > MapVec
Definition: SparseGenMatProd.h:30
Spectra::SparseGenMatProd::Index
Eigen::Index Index
Definition: SparseGenMatProd.h:27
Spectra::SparseGenMatProd
Definition: SparseGenMatProd.h:24
Eigen::Map
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:94
y
Scalar * y
Definition: level1_cplx_impl.h:124
Eigen::Ref
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:281
Spectra::SparseGenMatProd::m_mat
ConstGenericSparseMatrix m_mat
Definition: SparseGenMatProd.h:34
Spectra::SparseGenMatProd::SparseMatrix
Eigen::SparseMatrix< Scalar, Flags, StorageIndex > SparseMatrix
Definition: SparseGenMatProd.h:31
Spectra
Definition: LOBPCGSolver.h:19
Spectra::SparseGenMatProd::rows
Index rows() const
Definition: SparseGenMatProd.h:51
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 >
Spectra::SparseGenMatProd::MapConstVec
Eigen::Map< const Vector > MapConstVec
Definition: SparseGenMatProd.h:29
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Spectra::SparseGenMatProd::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: SparseGenMatProd.h:28
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Spectra::SparseGenMatProd::perform_op
void perform_op(const Scalar *x_in, Scalar *y_out) const
Definition: SparseGenMatProd.h:64


gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:03:00