TTK
|
Replacement for std::vector<std::vector<SimplexId>> More...
#include <FlatJaggedArray.h>
Classes | |
struct | Iterator |
struct | Slice |
Public Member Functions | |
void | setData (std::vector< SimplexId > &&data, std::vector< SimplexId > &&offsets) |
Set internal data from pre-existing vectors. | |
void | clear () |
Clear the underlying vectors. | |
SimplexId | size (SimplexId id) const |
Get the size of a particular sub-vector. | |
SimplexId | offset (SimplexId id) const |
Get the offset of a particular sub-vector. | |
Iterator | begin () const |
Iterator | end () const |
Slice | operator[] (const size_t id) const |
SimplexId | get (SimplexId id, SimplexId local) const |
Returns the data inside the sub-vectors. | |
const SimplexId * | get_ptr (SimplexId id, SimplexId local) const |
Returns a const pointer to the data inside the sub-vectors. | |
const SimplexId * | offset_ptr () const |
Returns a const pointer to the offset member. | |
size_t | size () const |
Returns the number of sub-vectors. | |
size_t | dataSize () const |
Returns the size of the data_ member. | |
bool | empty () const |
If the underlying buffers are empty. | |
size_t | footprint () const |
Computes the memory footprint of the array. | |
template<typename T > | |
void | fillFrom (const std::vector< T > &src, int threadNumber=1) |
Fill buffers from a std::vector<std::vector<SimplexId>> | |
void | copyTo (std::vector< std::vector< SimplexId > > &dst, int threadNumber=1) const |
Copy buffers to a std::vector<std::vector<SimplexId>> | |
void | writeToFile (const std::string &fName) const |
Write content into a file. | |
Static Public Member Functions | |
static void | writeToFile (const std::string &fName, const std::vector< std::vector< SimplexId > > &src) |
Also write std::vector<std::vector<SimplexId>> to disk. | |
Replacement for std::vector<std::vector<SimplexId>>
Use this when instead of a std::vector<std::vector<SimplexId>> when the data is set once and not modified afterwards.
Definition at line 12 of file FlatJaggedArray.h.
|
inline |
Definition at line 107 of file FlatJaggedArray.h.
|
inline |
Clear the underlying vectors.
Definition at line 35 of file FlatJaggedArray.h.
|
inline |
Copy buffers to a std::vector<std::vector<SimplexId>>
Definition at line 221 of file FlatJaggedArray.h.
|
inline |
Returns the size of the data_ member.
Definition at line 173 of file FlatJaggedArray.h.
|
inline |
If the underlying buffers are empty.
Definition at line 180 of file FlatJaggedArray.h.
|
inline |
Definition at line 110 of file FlatJaggedArray.h.
|
inline |
Fill buffers from a std::vector<std::vector<SimplexId>>
Templated to also accept Boost small_vectors.
Definition at line 201 of file FlatJaggedArray.h.
|
inline |
Computes the memory footprint of the array.
Definition at line 187 of file FlatJaggedArray.h.
Returns the data inside the sub-vectors.
Definition at line 126 of file FlatJaggedArray.h.
Returns a const pointer to the data inside the sub-vectors.
Definition at line 141 of file FlatJaggedArray.h.
Get the offset of a particular sub-vector.
Definition at line 59 of file FlatJaggedArray.h.
|
inline |
Returns a const pointer to the offset member.
Definition at line 156 of file FlatJaggedArray.h.
|
inline |
Definition at line 114 of file FlatJaggedArray.h.
|
inline |
Set internal data from pre-existing vectors.
Definition at line 26 of file FlatJaggedArray.h.
|
inline |
Returns the number of sub-vectors.
Definition at line 163 of file FlatJaggedArray.h.
Get the size of a particular sub-vector.
Definition at line 47 of file FlatJaggedArray.h.
|
inline |
Write content into a file.
Definition at line 245 of file FlatJaggedArray.h.
|
inlinestatic |
Also write std::vector<std::vector<SimplexId>> to disk.
Definition at line 259 of file FlatJaggedArray.h.