A vector of cells.
#include <CellVector.h>
Public Types | |
Standard container typedefs | |
using | iterator = std::vector< Cell >::iterator |
using | const_iterator = std::vector< Cell >::const_iterator |
using | size_type = std::vector< Cell >::size_type |
using | reference = std::vector< Cell >::reference |
using | const_reference = std::vector< Cell >::const_reference |
using | difference_type = std::vector< Cell >::difference_type |
using | value_type = Cell |
Public Member Functions | |
Constructors | |
CellVector ()=default | |
CellVector (size_type n, const Cell &value=Cell()) | |
template<class InputIterator > | |
CellVector (InputIterator first, InputIterator last) | |
Vector functions | |
see documentation of std::vector | |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cend () const |
reference | operator[] (size_type n) |
const_reference | operator[] (size_type n) const |
reference | at (size_type n) |
const_reference | at (size_type n) const |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
void | reserve (size_type n) |
void | resize (size_type n, const Cell &value=Cell()) |
size_type | size () const |
bool | empty () const |
template<class InputIterator > | |
void | assign (InputIterator first, InputIterator last) |
void | push_back (const Cell &x) |
void | pop_back () |
iterator | erase (iterator position) |
iterator | erase (iterator first, iterator last) |
iterator | insert (iterator position, const Cell &cell) |
void | insert (iterator position, size_type n, const Cell &cell) |
template<class InputIterator > | |
void | insert (iterator position, InputIterator first, InputIterator last) |
void | swap (CellVector &rhs) |
void | clear () |
Utility functions | |
std::vector< Cell > | cells_ |
The vector the contained cells are stored in. More... | |
void | push_back (const cell_idx_t x, const cell_idx_t y, const cell_idx_t z) |
push_back( Cell(x,y,z) ) More... | |
void | push_back (const uint_t x, const uint_t y, const uint_t z) |
push_back( Cell(x,y,z) ) More... | |
difference_type | removeDuplicates () |
Removes duplicate entries. More... | |
CellInterval | boundingBox () const |
Calculates the axis-aligned bounding box of the cell vector. More... | |
bool | contains (const cell_idx_t x, const cell_idx_t y, const cell_idx_t z) const |
Return if cell (x,y,z) is contained in cell vector. More... | |
bool | contains (const uint_t x, const uint_t y, const uint_t z) const |
for documentation see "contains( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z )" More... | |
void | sort () |
using walberla::cell::CellVector::const_iterator = std::vector<Cell>::const_iterator |
using walberla::cell::CellVector::const_reference = std::vector<Cell>::const_reference |
using walberla::cell::CellVector::difference_type = std::vector<Cell>::difference_type |
using walberla::cell::CellVector::iterator = std::vector<Cell>::iterator |
using walberla::cell::CellVector::reference = std::vector<Cell>::reference |
using walberla::cell::CellVector::size_type = std::vector<Cell>::size_type |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
CellInterval walberla::cell::CellVector::boundingBox | ( | ) | const |
Calculates the axis-aligned bounding box of the cell vector.
Complexity is O(N), where N == this->size()
std::domain_error | Thrown when the CellVector is empty. |
|
inline |
|
inline |
|
inline |
|
inline |
Return if cell (x,y,z) is contained in cell vector.
Complexity is O(N), where N == this->size(). If you need a data structure for storing cells that provides an contains method that runs in O(logN) use a CellSet, not a CellVector.
|
inline |
for documentation see "contains( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z )"
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
push_back( Cell(x,y,z) )
|
inline |
push_back( Cell(x,y,z) )
CellVector::difference_type walberla::cell::CellVector::removeDuplicates | ( | ) |
Removes duplicate entries.
During the operation the CellVector is sorted. Iterators get invalidated.
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
The vector the contained cells are stored in.