mlpack  2.0.1
primal_dual.hpp
Go to the documentation of this file.
1 
13 #ifndef __MLPACK_CORE_OPTIMIZERS_SDP_PRIMAL_DUAL_HPP
14 #define __MLPACK_CORE_OPTIMIZERS_SDP_PRIMAL_DUAL_HPP
15 
16 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace optimization {
21 
27 template <typename SDPType>
29 {
30  public:
37  PrimalDualSolver(const SDPType& sdp);
38 
50  PrimalDualSolver(const SDPType& sdp,
51  const arma::mat& initialX,
52  const arma::vec& initialYSparse,
53  const arma::vec& initialYDense,
54  const arma::mat& initialZ);
55 
65  double Optimize(arma::mat& X,
66  arma::vec& ySparse,
67  arma::vec& yDense,
68  arma::mat& Z);
69 
75  double Optimize(arma::mat& X)
76  {
77  arma::vec ysparse, ydense;
78  arma::mat Z;
79  return Optimize(X, ysparse, ydense, Z);
80  }
81 
83  const SDPType& SDP() const { return sdp; }
84 
86  double& Tau() { return tau; }
87 
89  double& NormXzTol() { return normXzTol; }
90 
92  double& PrimalInfeasTol() { return primalInfeasTol; }
93 
95  double& DualInfeasTol() { return dualInfeasTol; }
96 
98  size_t& MaxIterations() { return maxIterations; }
99 
100  private:
102  SDPType sdp;
103 
105  arma::mat initialX;
106 
108  arma::vec initialYsparse;
109 
111  arma::vec initialYdense;
112 
114  //positive definite.
115  arma::mat initialZ;
116 
118  double tau;
119 
121  double normXzTol;
122 
126 
129 
132 };
133 
134 } // namespace optimization
135 } // namespace mlpack
136 
137 // Include implementation.
138 #include "primal_dual_impl.hpp"
139 
140 #endif
arma::vec initialYdense
Starting lagrange multiplier for the sparse constraints.
double & Tau()
Modify tau. Typical values are 0.99.
Definition: primal_dual.hpp:86
size_t maxIterations
Maximum number of iterations to run. Set to 0 for no limit.
double Optimize(arma::mat &X)
Invoke the optimization procedure, and only return the primal variable.
Definition: primal_dual.hpp:75
double Optimize(arma::mat &X, arma::vec &ySparse, arma::vec &yDense, arma::mat &Z)
Invoke the optimization procedure, returning the converged values for the primal and dual variables...
size_t & MaxIterations()
Modify the maximum number of iterations to run before converging.
Definition: primal_dual.hpp:98
Linear algebra utility functions, generally performed on matrices or vectors.
double primalInfeasTol
The tolerance required on the primal constraints required before terminating.
double & PrimalInfeasTol()
Modify the primal infeasibility tolerance.
Definition: primal_dual.hpp:92
double & NormXzTol()
Modify the XZ tolerance.
Definition: primal_dual.hpp:89
SDPType sdp
The SDP problem instance to optimize.
double tau
The step size modulating factor. Needs to be a scalar in (0, 1).
Interface to a primal dual interior point solver.
Definition: primal_dual.hpp:28
arma::mat initialZ
Starting point for Z, the complementary slack variable. Needs to be.
const SDPType & SDP() const
Return the underlying SDP instance.
Definition: primal_dual.hpp:83
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
double & DualInfeasTol()
Modify the dual infeasibility tolerance.
Definition: primal_dual.hpp:95
double dualInfeasTol
The tolerance required on the dual constraint required before terminating.
double normXzTol
The tolerance on the norm of XZ required before terminating.
arma::vec initialYsparse
Starting lagrange multiplier for the sparse constraints.
arma::mat initialX
Starting point for X. Needs to be positive definite.
PrimalDualSolver(const SDPType &sdp)
Construct a new solver instance from a given SDP instance.