File ord-vector.hh¶
-
namespace mata
Main namespace including structs and algorithms for all automata.
In particular, this includes:
Alphabets,
Formula graphs and nodes,
Closed sets.
-
namespace utils¶
SparseSet.h Implements a class template of a sparse set of unsigned integers.
Non-automata-related structures and algorithms.
In particular, this includes:
Predicates,
Ordered Vectors,
Iterators,
Printers,
Other helper functions.
- Author
Sam Griffiths www.computist.xyz https://gist.github.com/sjgriffiths/06732c6076b9db8a7cf4dfe3a7aed43a
Functions
-
template<class Key>
class OrdVector - #include <ord-vector.hh>
Implementation of a set using ordered vector.
This class implements the interface of a set (the same interface as std::set) using ordered vector as the underlying data structure.
- Template Parameters:
Key – Key type: type of the elements contained in the container. Each elements in a set is also its key.
Public Types
-
using size_type = size_t¶
-
using iterator = typename VectorType::iterator¶
-
using const_iterator = typename VectorType::const_iterator¶
-
using const_reference = typename VectorType::const_reference¶
-
using reference = typename VectorType::reference¶
Public Functions
-
inline OrdVector()¶
-
inline explicit OrdVector(const VectorType &vec)¶
-
template<class InputIterator>
inline explicit OrdVector(InputIterator first, InputIterator last)¶
-
virtual ~OrdVector() = default¶
-
inline virtual void reserve(size_t size)¶
-
inline virtual void resize(size_t size)¶
-
inline virtual iterator erase(const_iterator pos)¶
-
inline virtual iterator erase(const_iterator first, const_iterator last)¶
-
inline void clear()¶
-
inline virtual size_t size() const¶
-
inline OrdVector difference(const OrdVector &rhs) const
Compute set difference as
thisminusrhs.- Parameters:
rhs – Other vector with symbols to be excluded.
- Returns:
thisminusrhs.
-
inline virtual const_iterator find(const Key &key) const¶
-
inline bool contains(const Key &key) const
Check whether
keyexists in the ordered vector.
-
inline size_t erase(const Key &k)
Remove
kfrom sorted vector.This function expects the vector to be sorted.
-
inline virtual bool empty() const¶
-
inline virtual const_reference back() const¶
-
inline virtual reference back()
Get reference to the last element in the vector.
Modifying the underlying value in the reference could break sortedness.
-
inline virtual void pop_back()¶
-
inline virtual const_iterator begin() const¶
-
inline virtual const_iterator end() const¶
-
inline virtual const_iterator cbegin() const¶
-
inline virtual const_iterator cend() const¶
Public Static Functions
Private Functions
-
inline bool is_sorted() const¶
Private Members
-
VectorType vec_¶
Private Static Functions