 |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Go to the documentation of this file.
6 #ifndef LLU_CONTAINERS_VIEWS_NUMERICARRAY_HPP
7 #define LLU_CONTAINERS_VIEWS_NUMERICARRAY_HPP
53 numericarray_data_t
type() const final {
63 MNumericArray na =
nullptr;
83 if (NumericArrayType<T> !=
type()) {
94 if (NumericArrayType<T> !=
type()) {
105 if (NumericArrayType<T> !=
type()) {
111 T* getData() const noexcept
override {
112 return static_cast<T*
>(
rawData());
115 mint getSize() const noexcept
override {
128 template<
typename NumericArrayT,
typename F>
141 case MNumericArray_Type_Complex_Real32:
143 case MNumericArray_Type_Complex_Real64:
158 #endif // LLU_CONTAINERS_VIEWS_NUMERICARRAY_HPP
Abstract class that defines a basic set of operations on a numeric array.
Definition: Interfaces.h:106
NumericArrayTypedView(MNumericArray mna)
Create a NumericArrayTypedView from a raw MNumericArray.
Definition: Views/NumericArray.hpp:104
Simple, light-weight, non-owning wrappper over MNumericArray.
Definition: Views/NumericArray.hpp:73
Abstract class that provides iterators (c/r/begin and c/r/end methods) and subscript operator for any...
Definition: IterableContainer.hpp:20
MContainer specialization for MNumericArray.
Definition: Generic/NumericArray.hpp:23
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
mint getRank() const override
Get rank.
Definition: Views/NumericArray.hpp:38
NumericArrayTypedView(const GenericNumericArray &gNA)
Create a NumericArrayTypedView from a GenericNumericArray.
Definition: Views/NumericArray.hpp:82
void * rawData() const noexcept override
Get access to the raw data.
Definition: Views/NumericArray.hpp:58
NumericArrayView(MNumericArray mna)
Create a NumericArrayView from a raw MNumericArray.
Definition: Views/NumericArray.hpp:35
numericarray_data_t type() const final
Get the data type of this array.
Definition: Views/NumericArray.hpp:53
const std::string NumericArrayTypeError
NumericArray type mismatch.
Simple, light-weight, non-owning, data-type-agnostic wrappper over MNumericArray.
Definition: Views/NumericArray.hpp:21
mint const * getDimensions() const override
Get dimensions.
Definition: Views/NumericArray.hpp:43
Container getContainer() const noexcept
Get internal container.
Definition: Base.hpp:97
mint getFlattenedLength() const override
Get length.
Definition: Views/NumericArray.hpp:48
static void throwException(const std::string &errorName, T &&... args)
Throw exception with given name.
Definition: ErrorManager.h:199
auto asTypedNumericArray(NumericArrayT &&na, F &&callable)
Take a NumericArray-like object na and a function callable and call the function with a NumericArrayT...
Definition: Views/NumericArray.hpp:129
NumericArrayTypedView(NumericArrayView nav)
Create a NumericArrayTypedView from a NumericArrayView.
Definition: Views/NumericArray.hpp:93
static const st_WolframNumericArrayLibrary_Functions * NumericArrayAPI()
Get a pointer to structure with function pointers to MNumericArray API.
Definition: LibraryData.cpp:33
NumericArrayView(const GenericNumericArray &gNA)
Create a NumericArrayView from a GenericNumericArray.
Definition: Views/NumericArray.hpp:29
Implementation of the IterableContainer class.
GenericNumericArray definition and implementation.