NDArray.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5  * Karlsruhe Institute of Technology (KIT), all rights reserved.
6  *
7  * ArmarX is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * ArmarX is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * @author Fabian Peller-Konrad (fabian dot peller-konrad at kit dot edu)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 // Header
25 #include "NDArray.h"
26 
27 namespace armarx::aron::type
28 {
29  // constructors
30  NDArray::NDArray(const Path& path) :
31  detail::NDArrayVariant<type::dto::NDArray, NDArray>(type::Descriptor::NDARRAY, path)
32  {
33  }
34 
35  NDArray::NDArray(const type::dto::NDArray& o, const Path& path) :
36  detail::NDArrayVariant<type::dto::NDArray, NDArray>(o, type::Descriptor::NDARRAY, path)
37  {
38  }
39 
42  {
43  return this->aron;
44  }
45 
46  int
48  {
49  return this->aron->ndimensions;
50  }
51 
54  {
55  return this->aron->elementType;
56  }
57 
58  void
60  {
61  this->aron->elementType = s;
62  }
63 
64  void
66  {
67  this->aron->ndimensions = v;
68  }
69 
70  void
72  {
73  this->aron->ndimensions++;
74  }
75 
76  // virtual implementations
77  std::string
79  {
80  return "NDArray";
81  }
82 
83  std::string
85  {
86  return "armarx::aron::type::NDArray";
87  }
88 } // namespace armarx::aron::type
armarx::aron::type::NDArray::getNumberDimensions
int getNumberDimensions() const
Definition: NDArray.cpp:47
armarx::aron::type::NDArray
The NDArray class.
Definition: NDArray.h:38
detail
Definition: OpenCVUtil.cpp:127
armarx::aron::data::NDArrayPtr
std::shared_ptr< NDArray > NDArrayPtr
Definition: NDArray.h:46
armarx::aron::type::Descriptor::NDARRAY
@ NDARRAY
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron::type::NDArray::getShortName
std::string getShortName() const override
get a short name of this specific type
Definition: NDArray.cpp:78
armarx::aron::type::NDArray::toNDArrayDTO
type::dto::NDArrayPtr toNDArrayDTO() const
Definition: NDArray.cpp:41
armarx::aron::type::NDArray::getFullName
std::string getFullName() const override
get the full name of this specific type
Definition: NDArray.cpp:84
armarx::aron::type::NDArray::getElementType
type::ndarray::ElementType getElementType() const
Definition: NDArray.cpp:53
armarx::aron::type::detail::SpecializedVariantBase< type::dto::NDArray, NDArray >::aron
type::dto::NDArray ::PointerType aron
Definition: SpecializedVariant.h:137
armarx::aron::type
A convenience header to include all aron files (full include, not forward declared)
Definition: aron_conversions.cpp:9
armarx::ElementTypes::ElementType
ElementType
Definition: AbstractObjectSerializer.h:32
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
armarx::aron::type::NDArray::NDArray
NDArray(const Path &path=Path())
Definition: NDArray.cpp:30
NDArray.h
armarx::aron::type::NDArray::setElementType
void setElementType(type::ndarray::ElementType)
Definition: NDArray.cpp:59
armarx::aron::type::NDArray::setNumberDimensions
void setNumberDimensions(int)
Definition: NDArray.cpp:65
armarx::aron::type::Descriptor
Descriptor
Definition: Descriptor.h:76
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx::aron::type::NDArray::addDimension
void addDimension()
Definition: NDArray.cpp:71