Vector of columns.
More...
#include <columnVector.h>
|
class | const_ptr |
| Read-only proxy for accessing a column vector entry. More...
|
|
class | ptr |
| Proxy for accessing a column vector entry. More...
|
|
|
| ColumnVector (std::size_t count) |
|
| ColumnVector (ColumnVector &&rhs) |
|
std::size_t | getSize () const |
|
const COLUMN & | operator[] (unsigned iDim) const |
|
COLUMN & | operator[] (unsigned iDim) |
|
auto | getRow (std::size_t i) const |
| Return copy of data at index i.
|
|
auto | setRow (std::size_t i, const Vector< typename COLUMN::value_t, D > &value) |
|
ptr | getRowPointer (std::size_t i) |
|
const_ptr | getRowPointer (std::size_t i) const |
|
void | resize (std::size_t newCount) |
| Resize columns, potentially invalidates any inbound pointers.
|
|
void | swap (std::size_t i, std::size_t j) |
| Swap contents of row i and row j.
|
|
std::size_t | getNblock () const override |
| Number of data blocks for the serializable interface.
|
|
std::size_t | getSerializableSize () const override |
| Binary size for the serializer.
|
|
bool * | getBlock (std::size_t iBlock, std::size_t &sizeBlock, bool loadingMode) override |
| Return a pointer to the memory of the current block and its size for the serializable interface.
|
|
void | postLoad () override |
|
Public Member Functions inherited from olb::ColumnVectorBase |
virtual | ~ColumnVectorBase () |
|
virtual | ~Serializable ()=default |
|
template<bool includeLogOutputDir = true> |
bool | save (std::string fileName="", const bool enforceUint=false) |
| Save Serializable into file fileName
|
|
template<bool includeLogOutputDir = true> |
bool | load (std::string fileName="", const bool enforceUint=false) |
| Load Serializable from file fileName
|
|
bool | save (std::uint8_t *buffer) |
| Save Serializable into buffer of length getSerializableSize
|
|
bool | load (const std::uint8_t *buffer) |
| Load Serializable from buffer of length getSerializableSize
|
|
|
static constexpr unsigned | d = D |
|
|
std::size_t | _count |
| Number of rows.
|
|
std::array< COLUMN, D > | _column |
|
|
template<typename DataType > |
void | registerVar (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, const DataType &data, const size_t arrayLength=1) const |
| Register primitive data types (int , double , ...) or arrays of those.
|
|
template<typename DataType > |
void | registerSerializableOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType &data, const bool loadingMode=false) |
| Register Serializable object of constant size.
|
|
template<typename DataType > |
void | registerSerializablesOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType *data, const size_t arrayLength, const bool loadingMode=false) |
| Register an array of Serializable objects of constant size.
|
|
template<typename COLUMN, unsigned D>
class olb::ColumnVector< COLUMN, D >
Vector of columns.
Base storage of FieldArrayD and as such all field data including populations
Definition at line 56 of file columnVector.h.
◆ ColumnVector() [1/2]
template<typename COLUMN , unsigned D>
Definition at line 68 of file columnVector.h.
68 :
70 _column(meta::make_array_f<COLUMN,D>([count](
unsigned iDim) -> std::size_t {
71 return count;
72 }))
73 { }
std::size_t _count
Number of rows.
std::array< COLUMN, D > _column
◆ ColumnVector() [2/2]
template<typename COLUMN , unsigned D>
◆ getBlock()
template<typename COLUMN , unsigned D>
bool * olb::ColumnVector< COLUMN, D >::getBlock |
( |
std::size_t | iBlock, |
|
|
std::size_t & | sizeBlock, |
|
|
bool | loadingMode ) |
|
overridevirtual |
Return a pointer to the memory of the current block and its size for the serializable interface.
Implements olb::Serializable.
Definition at line 167 of file columnVector.h.
168{
169 std::size_t currentBlock = 0;
170 bool* dataPtr = nullptr;
171
172 for (unsigned iDim=0; iDim < D; ++iDim) {
174 }
175
176 return dataPtr;
177}
void registerSerializableOfConstSize(const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType &data, const bool loadingMode=false)
Register Serializable object of constant size.
◆ getNblock()
template<typename COLUMN , unsigned D>
◆ getRow()
template<typename COLUMN , unsigned D>
Return copy of data at index i.
Definition at line 95 of file columnVector.h.
96 {
97 if constexpr (D == 1) {
99 } else {
100 return Vector<typename COLUMN::value_t,D>([this,i](unsigned iDim) {
102 });
103 }
104 __builtin_unreachable();
105 }
const COLUMN & operator[](unsigned iDim) const
◆ getRowPointer() [1/2]
template<typename COLUMN , unsigned D>
◆ getRowPointer() [2/2]
template<typename COLUMN , unsigned D>
Definition at line 119 of file columnVector.h.
120 {
121 return const_ptr(*this, i);
122 }
◆ getSerializableSize()
template<typename COLUMN , unsigned D>
◆ getSize()
template<typename COLUMN , unsigned D>
◆ operator[]() [1/2]
template<typename COLUMN , unsigned D>
◆ operator[]() [2/2]
template<typename COLUMN , unsigned D>
◆ postLoad()
template<typename COLUMN , unsigned D>
◆ resize()
template<typename COLUMN , unsigned D>
Resize columns, potentially invalidates any inbound pointers.
Definition at line 125 of file columnVector.h.
126 {
127 for (unsigned iDim=0; iDim < D; ++iDim) {
128 _column[iDim].resize(newCount);
129 }
131 }
◆ setRow()
template<typename COLUMN , unsigned D>
Definition at line 107 of file columnVector.h.
108 {
109 for (unsigned iDim=0; iDim < D; ++iDim) {
111 }
112 }
◆ swap()
template<typename COLUMN , unsigned D>
Swap contents of row i and row j.
Required to realize sorted column stores in CellIndexListD
Definition at line 137 of file columnVector.h.
138 {
139 for (unsigned iDim=0; iDim < D; ++iDim) {
141 }
142 }
◆ _column
template<typename COLUMN , unsigned D>
◆ _count
template<typename COLUMN , unsigned D>
template<typename COLUMN , unsigned D>
The documentation for this class was generated from the following file: