DenseSymMatProd.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_SYM_MAT_PROD_H
8 #define DENSE_SYM_MAT_PROD_H
9 
10 #include <Eigen/Core>
11 
12 namespace Spectra {
13 
21 template <typename Scalar, int Uplo = Eigen::Lower>
23 {
24 private:
31 
32  ConstGenericMatrix m_mat;
33 
34 public:
43  DenseSymMatProd(ConstGenericMatrix& mat) :
44  m_mat(mat)
45  {}
46 
50  Index rows() const { return m_mat.rows(); }
54  Index cols() const { return m_mat.cols(); }
55 
62  // y_out = A * x_in
63  void perform_op(const Scalar* x_in, Scalar* y_out) const
64  {
65  MapConstVec x(x_in, m_mat.cols());
66  MapVec y(y_out, m_mat.rows());
67  y.noalias() = m_mat.template selfadjointView<Uplo>() * x;
68  }
69 };
70 
71 } // namespace Spectra
72 
73 #endif // DENSE_SYM_MAT_PROD_H
SCALAR Scalar
Definition: bench_gemm.cpp:33
Scalar * y
ConstGenericMatrix m_mat
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:94
void perform_op(const Scalar *x_in, Scalar *y_out) const
DenseSymMatProd(ConstGenericMatrix &mat)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
const Eigen::Ref< const Matrix > ConstGenericMatrix
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Eigen::Map< const Vector > MapConstVec
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
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Eigen::Map< Vector > MapVec


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:41:58