 |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Go to the documentation of this file.
6 #ifndef LLU_CONTAINERS_GENERIC_TENSOR_HPP
7 #define LLU_CONTAINERS_GENERIC_TENSOR_HPP
39 MContainer(mint type, mint rank,
const mint* dims);
66 mint
type()
const override {
71 void* rawData()
const override;
79 mint shareCountImpl() const noexcept
override {
84 void passImpl(MArgument& res)
const noexcept
override {
85 MArgument_setMTensor(res, this->getContainer());
92 Container cloneImpl()
const override;
97 #endif // LLU_CONTAINERS_GENERIC_TENSOR_HPP
Template of the base class for all generic containers.
Definition: Base.hpp:35
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
MContainer is an abstract class template for generic containers. Only specializations shall be used.
Definition: Base.hpp:245
mint type() const override
Get the data type of this tensor.
Definition: Generic/Tensor.hpp:66
static WolframLibraryData API()
Get currently owned WolframLibraryData, if any.
Definition: LibraryData.cpp:22
@ Library
The library (LLU) is responsible for managing the container's memory. Used for Manual passing and con...
Abstract class that defines a basic set of operations on a tensor.
Definition: Interfaces.h:157
mint getRank() const override
Get rank.
Definition: Generic/Tensor.hpp:51
Definitions of MContainerBase and MContainer class templates.
MContainer clone() const
Clone this MContainer, performs a deep copy of the underlying MTensor.
Definition: Generic/Tensor.hpp:46
MArgumentType
Strongly type enum with possible types of data stored in MArgument.
Definition: MArgument.h:22
MContainer specialization for MTensor.
Definition: Generic/Tensor.hpp:24
MContainer()=default
Default constructor, the MContainer does not manage any instance of MTensor.
MContainer< MArgumentType::Tensor > Tensor
Tensor stands for a GenericTensor - type agnostic wrapper over MTensor.
Definition: TypedMArgument.h:47
mint const * getDimensions() const override
Get dimensions.
Definition: Generic/Tensor.hpp:56
mint getFlattenedLength() const override
Get total length.
Definition: Generic/Tensor.hpp:61