ShapeOp
 All Classes Files Functions Variables Typedefs Macros Pages
Types.h
Go to the documentation of this file.
1 // This file is part of ShapeOp, a lightweight C++ library
3 // for static and dynamic geometry processing.
4 //
5 // Copyright (C) 2014 Sofien Bouaziz <sofien.bouaziz@gmail.com>
6 // Copyright (C) 2014 LGG EPFL
7 //
8 // This Source Code Form is subject to the terms of the Mozilla
9 // Public License v. 2.0. If a copy of the MPL was not distributed
10 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 #ifndef TYPES_H
13 #define TYPES_H
14 #include "Common.h"
16 #include <Eigen/Dense>
17 #include <Eigen/Sparse>
19 
21 //TODO: For windows 32 bit we may need Eigen::DontAlign
23 #ifdef SHAPEOP_DONT_ALIGN
24 #define SHAPEOP_ALIGNMENT Eigen::DontAlign
25 #else
26 #define SHAPEOP_ALIGNMENT Eigen::AutoAlign
27 #endif
28 namespace ShapeOp {
30 typedef ShapeOpScalar Scalar;
31 //Dense
32 template < int Rows, int Cols, int Options = (Eigen::ColMajor | SHAPEOP_ALIGNMENT) >
33 using MatrixT = Eigen::Matrix<Scalar, Rows, Cols, Options>;
34 typedef MatrixT<2, 1> Vector2;
35 typedef MatrixT<2, 2> Matrix22;
36 typedef MatrixT<2, 3> Matrix23;
37 typedef MatrixT<3, 1> Vector3;
38 typedef MatrixT<3, 2> Matrix32;
39 typedef MatrixT<3, 3> Matrix33;
40 typedef MatrixT<3, 4> Matrix34;
41 typedef MatrixT<4, 1> Vector4;
42 typedef MatrixT<4, 4> Matrix44;
43 typedef MatrixT<3, Eigen::Dynamic> Matrix3X;
44 typedef MatrixT<Eigen::Dynamic, 3> MatrixX3;
45 typedef MatrixT<Eigen::Dynamic, 1> VectorX;
46 typedef MatrixT<Eigen::Dynamic, Eigen::Dynamic> MatrixXX;
47 //Sparse
48 template<int Options = Eigen::ColMajor>
49 using SparseMatrixT = Eigen::SparseMatrix<Scalar, Options>;
50 typedef SparseMatrixT<> SparseMatrix;
51 typedef Eigen::Triplet<Scalar> Triplet;
53 } // namespace ShapeOp
55 #endif // TYPES_H
56