MyMatrixTypeDefs.hpp
Go to the documentation of this file.
00001 // ========================================================================================
00002 //  ApproxMVBB
00003 //  Copyright (C) 2014 by Gabriel Nützi <nuetzig (at) imes (d0t) mavt (d0t) ethz (døt) ch>
00004 //
00005 //  This Source Code Form is subject to the terms of the Mozilla Public
00006 //  License, v. 2.0. If a copy of the MPL was not distributed with this
00007 //  file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008 // ========================================================================================
00009 
00010 #ifndef ApproxMVBB_Common_MyMatrixTypeDefs_hpp
00011 #define ApproxMVBB_Common_MyMatrixTypeDefs_hpp
00012 
00013 #include "ApproxMVBB/Common/Platform.hpp"
00014 
00015 //#define EIGEN_DONT_VECTORIZE
00016 //#define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT
00017 
00018 #include <Eigen/Dense>
00019 
00020 namespace ApproxMVBB{
00021 
00022 // ================================================================================================
00027 namespace MyMatrix {
00028 
00029     template<typename Scalar>
00030     using  Matrix44 =  Eigen::Matrix<Scalar, 4, 4>;
00031     template<typename Scalar>
00032     using  Matrix43 =  Eigen::Matrix<Scalar, 4, 3>;
00033     template<typename Scalar>
00034     using  Matrix34 =  Eigen::Matrix<Scalar, 3, 4>;
00035     template<typename Scalar>
00036     using  Matrix33 =  Eigen::Matrix<Scalar, 3, 3>;
00037     template<typename Scalar>
00038     using  Matrix32 =  Eigen::Matrix<Scalar, 3, 2>;
00039     template<typename Scalar>
00040     using  Matrix23 =  Eigen::Matrix<Scalar, 2, 3>;
00041     template<typename Scalar>
00042     using  Matrix22 =  Eigen::Matrix<Scalar, 2, 2>;
00043     template<typename Scalar>
00044     using  Vector3 =  Eigen::Matrix<Scalar, 3, 1>;
00045     template<typename Scalar>
00046     using  Vector2 =  Eigen::Matrix<Scalar, 2, 1>;
00047 
00048     template<typename Scalar>
00049     using  Quaternion =  Eigen::Quaternion<Scalar>;
00050     template<typename Scalar>
00051     using  AngleAxis =  Eigen::AngleAxis<Scalar>;
00052 
00053     template<typename Scalar>
00054     using  Vector4 =  Eigen::Matrix<Scalar, 4, 1>;
00055     template<typename Scalar>
00056     using  Vector6 =  Eigen::Matrix<Scalar, 6, 1>;
00057     template<typename Scalar>
00058     using  VectorDyn =  Eigen::Matrix<Scalar, Eigen::Dynamic , 1 >;
00059 
00060 
00061     template<typename Scalar>
00062     using  MatrixDynDyn =  Eigen::Matrix<Scalar, Eigen::Dynamic , Eigen::Dynamic >;
00063     template<typename Scalar>
00064     using  MatrixDiagDyn =  Eigen::DiagonalMatrix<Scalar, Eigen::Dynamic >;
00065     template<typename Scalar>
00066     using  MatrixDynDynRow =  Eigen::Matrix<Scalar, Eigen::Dynamic , Eigen::Dynamic, Eigen::RowMajor>;
00067 
00068     template<typename Scalar,  int M>
00069     using  MatrixStatDyn =  Eigen::Matrix<Scalar, M, Eigen::Dynamic >;
00070     template<typename Scalar, int N>
00071     using  MatrixDynStat =  Eigen::Matrix<Scalar, Eigen::Dynamic, N >;
00072     template<typename Scalar, int M,  int N>
00073     using  MatrixStatStat =  Eigen::Matrix<Scalar, M, N >;
00074     template<typename Scalar, int M>
00075     using  VectorStat =  Eigen::Matrix<Scalar, M, 1 >;
00076 
00077 
00078     template<typename Scalar>
00079     using  AffineTrafo =  Eigen::Transform<Scalar,3,Eigen::TransformTraits::Affine>;
00080     template<typename Scalar>
00081     using  AffineTrafo2d =  Eigen::Transform<Scalar,2,Eigen::TransformTraits::Affine>;
00082 
00083     template<typename Scalar, int M>
00084     using  ArrayStatDyn =  Eigen::Array<Scalar, M, Eigen::Dynamic >;
00085     template<typename Scalar, int N>
00086     using  ArrayDynStat =  Eigen::Array<Scalar, Eigen::Dynamic, N >;
00087     template<typename Scalar, int M,  int N>
00088     using  ArrayStatStat =  Eigen::Array<Scalar, M, N >;
00089     template<typename Scalar, int M>
00090     using  ArrayStat =  Eigen::Array<Scalar, M,1>;
00091 
00092     template<typename Scalar>
00093     using  Array3 =  Eigen::Array<Scalar, 3, 1>;
00094     template<typename Scalar>
00095     using  Array2 =  Eigen::Array<Scalar, 2, 1>;
00096 
00097 }
00098 
00099 namespace MyMatrix{
00100 
00101     template<typename Derived> using MatrixBase = Eigen::MatrixBase<Derived>;
00102     template<typename Derived> using ArrayBase = Eigen::ArrayBase<Derived>;
00103 
00104     template<typename Derived> using VectorBDyn = Eigen::VectorBlock<Derived,Eigen::Dynamic>;
00105     template<typename Derived, int M> using VectorBStat    = Eigen::VectorBlock<Derived,M>;
00106 
00107     template<typename Derived> using MatrixBDynDyn  = Eigen::Block<Derived>;
00108     template<typename Derived, int M> using MatrixBStatDyn = Eigen::Block<Derived,M, Eigen::Dynamic>;
00109     template<typename Derived, int N> using MatrixBDynStat = Eigen::Block<Derived,Eigen::Dynamic,N>;
00110 
00111     template<typename EigenType> using MatrixRef = Eigen::Ref<EigenType>;
00112 
00113     template<typename EigenType> using MatrixMap = Eigen::Map<EigenType>;
00114 
00115 }
00116 
00117 
00118 struct APPROXMVBB_EXPORT  MyMatrixIOFormat {
00119      static const  Eigen::IOFormat Matlab;
00120      static const  Eigen::IOFormat CommaSep;
00121      static const  Eigen::IOFormat SpaceSep;
00122 };
00123 
00124 }
00125 
00126 
00127 #define ApproxMVBB_DEFINE_MATRIX_SPECIALTYPES \
00128    template<typename Derived> using MatrixBase = ApproxMVBB::MyMatrix::MatrixBase<Derived>; \
00129    template<typename Derived> using ArrayBase  = ApproxMVBB::MyMatrix::ArrayBase<Derived>; \
00130    \
00131    template<typename Derived> using VectorBDyn = ApproxMVBB::MyMatrix::VectorBDyn<Derived>; \
00132    template<typename Derived, int M> using VectorBStat = ApproxMVBB::MyMatrix::VectorBStat<Derived,M>; \
00133    \
00134    template<typename Derived> using MatrixBDynDyn = ApproxMVBB::MyMatrix::MatrixBDynDyn<Derived>; \
00135    template<typename Derived, int N> using MatrixBDynStat = ApproxMVBB::MyMatrix::MatrixBDynStat<Derived,N>; \
00136    template<typename Derived, int M> using MatrixBStatDyn = ApproxMVBB::MyMatrix::MatrixBStatDyn<Derived,M>; \
00137     \
00138    template<typename EigenType> using MatrixRef = ApproxMVBB::MyMatrix::MatrixRef< EigenType >; \
00139    template<typename EigenType> using MatrixMap = ApproxMVBB::MyMatrix::MatrixMap< EigenType >; \
00140 
00141 
00144 #define ApproxMVBB_DEFINE_MATRIX_TYPES_OF( _PREC_ ) \
00145     using Matrix44 = ApproxMVBB::MyMatrix::Matrix44< _PREC_ >; \
00146     using Matrix33 = ApproxMVBB::MyMatrix::Matrix33< _PREC_ >; \
00147     using Matrix22 = ApproxMVBB::MyMatrix::Matrix22< _PREC_ >; \
00148     using Matrix32 = ApproxMVBB::MyMatrix::Matrix32< _PREC_ >; \
00149     using Matrix23 = ApproxMVBB::MyMatrix::Matrix23< _PREC_ >; \
00150     using Matrix43 = ApproxMVBB::MyMatrix::Matrix43< _PREC_ >; \
00151     using Matrix34 = ApproxMVBB::MyMatrix::Matrix34< _PREC_ >; \
00152     using Vector3 = ApproxMVBB::MyMatrix::Vector3< _PREC_ >; \
00153     using Vector2 = ApproxMVBB::MyMatrix::Vector2< _PREC_ >; \
00154     using Vector4 = ApproxMVBB::MyMatrix::Vector4< _PREC_ >; \
00155     using Vector6 = ApproxMVBB::MyMatrix::Vector6< _PREC_ >; \
00156     using Quaternion = ApproxMVBB::MyMatrix::Quaternion< _PREC_ >; \
00157     using AngleAxis = ApproxMVBB::MyMatrix::AngleAxis< _PREC_ >; \
00158     using VectorDyn = ApproxMVBB::MyMatrix::VectorDyn< _PREC_ >; \
00159     using MatrixDynDyn = ApproxMVBB::MyMatrix::MatrixDynDyn< _PREC_ >; \
00160     using MatrixDiagDyn = ApproxMVBB::MyMatrix::MatrixDiagDyn< _PREC_ >; \
00161     using MatrixDynDynRow = ApproxMVBB::MyMatrix::MatrixDynDynRow< _PREC_ >; \
00162     \
00163     template<int M> using MatrixStatDyn = ApproxMVBB::MyMatrix::MatrixStatDyn< _PREC_, M>; \
00164     template<int N> using MatrixDynStat = ApproxMVBB::MyMatrix::MatrixDynStat< _PREC_, N>; \
00165     template<int M, int N> using MatrixStatStat = ApproxMVBB::MyMatrix::MatrixStatStat< _PREC_, M,N>; \
00166     template<int M> using VectorStat = ApproxMVBB::MyMatrix::VectorStat< _PREC_, M>; \
00167     \
00168     using AffineTrafo = ApproxMVBB::MyMatrix::AffineTrafo< _PREC_ >; \
00169     using AffineTrafo2d = ApproxMVBB::MyMatrix::AffineTrafo2d< _PREC_ >; \
00170     \
00171     template<int M> using ArrayStatDyn = ApproxMVBB::MyMatrix::ArrayStatDyn< _PREC_, M>; \
00172     template<int N> using ArrayDynStat = ApproxMVBB::MyMatrix::ArrayDynStat< _PREC_, N>; \
00173     template<int M,int N> using ArrayStatStat = ApproxMVBB::MyMatrix::ArrayStatStat< _PREC_, M,N>; \
00174     template<int M> using ArrayStat = ApproxMVBB::MyMatrix::ArrayStat< _PREC_, M>; \
00175     using Array3 = ApproxMVBB::MyMatrix::Array3< _PREC_ >; \
00176     using Array2 = ApproxMVBB::MyMatrix::Array2< _PREC_ >; \
00177     \
00178     ApproxMVBB_DEFINE_MATRIX_SPECIALTYPES
00179 
00180 #endif
00181 


asr_approx_mvbb
Author(s): Gassner Nikolai
autogenerated on Sat Jun 8 2019 20:21:49