SymGEigsCholeskyOp.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 SYM_GEIGS_CHOLESKY_OP_H
8 #define SYM_GEIGS_CHOLESKY_OP_H
9 
10 #include <Eigen/Core>
11 #include "../DenseSymMatProd.h"
12 #include "../DenseCholesky.h"
13 
14 namespace Spectra {
15 
24 template <typename Scalar = double,
25  typename OpType = DenseSymMatProd<double>,
26  typename BOpType = DenseCholesky<double> >
28 {
29 private:
33 
34  OpType& m_op;
35  BOpType& m_Bop;
36  Vector m_cache; // temporary working space
37 
38 public:
45  SymGEigsCholeskyOp(OpType& op, BOpType& Bop) :
46  m_op(op), m_Bop(Bop), m_cache(op.rows())
47  {}
48 
52  Index rows() const { return m_Bop.rows(); }
56  Index cols() const { return m_Bop.rows(); }
57 
64  // y_out = inv(L) * A * inv(L') * x_in
65  void perform_op(const Scalar* x_in, Scalar* y_out)
66  {
67  m_Bop.upper_triangular_solve(x_in, y_out);
68  m_op.perform_op(y_out, m_cache.data());
69  m_Bop.lower_triangular_solve(m_cache.data(), y_out);
70  }
71 };
72 
73 } // namespace Spectra
74 
75 #endif // SYM_GEIGS_CHOLESKY_OP_H
SCALAR Scalar
Definition: bench_gemm.cpp:46
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
SymGEigsCholeskyOp(OpType &op, BOpType &Bop)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
void perform_op(const Scalar *x_in, Scalar *y_out)
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:36:35