mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
primal_dual.hpp
Go to the documentation of this file.
1 
11 #ifndef MLPACK_CORE_OPTIMIZERS_SDP_PRIMAL_DUAL_HPP
12 #define MLPACK_CORE_OPTIMIZERS_SDP_PRIMAL_DUAL_HPP
13 
14 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace optimization {
19 
25 template <typename SDPType>
27 {
28  public:
35  PrimalDualSolver(const SDPType& sdp);
36 
48  PrimalDualSolver(const SDPType& sdp,
49  const arma::mat& initialX,
50  const arma::vec& initialYSparse,
51  const arma::vec& initialYDense,
52  const arma::mat& initialZ);
53 
63  double Optimize(arma::mat& X,
64  arma::vec& ySparse,
65  arma::vec& yDense,
66  arma::mat& Z);
67 
73  double Optimize(arma::mat& X)
74  {
75  arma::vec ysparse, ydense;
76  arma::mat Z;
77  return Optimize(X, ysparse, ydense, Z);
78  }
79 
81  const SDPType& SDP() const { return sdp; }
82 
84  double& Tau() { return tau; }
85 
87  double& NormXzTol() { return normXzTol; }
88 
90  double& PrimalInfeasTol() { return primalInfeasTol; }
91 
93  double& DualInfeasTol() { return dualInfeasTol; }
94 
96  size_t& MaxIterations() { return maxIterations; }
97 
98  private:
100  SDPType sdp;
101 
103  arma::mat initialX;
104 
106  arma::vec initialYsparse;
107 
109  arma::vec initialYdense;
110 
112  //positive definite.
113  arma::mat initialZ;
114 
116  double tau;
117 
119  double normXzTol;
120 
123  double primalInfeasTol;
124 
126  double dualInfeasTol;
127 
129  size_t maxIterations;
130 };
131 
132 } // namespace optimization
133 } // namespace mlpack
134 
135 // Include implementation.
136 #include "primal_dual_impl.hpp"
137 
138 #endif
double & Tau()
Modify tau. Typical values are 0.99.
Definition: primal_dual.hpp:84
double Optimize(arma::mat &X)
Invoke the optimization procedure, and only return the primal variable.
Definition: primal_dual.hpp:73
The core includes that mlpack expects; standard C++ includes and Armadillo.
const SDPType & SDP() const
Return the underlying SDP instance.
Definition: primal_dual.hpp:81
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...
PrimalDualSolver(const SDPType &sdp)
Construct a new solver instance from a given SDP instance.
Interface to a primal dual interior point solver.
Definition: primal_dual.hpp:26
double & NormXzTol()
Modify the XZ tolerance.
Definition: primal_dual.hpp:87
double & DualInfeasTol()
Modify the dual infeasibility tolerance.
Definition: primal_dual.hpp:93
size_t & MaxIterations()
Modify the maximum number of iterations to run before converging.
Definition: primal_dual.hpp:96
double & PrimalInfeasTol()
Modify the primal infeasibility tolerance.
Definition: primal_dual.hpp:90