irlba
A C++ library for IRLBA
Loading...
Searching...
No Matches
MockMatrix.hpp
Go to the documentation of this file.
1#ifndef IRLBA_MOCK_MATRIX_HPP
2#define IRLBA_MOCK_MATRIX_HPP
3
4#include "Eigen/Dense"
5
11namespace irlba {
12
23public:
27 MockMatrix(Eigen::MatrixXd x) : my_x(std::move(x)) {}
32private:
33 Eigen::MatrixXd my_x;
34
35public:
36
40 Eigen::Index rows() const { return my_x.rows(); }
41
45 Eigen::Index cols() const { return my_x.cols(); }
46
47public:
54 struct Workspace {};
55
60 return Workspace();
61 }
62
70
77
78public:
94 template<class Right_, class EigenVector_>
96 out.noalias() = my_x * rhs;
97 }
98
114 template<class Right_, class EigenVector_>
116 out.noalias() = my_x.adjoint() * rhs;
117 }
118
124 template<class EigenMatrix_>
126 return EigenMatrix_(my_x);
127 }
128};
129
130}
131
132#endif
Interface for a matrix to use in compute().
Definition MockMatrix.hpp:22
void adjoint_multiply(const Right_ &rhs, AdjointWorkspace &work, EigenVector_ &out) const
Definition MockMatrix.hpp:115
AdjointWorkspace adjoint_workspace() const
Definition MockMatrix.hpp:74
Eigen::Index cols() const
Definition MockMatrix.hpp:45
Eigen::Index rows() const
Definition MockMatrix.hpp:40
Workspace workspace() const
Definition MockMatrix.hpp:59
EigenMatrix_ realize() const
Definition MockMatrix.hpp:125
void multiply(const Right_ &rhs, Workspace &work, EigenVector_ &out) const
Definition MockMatrix.hpp:95
Implements IRLBA for approximate SVD.
Definition compute.hpp:18
EigenMatrix_ wrapped_realize(const Matrix_ &matrix)
Definition wrappers.hpp:185
Workspace class for adjoint_multiply().
Definition MockMatrix.hpp:69
Workspace class for multiply().
Definition MockMatrix.hpp:54