Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Forward declaration. More...
#include <graph.h>
Public Member Functions | |
SVector () | |
~SVector () | |
SVector (const SVector &other) | |
Copy constructor and assignment operator. | |
SVector & | operator= (const SVector &other) |
SVector (SVector &&other) noexcept | |
Move constructor and move assignment operator. | |
SVector & | operator= (SVector &&other) noexcept |
T & | operator[] (int n) |
const T & | operator[] (int n) const |
void | resize (int n) |
void | clear () |
T * | data () const |
void | swap (SVector< T > &x) noexcept |
void | reserve (int n) |
void | grow (const T &left=T(), const T &right=T()) |
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 |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |