Forward declaration. More...
#include <graph.h>
Public Member Functions | |
| SVector () | |
| ~SVector () | |
| SVector (const SVector &other) | |
| Copy constructor and assignment operator. More... | |
| SVector & | operator= (const SVector &other) |
| SVector (SVector &&other) | |
| Move constructor and move assignment operator. More... | |
| SVector & | operator= (SVector &&other) |
| T & | operator[] (int n) |
| const T & | operator[] (int n) const |
| void | resize (int n) |
| void | clear () |
| T * | data () const |
| void | swap (SVector< T > &x) |
| void | reserve (int n) |
| void | grow (const T &left=T(), const T &right=T()) |
| NOTE(user): This doesn't currently support movable-only objects, but we could fix that. More... | |
| int | size () const |
| int | capacity () const |
| int | max_size () const |
| void | clear_and_dealloc () |
Forward declaration.
A vector-like class where valid indices are in [- size_, size_) and reserved indices for future growth are in [- capacity_, capacity_).
It is used to hold arc related information for graphs with reverse arcs. It supports only up to 2^31-1 elements, for compactness. If you ever need more, consider using templates for the size/capacity integer types.
Sample usage:
SVector<int> v; v.grow(left_value, right_value); v.resize(10); v.clear(); v.swap(new_v); std:swap(v[i], v[~i]);
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |