Go to the documentation of this file.
28 #include <SimoxUtility/algorithm/string.h>
54 const std::vector<unsigned char>&
data,
65 if (
aron->shape != otherAron->shape)
69 if (
aron->type != otherAron->type)
74 if (
aron->data != otherAron->data)
88 return *
this == *other;
106 return std::make_shared<NDArray>(
aron);
112 return variant ? variant->toNDArrayDTO() :
nullptr;
119 auto dict = std::make_shared<Dict>();
121 dict->addElement(
"data", copy_this);
128 return aron->data.data();
134 aron->data = std::vector<unsigned char>(elements);
135 std::memcpy(
aron->data.data(), src, elements);
138 std::vector<unsigned char>
159 aron->shape.push_back(i);
220 return (
aron->shape.size() == 3 &&
aron->shape[0] == casted->getRows() &&
221 aron->shape[1] == casted->getCols());
227 return (
aron->shape.size() == 3 &&
aron->shape[0] == 1 &&
aron->shape[1] == 4);
233 return (
aron->shape.size() == 3);
239 return (
aron->shape.size() == 3);
245 return (
aron->shape.size() == (
unsigned int)casted->getNumberDimensions());
256 std::stringstream ss;
257 ss <<
"(" << simox::alg::join(simox::alg::multi_to_string(dimensions),
", ") <<
")";
A base class for aron exceptions.
std::shared_ptr< Variant > VariantPtr
ReaderT::InputType T & ret
std::vector< unsigned char > getDataAsVector() const
virtual std::string getFullName() const override
get the full str representation of this variant
void setType(const std::string &)
static VariantPtr FromAronDTO(const data::dto::GenericDataPtr &, const Path &=Path())
create a variant from a dto object
Path getPath() const
get the path
std::string getType() const
virtual std::string getShortName() const override
get a short str representation of this variant
virtual type::VariantPtr recalculateType() const override
recalculate the type of a data variant. Please not tha the mapping ist NOT bijective,...
std::shared_ptr< NDArray > NDArrayPtr
static data::dto::NDArrayPtr ToNDArrayDTO(const PointerType &navigator)
std::vector< int > getShape() const
static std::string DimensionsToString(const std::vector< int > &dimensions)
Return dimensions in a readable string such as "(2, 3, 4)".
The NotImplementedYetException class.
virtual PointerType clone() const
void setShape(const std::vector< int > &)
virtual bool operator==(const NDArray &) const override
const std::string & to_string(const std::string &s)
A convenience header to include all aron files (full include, not forward declared)
data::dto::GenericDataPtr toAronDTO() const override
std::shared_ptr< Dict > DictPtr
static PointerType FromNDArrayDTO(const data::dto::NDArrayPtr &aron)
DictPtr getAsDict() const
static std::shared_ptr< Matrix > DynamicCastAndCheck(const VariantPtr &n)
data::dto::NDArrayPtr toNDArrayDTO() const
void setData(unsigned int, const unsigned char *)
NDArray(const Path &path=Path())
unsigned char * getData() const
AronDataType::PointerType aron
virtual bool fullfillsType(const type::VariantPtr &) const override
checks, if the current data variant fullfills the given type