Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <strong_vector.h>
Public Types | |
typedef std::vector< NativeType, Alloc > | ParentType |
typedef ParentType::size_type | size_type |
typedef ParentType::allocator_type | allocator_type |
typedef ParentType::value_type | value_type |
typedef ParentType::reference | reference |
typedef ParentType::const_reference | const_reference |
typedef ParentType::pointer | pointer |
typedef ParentType::const_pointer | const_pointer |
typedef ParentType::iterator | iterator |
typedef ParentType::const_iterator | const_iterator |
typedef ParentType::reverse_iterator | reverse_iterator |
typedef ParentType::const_reverse_iterator | const_reverse_iterator |
Public Member Functions | |
StrongVector () | |
StrongVector (const allocator_type &a) | |
StrongVector (size_type n) | |
StrongVector (IntType n) | |
StrongVector (size_type n, const value_type &v, const allocator_type &a=allocator_type()) | |
StrongVector (IntType n, const value_type &v, const allocator_type &a=allocator_type()) | |
StrongVector (const StrongVector &x) | |
StrongVector (StrongVector &&x)=default | |
StrongVector (std::initializer_list< value_type > l, const allocator_type &a=allocator_type()) | |
template<typename InputIteratorType > | |
StrongVector (InputIteratorType first, InputIteratorType last, const allocator_type &a=allocator_type()) | |
~StrongVector () | |
const ParentType & | get () const |
ParentType * | mutable_get () |
reference | operator[] (IntType i) |
– Modified methods ----------------------------------------------------— | |
const_reference | operator[] (IntType i) const |
reference | at (IntType i) |
const_reference | at (IntType i) const |
IntType | start_index () const |
– Extension methods ---------------------------------------------------— | |
IntType | end_index () const |
bool | IsValidSize () const |
Returns true if the vector is fully addressable by the index type. | |
StrongIntRange< IntType > | index_range () const |
value_type * | data () |
– Pass-through methods to STL vector ----------------------------------— | |
const value_type * | data () const |
StrongVector & | operator= (const StrongVector &x) |
StrongVector & | operator= (StrongVector &&x)=default |
StrongVector & | operator= (std::initializer_list< value_type > l) |
void | swap (StrongVector &x) noexcept |
void | assign (size_type n, const value_type &val) |
template<typename InputIt > | |
void | assign (InputIt f, InputIt l) |
void | assign (std::initializer_list< value_type > l) |
template<typename... Args> | |
iterator | emplace (const_iterator pos, Args &&... args) |
template<typename... Args> | |
reference | emplace_back (Args &&... args) |
iterator | insert (const_iterator pos, const value_type &x) |
iterator | insert (const_iterator pos, value_type &&x) |
void | insert (const_iterator pos, size_type n, const value_type &x) |
template<typename SIT > | |
void | insert (const_iterator pos, SIT first, SIT last) |
void | push_back (const value_type &val) |
void | push_back (value_type &&val) |
void | reserve (size_type n) |
void | reserve (IntType n) |
void | resize (size_type new_size) |
void | resize (IntType new_size) |
void | resize (size_type new_size, const value_type &x) |
void | resize (IntType new_size, const value_type &x) |
Friends | |
template<typename H > | |
H | AbslHashValue (H h, const StrongVector &v) |
bool | operator== (const StrongVector &x, const StrongVector &y) |
bool | operator!= (const StrongVector &x, const StrongVector &y) |
bool | operator< (const StrongVector &x, const StrongVector &y) |
bool | operator> (const StrongVector &x, const StrongVector &y) |
bool | operator<= (const StrongVector &x, const StrongVector &y) |
bool | operator>= (const StrongVector &x, const StrongVector &y) |
void | swap (StrongVector &x, StrongVector &y) noexcept |
Definition at line 75 of file strong_vector.h.
ParentType::allocator_type util_intops::StrongVector< IntType, NativeType, Alloc >::allocator_type |
Definition at line 79 of file strong_vector.h.
ParentType::const_iterator util_intops::StrongVector< IntType, NativeType, Alloc >::const_iterator |
Definition at line 86 of file strong_vector.h.
ParentType::const_pointer util_intops::StrongVector< IntType, NativeType, Alloc >::const_pointer |
Definition at line 84 of file strong_vector.h.
ParentType::const_reference util_intops::StrongVector< IntType, NativeType, Alloc >::const_reference |
Definition at line 82 of file strong_vector.h.
ParentType::const_reverse_iterator util_intops::StrongVector< IntType, NativeType, Alloc >::const_reverse_iterator |
Definition at line 88 of file strong_vector.h.
ParentType::iterator util_intops::StrongVector< IntType, NativeType, Alloc >::iterator |
Definition at line 85 of file strong_vector.h.
std::vector<NativeType, Alloc> util_intops::StrongVector< IntType, NativeType, Alloc >::ParentType |
Definition at line 77 of file strong_vector.h.
ParentType::pointer util_intops::StrongVector< IntType, NativeType, Alloc >::pointer |
Definition at line 83 of file strong_vector.h.
ParentType::reference util_intops::StrongVector< IntType, NativeType, Alloc >::reference |
Definition at line 81 of file strong_vector.h.
ParentType::reverse_iterator util_intops::StrongVector< IntType, NativeType, Alloc >::reverse_iterator |
Definition at line 87 of file strong_vector.h.
ParentType::size_type util_intops::StrongVector< IntType, NativeType, Alloc >::size_type |
Definition at line 78 of file strong_vector.h.
ParentType::value_type util_intops::StrongVector< IntType, NativeType, Alloc >::value_type |
Definition at line 80 of file strong_vector.h.
|
inline |
Definition at line 91 of file strong_vector.h.
|
inlineexplicit |
Definition at line 92 of file strong_vector.h.
|
inlineexplicit |
Definition at line 93 of file strong_vector.h.
|
inlineexplicit |
Definition at line 94 of file strong_vector.h.
|
inlineexplicit |
Definition at line 96 of file strong_vector.h.
|
inlineexplicit |
Definition at line 101 of file strong_vector.h.
|
inline |
Definition at line 104 of file strong_vector.h.
|
default |
|
inline |
Definition at line 108 of file strong_vector.h.
|
inline |
Definition at line 114 of file strong_vector.h.
|
inline |
Definition at line 119 of file strong_vector.h.
|
inline |
Definition at line 220 of file strong_vector.h.
|
inline |
Definition at line 215 of file strong_vector.h.
|
inline |
Definition at line 224 of file strong_vector.h.
|
inline |
Definition at line 139 of file strong_vector.h.
|
inline |
Definition at line 142 of file strong_vector.h.
|
inline |
– Pass-through methods to STL vector ----------------------------------—
Definition at line 199 of file strong_vector.h.
|
inline |
Definition at line 200 of file strong_vector.h.
|
inline |
Definition at line 230 of file strong_vector.h.
|
inline |
Definition at line 237 of file strong_vector.h.
|
inline |
Index following the last valid index into the vector. In case size() has grown beyond values representable by IntType, this function will truncate the result. There is a debugging check for such behavior, but it is unlikely to be triggered in testing.
Definition at line 156 of file strong_vector.h.
|
inline |
– Accessors -----------------------------------------------------------— This const accessor is useful in defining the comparison operators below.
Definition at line 123 of file strong_vector.h.
|
inline |
Returns an iterator of valid indices into this vector. Goes from start_index() to end_index(). This is useful for cases of parallel iteration over several vectors indexed by the same type, e.g. StrongVector<MyInt, foo> v1; StrongVector<MyInt, foo> v2; CHECK_EQ(v1.size(), v2.size()); for (const auto i : v1.index_range()) { do_stuff(v1[i], v2[i]); }
Definition at line 190 of file strong_vector.h.
|
inline |
Definition at line 243 of file strong_vector.h.
|
inline |
Definition at line 258 of file strong_vector.h.
|
inline |
Definition at line 253 of file strong_vector.h.
|
inline |
Definition at line 248 of file strong_vector.h.
|
inline |
Returns true if the vector is fully addressable by the index type.
Definition at line 162 of file strong_vector.h.
|
inline |
The mutable accessor is useful when using auxiliary methods relying on vector parameters such as JoinUsing(), SplitStringUsing(), etc. Methods relying solely on iterators (e.g. STLDeleteElements) should work just fine without the need for mutable_get(). NB: It should be used only in this case and thus should not be abused to index the underlying vector without the appropriate IntType.
Definition at line 130 of file strong_vector.h.
|
inline |
Definition at line 202 of file strong_vector.h.
|
inline |
Definition at line 207 of file strong_vector.h.
|
default |
|
inline |
– Modified methods ----------------------------------------------------—
Definition at line 133 of file strong_vector.h.
|
inline |
Definition at line 136 of file strong_vector.h.
|
inline |
Definition at line 263 of file strong_vector.h.
|
inline |
Definition at line 267 of file strong_vector.h.
|
inline |
Definition at line 277 of file strong_vector.h.
|
inline |
Definition at line 272 of file strong_vector.h.
|
inline |
Definition at line 284 of file strong_vector.h.
|
inline |
Definition at line 293 of file strong_vector.h.
|
inline |
Definition at line 279 of file strong_vector.h.
|
inline |
Definition at line 288 of file strong_vector.h.
|
inline |
– Extension methods ---------------------------------------------------—
Iteration related methods. Useful for parallel iteration and non-trivial access patterns. Typical loop will be: for (auto i = v.start_index(); i < v.end_index(); ++i) ...
Definition at line 151 of file strong_vector.h.
|
inlinenoexcept |
Definition at line 213 of file strong_vector.h.
|
friend |
Definition at line 303 of file strong_vector.h.
|
friend |
Definition at line 316 of file strong_vector.h.
|
friend |
Definition at line 319 of file strong_vector.h.
|
friend |
Definition at line 325 of file strong_vector.h.
|
friend |
Definition at line 313 of file strong_vector.h.
|
friend |
Definition at line 322 of file strong_vector.h.
|
friend |
Definition at line 328 of file strong_vector.h.
|
friend |
Definition at line 331 of file strong_vector.h.