 |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Go to the documentation of this file.
7 #ifndef LLU_CONTAINERS_SPARSEARRAY_H
8 #define LLU_CONTAINERS_SPARSEARRAY_H
205 return Tensor<mint> {MContainer::getExplicitPositions()};
209 return Tensor<T> {MContainer::toGenericTensor()};
215 #endif // LLU_CONTAINERS_SPARSEARRAY_H
Tensor< mint > explicitPositions() const
Get the explicitly specified positions in this sparse array.
Definition: SparseArray.h:204
SparseArray()=default
Default constructor, creates a SparseArray that does not wrap over any raw MSparseArray.
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
Tensor< T > explicitValues() const
Get a tensor with the values corresponding to the explicitly stored positions in the sparse array.
Definition: SparseArray.h:191
Tensor< mint > rowPointers() const
Get a row pointer array for this sparse array.
Definition: SparseArray.h:196
Tensor< T > toTensor() const
Expand this sparse array to a regular tensor.
Definition: SparseArray.h:208
void setImplicitValue(T newImplicitValue)
Change the implicit value of this array.
Definition: SparseArray.h:186
MContainer specialization for MSparseArray.
Definition: SparseArray.hpp:23
This is a class template, where template parameter T is the type of data elements....
Definition: Tensor.h:53
mint getRank() const
Get the rank (number of dimensions) of this sparse array.
Definition: SparseArray.hpp:88
GenericTensor getImplicitValueAsTensor() const
Get the implicit value of this sparse array.
Definition: SparseArray.cpp:46
mint type() const
Get the data type of this MSparseArray.
Definition: SparseArray.cpp:102
mint rank() const
Get the rank (number of dimensions) of this sparse array.
Definition: SparseArray.h:75
Container getContainer() const noexcept
Get internal container.
Definition: Base.hpp:97
GenericTensor getExplicitValues() const
Get a tensor with the values corresponding to the explicitly stored positions in the sparse array.
Definition: SparseArray.cpp:61
T implicitValue() const
Get the implicit value of this sparse array.
Definition: SparseArray.h:181
GenericSparseArray definition and implementation.
void setImplicitValueFromTensor(const GenericTensor &implicitValue)
Change the implicit value of this array.
Definition: SparseArray.cpp:53
static void throwException(const std::string &errorName, T &&... args)
Throw exception with given name.
Definition: ErrorManager.h:199
MContainer< MArgumentType::SparseArray > GenericSparseArray
MContainer specialization for MSparseArray is called GenericSparseArray.
Definition: SparseArray.hpp:17
Strongly typed wrapper for MSparseArray.
Definition: SparseArray.h:20
@ LibraryLink
LibraryLink is responsible for managing the container's memory. Corresponds to Automatic and "Constan...
Templated C++ wrapper for MTensor.
Tensor< mint > columnIndices() const
Get the column indices for the explicitly stored positions in this sparse array.
Definition: SparseArray.h:200
const std::string SparseArrayTypeError
SparseArray type mismatch.
auto asTypedSparseArray(const GenericSparseArray &sa, F &&callable)
Take a SparseArray-like object t and a function callable and call the function with a SparseArrayType...
Definition: SparseArray.h:142
Ownership
An enum listing possible owners of a LibraryLink container.
Definition: Base.hpp:22