23 #ifndef __MLPACK_CORE_OPTIMIZERS_LRSDP_LRSDP_HPP
24 #define __MLPACK_CORE_OPTIMIZERS_LRSDP_LRSDP_HPP
30 namespace optimization {
44 LRSDP(
const size_t numConstraints,
56 LRSDP(
const size_t numConstraints,
57 const arma::mat& initialPoint,
66 double Optimize(arma::mat& coordinates);
72 double Evaluate(
const arma::mat& coordinates)
const;
78 void Gradient(
const arma::mat& coordinates, arma::mat& gradient)
const;
84 const arma::mat& coordinates)
const;
91 const arma::mat& coordinates,
92 arma::mat& gradient)
const;
101 const arma::mat&
C()
const {
return c; }
103 arma::mat&
C() {
return c; }
106 const std::vector<arma::mat>&
A()
const {
return a; }
108 std::vector<arma::mat>&
A() {
return a; }
116 const arma::vec&
B()
const {
return b; }
118 arma::vec&
B() {
return b; }
131 std::vector<arma::mat>
a;
152 #include "lrsdp_impl.hpp"
arma::mat initialPoint
Initial point.
double EvaluateConstraint(const size_t index, const arma::mat &coordinates) const
Evaluate a particular constraint of the LRSDP at the given coordinates.
arma::vec & B()
Modify the vector of B values.
AugLagrangian< LRSDP > augLagInternal
Internal AugLagrangian object, if one was not passed at construction time.
const arma::mat & GetInitialPoint()
Get the initial point of the LRSDP.
arma::uvec aModes
1 if entries in matrix, 0 for normal.
arma::vec b
b_i for each constraint.
const std::vector< arma::mat > & A() const
Return the vector of A matrices (which correspond to the constraints).
arma::uvec & AModes()
Modify the vector of modes for the A matrices.
AugLagrangian< LRSDP > & AugLag()
Modify the augmented Lagrangian object.
std::vector< arma::mat > a
A_i for each constraint.
The AugLagrangian class implements the Augmented Lagrangian method of optimization.
const AugLagrangian< LRSDP > & AugLag() const
Return the augmented Lagrangian object.
size_t NumConstraints() const
Get the number of constraints in the LRSDP.
LRSDP(const size_t numConstraints, const arma::mat &initialPoint)
Create an LRSDP to be optimized.
const arma::uvec & AModes() const
Return the vector of modes for the A matrices.
std::vector< arma::mat > & A()
Modify the veector of A matrices (which correspond to the constraints).
const arma::mat & C() const
Return the objective function matrix (C).
arma::mat c
For objective function.
AugLagrangian< LRSDP > & augLag
The AugLagrangian object which will be used for optimization.
double Evaluate(const arma::mat &coordinates) const
Evaluate the objective function of the LRSDP (no constraints) at the given coordinates.
void GradientConstraint(const size_t index, const arma::mat &coordinates, arma::mat &gradient) const
Evaluate the gradient of a particular constraint of the LRSDP at the given coordinates.
const arma::vec & B() const
Return the vector of B values.
void Gradient(const arma::mat &coordinates, arma::mat &gradient) const
Evaluate the gradient of the LRSDP (no constraints) at the given coordinates.
double Optimize(arma::mat &coordinates)
Optimize the LRSDP and return the final objective value.
arma::mat & C()
Modify the objective function matrix (C).