3 #include <initializer_list> 6 #include <unordered_map> 8 #include "dreal/symbolic/symbolic_variable.h" 9 #include "dreal/symbolic/symbolic_variables.h" 60 typedef double mapped_type;
62 typename std::unordered_map<key_type, mapped_type, hash_value<key_type>>
66 typedef typename map::iterator iterator;
67 typedef typename map::const_iterator const_iterator;
77 Environment(std::initializer_list<value_type> init);
87 iterator
begin() {
return map_.begin(); }
89 iterator
end() {
return map_.end(); }
91 const_iterator
begin()
const {
return map_.cbegin(); }
93 const_iterator
end()
const {
return map_.cend(); }
95 const_iterator
cbegin()
const {
return map_.cbegin(); }
97 const_iterator
cend()
const {
return map_.cend(); }
100 void insert(
const key_type& key,
const mapped_type& elem);
102 bool empty()
const {
return map_.empty(); }
104 size_t size()
const {
return map_.size(); }
107 iterator
find(
const key_type& key) {
return map_.find(key); }
109 const_iterator
find(
const key_type& key)
const {
return map_.find(key); }
124 const mapped_type&
operator[](
const key_type& key)
const;
126 friend std::ostream& operator<<(std::ostream& os,
const Environment& env);
mapped_type & operator[](const key_type &key)
Returns a reference to the value that is mapped to a key equivalent to key, performing an insertion i...
Definition: symbolic_environment.cc:83
const_iterator end() const
Returns a const iterator to the end.
Definition: symbolic_environment.h:93
bool empty() const
Checks whether the container is empty.
Definition: symbolic_environment.h:102
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
Variables domain() const
Returns the domain of this environment.
Definition: symbolic_environment.cc:69
void insert(const key_type &key, const mapped_type &elem)
Inserts a pair (key, elem).
Definition: symbolic_environment.cc:63
map::value_type value_type
std::pair<key_type, mapped_type>
Definition: symbolic_environment.h:65
Environment()=default
Default constructor.
Represents a symbolic variable.
Definition: symbolic_variable.h:16
const_iterator find(const key_type &key) const
Finds element with specific key.
Definition: symbolic_environment.h:109
iterator end()
Returns an iterator to the end.
Definition: symbolic_environment.h:89
const_iterator begin() const
Returns a const iterator to the beginning.
Definition: symbolic_environment.h:91
Represents a symbolic environment (mapping from a variable to a value).
Definition: symbolic_environment.h:52
const_iterator cend() const
Returns a const iterator to the end.
Definition: symbolic_environment.h:97
iterator begin()
Returns an iterator to the beginning.
Definition: symbolic_environment.h:87
~Environment()=default
Default destructor.
std::string to_string() const
Returns string representation.
Definition: symbolic_environment.cc:77
Represents a set of variables.
Definition: symbolic_variables.h:25
iterator find(const key_type &key)
Finds element with specific key.
Definition: symbolic_environment.h:107
size_t size() const
Returns the number of elements.
Definition: symbolic_environment.h:104
const_iterator cbegin() const
Returns a const iterator to the beginning.
Definition: symbolic_environment.h:95