mlpack  2.0.1
matrix_completion.hpp
Go to the documentation of this file.
1 
15 #ifndef __MLPACK_METHODS_MATRIX_COMPLETION_MATRIX_COMPLETION_HPP
16 #define __MLPACK_METHODS_MATRIX_COMPLETION_MATRIX_COMPLETION_HPP
17 
20 
21 namespace mlpack {
22 namespace matrix_completion {
23 
56 {
57  public:
70  MatrixCompletion(const size_t m,
71  const size_t n,
72  const arma::umat& indices,
73  const arma::vec& values,
74  const size_t r);
75 
88  MatrixCompletion(const size_t m,
89  const size_t n,
90  const arma::umat& indices,
91  const arma::vec& values,
92  const arma::mat& initialPoint);
93 
104  MatrixCompletion(const size_t m,
105  const size_t n,
106  const arma::umat& indices,
107  const arma::vec& values);
108 
114  void Recover(arma::mat& recovered);
115 
120 
121  private:
123  size_t m;
125  size_t n;
127  arma::umat indices;
129  arma::mat values;
130 
133 
135  void CheckValues();
137  void InitSDP();
138 
141  static size_t DefaultRank(const size_t m, const size_t n, const size_t p);
142 };
143 
144 } // namespace matrix_completion
145 } // namespace mlpack
146 
147 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
const optimization::LRSDP< optimization::SDP< arma::sp_mat > > & Sdp() const
Return the underlying SDP.
static size_t DefaultRank(const size_t m, const size_t n, const size_t p)
Select a rank of the matrix given that is of size m x n and has p known elements. ...
LRSDP is the implementation of Monteiro and Burer's formulation of low-rank semidefinite programs (LR...
Definition: lrsdp.hpp:32
size_t m
Number of rows in original matrix.
arma::mat values
Vector containing the values of the known entries.
optimization::LRSDP< optimization::SDP< arma::sp_mat > > & Sdp()
Modify the underlying SDP.
MatrixCompletion(const size_t m, const size_t n, const arma::umat &indices, const arma::vec &values, const size_t r)
Construct a matrix completion problem, specifying the maximum rank of the solution.
size_t n
Number of columns in original matrix.
optimization::LRSDP< optimization::SDP< arma::sp_mat > > sdp
The underlying SDP to be solved.
void Recover(arma::mat &recovered)
Solve the underlying SDP to fill in the remaining values.
arma::umat indices
Matrix containing the indices of the known entries (has two rows).
This class implements the popular nuclear norm minimization heuristic for matrix completion problems...
void CheckValues()
Validate the input matrices.