DenseGenMatProd.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 DENSE_GEN_MAT_PROD_H
8 #define DENSE_GEN_MAT_PROD_H
9 
10 #include <Eigen/Core>
11 
12 namespace Spectra {
13 
19 
28 template <typename Scalar>
30 {
31 private:
38 
40 
41 public:
51  m_mat(mat)
52  {}
53 
57  Index rows() const { return m_mat.rows(); }
61  Index cols() const { return m_mat.cols(); }
62 
69  // y_out = A * x_in
70  void perform_op(const Scalar* x_in, Scalar* y_out) const
71  {
72  MapConstVec x(x_in, m_mat.cols());
73  MapVec y(y_out, m_mat.rows());
74  y.noalias() = m_mat * x;
75  }
76 };
77 
78 } // namespace Spectra
79 
80 #endif // DENSE_GEN_MAT_PROD_H
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::DenseGenMatProd::DenseGenMatProd
DenseGenMatProd(ConstGenericMatrix &mat)
Definition: DenseGenMatProd.h:50
Spectra::DenseGenMatProd::perform_op
void perform_op(const Scalar *x_in, Scalar *y_out) const
Definition: DenseGenMatProd.h:70
Spectra::DenseGenMatProd::Matrix
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition: DenseGenMatProd.h:33
mat
MatrixXf mat
Definition: Tutorial_AdvancedInitialization_CommaTemporary.cpp:1
Spectra::DenseGenMatProd::m_mat
ConstGenericMatrix m_mat
Definition: DenseGenMatProd.h:39
Spectra::DenseGenMatProd::rows
Index rows() const
Definition: DenseGenMatProd.h:57
Spectra::DenseGenMatProd::MapVec
Eigen::Map< Vector > MapVec
Definition: DenseGenMatProd.h:36
Spectra::DenseGenMatProd::Index
Eigen::Index Index
Definition: DenseGenMatProd.h:32
Spectra::DenseGenMatProd::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: DenseGenMatProd.h:34
Spectra::DenseGenMatProd::cols
Index cols() const
Definition: DenseGenMatProd.h:61
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
Definition: LOBPCGSolver.h:19
Spectra::DenseGenMatProd::MapConstVec
Eigen::Map< const Vector > MapConstVec
Definition: DenseGenMatProd.h:35
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic >
Spectra::DenseGenMatProd::ConstGenericMatrix
const typedef Eigen::Ref< const Matrix > ConstGenericMatrix
Definition: DenseGenMatProd.h:37
Spectra::DenseGenMatProd
Definition: DenseGenMatProd.h:29
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:12