Drake
drake::solvers::internal Namespace Reference

Classes

class  SymbolicError
 

Functions

template<typename C , typename... Args>
Binding< C > CreateBinding (const std::shared_ptr< C > &c, Args &&...args)
 
Binding< LinearConstraintParseLinearConstraint (const Eigen::Ref< const VectorX< Expression >> &v, const Eigen::Ref< const Eigen::VectorXd > &lb, const Eigen::Ref< const Eigen::VectorXd > &ub)
 
Binding< LinearConstraintParseLinearConstraint (const set< Formula > &formulas)
 
Binding< LinearConstraintParseLinearConstraint (const Formula &f)
 
Binding< LinearEqualityConstraintParseLinearEqualityConstraint (const set< Formula > &formulas)
 
Binding< LinearEqualityConstraintParseLinearEqualityConstraint (const Formula &f)
 
Binding< LinearEqualityConstraintDoParseLinearEqualityConstraint (const Eigen::Ref< const VectorX< Expression >> &v, const Eigen::Ref< const Eigen::VectorXd > &b)
 
shared_ptr< ConstraintMakePolynomialConstraint (const VectorXPoly &polynomials, const vector< Polynomiald::VarType > &poly_vars, const Eigen::VectorXd &lb, const Eigen::VectorXd &ub)
 
Binding< LorentzConeConstraintParseLorentzConeConstraint (const Eigen::Ref< const VectorX< Expression >> &v)
 
Binding< LorentzConeConstraintParseLorentzConeConstraint (const Expression &linear_expr, const Expression &quadratic_expr, double tol)
 
Binding< RotatedLorentzConeConstraintParseRotatedLorentzConeConstraint (const Eigen::Ref< const VectorX< symbolic::Expression >> &v)
 
Binding< RotatedLorentzConeConstraintParseRotatedLorentzConeConstraint (const symbolic::Expression &linear_expr1, const symbolic::Expression &linear_expr2, const symbolic::Expression &quadratic_expr, double tol)
 
Binding< LinearConstraintParseLinearConstraint (const Eigen::Ref< const VectorX< symbolic::Expression >> &v, const Eigen::Ref< const Eigen::VectorXd > &lb, const Eigen::Ref< const Eigen::VectorXd > &ub)
 
Binding< LinearConstraintParseLinearConstraint (const symbolic::Expression &e, const double lb, const double ub)
 
Binding< LinearConstraintParseLinearConstraint (const symbolic::Formula &f)
 
Binding< LinearConstraintParseLinearConstraint (const std::set< symbolic::Formula > &formulas)
 
template<typename Derived >
std::enable_if< is_eigen_scalar_same< Derived, symbolic::Formula >::value, Binding< LinearConstraint > >::type ParseLinearConstraint (const Eigen::ArrayBase< Derived > &formulas)
 
Binding< LinearEqualityConstraintDoParseLinearEqualityConstraint (const Eigen::Ref< const VectorX< symbolic::Expression >> &v, const Eigen::Ref< const Eigen::VectorXd > &b)
 
Binding< LinearEqualityConstraintParseLinearEqualityConstraint (const symbolic::Expression &e, double b)
 
Binding< LinearEqualityConstraintParseLinearEqualityConstraint (const std::set< symbolic::Formula > &formulas)
 
Binding< LinearEqualityConstraintParseLinearEqualityConstraint (const symbolic::Formula &f)
 
template<typename DerivedV , typename DerivedB >
std::enable_if< is_eigen_vector_expression_double_pair< DerivedV, DerivedB >::value, Binding< LinearEqualityConstraint > >::type ParseLinearEqualityConstraint (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedB > &b)
 
template<typename DerivedV , typename DerivedB >
std::enable_if< is_eigen_nonvector_expression_double_pair< DerivedV, DerivedB >::value, Binding< LinearEqualityConstraint > >::type ParseLinearEqualityConstraint (const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedB > &B, bool lower_triangle=false)
 
Binding< LorentzConeConstraintParseLorentzConeConstraint (const Eigen::Ref< const VectorX< symbolic::Expression >> &v)
 
Binding< LorentzConeConstraintParseLorentzConeConstraint (const symbolic::Expression &linear_expr, const symbolic::Expression &quadratic_expr, double tol=0)
 
template<typename Derived >
std::enable_if< is_eigen_vector_of< Derived, symbolic::Formula >::value, Binding< Constraint > >::type ParseConstraint (const Eigen::MatrixBase< Derived > &e)
 
Binding< LinearCostParseLinearCost (const Expression &e)
 
Binding< QuadraticCostParseQuadraticCost (const Expression &e)
 
Binding< PolynomialCostParsePolynomialCost (const symbolic::Expression &e)
 
Binding< CostParseCost (const symbolic::Expression &e)
 
Binding< LinearCostParseLinearCost (const symbolic::Expression &e)
 
Binding< QuadraticCostParseQuadraticCost (const symbolic::Expression &e)
 
template<int Size>
NewVariableNames< Size >::type::type CreateNewVariableNames (int)
 
template<int Size>
std::enable_if< Size==Eigen::Dynamic, typename NewVariableNames< Size >::type >::type CreateNewVariableNames (int size)
 Return un-initialized new variable names. More...
 
template<typename Derived >
void SetVariableNames (const std::string &name, int rows, int cols, Derived *names)
 Set the names of the newly added variables. More...
 
std::vector< Eigen::Vector3d > ComputeBoxEdgesAndSphereIntersection (const Eigen::Vector3d &bmin, const Eigen::Vector3d &bmax)
 
void ComputeTriangleOutwardNormal (const Eigen::Vector3d &pt0, const Eigen::Vector3d &pt1, const Eigen::Vector3d &pt2, Eigen::Vector3d *n, double *d)
 Compute the outward unit length normal of the triangle, with the three vertices being pt0, pt1 and pt2. More...
 
bool AreAllVerticesCoPlanar (const std::vector< Eigen::Vector3d > &pts, Eigen::Vector3d *n, double *d)
 For the vertices in pts, determine if these vertices are co-planar. More...
 
void ComputeHalfSpaceRelaxationForBoxSphereIntersection (const std::vector< Eigen::Vector3d > &pts, Eigen::Vector3d *n, double *d)
 
void ComputeInnerFacetsForBoxSphereIntersection (const std::vector< Eigen::Vector3d > &pts, Eigen::Matrix< double, Eigen::Dynamic, 3 > *A, Eigen::VectorXd *b)
 For the intersection region between the surface of the unit sphere, and the interior of a box aligned with the axes, relax this nonconvex intersection region to its convex hull. More...
 
void ExtractAndAppendVariablesFromExpression (const Expression &e, VectorXDecisionVariable *vars, unordered_map< Variable::Id, int > *map_var_to_index)
 
void DecomposeLinearExpression (const Eigen::Ref< const VectorX< Expression >> &v, Eigen::MatrixXd *A, Eigen::VectorXd *b, VectorXDecisionVariable *vars)
 
pair< VectorXDecisionVariable, unordered_map< Variable::Id, int > > ExtractVariablesFromExpression (const Expression &e)
 
void DecomposeQuadraticPolynomial (const symbolic::Polynomial &poly, const unordered_map< Variable::Id, int > &map_var_to_index, Eigen::MatrixXd *Q, Eigen::VectorXd *b, double *c)
 
template<typename Derived , typename = typename std::enable_if<Derived::ColsAtCompileTime == 1>::type>
void AppendToVector (const typename Derived::Scalar &s, Eigen::MatrixBase< Derived > *px)
 
void ExtractAndAppendVariablesFromExpression (const symbolic::Expression &e, VectorXDecisionVariable *vars, std::unordered_map< symbolic::Variable::Id, int > *map_var_to_index)
 
std::pair< VectorXDecisionVariable, std::unordered_map< symbolic::Variable::Id, int > > ExtractVariablesFromExpression (const symbolic::Expression &e)
 
void DecomposeQuadraticPolynomial (const symbolic::Polynomial &poly, const std::unordered_map< symbolic::Variable::Id, int > &map_var_to_index, Eigen::MatrixXd *Q, Eigen::VectorXd *b, double *c)
 
void DecomposeLinearExpression (const Eigen::Ref< const VectorX< symbolic::Expression >> &v, Eigen::MatrixXd *A, Eigen::VectorXd *b, VectorXDecisionVariable *vars)
 
template<typename Derived >
std::enable_if< std::is_same< typename Derived::Scalar, double >::value, int >::type DecomposeLinearExpression (const symbolic::Expression &e, const std::unordered_map< symbolic::Variable::Id, int > &map_var_to_index, const Eigen::MatrixBase< Derived > &coeffs, double *constant_term)
 

Function Documentation

void drake::solvers::internal::AppendToVector ( const typename Derived::Scalar &  s,
Eigen::MatrixBase< Derived > *  px 
)

Here is the caller graph for this function:

bool AreAllVerticesCoPlanar ( const std::vector< Eigen::Vector3d > &  pts,
Eigen::Vector3d *  n,
double d 
)

For the vertices in pts, determine if these vertices are co-planar.

If they are, then compute that plane nᵀ * x = d.

Parameters
ptsThe vertices to be checked.
nThe unit length normal vector of the plane, points outward from the origin. If the vertices are not co-planar, leave n to 0.
dThe intersecpt of the plane. If the vertices are not co-planar, set this to 0.
Returns
If the vertices are co-planar, set this to true. Otherwise set to false.

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< Eigen::Vector3d > ComputeBoxEdgesAndSphereIntersection ( const Eigen::Vector3d &  bmin,
const Eigen::Vector3d &  bmax 
)

Here is the caller graph for this function:

void ComputeHalfSpaceRelaxationForBoxSphereIntersection ( const std::vector< Eigen::Vector3d > &  pts,
Eigen::Vector3d *  n,
double d 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void ComputeInnerFacetsForBoxSphereIntersection ( const std::vector< Eigen::Vector3d > &  pts,
Eigen::Matrix< double, Eigen::Dynamic, 3 > *  A,
Eigen::VectorXd *  b 
)

For the intersection region between the surface of the unit sphere, and the interior of a box aligned with the axes, relax this nonconvex intersection region to its convex hull.

This convex hull has some planar facets (formed by the triangles connecting the vertices of the intersection region). This function computes these planar facets. It is guaranteed that any point x on the intersection region, satisfies A * x <= b.

Parameters
[in]ptsThe vertices of the intersection region. Same as the pts in ComputeHalfSpaceRelaxationForBoxSphereIntersection()
[out]AThe rows of A are the normal vector of facets. Each row of A is a unit length vector.
bb(i) is the interscept of the i'th facet.
Precondition
pts[i] are all in the first orthant, namely (pts[i].array() >=0).all() should be true.

Here is the call graph for this function:

void drake::solvers::internal::ComputeTriangleOutwardNormal ( const Eigen::Vector3d &  pt0,
const Eigen::Vector3d &  pt1,
const Eigen::Vector3d &  pt2,
Eigen::Vector3d *  n,
double d 
)

Compute the outward unit length normal of the triangle, with the three vertices being pt0, pt1 and pt2.

Parameters
pt0A vertex of the triangle, in the first orthant (+++).
pt1A vertex of the triangle, in the first orthant (+++).
pt2A vertex of the triangle, in the first orthant (+++).
nThe unit length normal vector of the triangle, pointing outward from the origin.
dThe intersecpt of the plane. Namely nᵀ * x = d for any point x on the triangle.

Here is the call graph for this function:

Here is the caller graph for this function:

Binding<C> drake::solvers::internal::CreateBinding ( const std::shared_ptr< C > &  c,
Args &&...  args 
)

Here is the caller graph for this function:

NewVariableNames<Size>::type ::type drake::solvers::internal::CreateNewVariableNames ( int  )
std::enable_if<Size == Eigen::Dynamic, typename NewVariableNames<Size>::type>::type drake::solvers::internal::CreateNewVariableNames ( int  size)

Return un-initialized new variable names.

void drake::solvers::internal::DecomposeLinearExpression ( const Eigen::Ref< const VectorX< Expression >> &  v,
Eigen::MatrixXd *  A,
Eigen::VectorXd *  b,
VectorXDecisionVariable vars 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void drake::solvers::internal::DecomposeLinearExpression ( const Eigen::Ref< const VectorX< symbolic::Expression >> &  v,
Eigen::MatrixXd *  A,
Eigen::VectorXd *  b,
VectorXDecisionVariable vars 
)
std::enable_if<std::is_same<typename Derived::Scalar, double>::value, int>::type drake::solvers::internal::DecomposeLinearExpression ( const symbolic::Expression e,
const std::unordered_map< symbolic::Variable::Id, int > &  map_var_to_index,
const Eigen::MatrixBase< Derived > &  coeffs,
double constant_term 
)

Here is the call graph for this function:

void drake::solvers::internal::DecomposeQuadraticPolynomial ( const symbolic::Polynomial poly,
const std::unordered_map< symbolic::Variable::Id, int > &  map_var_to_index,
Eigen::MatrixXd *  Q,
Eigen::VectorXd *  b,
double c 
)
void drake::solvers::internal::DecomposeQuadraticPolynomial ( const symbolic::Polynomial poly,
const unordered_map< Variable::Id, int > &  map_var_to_index,
Eigen::MatrixXd *  Q,
Eigen::VectorXd *  b,
double c 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding<LinearEqualityConstraint> drake::solvers::internal::DoParseLinearEqualityConstraint ( const Eigen::Ref< const VectorX< symbolic::Expression >> &  v,
const Eigen::Ref< const Eigen::VectorXd > &  b 
)
Binding<LinearEqualityConstraint> drake::solvers::internal::DoParseLinearEqualityConstraint ( const Eigen::Ref< const VectorX< Expression >> &  v,
const Eigen::Ref< const Eigen::VectorXd > &  b 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void drake::solvers::internal::ExtractAndAppendVariablesFromExpression ( const Expression &  e,
VectorXDecisionVariable vars,
unordered_map< Variable::Id, int > *  map_var_to_index 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void drake::solvers::internal::ExtractAndAppendVariablesFromExpression ( const symbolic::Expression e,
VectorXDecisionVariable vars,
std::unordered_map< symbolic::Variable::Id, int > *  map_var_to_index 
)
std::pair<VectorXDecisionVariable, std::unordered_map<symbolic::Variable::Id, int> > drake::solvers::internal::ExtractVariablesFromExpression ( const symbolic::Expression e)
pair<VectorXDecisionVariable, unordered_map<Variable::Id, int> > drake::solvers::internal::ExtractVariablesFromExpression ( const Expression &  e)

Here is the call graph for this function:

Here is the caller graph for this function:

std::shared_ptr< Constraint > MakePolynomialConstraint ( const VectorXPoly polynomials,
const vector< Polynomiald::VarType > &  poly_vars,
const Eigen::VectorXd &  lb,
const Eigen::VectorXd &  ub 
)

Here is the caller graph for this function:

std::enable_if<is_eigen_vector_of<Derived, symbolic::Formula>::value, Binding<Constraint> >::type drake::solvers::internal::ParseConstraint ( const Eigen::MatrixBase< Derived > &  e)
Binding< Cost > ParseCost ( const symbolic::Expression e)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding<LinearConstraint> drake::solvers::internal::ParseLinearConstraint ( const Eigen::Ref< const VectorX< symbolic::Expression >> &  v,
const Eigen::Ref< const Eigen::VectorXd > &  lb,
const Eigen::Ref< const Eigen::VectorXd > &  ub 
)
Binding<LinearConstraint> drake::solvers::internal::ParseLinearConstraint ( const symbolic::Expression e,
const double  lb,
const double  ub 
)
inline

Here is the call graph for this function:

Binding<LinearConstraint> drake::solvers::internal::ParseLinearConstraint ( const Eigen::Ref< const VectorX< Expression >> &  v,
const Eigen::Ref< const Eigen::VectorXd > &  lb,
const Eigen::Ref< const Eigen::VectorXd > &  ub 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding<LinearConstraint> drake::solvers::internal::ParseLinearConstraint ( const symbolic::Formula f)
Binding<LinearConstraint> drake::solvers::internal::ParseLinearConstraint ( const std::set< symbolic::Formula > &  formulas)
std::enable_if<is_eigen_scalar_same<Derived, symbolic::Formula>::value, Binding<LinearConstraint> >::type drake::solvers::internal::ParseLinearConstraint ( const Eigen::ArrayBase< Derived > &  formulas)

Here is the call graph for this function:

Binding<LinearConstraint> drake::solvers::internal::ParseLinearConstraint ( const set< Formula > &  formulas)

Here is the call graph for this function:

Binding<LinearConstraint> drake::solvers::internal::ParseLinearConstraint ( const Formula &  f)

Here is the call graph for this function:

Binding<LinearCost> drake::solvers::internal::ParseLinearCost ( const symbolic::Expression e)
Binding<LinearCost> drake::solvers::internal::ParseLinearCost ( const Expression &  e)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding<LinearEqualityConstraint> drake::solvers::internal::ParseLinearEqualityConstraint ( const symbolic::Expression e,
double  b 
)
inline

Here is the call graph for this function:

Binding<LinearEqualityConstraint> drake::solvers::internal::ParseLinearEqualityConstraint ( const std::set< symbolic::Formula > &  formulas)
Binding<LinearEqualityConstraint> drake::solvers::internal::ParseLinearEqualityConstraint ( const symbolic::Formula f)
std::enable_if< is_eigen_vector_expression_double_pair<DerivedV, DerivedB>::value, Binding<LinearEqualityConstraint> >::type drake::solvers::internal::ParseLinearEqualityConstraint ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedB > &  b 
)

Here is the call graph for this function:

std::enable_if< is_eigen_nonvector_expression_double_pair<DerivedV, DerivedB>::value, Binding<LinearEqualityConstraint> >::type drake::solvers::internal::ParseLinearEqualityConstraint ( const Eigen::MatrixBase< DerivedV > &  V,
const Eigen::MatrixBase< DerivedB > &  B,
bool  lower_triangle = false 
)

Here is the call graph for this function:

Binding<LinearEqualityConstraint> drake::solvers::internal::ParseLinearEqualityConstraint ( const set< Formula > &  formulas)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding<LinearEqualityConstraint> drake::solvers::internal::ParseLinearEqualityConstraint ( const Formula &  f)

Here is the call graph for this function:

Binding<LorentzConeConstraint> drake::solvers::internal::ParseLorentzConeConstraint ( const Eigen::Ref< const VectorX< symbolic::Expression >> &  v)
Binding<LorentzConeConstraint> drake::solvers::internal::ParseLorentzConeConstraint ( const symbolic::Expression linear_expr,
const symbolic::Expression quadratic_expr,
double  tol = 0 
)
Binding<LorentzConeConstraint> drake::solvers::internal::ParseLorentzConeConstraint ( const Eigen::Ref< const VectorX< Expression >> &  v)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding<LorentzConeConstraint> drake::solvers::internal::ParseLorentzConeConstraint ( const Expression &  linear_expr,
const Expression &  quadratic_expr,
double  tol 
)

Here is the call graph for this function:

Binding< PolynomialCost > ParsePolynomialCost ( const symbolic::Expression e)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding<QuadraticCost> drake::solvers::internal::ParseQuadraticCost ( const symbolic::Expression e)
Binding<QuadraticCost> drake::solvers::internal::ParseQuadraticCost ( const Expression &  e)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding< RotatedLorentzConeConstraint > ParseRotatedLorentzConeConstraint ( const Eigen::Ref< const VectorX< symbolic::Expression >> &  v)

Here is the call graph for this function:

Here is the caller graph for this function:

Binding< RotatedLorentzConeConstraint > ParseRotatedLorentzConeConstraint ( const symbolic::Expression linear_expr1,
const symbolic::Expression linear_expr2,
const symbolic::Expression quadratic_expr,
double  tol 
)

Here is the call graph for this function:

void drake::solvers::internal::SetVariableNames ( const std::string &  name,
int  rows,
int  cols,
Derived *  names 
)

Set the names of the newly added variables.

Parameters
nameThe common name of all new variables.
rowsThe number of rows in the new variables.
colsThe number of columns in the new variables.
Precondition
The size of names is rows * cols.

Here is the call graph for this function:

Here is the caller graph for this function: