Drake
Drake C++ Documentation
mixed_integer_optimization_util.h File Reference
#include <string>
#include <utility>
#include "drake/common/fmt.h"
#include "drake/solvers/mathematical_program.h"
Include dependency graph for mixed_integer_optimization_util.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  LogarithmicSos2NewBinaryVariables< NumLambda >
 The size of the new binary variables in the compile time, for Special Ordered Set of type 2 (SOS2) constraint. More...
 

Namespaces

 drake
 
 drake::solvers
 

Enumerations

enum  IntervalBinning { kLogarithmic, kLinear }
 For a continuous variable whose range is cut into small intervals, we will use binary variables to represent which interval the continuous variable is in. More...
 

Functions

constexpr int CeilLog2 (int n)
 Return ⌈log₂(n)⌉, namely the minimal integer no smaller than log₂(n), with base 2. More...
 
template<typename Derived >
std::enable_if_t< drake::is_eigen_vector_of< Derived, symbolic::Expression >::value, typename LogarithmicSos2NewBinaryVariables< Derived::RowsAtCompileTime >::type > AddLogarithmicSos2Constraint (MathematicalProgram *prog, const Eigen::MatrixBase< Derived > &lambda, const std::string &binary_variable_name="y")
 Adds the special ordered set 2 (SOS2) constraint,. More...
 
void AddLogarithmicSos2Constraint (MathematicalProgram *prog, const Eigen::Ref< const VectorX< symbolic::Expression >> &lambda, const Eigen::Ref< const VectorX< symbolic::Expression >> &y)
 Adds the special ordered set 2 (SOS2) constraint,. More...
 
void AddSos2Constraint (MathematicalProgram *prog, const Eigen::Ref< const VectorX< symbolic::Expression >> &lambda, const Eigen::Ref< const VectorX< symbolic::Expression >> &y)
 Adds the special ordered set 2 (SOS2) constraint. More...
 
void AddLogarithmicSos1Constraint (MathematicalProgram *prog, const Eigen::Ref< const VectorX< symbolic::Expression >> &lambda, const Eigen::Ref< const VectorXDecisionVariable > &y, const Eigen::Ref< const Eigen::MatrixXi > &binary_encoding)
 Adds the special ordered set of type 1 (SOS1) constraint. More...
 
std::pair< VectorX< symbolic::Variable >, VectorX< symbolic::Variable > > AddLogarithmicSos1Constraint (MathematicalProgram *prog, int num_lambda)
 Adds the special ordered set of type 1 (SOS1) constraint. More...
 
std::string to_string (IntervalBinning interval_binning)
 
std::ostream & operator<< (std::ostream &os, const IntervalBinning &binning)
 
template<typename DerivedPhiX , typename DerivedPhiY , typename DerivedBx , typename DerivedBy >
std::enable_if_t< is_eigen_vector_of< DerivedPhiX, double >::value &&is_eigen_vector_of< DerivedPhiY, double >::value &&is_eigen_vector_of< DerivedBx, symbolic::Expression >::value &&is_eigen_vector_of< DerivedBy, symbolic::Expression >::value, MatrixDecisionVariable< DerivedPhiX::RowsAtCompileTime, DerivedPhiY::RowsAtCompileTime > > AddBilinearProductMcCormickEnvelopeSos2 (MathematicalProgram *prog, const symbolic::Variable &x, const symbolic::Variable &y, const symbolic::Expression &w, const DerivedPhiX &phi_x, const DerivedPhiY &phi_y, const DerivedBx &Bx, const DerivedBy &By, IntervalBinning binning)
 Add constraints to the optimization program, such that the bilinear product x * y is approximated by w, using Special Ordered Set of Type 2 (sos2) constraint. More...
 
void AddBilinearProductMcCormickEnvelopeMultipleChoice (MathematicalProgram *prog, const symbolic::Variable &x, const symbolic::Variable &y, const symbolic::Expression &w, const Eigen::Ref< const Eigen::VectorXd > &phi_x, const Eigen::Ref< const Eigen::VectorXd > &phi_y, const Eigen::Ref< const VectorX< symbolic::Expression >> &Bx, const Eigen::Ref< const VectorX< symbolic::Expression >> &By)
 Add constraints to the optimization program, such that the bilinear product x * y is approximated by w, using Mixed Integer constraint with "Multiple Choice" model. More...