Matrix.h
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 #pragma once
25 
26 // STD/STL
27 #include <map>
28 #include <string>
29 
30 // Base class
31 #include "../detail/NDArrayVariant.h"
32 
33 namespace armarx::aron::type
34 {
35  /**
36  * @brief The Matrix class. It represents the matrix type
37  * A Matrix is defined through the number of rows, cols and the element type
38  */
39  class Matrix : public detail::NDArrayVariant<type::dto::Matrix, Matrix>
40  {
41  public:
42  // constructors
43  Matrix(const Path& path = Path());
44  Matrix(const type::dto::Matrix&, const Path& path = Path());
45 
46  int getRows() const;
47  int getCols() const;
49 
50  void setRows(const int);
51  void setCols(const int);
53 
55 
56  // virtual implementations
57  std::string getShortName() const override;
58  std::string getFullName() const override;
59 
60  static const std::map<matrix::ElementType, std::string> Elementtype2String;
61  static const std::map<std::string, matrix::ElementType> String2Elementtype;
62  };
63 } // namespace armarx::aron::type
armarx::aron::type::Matrix::String2Elementtype
static const std::map< std::string, matrix::ElementType > String2Elementtype
Definition: Matrix.h:61
armarx::aron::type::MatrixPtr
std::shared_ptr< class Matrix > MatrixPtr
Definition: forward_declarations.h:20
armarx::aron::type::Matrix::setElementType
void setElementType(const type::matrix::ElementType)
Definition: Matrix.cpp:94
Matrix
Eigen::Matrix< T, 3, 3 > Matrix
Definition: UnscentedKalmanFilterTest.cpp:37
armarx::aron::type::Matrix::getFullName
std::string getFullName() const override
get the full name of this specific type
Definition: Matrix.cpp:113
armarx::aron::type::Matrix::getCols
int getCols() const
Definition: Matrix.cpp:60
armarx::aron::type::Matrix::setRows
void setRows(const int)
Definition: Matrix.cpp:66
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron::type::Matrix::toMatrixDTO
type::dto::MatrixPtr toMatrixDTO() const
Definition: Matrix.cpp:100
armarx::aron::type::detail::NDArrayVariant
Definition: NDArrayVariant.h:39
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::aron::type::Matrix::setCols
void setCols(const int)
Definition: Matrix.cpp:77
armarx::aron::type::Matrix::Matrix
Matrix(const Path &path=Path())
Definition: Matrix.cpp:43
armarx::aron::type::Matrix::getElementType
type::matrix::ElementType getElementType() const
Definition: Matrix.cpp:88
armarx::aron::type::Matrix::getShortName
std::string getShortName() const override
get a short name of this specific type
Definition: Matrix.cpp:107
armarx::armem::server::ltm::detail::mixin::Path
std::filesystem::path Path
Definition: DiskStorageMixin.h:17
armarx::aron::type::Variant::path
const Path path
Definition: Variant.h:139
armarx::aron::type::Matrix::Elementtype2String
static const std::map< matrix::ElementType, std::string > Elementtype2String
Definition: Matrix.h:60
armarx::aron::type::Matrix::getRows
int getRows() const
Definition: Matrix.cpp:54
armarx::aron::type::Matrix
The Matrix class.
Definition: Matrix.h:39