dReal4
Variables Class Reference

Represents a set of variables. More...

#include </home/soonhokong/work/dreal4/third_party/com_github_robotlocomotion_drake/dreal/symbolic/symbolic_variables.h>

Public Types

typedef std::set< Variable >::size_type size_type
 
typedef std::set< Variable >::iterator iterator
 
typedef std::set< Variable >::const_iterator const_iterator
 
typedef std::set< Variable >::reverse_iterator reverse_iterator
 
typedef std::set< Variable >::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 Variables (const Variables &)=default
 
Variablesoperator= (const Variables &)=default
 
 Variables (Variables &&)=default
 
Variablesoperator= (Variables &&)=default
 
 Variables ()=default
 Default constructor. More...
 
 ~Variables ()=default
 Default destructor. More...
 
 Variables (std::initializer_list< Variable > init)
 List constructor. More...
 
size_t get_hash () const
 Returns hash value. More...
 
size_type size () const
 Returns the number of elements. More...
 
bool empty () const
 Checks if this set is empty or not. More...
 
std::string to_string () const
 Returns string representation of Variables. More...
 
iterator begin ()
 Returns an iterator to the beginning. More...
 
iterator end ()
 Returns an iterator to the end. More...
 
const_iterator begin () const
 Returns an iterator to the beginning. More...
 
const_iterator end () const
 Returns an iterator to the end. More...
 
const_iterator cbegin () const
 Returns a const iterator to the beginning. More...
 
const_iterator cend () const
 Returns a const iterator to the end. More...
 
reverse_iterator rbegin ()
 Returns a reverse iterator to the beginning. More...
 
reverse_iterator rend ()
 Returns a reverse iterator to the end. More...
 
const_reverse_iterator rbegin () const
 Returns a reverse iterator to the beginning. More...
 
const_reverse_iterator rend () const
 Returns a reverse iterator to the end. More...
 
const_reverse_iterator crbegin () const
 Returns a const reverse-iterator to the beginning. More...
 
const_reverse_iterator crend () const
 Returns a const reverse-iterator to the end. More...
 
void insert (const Variable &var)
 Inserts a variable var into a set. More...
 
template<class InputIt >
void insert (InputIt first, InputIt last)
 Inserts variables in [first, last) into a set. More...
 
void insert (const Variables &vars)
 Inserts variables in vars into a set. More...
 
size_type erase (const Variable &key)
 Erases key from a set. More...
 
size_type erase (const Variables &vars)
 Erases variables in vars from a set. More...
 
iterator find (const Variable &key)
 Finds element with specific key. More...
 
const_iterator find (const Variable &key) const
 
bool include (const Variable &key) const
 Return true if key is included in the Variables. More...
 
bool IsSubsetOf (const Variables &vars) const
 Return true if vars is a subset of the Variables. More...
 
bool IsSupersetOf (const Variables &vars) const
 Return true if vars is a superset of the Variables. More...
 
bool IsStrictSubsetOf (const Variables &vars) const
 Return true if vars is a strict subset of the Variables. More...
 
bool IsStrictSupersetOf (const Variables &vars) const
 Return true if vars is a strict superset of the Variables. More...
 

Friends

bool operator== (const Variables &vars1, const Variables &vars2)
 
bool operator< (const Variables &vars1, const Variables &vars2)
 
std::ostream & operator<< (std::ostream &, const Variables &vars)
 
Variables intersect (const Variables &vars1, const Variables &vars2)
 Returns the intersection of vars1 and vars2. More...
 

Detailed Description

Represents a set of variables.

This class is based on std::set<Variable>. The intent is to add things that we need including set-union (Variables::insert, operator+, operator+=), set-minus (Variables::erase, operator-, operator-=), and subset/superset checking functions (Variables::IsSubsetOf, Variables::IsSupersetOf, Variables::IsStrictSubsetOf, Variables::IsStrictSupersetOf).

Constructor & Destructor Documentation

◆ Variables() [1/2]

Variables ( )
default

Default constructor.

◆ ~Variables()

~Variables ( )
default

Default destructor.

◆ Variables() [2/2]

Variables ( std::initializer_list< Variable init)

List constructor.

Member Function Documentation

◆ begin() [1/2]

iterator begin ( )
inline

Returns an iterator to the beginning.

◆ begin() [2/2]

const_iterator begin ( ) const
inline

Returns an iterator to the beginning.

◆ cbegin()

const_iterator cbegin ( ) const
inline

Returns a const iterator to the beginning.

◆ cend()

const_iterator cend ( ) const
inline

Returns a const iterator to the end.

◆ crbegin()

const_reverse_iterator crbegin ( ) const
inline

Returns a const reverse-iterator to the beginning.

◆ crend()

const_reverse_iterator crend ( ) const
inline

Returns a const reverse-iterator to the end.

◆ empty()

bool empty ( ) const
inline

Checks if this set is empty or not.

◆ end() [1/2]

iterator end ( )
inline

Returns an iterator to the end.

◆ end() [2/2]

const_iterator end ( ) const
inline

Returns an iterator to the end.

◆ erase() [1/2]

size_type erase ( const Variable key)
inline

Erases key from a set.

Return number of erased elements (0 or 1).

◆ erase() [2/2]

Variables::size_type erase ( const Variables vars)

Erases variables in vars from a set.

Return number of erased elements ([0, vars.size()]).

◆ find()

iterator find ( const Variable key)
inline

Finds element with specific key.

◆ get_hash()

size_t get_hash ( ) const

Returns hash value.

◆ include()

bool include ( const Variable key) const
inline

Return true if key is included in the Variables.

◆ insert() [1/3]

void insert ( const Variable var)
inline

Inserts a variable var into a set.

◆ insert() [2/3]

void insert ( InputIt  first,
InputIt  last 
)
inline

Inserts variables in [first, last) into a set.

◆ insert() [3/3]

void insert ( const Variables vars)
inline

Inserts variables in vars into a set.

◆ IsStrictSubsetOf()

bool IsStrictSubsetOf ( const Variables vars) const

Return true if vars is a strict subset of the Variables.

◆ IsStrictSupersetOf()

bool IsStrictSupersetOf ( const Variables vars) const

Return true if vars is a strict superset of the Variables.

◆ IsSubsetOf()

bool IsSubsetOf ( const Variables vars) const

Return true if vars is a subset of the Variables.

◆ IsSupersetOf()

bool IsSupersetOf ( const Variables vars) const

Return true if vars is a superset of the Variables.

◆ rbegin() [1/2]

reverse_iterator rbegin ( )
inline

Returns a reverse iterator to the beginning.

◆ rbegin() [2/2]

const_reverse_iterator rbegin ( ) const
inline

Returns a reverse iterator to the beginning.

◆ rend() [1/2]

reverse_iterator rend ( )
inline

Returns a reverse iterator to the end.

◆ rend() [2/2]

const_reverse_iterator rend ( ) const
inline

Returns a reverse iterator to the end.

◆ size()

size_type size ( ) const
inline

Returns the number of elements.

◆ to_string()

string to_string ( ) const

Returns string representation of Variables.

Friends And Related Function Documentation

◆ intersect

Variables intersect ( const Variables vars1,
const Variables vars2 
)
friend

Returns the intersection of vars1 and vars2.

This function has a time complexity of O(N₁ + N₂) where N₁ and N₂ are the size of vars1 and vars2 respectively.


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