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; }
92 const std::vector<arma::sp_mat>&
SparseA()
const {
return sparseA; }
96 std::vector<arma::sp_mat>&
SparseA() {
return sparseA; }
100 const std::vector<arma::mat>&
DenseA()
const {
return denseA; }
104 std::vector<arma::mat>&
DenseA() {
return denseA; }
107 const arma::vec&
SparseB()
const {
return sparseB; }
112 const arma::vec&
DenseB()
const {
return denseB; }
125 ObjectiveMatrixType c;
128 std::vector<arma::sp_mat> sparseA;
133 std::vector<arma::mat> denseA;
142 #include "sdp_impl.hpp"
const arma::vec & SparseB() const
Return the vector of sparse B values.
size_t NumDenseConstraints() const
Return the number of dense constraints (constraints with dense Ai) in the SDP.
std::vector< arma::mat > & DenseA()
Modify the veector of dense A matrices (which correspond to the dense constraints).
size_t NumSparseConstraints() const
Return the number of sparse constraints (constraints with sparse Ai) in the SDP.
The core includes that mlpack expects; standard C++ includes and Armadillo.
const std::vector< arma::sp_mat > & SparseA() const
Return the vector of sparse A matrices (which correspond to the sparse constraints).
bool HasLinearlyIndependentConstraints() const
Check whether or not the constraint matrices are linearly independent.
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).
size_t NumConstraints() const
Return the total number of constraints in the SDP.
ObjectiveMatrixType objective_matrix_type
size_t N() const
Return number of rows and columns in the objective matrix C.
const ObjectiveMatrixType & C() const
Return the sparse objective function matrix (sparseC).
SDP()
Initialize this SDP to an empty state.
Specify an SDP in primal form.
arma::vec & SparseB()
Modify the vector of sparse B values.
std::vector< arma::sp_mat > & SparseA()
Modify the veector of sparse A matrices (which correspond to the sparse constraints).
arma::vec & DenseB()
Modify the vector of dense B values.
const arma::vec & DenseB() const
Return the vector of dense B values.