SymGEigsRegInvOp.h
Go to the documentation of this file.
1 // Copyright (C) 2017-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_REG_INV_OP_H
8 #define SYM_GEIGS_REG_INV_OP_H
9 
10 #include <Eigen/Core>
11 #include "../SparseSymMatProd.h"
12 #include "../SparseRegularInverse.h"
13 
14 namespace Spectra {
15 
22 template <typename Scalar = double,
23  typename OpType = SparseSymMatProd<double>,
24  typename BOpType = SparseRegularInverse<double> >
26 {
27 private:
31 
32  OpType& m_op;
33  BOpType& m_Bop;
34  Vector m_cache; // temporary working space
35 
36 public:
43  SymGEigsRegInvOp(OpType& op, BOpType& Bop) :
44  m_op(op), m_Bop(Bop), m_cache(op.rows())
45  {}
46 
50  Index rows() const { return m_Bop.rows(); }
54  Index cols() const { return m_Bop.rows(); }
55 
62  // y_out = inv(B) * A * x_in
63  void perform_op(const Scalar* x_in, Scalar* y_out)
64  {
65  m_op.perform_op(x_in, m_cache.data());
66  m_Bop.solve(m_cache.data(), y_out);
67  }
68 };
69 
70 } // namespace Spectra
71 
72 #endif // SYM_GEIGS_REG_INV_OP_H
SCALAR Scalar
Definition: bench_gemm.cpp:33
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
void perform_op(const Scalar *x_in, Scalar *y_out)
SymGEigsRegInvOp(OpType &op, BOpType &Bop)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:45:07