Drake
Drake C++ Documentation
Binding< C > Class Template Reference

Detailed Description

template<typename C>
class drake::solvers::Binding< C >

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 VectorXDecisionVariablevariables () 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
 
Bindingoperator= (const Binding &)=default
 
 Binding (Binding &&)=default
 
Bindingoperator= (Binding &&)=default
 

Friends

template<class HashAlgorithm >
void hash_append (HashAlgorithm &hasher, const Binding< C > &item) noexcept
 Implements the hash_append generic hashing concept. More...
 

Constructor & Destructor Documentation

◆ Binding() [1/5]

Binding ( const Binding< C > &  )
default

◆ Binding() [2/5]

Binding ( Binding< C > &&  )
default

◆ Binding() [3/5]

Binding ( const std::shared_ptr< C > &  c,
const Eigen::Ref< const VectorXDecisionVariable > &  v 
)

◆ Binding() [4/5]

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() [5/5]

Binding ( const Binding< U > &  b,
typename std::enable_if_t< std::is_convertible_v< std::shared_ptr< U >, std::shared_ptr< C >>> *  = nullptr 
)

Member Function Documentation

◆ ContainsVariable()

bool ContainsVariable ( const symbolic::Variable var) const

Returns true iff the given var is included in this Binding.

◆ evaluator()

const std::shared_ptr<C>& evaluator ( ) const

◆ GetNumElements()

size_t GetNumElements ( ) const

Returns the number of variables associated with this evaluator.

◆ operator!=()

bool operator!= ( const Binding< C > &  other) const

◆ operator=() [1/2]

Binding& operator= ( Binding< C > &&  )
default

◆ operator=() [2/2]

Binding& operator= ( const Binding< C > &  )
default

◆ operator==()

bool operator== ( const Binding< C > &  other) const

Compare two bindings based on their evaluator pointers and the bound variables.

◆ to_string()

std::string to_string ( ) const

Returns string representation of Binding.

◆ ToLatex()

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() + "$$".

◆ variables()

const VectorXDecisionVariable& variables ( ) const

Friends And Related Function Documentation

◆ hash_append

void hash_append ( HashAlgorithm &  hasher,
const Binding< C > &  item 
)
friend

Implements the hash_append generic hashing concept.


The documentation for this class was generated from the following file: