11 #ifndef MLPACK_CORE_OPTIMIZERS_SDP_SDP_HPP 12 #define MLPACK_CORE_OPTIMIZERS_SDP_SDP_HPP 18 namespace optimization {
38 template <
typename ObjectiveMatrixType>
67 const size_t numSparseConstraints,
68 const size_t numDenseConstraints);
71 size_t N()
const {
return c.n_rows; }
73 size_t N2bar()
const {
return N() * (
N() + 1) / 2; }
86 ObjectiveMatrixType&
C() {
return c; }
88 const ObjectiveMatrixType&
C()
const {
return c; }
125 ObjectiveMatrixType
c;
142 #include "sdp_impl.hpp" const std::vector< arma::mat > & DenseA() const
Return the vector of dense A matrices (which correspond to the dense constraints).
ObjectiveMatrixType & C()
Modify the sparse objective function matrix (sparseC).
Linear algebra utility functions, generally performed on matrices or vectors.
const arma::vec & DenseB() const
Return the vector of dense B values.
The core includes that mlpack expects; standard C++ includes and Armadillo.
const arma::vec & SparseB() const
Return the vector of sparse B values.
std::vector< arma::sp_mat > sparseA
A_i for each sparse constraint.
arma::vec denseB
b_i for each dense constraint.
size_t N() const
Return number of rows and columns in the objective matrix C.
bool HasLinearlyIndependentConstraints() const
Check whether or not the constraint matrices are linearly independent.
size_t NumDenseConstraints() const
Return the number of dense constraints (constraints with dense Ai) in the SDP.
SDP()
Initialize this SDP to an empty state.
arma::vec sparseB
b_i for each sparse constraint.
size_t NumSparseConstraints() const
Return the number of sparse constraints (constraints with sparse Ai) in the SDP.
size_t NumConstraints() const
Return the total number of constraints in the SDP.
ObjectiveMatrixType c
Objective function matrix c.
std::vector< arma::mat > & DenseA()
Modify the veector of dense A matrices (which correspond to the dense constraints).
std::vector< arma::sp_mat > & SparseA()
Modify the veector of sparse A matrices (which correspond to the sparse constraints).
std::vector< arma::mat > denseA
A_i for each dense constraint.
const std::vector< arma::sp_mat > & SparseA() const
Return the vector of sparse A matrices (which correspond to the sparse constraints).
Specify an SDP in primal form.
ObjectiveMatrixType objective_matrix_type
arma::vec & DenseB()
Modify the vector of dense B values.
arma::vec & SparseB()
Modify the vector of sparse B values.
const ObjectiveMatrixType & C() const
Return the sparse objective function matrix (sparseC).