Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
Binding< C > Class Template Reference

Detailed Description

template<typename C>
class drake::multibody::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.
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.
size_t GetNumElements () const
 Returns the number of variables associated with this evaluator.
std::string to_string () const
 Returns string representation of Binding.
std::string ToLatex (int precision=3) const
 Returns a LaTeX description of this Binding.
bool operator== (const Binding< C > &other) const
 Compare two bindings based on their evaluator pointers and the bound variables.
bool operator!= (const Binding< C > &other) const
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Binding (const Binding &)=default
 Binding (Binding &&)=default
Bindingoperator= (const 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.

Constructor & Destructor Documentation

◆ Binding() [1/5]

template<typename C>
Binding ( const Binding< C > & )
default

◆ Binding() [2/5]

template<typename C>
Binding ( Binding< C > && )
default

◆ Binding() [3/5]

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

◆ Binding() [4/5]

template<typename C>
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]

template<typename C>
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 )

Member Function Documentation

◆ ContainsVariable()

template<typename C>
bool ContainsVariable ( const symbolic::Variable & var) const
nodiscard

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

◆ evaluator()

template<typename C>
const std::shared_ptr< C > & evaluator ( ) const
nodiscard

◆ GetNumElements()

template<typename C>
size_t GetNumElements ( ) const
nodiscard

Returns the number of variables associated with this evaluator.

◆ operator!=()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==()

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

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

◆ to_string()

template<typename C>
std::string to_string ( ) const
nodiscard

Returns string representation of Binding.

◆ ToLatex()

template<typename C>
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()

template<typename C>
const VectorXDecisionVariable & variables ( ) const
nodiscard

◆ hash_append

template<typename C>
template<class HashAlgorithm>
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: