Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef HECTOR_POSE_ESTIMATION_MATRIX_H
00030 #define HECTOR_POSE_ESTIMATION_MATRIX_H
00031
00032 #include <bfl/wrappers/matrix/matrix_wrapper.h>
00033 #include <stdexcept>
00034
00035 namespace hector_pose_estimation {
00036
00037 using namespace MatrixWrapper;
00038
00039 template <unsigned int dim>
00040 class ColumnVector_ : public ColumnVector {
00041 public:
00042 ColumnVector_() : ColumnVector(dim) {}
00043 ColumnVector_(double value) : ColumnVector(dim, value) {}
00044 ColumnVector_(const ColumnVector_<dim>& other) : ColumnVector(other) {}
00045 ColumnVector_(const ColumnVector& other) : ColumnVector(other)
00046 {
00047 if (other.rows() != dim) {
00048 std::cerr << (int)dim << " != " << (int)other.rows() << std::endl;
00049 throw std::runtime_error("Illegal vector assignment");
00050 }
00051 }
00052
00053
00054
00055
00056
00057 };
00058
00059 template <unsigned int dim>
00060 class RowVector_ : public RowVector {
00061 public:
00062 RowVector_() : RowVector(dim) {}
00063 RowVector_(double value) : RowVector(dim, value) {}
00064 RowVector_(const RowVector_<dim>& other) : RowVector(other) {}
00065 RowVector_(const RowVector& other) : RowVector(other) {
00066 if (other.columns() != dim) {
00067 std::cerr << (int)dim << " != " << (int)other.columns() << std::endl;
00068 throw std::runtime_error("Illegal vector assignment");
00069 }
00070 }
00071
00072
00073
00074
00075
00076 };
00077
00078 template <unsigned int m, unsigned int n>
00079 class Matrix_ : public Matrix {
00080 public:
00081 Matrix_() : Matrix(m, n) {}
00082 Matrix_(double value) : Matrix(m, RowVector_<n>(value)) {}
00083 Matrix_(const RowVector_<n> &row_value) : Matrix(m, row_value) {}
00084 Matrix_(const Matrix_<m,n>& other) : Matrix(other) {}
00085 Matrix_(const Matrix& other) : Matrix(other) {
00086 if (other.rows() != m || other.columns() != n) {
00087 std::cerr << (int)m << "x" << (int)n << " != " << (int)other.rows() << "x" << (int)other.columns() << std::endl;
00088 throw std::runtime_error("Illegal matrix assignment");
00089 }
00090 }
00091
00092
00093
00094
00095
00096 };
00097
00098 template <unsigned int dim>
00099 class SymmetricMatrix_ : public SymmetricMatrix {
00100 public:
00101 SymmetricMatrix_() : SymmetricMatrix(dim) {}
00102 SymmetricMatrix_(double value) : SymmetricMatrix(dim, RowVector_<dim>(value)) {}
00103 SymmetricMatrix_(const SymmetricMatrix_<dim>& other) : SymmetricMatrix(other) {}
00104 SymmetricMatrix_(const SymmetricMatrix& other) : SymmetricMatrix(other) {
00105 if (other.rows() != dim || other.columns() != dim) {
00106 std::cerr << (int)dim << "x" << (int)dim << " != " << (int)other.rows() << "x" << (int)other.columns() << std::endl;
00107 throw std::runtime_error("Illegal matrix assignment");
00108 }
00109 }
00110
00111
00112
00113
00114
00115 };
00116
00117 }
00118
00119 #endif // HECTOR_POSE_ESTIMATION_MATRIX_H