mlpack 3.4.2
svd_wrapper.hpp
Go to the documentation of this file.
1
12#ifndef MLPACK_METHODS_SVDWRAPPER_HPP
13#define MLPACK_METHODS_SVDWRAPPER_HPP
14
15#include <mlpack/prereqs.hpp>
16
17namespace mlpack
18{
19namespace cf
20{
21
27class DummyClass {};
28
39template<class Factorizer = DummyClass>
41{
42 public:
43 // empty constructor
44 SVDWrapper(const Factorizer& factorizer = Factorizer()) :
45 factorizer(factorizer)
46 {
47 // Nothing to do here.
48 }
49
61 double Apply(const arma::mat& V,
62 arma::mat& W,
63 arma::mat& sigma,
64 arma::mat& H) const;
76 double Apply(const arma::mat& V,
77 size_t r,
78 arma::mat& W,
79 arma::mat& H) const;
80
81 private:
83 Factorizer factorizer;
84}; // class SVDWrapper
85
88
89} // namespace cf
90} // namespace mlpack
91
93#include "svd_wrapper_impl.hpp"
94
95#endif
This class acts as a dummy class for passing as template parameter.
Definition: svd_wrapper.hpp:27
This class acts as the wrapper for all SVD factorizers which are incompatible with CF module.
Definition: svd_wrapper.hpp:41
SVDWrapper(const Factorizer &factorizer=Factorizer())
Definition: svd_wrapper.hpp:44
double Apply(const arma::mat &V, arma::mat &W, arma::mat &sigma, arma::mat &H) const
Factorizer function which takes SVD of the given matrix and returns the frobenius norm of error.
double Apply(const arma::mat &V, size_t r, arma::mat &W, arma::mat &H) const
Factorizer function which computes SVD and returns matrices as required by CF module.
SVDWrapper< DummyClass > ArmaSVDFactorizer
add simple typedefs
Definition: svd_wrapper.hpp:87
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.