Epigraph
Convex Optimization in C++
Classes | Functions
constraint.hpp File Reference
#include "expressions.hpp"
#include <variant>

Go to the source code of this file.

Classes

class  cvx::Constraint
 

Functions

Constraint cvx::equalTo (const Scalar &lhs, const Scalar &rhs)
 Create an equality constraint: lhs == rhs. More...
 
Constraint cvx::greaterThan (const Scalar &lhs, const Scalar &rhs)
 Create a greater than or equal constraint: lhs >= rhs. More...
 
Constraint cvx::lessThan (const Scalar &lhs, const Scalar &rhs)
 Create a less than or equal constraint: lhs <= rhs. More...
 
Constraint cvx::box (const Scalar &lower, const Scalar &middle, const Scalar &upper)
 Create a box constraint: lower <= middle <= upper. More...
 
template<typename Derived >
std::vector< Constraint > cvx::equalTo (const Eigen::MatrixBase< Derived > &lhs, const Scalar &rhs)
 
template<typename Derived >
std::vector< Constraint > cvx::equalTo (const Scalar &lhs, const Eigen::MatrixBase< Derived > &rhs)
 Create an equality constraint: lhs == rhs. More...
 
template<typename DerivedLhs , typename DerivedRhs >
std::vector< Constraint > cvx::equalTo (const Eigen::MatrixBase< DerivedLhs > &lhs, const Eigen::MatrixBase< DerivedRhs > &rhs)
 Create an equality constraint: lhs == rhs. More...
 
template<typename Derived >
std::vector< Constraint > cvx::lessThan (const Eigen::MatrixBase< Derived > &lhs, const Scalar &rhs)
 Create a less than or equal constraint: lhs <= rhs. More...
 
template<typename Derived >
std::vector< Constraint > cvx::lessThan (const Scalar &lhs, const Eigen::MatrixBase< Derived > &rhs)
 Create a less than or equal constraint: lhs <= rhs. More...
 
template<typename DerivedLhs , typename DerivedRhs >
std::vector< Constraint > cvx::lessThan (const Eigen::MatrixBase< DerivedLhs > &lhs, const Eigen::MatrixBase< DerivedRhs > &rhs)
 Create a less than or equal constraint: lhs <= rhs. More...
 
template<typename DerivedLhs , typename DerivedRhs >
std::vector< Constraint > cvx::greaterThan (const Eigen::MatrixBase< DerivedLhs > &lhs, const Eigen::MatrixBase< DerivedRhs > &rhs)
 Create a greater than or equal constraint: lhs >= rhs. More...
 
template<typename Derived >
std::vector< Constraint > cvx::greaterThan (const Scalar &lhs, const Eigen::MatrixBase< Derived > &rhs)
 Create a greater than or equal constraint: lhs >= rhs. More...
 
template<typename Derived >
std::vector< Constraint > cvx::greaterThan (const Eigen::MatrixBase< Derived > &lhs, const Scalar &rhs)
 Create a greater than or equal constraint: lhs >= rhs. More...
 
template<typename DerivedLower , typename DerivedMiddle , typename DerivedUpper >
std::vector< Constraint > cvx::box (const Eigen::MatrixBase< DerivedLower > &lower, const Eigen::MatrixBase< DerivedMiddle > &middle, const Eigen::MatrixBase< DerivedUpper > &upper)
 Create a box constraint: lower <= middle <= upper. More...
 
template<typename Derived >
std::vector< Constraint > cvx::box (const Scalar &lower, const Eigen::MatrixBase< Derived > &middle, const Scalar &upper)
 Create a box constraint: lower <= middle <= upper. More...
 

Function Documentation

◆ box() [1/3]

template<typename DerivedLower , typename DerivedMiddle , typename DerivedUpper >
std::vector<Constraint> cvx::box ( const Eigen::MatrixBase< DerivedLower > &  lower,
const Eigen::MatrixBase< DerivedMiddle > &  middle,
const Eigen::MatrixBase< DerivedUpper > &  upper 
)

Create a box constraint: lower <= middle <= upper.

Template Parameters
DerivedLowerHas to be cvx::Scalar
DerivedMiddleHas to be cvx::Scalar
DerivedUpperHas to be cvx::Scalar
Parameters
lowerThe lower bound
middleThe middle term
upperThe upper bound
Returns
std::vector<Constraint>

◆ box() [2/3]

template<typename Derived >
std::vector<Constraint> cvx::box ( const Scalar lower,
const Eigen::MatrixBase< Derived > &  middle,
const Scalar upper 
)

Create a box constraint: lower <= middle <= upper.

Template Parameters
DerivedHas to be cvx::Scalar
Parameters
lowerThe lower bound
middleThe middle term
upperThe upper bound
Returns
std::vector<Constraint> The constraints to pass to addConstraint()

◆ box() [3/3]

Constraint cvx::box ( const Scalar lower,
const Scalar middle,
const Scalar upper 
)

Create a box constraint: lower <= middle <= upper.

Parameters
lowerThe lower bound
middleThe middle term
upperThe upper bound
Returns
Constraint The constraint to pass to addConstraint()

◆ equalTo() [1/3]

template<typename DerivedLhs , typename DerivedRhs >
std::vector<Constraint> cvx::equalTo ( const Eigen::MatrixBase< DerivedLhs > &  lhs,
const Eigen::MatrixBase< DerivedRhs > &  rhs 
)

Create an equality constraint: lhs == rhs.

Template Parameters
DerivedLhsHas to be cvx::Scalar
DerivedRhsHas to be cvx::Scalar
Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ equalTo() [2/3]

template<typename Derived >
std::vector<Constraint> cvx::equalTo ( const Scalar lhs,
const Eigen::MatrixBase< Derived > &  rhs 
)

Create an equality constraint: lhs == rhs.

Template Parameters
DerivedHas to be cvx::Scalar
Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ equalTo() [3/3]

Constraint cvx::equalTo ( const Scalar lhs,
const Scalar rhs 
)

Create an equality constraint: lhs == rhs.

Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ greaterThan() [1/4]

template<typename Derived >
std::vector<Constraint> cvx::greaterThan ( const Eigen::MatrixBase< Derived > &  lhs,
const Scalar rhs 
)

Create a greater than or equal constraint: lhs >= rhs.

Template Parameters
DerivedHas to be cvx::Scalar
Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ greaterThan() [2/4]

template<typename DerivedLhs , typename DerivedRhs >
std::vector<Constraint> cvx::greaterThan ( const Eigen::MatrixBase< DerivedLhs > &  lhs,
const Eigen::MatrixBase< DerivedRhs > &  rhs 
)

Create a greater than or equal constraint: lhs >= rhs.

Template Parameters
DerivedLhsHas to be cvx::Scalar
DerivedRhsHas to be cvx::Scalar
Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ greaterThan() [3/4]

template<typename Derived >
std::vector<Constraint> cvx::greaterThan ( const Scalar lhs,
const Eigen::MatrixBase< Derived > &  rhs 
)

Create a greater than or equal constraint: lhs >= rhs.

Template Parameters
DerivedHas to be cvx::Scalar
Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ greaterThan() [4/4]

Constraint cvx::greaterThan ( const Scalar lhs,
const Scalar rhs 
)

Create a greater than or equal constraint: lhs >= rhs.

Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ lessThan() [1/4]

template<typename Derived >
std::vector<Constraint> cvx::lessThan ( const Eigen::MatrixBase< Derived > &  lhs,
const Scalar rhs 
)

Create a less than or equal constraint: lhs <= rhs.

Template Parameters
DerivedHas to be cvx::Scalar
Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ lessThan() [2/4]

template<typename DerivedLhs , typename DerivedRhs >
std::vector<Constraint> cvx::lessThan ( const Eigen::MatrixBase< DerivedLhs > &  lhs,
const Eigen::MatrixBase< DerivedRhs > &  rhs 
)

Create a less than or equal constraint: lhs <= rhs.

Template Parameters
DerivedLhsHas to be cvx::Scalar
DerivedRhsHas to be cvx::Scalar
Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ lessThan() [3/4]

template<typename Derived >
std::vector<Constraint> cvx::lessThan ( const Scalar lhs,
const Eigen::MatrixBase< Derived > &  rhs 
)

Create a less than or equal constraint: lhs <= rhs.

Template Parameters
DerivedHas to be cvx::Scalar
Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()

◆ lessThan() [4/4]

Constraint cvx::lessThan ( const Scalar lhs,
const Scalar rhs 
)

Create a less than or equal constraint: lhs <= rhs.

Parameters
lhsThe left hand side
rhsThe right hand side
Returns
Constraint The constraint to pass to addConstraint()