tatami
C++ API for different matrix representations
|
Array of some numeric type, determined at runtime. More...
#include <SomeNumericArray.hpp>
Classes | |
struct | Iterator |
Random-access iterator class. More... | |
Public Member Functions | |
SomeNumericArray (void *ptr, size_t number, SomeNumericType type) | |
SomeNumericArray (const int8_t *ptr, size_t number) | |
SomeNumericArray (const uint8_t *ptr, size_t number) | |
SomeNumericArray (const int16_t *ptr, size_t number) | |
SomeNumericArray (const uint16_t *ptr, size_t number) | |
SomeNumericArray (const int32_t *ptr, size_t number) | |
SomeNumericArray (const uint32_t *ptr, size_t number) | |
SomeNumericArray (const int64_t *ptr, size_t number) | |
SomeNumericArray (const uint64_t *ptr, size_t number) | |
SomeNumericArray (const float *ptr, size_t number) | |
SomeNumericArray (const double *ptr, size_t number) | |
Value_ | operator[] (size_t i) const |
size_t | size () const |
Iterator | begin () const |
Iterator | end () const |
Array of some numeric type, determined at runtime.
This holds a pointer to an existing array of some numeric type, mimicking the behavior of std::vector<Value_>
for tatami use cases. The aim is to support inputs of variable types without multiple template specializations, especially in cases where there are combinations of such arrays (e.g., CompressedSparseMatrix
). Of course, this comes with a mild performance penalty as the type must be checked upon extracting any value.
Value_ | Type to return when values are extracted. This is allowed to differ from the internal storage type. |
|
inline |
[in] | ptr | Pointer to the array of interest, of run-time type specified by type . The lifetime of the array should exceed that of the constructed SomeNumericArray and any of its copies. |
number | Length of the array pointed to by ptr . | |
type | Type of the array. |
|
inline |
ptr | Pointer to an existing array of int8_t s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of uint8_t s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of int16_t s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of uint16_t s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of int32_t s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of uint32_t s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of int64_t s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of uint64_t s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of float s. |
number | Length of the array pointed to by ptr . |
|
inline |
ptr | Pointer to an existing array of double s. |
number | Length of the array pointed to by ptr . |
|
inline |
i | Positional index on the array. |
i
-th element as a Value_
.
|
inline |
|
inline |
SomeNumericArray
.
|
inline |
SomeNumericArray
.