mlpack  2.0.1
svd_wrapper.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_METHODS_SVDWRAPPER_HPP
15 #define __MLPACK_METHODS_SVDWRAPPER_HPP
16 
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack
20 {
21 namespace cf
22 {
23 
29 class DummyClass {};
30 
41 template<class Factorizer = DummyClass>
43 {
44  public:
45  // empty constructor
46  SVDWrapper(const Factorizer& factorizer = Factorizer())
47  : factorizer(factorizer) {};
48 
60  double Apply(const arma::mat& V,
61  arma::mat& W,
62  arma::mat& sigma,
63  arma::mat& H) const;
74  double Apply(const arma::mat& V,
75  size_t r,
76  arma::mat& W,
77  arma::mat& H) const;
78 
79  private:
81  Factorizer factorizer;
82 }; // class SVDWrapper
83 
86 
88 #include "svd_wrapper_impl.hpp"
89 
90 } // namespace cf
91 } // namespace mlpack
92 
93 #endif
SVDWrapper< DummyClass > ArmaSVDFactorizer
add simple typedefs
Definition: svd_wrapper.hpp:85
SVDWrapper(const Factorizer &factorizer=Factorizer())
Definition: svd_wrapper.hpp:46
Linear algebra utility functions, generally performed on matrices or vectors.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
This class acts as a dummy class for passing as template parameter.
Definition: svd_wrapper.hpp:29
This class acts as the wrapper for all SVD factorizers which are incompatible with CF module...
Definition: svd_wrapper.hpp:42
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...
Factorizer factorizer
svd factorizer
Definition: svd_wrapper.hpp:81