![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
Sparse vector for indexed data views. More...
#include <sparse_vector.hpp>
Public Member Functions | |
| SparseVector (size_t size) | |
| Construct empty SparseVector. | |
| SparseVector (const std::vector< size_t > &indices) | |
| Construct SparseVector with given indices. | |
| SparseVector (const std::vector< size_t > &indices, const std::vector< T > &data) | |
| Construct SparseVector with indices and initial data. | |
| size_t | size () const |
| Get number of entries. | |
| bool | empty () const |
| Check if empty. | |
| const DataBuffer< BackendTag, size_t > & | indices () const |
| Get indices buffer (read-only) | |
| DataBuffer< BackendTag, T > & | data () |
| Get data buffer (read-write) | |
| const DataBuffer< BackendTag, T > & | data () const |
| bool | is_sorted () const |
| Check if indices are sorted. | |
Sparse vector for indexed data views.
Represents a sparse view into selected entries of a dense array. Indices are automatically sorted for optimal memory access.
| BackendTag | Backend tag (CpuTag, CudaTag, HipTag) |
| T | Element type (must be trivially copyable for GPU backends) |
|
inlineexplicit |
Construct empty SparseVector.
| size | Number of entries |
|
inlineexplicit |
Construct SparseVector with given indices.
| indices | Linear indices into dense array (will be sorted) |

|
inline |
Construct SparseVector with indices and initial data.
| indices | Linear indices (will be sorted) |
| data | Initial values |
