/* * Eigen.hpp, part of LatAnalyze 3 * * Copyright (C) 2013 - 2016 Antonin Portelli * * LatAnalyze 3 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * LatAnalyze 3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LatAnalyze 3. If not, see . */ // Eigen inclusion #define EIGEN_DONT_PARALLELIZE #define EIGEN_MATRIXBASE_PLUGIN #include // copy/assignement from Eigen expression #define EIGEN_EXPR_CTOR(ctorName, Class, Base, ExprType) \ template \ ctorName(const ExprType &m): Base(m) {}\ template\ Class & operator=(const ExprType &m)\ {\ this->Base::operator=(m);\ return *this;\ } #define FOR_MAT(mat, i, j) \ for (Latan::Index j = 0; j < mat.cols(); ++j)\ for (Latan::Index i = 0; i < mat.rows(); ++i) BEGIN_LATAN_NAMESPACE const int dynamic = Eigen::Dynamic; // array types template using ArrayExpr = Eigen::ArrayBase; template using Array = Eigen::Array; // matrix types template using MatExpr = Eigen::MatrixBase; template using MatBase = Eigen::Matrix; template using SFMat = Eigen::Matrix; template using SDMat = Eigen::Matrix; template using SCMat = Eigen::Matrix, nRow, nCol>; // vector types template using Vec = MatBase; template using SIVec = Vec; template using SUVec = Vec; template using SFVec = Vec; template using SDVec = Vec; template using SCVec = Vec, size>; typedef SIVec IVec; typedef SUVec UVec; typedef SDVec DVec; typedef SCVec CVec; // block types template using Block = Eigen::Block; template using ConstBlock = const Eigen::Block; template using Row = typename Derived::RowXpr; template using ConstRow = typename Derived::ConstRowXpr; template using Col = typename Derived::ColXpr; template using ConstCol = typename Derived::ConstColXpr; // map type template using InnerStride = Eigen::InnerStride; template using Stride = Eigen::Stride; template > using Map = Eigen::Map; template > using ConstMap = Eigen::Map; // Index type ////////////////////////////////////////////////////////////////// typedef MatBase::Index Index; #define FOR_VEC(vec, i) for (Latan::Index i = 0; i < (vec).size(); ++i) #define FOR_ARRAY(ar, i) FOR_VEC(ar, i) END_LATAN_NAMESPACE