A binding on constraint type C is a mapping of the decision variables onto the inputs of C.
This allows the constraint to operate on a vector made up of different elements of the decision variables.
#include <drake/solvers/binding.h>
Public Member Functions | |
Binding (const std::shared_ptr< C > &c, const Eigen::Ref< const VectorXDecisionVariable > &v) | |
Binding (const std::shared_ptr< C > &c, const VariableRefList &v) | |
Concatenates each VectorDecisionVariable object in v into a single column vector, binds this column vector of decision variables with the constraint c . More... | |
template<typename U > | |
Binding (const Binding< U > &b, typename std::enable_if_t< std::is_convertible_v< std::shared_ptr< U >, std::shared_ptr< C >>> *=nullptr) | |
const std::shared_ptr< C > & | evaluator () const |
const VectorXDecisionVariable & | variables () const |
bool | ContainsVariable (const symbolic::Variable &var) const |
Returns true iff the given var is included in this Binding. More... | |
size_t | GetNumElements () const |
Returns the number of variables associated with this evaluator. More... | |
std::string | to_string () const |
Returns string representation of Binding. More... | |
std::string | ToLatex (int precision=3) const |
Returns a LaTeX description of this Binding. More... | |
bool | operator== (const Binding< C > &other) const |
Compare two bindings based on their evaluator pointers and the bound variables. More... | |
bool | operator!= (const Binding< C > &other) const |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
Binding (const Binding &)=default | |
Binding & | operator= (const Binding &)=default |
Binding (Binding &&)=default | |
Binding & | operator= (Binding &&)=default |
Friends | |
template<class HashAlgorithm > | |
void | hash_append (HashAlgorithm &hasher, const Binding< C > &item) noexcept |
Implements the hash_append generic hashing concept. More... | |
Binding | ( | const std::shared_ptr< C > & | c, |
const Eigen::Ref< const VectorXDecisionVariable > & | v | ||
) |
Binding | ( | const std::shared_ptr< C > & | c, |
const VariableRefList & | v | ||
) |
Concatenates each VectorDecisionVariable object in v
into a single column vector, binds this column vector of decision variables with the constraint c
.
Binding | ( | const Binding< U > & | b, |
typename std::enable_if_t< std::is_convertible_v< std::shared_ptr< U >, std::shared_ptr< C >>> * | = nullptr |
||
) |
bool ContainsVariable | ( | const symbolic::Variable & | var | ) | const |
Returns true iff the given var
is included in this Binding.
const std::shared_ptr<C>& evaluator | ( | ) | const |
size_t GetNumElements | ( | ) | const |
Returns the number of variables associated with this evaluator.
bool operator!= | ( | const Binding< C > & | other | ) | const |
bool operator== | ( | const Binding< C > & | other | ) | const |
Compare two bindings based on their evaluator pointers and the bound variables.
std::string to_string | ( | ) | const |
Returns string representation of Binding.
std::string ToLatex | ( | int | precision = 3 | ) | const |
Returns a LaTeX description of this Binding.
Does not include any characters to enter/exit math mode; you might want, e.g. "$$" + evaluator.ToLatex() + "$$".
const VectorXDecisionVariable& variables | ( | ) | const |
|
friend |
Implements the hash_append generic hashing concept.