diff --git a/Biopool/APPS/CEmain.cc b/Biopool/APPS/CEmain.cc
new file mode 100644
index 0000000..7244d90
--- /dev/null
+++ b/Biopool/APPS/CEmain.cc
@@ -0,0 +1,189 @@
+/* This file is part of Victor.
+
+ Victor 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.
+
+ Victor 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 Victor. If not, see .
+ */
+/*
+ * Author: Alberto Tilocca
+ *
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "XyzLoader.h"
+#include
+#include
+
+#include "CEFunctions.h"
+
+using namespace Victor;using namespace Victor::Biopool;
+
+
+void sShowHelp() {
+ cout << "\n\nCE - Combinatiorial Extension -- calculate the protein structure alignment by incremental combinatorial extension of the optimal path\n"
+ << "Options: \n"
+ << "\t -i first pdb inputFile , \t \t(mandatory)\n"
+ << "\t -j second pdb inputFile, \t \t(mandatory)\n"
+ << "\t -m AFP size (defaul 8)\n"
+ << "\t -c select the chain of the first pdb file (default: first chain)\n"
+ << "\t -d select the chain of the second pdb file (default: first chain)\n"
+ << "\t -l select the model of the first pdb file\n"
+ << "\t -n select the model of the second pdb file\n"
+ << "\t -o outputFile (deafult: chainID1_chainID2.pdb)\n"
+ << "\t -v set verbose\n"
+ << "\t -h this message\n"
+ << "Usage exemple: \n"
+ << "\t CEmain -i input_1cpc.pdb -j input_1col.pdb -c L -d A \n";
+}
+
+int main(int argc, char** argv) {
+
+ if (getArg("h", argc, argv)) {
+ sShowHelp();
+ return 1;
+ }
+
+ string inputFile1;
+ string inputFile2;
+ string chainID1;
+ string chainID2;
+ int m;
+ unsigned int modelNum1;
+ unsigned int modelNum2;
+
+ // Output
+ string outputFile;
+ string outputFile2="onlyModifiedChain.pdb";
+
+ bool verbose;
+
+ // Input
+ getArg("i", inputFile1, argc, argv, "!");
+ getArg("j", inputFile2, argc, argv, "!");
+ getArg("c", chainID1, argc, argv, "!");
+ getArg("d", chainID2, argc, argv, "!");
+ getArg("m", m, argc, argv, 8);
+ getArg("l", modelNum1, argc, argv, 999);
+ getArg("n", modelNum2, argc, argv, 999);
+ verbose = getArg("v", argc, argv);
+ // Output
+ string outputFileDefault="chains"+chainID1+"_"+chainID2+".pdb";
+ getArg("o", outputFile, argc, argv, outputFileDefault);
+
+ // ---------------------------------------------------------------------- //
+
+
+ if (inputFile1 == "!" || inputFile2 == "!" ) {
+ cout << "Missing input files specification. Aborting. " << endl;
+ return -1;
+ }
+
+ ifstream inFile1(inputFile1.c_str());
+ ifstream inFile2(inputFile2.c_str());
+ // Initialize PdbLoaders
+ PdbLoader pl1(inFile1);
+ PdbLoader pl2(inFile2);
+
+ pl1.setModel(modelNum1);
+ pl2.setModel(modelNum2);
+
+ // Set chain(s) 1
+
+ if (chainID1 != "!")
+ pl1.setChain(chainID1[0]);
+ else
+ pl1.setChain(pl1.getAllChains()[0]);
+
+ // Set chain(s) 2
+ if (chainID2 != "!")
+ pl2.setChain(chainID2[0]);
+ else
+ pl2.setChain(pl2.getAllChains()[0]);
+
+ if (!verbose){
+ pl1.setNoVerbose(); // Set PdbLoader verbosity
+ pl2.setNoVerbose();
+ }
+
+ if (verbose)
+ cout << "PdbLoader set" << endl;
+
+ // Create and load the protein object
+ Protein* prot1 = new Protein ;
+ Protein* prot2 = new Protein ;
+
+ prot1->load(pl1);
+ prot2->load(pl2);
+
+
+ inFile1.close();
+ inFile2.close();
+ //Prendo gli spacer delle due catene
+
+ Spacer* sp1 = prot1->getSpacer(chainID1[0]); // Get spacer
+ Spacer* sp2 = prot2->getSpacer(chainID2[0]); // Get spacer
+
+ int dimSpacer1=(int)sp1->sizeAmino();
+ int dimSpacer2=(int)sp2->sizeAmino();
+ int combination=(m-1)*(m-2)/2; //to exclude the neighbors
+ int smaller = ( dimSpacer1 < dimSpacer2 ) ? dimSpacer1 : dimSpacer2;
+
+ //calculate the inner distances for each spacer.
+ vector > distA(dimSpacer1);//inner distance matrix chain1
+ vector > distB(dimSpacer2);//inner distance matrix chain1
+
+ for (int i = 0; i < dimSpacer1; i++)
+ distA[i].resize(dimSpacer1);
+
+ for (int i = 0; i< dimSpacer2; i++)
+ distB[i].resize(dimSpacer2);
+
+ CEFunctions::innerDistance(sp1,distA);
+ CEFunctions::innerDistance(sp2,distB);
+
+ //Calculate the score Matrix
+ vector > score(dimSpacer1);
+ for (int i = 0; i< dimSpacer1; i++)
+ score[i].resize(dimSpacer2);
+
+ CEFunctions::createSMatrix(sp1,sp2, combination, m,score,distA,distB);
+
+
+ //search of the path
+ int MAXPATH=30;
+ vector scoreBuffer(MAXPATH);
+ vector > tempPathBuffer(smaller);
+ for (int i = 0; i< smaller; i++)
+ tempPathBuffer[i].resize(smaller);
+ vector lenBuffer(MAXPATH);
+
+ CEFunctions::CESearch(sp1,sp2,tempPathBuffer, scoreBuffer,score,smaller,combination,m,distA, distB,lenBuffer);
+
+ //here I have the path
+
+ // superimposition with kabash algorithm and take the path who have the lower RMSD
+
+ int indexFinalPath = CEFunctions::finalSteps(sp1,sp2,tempPathBuffer,smaller,lenBuffer ,m,outputFile,outputFile2);
+
+ cout << "scoreCE: "<.
+ */
+/*
+ * Author: Alberto Tilocca
+ *
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "XyzLoader.h"
+#include
+#include
+#include "CEFunctions.h"
+
+
+using namespace Victor;using namespace Victor::Biopool;
+/**
+ * Constructor
+ * @param none
+ */
+CEFunctions::CEFunctions() {
+
+}
+
+/**
+ * Destructor
+ * @param none
+ */
+CEFunctions::~CEFunctions() {
+
+}
+/**
+ * calculate the distances of CA atoms of a spacer.
+ * @param Spacer* vector >&
+ */
+void CEFunctions::innerDistance(Spacer*sp ,vector >&dist ){
+
+ int len=sp->sizeAmino();
+ for (int row=0;rowgetAmino(row)[CA].distance(sp->getAmino(col)[CA]);
+
+
+}
+/**
+ * calculate the similarity matrix using a full set of inter-residue distaces, where all possibile distances except those for neighboring residues are evaluated.
+ * @param Spacer*
+ * @param Spacer*
+ * @param vector >&
+ * @param vector >&
+ * @param vector >&
+ * */
+void CEFunctions::createSMatrix(Spacer *sp1,Spacer *sp2, int combination,int m,vector > &score,vector > &distA ,vector > &distB)
+ {
+
+ int dimSpacer1=sp1->sizeAmino();
+ int dimSpacer2=sp2->sizeAmino();
+
+ for (int i=0;i >&
+ * @param vector >&
+ * @param vector >&
+ * @param int
+ * @param int
+ * @param int
+ * @param vector >
+ * @param vector >
+ * @param vector
+ * */
+ void CEFunctions::CESearch(Spacer *sp1,Spacer *sp2, vector >&tempPathBuffer,vector &scoreBuffer,vector >&score,int smaller,int combination,int m,vector > &distA,vector > &distB,vector &lenBuffer){
+
+ int D0=3; //threshold
+ int D1=4; //threshold
+ double bestScore= 1e6;
+ int MAXPATH=30;
+ int gapMax=30;
+ double bestScoreGap =1e6;
+ int bestPositionGap=-1;
+ vector bestPath(smaller);
+ vector pathCorr(smaller);
+ int bufferIndex=0;
+ int bufferSize=0;
+
+ int dimSpacer1=sp1->sizeAmino();
+ int dimSpacer2=sp2->sizeAmino();
+
+
+ for ( int i = 0; i < smaller; i++ ) {
+ bestPath[i].first = -1;
+ bestPath[i].second = -1;
+ }
+ for ( int i = 0; i < MAXPATH; i++ ) {
+ for(int j=0;j winCache(smaller);
+ for (int i=0;i index(smaller);
+ //in this matrix there will be the score releted to the gaps
+ vector > partialScoreGap(smaller);
+
+ for (int i = 0; i< smaller; i++)
+ partialScoreGap[i].resize(gapMax*2+1);
+
+ //inizialize
+ for ( int i = 0; i < smaller; i++ )
+ for ( int j = 0; j < gapMax*2+1; j++ )
+ partialScoreGap[i][j] = 1e6;
+
+ int bestLength=0;
+
+ //here start the searching
+
+ for(int i=0;idimSpacer1-m*(bestLength-1)){
+
+ break;
+ }
+ for(int j=0;j=D0 )
+ continue;
+
+ if(score[i][j]==-1 )
+ continue;
+
+ if(j> dimSpacer2 - m*(bestLength-1))
+ break;
+
+ //reset corrent path
+ for (int z=0;z dimSpacer1-m-1 || succ2 > dimSpacer2-m-1 ){
+ continue;
+ }
+ //se non รจ buono con i gap.
+ if ( score[succ1][succ2] > D0 )
+ continue;
+ // sicurezza nel caso non abbia modificato tutta la mtrice
+ if ( score[succ1][succ2] == -1.0 )
+ continue;
+
+ double scoreCorr=0.0;
+
+ //calculate formula 6
+ for(int s=0;s= D1){
+ continue;
+ }
+ //keep the best score with gaps
+
+ if( scoreCorr < bestScoreGap ){
+ pathCorr[pathLengthCorr].first =succ1;
+ pathCorr[pathLengthCorr].second=succ2;
+ bestScoreGap = scoreCorr;
+ bestPositionGap = g;
+ partialScoreGap[pathLengthCorr -1][g] = scoreCorr;
+ }
+ }//end of gapping
+ allScoreCorr =0.0;
+ double score1=0.0;
+ double score2=0.0;
+
+
+ int addGap;
+ int gap1,gap2;
+ if (bestPositionGap != -1){
+ addGap=(bestPositionGap +1)/2;
+ if ((bestPositionGap +1)%2==0){ //gap nel primo
+ gap1=pathCorr[pathLengthCorr-1].first + m + addGap;
+ gap2=pathCorr[pathLengthCorr-1].second + m;
+ }
+ else{ //gap nel secondo
+ gap1=pathCorr[pathLengthCorr-1].first + m ;
+ gap2=pathCorr[pathLengthCorr-1].second + m + addGap;
+ }
+
+ score1= (partialScoreGap[pathLengthCorr-1][bestPositionGap]
+ *m*pathLengthCorr + score[gap1][gap2]*combination)/
+ (m*pathLengthCorr+combination);
+ score2= ((pathLengthCorr>1 ? (partialScoreGap[pathLengthCorr-2][index[pathLengthCorr-1]])
+ :score[i][j])*winCache[pathLengthCorr-1]+ score1
+ * (winCache[pathLengthCorr]-winCache[pathLengthCorr-1]))
+ /winCache[pathLengthCorr];
+
+ allScoreCorr=score2;
+
+ if(allScoreCorr >D1){
+ ok=true;
+ bestPositionGap = -1;
+ break;
+
+ }
+ else {
+ partialScoreGap[pathLengthCorr-1][bestPositionGap] = allScoreCorr;
+ index[pathLengthCorr]=bestPositionGap;
+ pathLengthCorr++;
+ }
+ }
+ else{
+ //no good path with gaps
+ ok=true;
+ pathLengthCorr--;
+ break;
+ }
+
+ //if the gapped path is longer or same size but higher score keep the the gapped one.
+ if(pathLengthCorr > bestLength || (pathLengthCorr == bestLength && allScoreCorr lenBuffer[bufferIndex] ||
+ ( bestLength == lenBuffer[bufferIndex] &&
+ bestScore < scoreBuffer[bufferIndex] )){
+ bufferIndex = ( bufferIndex == MAXPATH-1 ) ? 0 : bufferIndex+1;
+ bufferSize = ( bufferSize < MAXPATH ) ? bufferSize+1 : MAXPATH;
+
+ vector pathCopy(smaller);
+ for (int i=0;i >&
+ * @param int
+ * @param vector
+ * @param int
+ * @param string
+ * @param int
+ * */
+int CEFunctions::finalSteps(Spacer *sp1,Spacer *sp2,vector >&tempPathBuffer,int smaller,vector &lenBuffer,int m,string outputFile,string outputFile2 ){
+
+ int MAXPATH=30;
+ Eigen::Matrix3Xd Matrix1;
+ Eigen::Matrix3Xd Matrix2;
+ Matrix1.resize(3,smaller);
+ Matrix2.resize(3,smaller);
+ double minRMSD=1e06;
+ int indexFinalPath;
+ Spacer *bestSp1;
+ Spacer *bestSp2;
+
+ for (int p=0;p=(int)(sp1->sizeAmino()-1))
+ end1=true;
+ if (lremoveComponentFromIndex(cnt*m);
+ iter++;
+ l++;
+ }
+ else{
+ l=l+m+cnt;
+ cnt++;
+ iter++;
+ end1=true;
+ }
+ }
+
+ //chain 2
+ end2 =false;
+ while(end2==false)
+ {
+ if (iter2>=(int)(sp2->sizeAmino()-1))
+ end2=true;
+ if (l2removeComponentFromIndex(cnt2*m);
+ iter2++;
+ l2++;
+ }
+ else{
+ l2=l2+m+cnt2;
+ cnt2++;
+ iter2++;
+ end2=true;
+ }
+ }
+ }
+ double RMSD=0.0;
+ vgVector3CaCoordsSp1;
+ vgVector3CaCoordsSp2;
+
+ for (int c=0; c< smaller;c++){
+ CaCoordsSp1 = copia1->getAmino(c)[CA].getCoords();
+ CaCoordsSp2 = copia2->getAmino(c)[CA].getCoords();
+ Matrix1(0,c)=CaCoordsSp1.x;
+ Matrix1(1,c)=CaCoordsSp1.y;
+ Matrix1(2,c)=CaCoordsSp1.z;
+ Matrix2(0,c)=CaCoordsSp2.x;
+ Matrix2(1,c)=CaCoordsSp2.y;
+ Matrix2(2,c)=CaCoordsSp2.z;
+ }
+
+ vgMatrix3 vgMat;
+ vgVector3vgVet;
+ //apply kabasch for the first time
+ Eigen::Affine3d A= Find3DAffineTransform(Matrix2,Matrix1);
+ //coordinates of rototaion matrix in victor format
+ vgMat.x.x=A.rotation().coeff(0,0);
+ vgMat.x.y=A.rotation().coeff(0,1);
+ vgMat.x.z=A.rotation().coeff(0,2);
+ vgMat.y.x=A.rotation().coeff(1,0);
+ vgMat.y.y=A.rotation().coeff(1,1);
+ vgMat.y.z=A.rotation().coeff(1,2);
+ vgMat.z.x=A.rotation().coeff(2,0);
+ vgMat.z.y=A.rotation().coeff(2,1);
+ vgMat.z.z=A.rotation().coeff(2,2);
+
+ //coordinates of rototaion matrix in victor format
+ vgVet.x=A.translation().coeff(0);
+ vgVet.y=A.translation().coeff(1);
+ vgVet.z=A.translation().coeff(2);
+
+ //apply rotation
+ copia2->getAmino(0)[CA].addRot(vgMat);
+ copia2->sync();
+
+ //new coordinates after ONLY rotation
+ for (int c=0; c< smaller;c++)
+ {
+ CaCoordsSp2 = copia2->getAmino(c)[CA].getCoords();
+ Matrix2(0,c)=CaCoordsSp2.x;
+ Matrix2(1,c)=CaCoordsSp2.y;
+ Matrix2(2,c)=CaCoordsSp2.z;
+ }
+
+ //again Kabash after applied rotation
+ A= Find3DAffineTransform(Matrix2,Matrix1);
+
+ //Victor format
+ vgVet.x=A.translation().coeff(0);
+ vgVet.y=A.translation().coeff(1);
+ vgVet.z=A.translation().coeff(2);
+
+ //apply translation
+ copia2->getAmino(0)[CA].addTrans(vgVet);
+ copia2->sync();
+ //calculate RMSD
+ for (int i=0; igetAmino(i)[CA].distance(copia2->getAmino(i)[CA]),2);
+ RMSD= sqrt((RMSD/smaller));
+
+ if (RMSDsave(ps);
+ outFile <<"ENDMDL"<save(ps);
+ outFile <<"ENDMDL"<save(ps2);
+ outFile.close();
+ cout<<"The pdb file has been created."<.
+ */
+/*
+ * Author: Alberto Tilocca
+ *
+ */
+#ifndef CEFUNCTIONS_H
+#define CEFUNCTIONS_H
+
+typedef struct {
+ int first;
+ int second;
+} afp;
+namespace Victor {
+ namespace Biopool {
+ class CEFunctions {
+ public:
+ //CONSTRUCTOR/DESTRUCTOR
+ CEFunctions();
+ ~CEFunctions();
+ static void stampa();
+ static void innerDistance(Spacer* ,vector >& );
+ static void createSMatrix(Spacer* ,Spacer*, int ,int ,vector >&,vector >& ,vector >&);
+ static void CESearch(Spacer*,Spacer*, vector >&,vector&,vector >&,int ,int,int,vector >&,vector >&,vector&);
+ static int finalSteps(Spacer*,Spacer*,vector >&,int ,vector&,int ,string ,string );
+
+
+ protected:
+
+ private:
+
+ };
+ }
+}
+
+#endif /* CEFUNCTIONS_H */
+
diff --git a/tools/Eigen/Array b/tools/Eigen/Array
new file mode 100644
index 0000000..3d004fb
--- /dev/null
+++ b/tools/Eigen/Array
@@ -0,0 +1,11 @@
+#ifndef EIGEN_ARRAY_MODULE_H
+#define EIGEN_ARRAY_MODULE_H
+
+// include Core first to handle Eigen2 support macros
+#include "Core"
+
+#ifndef EIGEN2_SUPPORT
+ #error The Eigen/Array header does no longer exist in Eigen3. All that functionality has moved to Eigen/Core.
+#endif
+
+#endif // EIGEN_ARRAY_MODULE_H
diff --git a/tools/Eigen/CMakeLists.txt b/tools/Eigen/CMakeLists.txt
new file mode 100644
index 0000000..a92dd6f
--- /dev/null
+++ b/tools/Eigen/CMakeLists.txt
@@ -0,0 +1,19 @@
+include(RegexUtils)
+test_escape_string_as_regex()
+
+file(GLOB Eigen_directory_files "*")
+
+escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+
+foreach(f ${Eigen_directory_files})
+ if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src")
+ list(APPEND Eigen_directory_files_to_install ${f})
+ endif()
+endforeach(f ${Eigen_directory_files})
+
+install(FILES
+ ${Eigen_directory_files_to_install}
+ DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel
+ )
+
+add_subdirectory(src)
diff --git a/tools/Eigen/Cholesky b/tools/Eigen/Cholesky
new file mode 100644
index 0000000..f727f5d
--- /dev/null
+++ b/tools/Eigen/Cholesky
@@ -0,0 +1,32 @@
+#ifndef EIGEN_CHOLESKY_MODULE_H
+#define EIGEN_CHOLESKY_MODULE_H
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/** \defgroup Cholesky_Module Cholesky module
+ *
+ *
+ *
+ * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
+ * Those decompositions are accessible via the following MatrixBase methods:
+ * - MatrixBase::llt(),
+ * - MatrixBase::ldlt()
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/misc/Solve.h"
+#include "src/Cholesky/LLT.h"
+#include "src/Cholesky/LDLT.h"
+#ifdef EIGEN_USE_LAPACKE
+#include "src/Cholesky/LLT_MKL.h"
+#endif
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_CHOLESKY_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/tools/Eigen/CholmodSupport b/tools/Eigen/CholmodSupport
new file mode 100644
index 0000000..88c29a6
--- /dev/null
+++ b/tools/Eigen/CholmodSupport
@@ -0,0 +1,45 @@
+#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H
+#define EIGEN_CHOLMODSUPPORT_MODULE_H
+
+#include "SparseCore"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+extern "C" {
+ #include
+}
+
+/** \ingroup Support_modules
+ * \defgroup CholmodSupport_Module CholmodSupport module
+ *
+ * This module provides an interface to the Cholmod library which is part of the suitesparse package.
+ * It provides the two following main factorization classes:
+ * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization.
+ * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial).
+ *
+ * For the sake of completeness, this module also propose the two following classes:
+ * - class CholmodSimplicialLLT
+ * - class CholmodSimplicialLDLT
+ * Note that these classes does not bring any particular advantage compared to the built-in
+ * SimplicialLLT and SimplicialLDLT factorization classes.
+ *
+ * \code
+ * #include
+ * \endcode
+ *
+ * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies.
+ * The dependencies depend on how cholmod has been compiled.
+ * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task.
+ *
+ */
+
+#include "src/misc/Solve.h"
+#include "src/misc/SparseSolve.h"
+
+#include "src/CholmodSupport/CholmodSupport.h"
+
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_CHOLMODSUPPORT_MODULE_H
+
diff --git a/tools/Eigen/Core b/tools/Eigen/Core
new file mode 100644
index 0000000..509c529
--- /dev/null
+++ b/tools/Eigen/Core
@@ -0,0 +1,376 @@
+// This file is part of Eigen, a lightweight C++ template library
+// for linear algebra.
+//
+// Copyright (C) 2008 Gael Guennebaud
+// Copyright (C) 2007-2011 Benoit Jacob
+//
+// This Source Code Form is subject to the terms of the Mozilla
+// Public License v. 2.0. If a copy of the MPL was not distributed
+// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef EIGEN_CORE_H
+#define EIGEN_CORE_H
+
+// first thing Eigen does: stop the compiler from committing suicide
+#include "src/Core/util/DisableStupidWarnings.h"
+
+// then include this file where all our macros are defined. It's really important to do it first because
+// it's where we do all the alignment settings (platform detection and honoring the user's will if he
+// defined e.g. EIGEN_DONT_ALIGN) so it needs to be done before we do anything with vectorization.
+#include "src/Core/util/Macros.h"
+
+// Disable the ipa-cp-clone optimization flag with MinGW 6.x or newer (enabled by default with -O3)
+// See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details.
+#if defined(__MINGW32__) && EIGEN_GNUC_AT_LEAST(4,6)
+ #pragma GCC optimize ("-fno-ipa-cp-clone")
+#endif
+
+#include
+
+// this include file manages BLAS and MKL related macros
+// and inclusion of their respective header files
+#include "src/Core/util/MKL_support.h"
+
+// if alignment is disabled, then disable vectorization. Note: EIGEN_ALIGN is the proper check, it takes into
+// account both the user's will (EIGEN_DONT_ALIGN) and our own platform checks
+#if !EIGEN_ALIGN
+ #ifndef EIGEN_DONT_VECTORIZE
+ #define EIGEN_DONT_VECTORIZE
+ #endif
+#endif
+
+#ifdef _MSC_VER
+ #include // for _aligned_malloc -- need it regardless of whether vectorization is enabled
+ #if (_MSC_VER >= 1500) // 2008 or later
+ // Remember that usage of defined() in a #define is undefined by the standard.
+ // a user reported that in 64-bit mode, MSVC doesn't care to define _M_IX86_FP.
+ #if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(_M_X64)
+ #define EIGEN_SSE2_ON_MSVC_2008_OR_LATER
+ #endif
+ #endif
+#else
+ // Remember that usage of defined() in a #define is undefined by the standard
+ #if (defined __SSE2__) && ( (!defined __GNUC__) || (defined __INTEL_COMPILER) || EIGEN_GNUC_AT_LEAST(4,2) )
+ #define EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC
+ #endif
+#endif
+
+#ifndef EIGEN_DONT_VECTORIZE
+
+ #if defined (EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)
+
+ // Defines symbols for compile-time detection of which instructions are
+ // used.
+ // EIGEN_VECTORIZE_YY is defined if and only if the instruction set YY is used
+ #define EIGEN_VECTORIZE
+ #define EIGEN_VECTORIZE_SSE
+ #define EIGEN_VECTORIZE_SSE2
+
+ // Detect sse3/ssse3/sse4:
+ // gcc and icc defines __SSE3__, ...
+ // there is no way to know about this on msvc. You can define EIGEN_VECTORIZE_SSE* if you
+ // want to force the use of those instructions with msvc.
+ #ifdef __SSE3__
+ #define EIGEN_VECTORIZE_SSE3
+ #endif
+ #ifdef __SSSE3__
+ #define EIGEN_VECTORIZE_SSSE3
+ #endif
+ #ifdef __SSE4_1__
+ #define EIGEN_VECTORIZE_SSE4_1
+ #endif
+ #ifdef __SSE4_2__
+ #define EIGEN_VECTORIZE_SSE4_2
+ #endif
+
+ // include files
+
+ // This extern "C" works around a MINGW-w64 compilation issue
+ // https://sourceforge.net/tracker/index.php?func=detail&aid=3018394&group_id=202880&atid=983354
+ // In essence, intrin.h is included by windows.h and also declares intrinsics (just as emmintrin.h etc. below do).
+ // However, intrin.h uses an extern "C" declaration, and g++ thus complains of duplicate declarations
+ // with conflicting linkage. The linkage for intrinsics doesn't matter, but at that stage the compiler doesn't know;
+ // so, to avoid compile errors when windows.h is included after Eigen/Core, ensure intrinsics are extern "C" here too.
+ // notice that since these are C headers, the extern "C" is theoretically needed anyways.
+ extern "C" {
+ // In theory we should only include immintrin.h and not the other *mmintrin.h header files directly.
+ // Doing so triggers some issues with ICC. However old gcc versions seems to not have this file, thus:
+ #if defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1110
+ #include
+ #else
+ #include
+ #include
+ #ifdef EIGEN_VECTORIZE_SSE3
+ #include
+ #endif
+ #ifdef EIGEN_VECTORIZE_SSSE3
+ #include
+ #endif
+ #ifdef EIGEN_VECTORIZE_SSE4_1
+ #include
+ #endif
+ #ifdef EIGEN_VECTORIZE_SSE4_2
+ #include
+ #endif
+ #endif
+ } // end extern "C"
+ #elif defined __ALTIVEC__
+ #define EIGEN_VECTORIZE
+ #define EIGEN_VECTORIZE_ALTIVEC
+ #include
+ // We need to #undef all these ugly tokens defined in
+ // => use __vector instead of vector
+ #undef bool
+ #undef vector
+ #undef pixel
+ #elif defined __ARM_NEON
+ #define EIGEN_VECTORIZE
+ #define EIGEN_VECTORIZE_NEON
+ #include
+ #endif
+#endif
+
+#if (defined _OPENMP) && (!defined EIGEN_DONT_PARALLELIZE)
+ #define EIGEN_HAS_OPENMP
+#endif
+
+#ifdef EIGEN_HAS_OPENMP
+#include
+#endif
+
+// MSVC for windows mobile does not have the errno.h file
+#if !(defined(_MSC_VER) && defined(_WIN32_WCE)) && !defined(__ARMCC_VERSION)
+#define EIGEN_HAS_ERRNO
+#endif
+
+#ifdef EIGEN_HAS_ERRNO
+#include
+#endif
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include // for CHAR_BIT
+// for min/max:
+#include
+
+// for outputting debug info
+#ifdef EIGEN_DEBUG_ASSIGN
+#include
+#endif
+
+// required for __cpuid, needs to be included after cmath
+#if defined(_MSC_VER) && (defined(_M_IX86)||defined(_M_X64)) && (!defined(_WIN32_WCE))
+ #include
+#endif
+
+#if defined(_CPPUNWIND) || defined(__EXCEPTIONS)
+ #define EIGEN_EXCEPTIONS
+#endif
+
+#ifdef EIGEN_EXCEPTIONS
+ #include
+#endif
+
+/** \brief Namespace containing all symbols from the %Eigen library. */
+namespace Eigen {
+
+inline static const char *SimdInstructionSetsInUse(void) {
+#if defined(EIGEN_VECTORIZE_SSE4_2)
+ return "SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
+#elif defined(EIGEN_VECTORIZE_SSE4_1)
+ return "SSE, SSE2, SSE3, SSSE3, SSE4.1";
+#elif defined(EIGEN_VECTORIZE_SSSE3)
+ return "SSE, SSE2, SSE3, SSSE3";
+#elif defined(EIGEN_VECTORIZE_SSE3)
+ return "SSE, SSE2, SSE3";
+#elif defined(EIGEN_VECTORIZE_SSE2)
+ return "SSE, SSE2";
+#elif defined(EIGEN_VECTORIZE_ALTIVEC)
+ return "AltiVec";
+#elif defined(EIGEN_VECTORIZE_NEON)
+ return "ARM NEON";
+#else
+ return "None";
+#endif
+}
+
+} // end namespace Eigen
+
+#define STAGE10_FULL_EIGEN2_API 10
+#define STAGE20_RESOLVE_API_CONFLICTS 20
+#define STAGE30_FULL_EIGEN3_API 30
+#define STAGE40_FULL_EIGEN3_STRICTNESS 40
+#define STAGE99_NO_EIGEN2_SUPPORT 99
+
+#if defined EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS
+ #define EIGEN2_SUPPORT
+ #define EIGEN2_SUPPORT_STAGE STAGE40_FULL_EIGEN3_STRICTNESS
+#elif defined EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API
+ #define EIGEN2_SUPPORT
+ #define EIGEN2_SUPPORT_STAGE STAGE30_FULL_EIGEN3_API
+#elif defined EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS
+ #define EIGEN2_SUPPORT
+ #define EIGEN2_SUPPORT_STAGE STAGE20_RESOLVE_API_CONFLICTS
+#elif defined EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API
+ #define EIGEN2_SUPPORT
+ #define EIGEN2_SUPPORT_STAGE STAGE10_FULL_EIGEN2_API
+#elif defined EIGEN2_SUPPORT
+ // default to stage 3, that's what it's always meant
+ #define EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API
+ #define EIGEN2_SUPPORT_STAGE STAGE30_FULL_EIGEN3_API
+#else
+ #define EIGEN2_SUPPORT_STAGE STAGE99_NO_EIGEN2_SUPPORT
+#endif
+
+#ifdef EIGEN2_SUPPORT
+#undef minor
+#endif
+
+// we use size_t frequently and we'll never remember to prepend it with std:: everytime just to
+// ensure QNX/QCC support
+using std::size_t;
+// gcc 4.6.0 wants std:: for ptrdiff_t
+using std::ptrdiff_t;
+
+/** \defgroup Core_Module Core module
+ * This is the main module of Eigen providing dense matrix and vector support
+ * (both fixed and dynamic size) with all the features corresponding to a BLAS library
+ * and much more...
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/Core/util/Constants.h"
+#include "src/Core/util/ForwardDeclarations.h"
+#include "src/Core/util/Meta.h"
+#include "src/Core/util/StaticAssert.h"
+#include "src/Core/util/XprHelper.h"
+#include "src/Core/util/Memory.h"
+
+#include "src/Core/NumTraits.h"
+#include "src/Core/MathFunctions.h"
+#include "src/Core/GenericPacketMath.h"
+
+#if defined EIGEN_VECTORIZE_SSE
+ #include "src/Core/arch/SSE/PacketMath.h"
+ #include "src/Core/arch/SSE/MathFunctions.h"
+ #include "src/Core/arch/SSE/Complex.h"
+#elif defined EIGEN_VECTORIZE_ALTIVEC
+ #include "src/Core/arch/AltiVec/PacketMath.h"
+ #include "src/Core/arch/AltiVec/Complex.h"
+#elif defined EIGEN_VECTORIZE_NEON
+ #include "src/Core/arch/NEON/PacketMath.h"
+ #include "src/Core/arch/NEON/Complex.h"
+#endif
+
+#include "src/Core/arch/Default/Settings.h"
+
+#include "src/Core/Functors.h"
+#include "src/Core/DenseCoeffsBase.h"
+#include "src/Core/DenseBase.h"
+#include "src/Core/MatrixBase.h"
+#include "src/Core/EigenBase.h"
+
+#ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874
+ // at least confirmed with Doxygen 1.5.5 and 1.5.6
+ #include "src/Core/Assign.h"
+#endif
+
+#include "src/Core/util/BlasUtil.h"
+#include "src/Core/DenseStorage.h"
+#include "src/Core/NestByValue.h"
+#include "src/Core/ForceAlignedAccess.h"
+#include "src/Core/ReturnByValue.h"
+#include "src/Core/NoAlias.h"
+#include "src/Core/PlainObjectBase.h"
+#include "src/Core/Matrix.h"
+#include "src/Core/Array.h"
+#include "src/Core/CwiseBinaryOp.h"
+#include "src/Core/CwiseUnaryOp.h"
+#include "src/Core/CwiseNullaryOp.h"
+#include "src/Core/CwiseUnaryView.h"
+#include "src/Core/SelfCwiseBinaryOp.h"
+#include "src/Core/Dot.h"
+#include "src/Core/StableNorm.h"
+#include "src/Core/MapBase.h"
+#include "src/Core/Stride.h"
+#include "src/Core/Map.h"
+#include "src/Core/Block.h"
+#include "src/Core/VectorBlock.h"
+#include "src/Core/Ref.h"
+#include "src/Core/Transpose.h"
+#include "src/Core/DiagonalMatrix.h"
+#include "src/Core/Diagonal.h"
+#include "src/Core/DiagonalProduct.h"
+#include "src/Core/PermutationMatrix.h"
+#include "src/Core/Transpositions.h"
+#include "src/Core/Redux.h"
+#include "src/Core/Visitor.h"
+#include "src/Core/Fuzzy.h"
+#include "src/Core/IO.h"
+#include "src/Core/Swap.h"
+#include "src/Core/CommaInitializer.h"
+#include "src/Core/Flagged.h"
+#include "src/Core/ProductBase.h"
+#include "src/Core/GeneralProduct.h"
+#include "src/Core/TriangularMatrix.h"
+#include "src/Core/SelfAdjointView.h"
+#include "src/Core/products/GeneralBlockPanelKernel.h"
+#include "src/Core/products/Parallelizer.h"
+#include "src/Core/products/CoeffBasedProduct.h"
+#include "src/Core/products/GeneralMatrixVector.h"
+#include "src/Core/products/GeneralMatrixMatrix.h"
+#include "src/Core/SolveTriangular.h"
+#include "src/Core/products/GeneralMatrixMatrixTriangular.h"
+#include "src/Core/products/SelfadjointMatrixVector.h"
+#include "src/Core/products/SelfadjointMatrixMatrix.h"
+#include "src/Core/products/SelfadjointProduct.h"
+#include "src/Core/products/SelfadjointRank2Update.h"
+#include "src/Core/products/TriangularMatrixVector.h"
+#include "src/Core/products/TriangularMatrixMatrix.h"
+#include "src/Core/products/TriangularSolverMatrix.h"
+#include "src/Core/products/TriangularSolverVector.h"
+#include "src/Core/BandMatrix.h"
+#include "src/Core/CoreIterators.h"
+
+#include "src/Core/BooleanRedux.h"
+#include "src/Core/Select.h"
+#include "src/Core/VectorwiseOp.h"
+#include "src/Core/Random.h"
+#include "src/Core/Replicate.h"
+#include "src/Core/Reverse.h"
+#include "src/Core/ArrayBase.h"
+#include "src/Core/ArrayWrapper.h"
+
+#ifdef EIGEN_USE_BLAS
+#include "src/Core/products/GeneralMatrixMatrix_MKL.h"
+#include "src/Core/products/GeneralMatrixVector_MKL.h"
+#include "src/Core/products/GeneralMatrixMatrixTriangular_MKL.h"
+#include "src/Core/products/SelfadjointMatrixMatrix_MKL.h"
+#include "src/Core/products/SelfadjointMatrixVector_MKL.h"
+#include "src/Core/products/TriangularMatrixMatrix_MKL.h"
+#include "src/Core/products/TriangularMatrixVector_MKL.h"
+#include "src/Core/products/TriangularSolverMatrix_MKL.h"
+#endif // EIGEN_USE_BLAS
+
+#ifdef EIGEN_USE_MKL_VML
+#include "src/Core/Assign_MKL.h"
+#endif
+
+#include "src/Core/GlobalFunctions.h"
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#ifdef EIGEN2_SUPPORT
+#include "Eigen2Support"
+#endif
+
+#endif // EIGEN_CORE_H
diff --git a/tools/Eigen/Dense b/tools/Eigen/Dense
new file mode 100644
index 0000000..5768910
--- /dev/null
+++ b/tools/Eigen/Dense
@@ -0,0 +1,7 @@
+#include "Core"
+#include "LU"
+#include "Cholesky"
+#include "QR"
+#include "SVD"
+#include "Geometry"
+#include "Eigenvalues"
diff --git a/tools/Eigen/Eigen b/tools/Eigen/Eigen
new file mode 100644
index 0000000..19b40ea
--- /dev/null
+++ b/tools/Eigen/Eigen
@@ -0,0 +1,2 @@
+#include "Dense"
+//#include "Sparse"
diff --git a/tools/Eigen/Eigen2Support b/tools/Eigen/Eigen2Support
new file mode 100644
index 0000000..6aa009d
--- /dev/null
+++ b/tools/Eigen/Eigen2Support
@@ -0,0 +1,95 @@
+// This file is part of Eigen, a lightweight C++ template library
+// for linear algebra.
+//
+// Copyright (C) 2009 Gael Guennebaud
+//
+// This Source Code Form is subject to the terms of the Mozilla
+// Public License v. 2.0. If a copy of the MPL was not distributed
+// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef EIGEN2SUPPORT_H
+#define EIGEN2SUPPORT_H
+
+#if (!defined(EIGEN2_SUPPORT)) || (!defined(EIGEN_CORE_H))
+#error Eigen2 support must be enabled by defining EIGEN2_SUPPORT before including any Eigen header
+#endif
+
+#ifndef EIGEN_NO_EIGEN2_DEPRECATED_WARNING
+
+#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
+#warning "Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3. (Define EIGEN_NO_EIGEN2_DEPRECATED_WARNING to disable this warning)"
+#else
+#pragma message ("Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3. (Define EIGEN_NO_EIGEN2_DEPRECATED_WARNING to disable this warning)")
+#endif
+
+#endif // EIGEN_NO_EIGEN2_DEPRECATED_WARNING
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/** \ingroup Support_modules
+ * \defgroup Eigen2Support_Module Eigen2 support module
+ *
+ * \warning Eigen2 support is deprecated in Eigen 3.2.x and it will be removed in Eigen 3.3.
+ *
+ * This module provides a couple of deprecated functions improving the compatibility with Eigen2.
+ *
+ * To use it, define EIGEN2_SUPPORT before including any Eigen header
+ * \code
+ * #define EIGEN2_SUPPORT
+ * \endcode
+ *
+ */
+
+#include "src/Eigen2Support/Macros.h"
+#include "src/Eigen2Support/Memory.h"
+#include "src/Eigen2Support/Meta.h"
+#include "src/Eigen2Support/Lazy.h"
+#include "src/Eigen2Support/Cwise.h"
+#include "src/Eigen2Support/CwiseOperators.h"
+#include "src/Eigen2Support/TriangularSolver.h"
+#include "src/Eigen2Support/Block.h"
+#include "src/Eigen2Support/VectorBlock.h"
+#include "src/Eigen2Support/Minor.h"
+#include "src/Eigen2Support/MathFunctions.h"
+
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+// Eigen2 used to include iostream
+#include
+
+#define EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \
+using Eigen::Matrix##SizeSuffix##TypeSuffix; \
+using Eigen::Vector##SizeSuffix##TypeSuffix; \
+using Eigen::RowVector##SizeSuffix##TypeSuffix;
+
+#define EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(TypeSuffix) \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \
+
+#define EIGEN_USING_MATRIX_TYPEDEFS \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(i) \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(f) \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(d) \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(cf) \
+EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(cd)
+
+#define USING_PART_OF_NAMESPACE_EIGEN \
+EIGEN_USING_MATRIX_TYPEDEFS \
+using Eigen::Matrix; \
+using Eigen::MatrixBase; \
+using Eigen::ei_random; \
+using Eigen::ei_real; \
+using Eigen::ei_imag; \
+using Eigen::ei_conj; \
+using Eigen::ei_abs; \
+using Eigen::ei_abs2; \
+using Eigen::ei_sqrt; \
+using Eigen::ei_exp; \
+using Eigen::ei_log; \
+using Eigen::ei_sin; \
+using Eigen::ei_cos;
+
+#endif // EIGEN2SUPPORT_H
diff --git a/tools/Eigen/Eigenvalues b/tools/Eigen/Eigenvalues
new file mode 100644
index 0000000..53c5a73
--- /dev/null
+++ b/tools/Eigen/Eigenvalues
@@ -0,0 +1,48 @@
+#ifndef EIGEN_EIGENVALUES_MODULE_H
+#define EIGEN_EIGENVALUES_MODULE_H
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+#include "Cholesky"
+#include "Jacobi"
+#include "Householder"
+#include "LU"
+#include "Geometry"
+
+/** \defgroup Eigenvalues_Module Eigenvalues module
+ *
+ *
+ *
+ * This module mainly provides various eigenvalue solvers.
+ * This module also provides some MatrixBase methods, including:
+ * - MatrixBase::eigenvalues(),
+ * - MatrixBase::operatorNorm()
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/Eigenvalues/Tridiagonalization.h"
+#include "src/Eigenvalues/RealSchur.h"
+#include "src/Eigenvalues/EigenSolver.h"
+#include "src/Eigenvalues/SelfAdjointEigenSolver.h"
+#include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h"
+#include "src/Eigenvalues/HessenbergDecomposition.h"
+#include "src/Eigenvalues/ComplexSchur.h"
+#include "src/Eigenvalues/ComplexEigenSolver.h"
+#include "src/Eigenvalues/RealQZ.h"
+#include "src/Eigenvalues/GeneralizedEigenSolver.h"
+#include "src/Eigenvalues/MatrixBaseEigenvalues.h"
+#ifdef EIGEN_USE_LAPACKE
+#include "src/Eigenvalues/RealSchur_MKL.h"
+#include "src/Eigenvalues/ComplexSchur_MKL.h"
+#include "src/Eigenvalues/SelfAdjointEigenSolver_MKL.h"
+#endif
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_EIGENVALUES_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/tools/Eigen/Geometry b/tools/Eigen/Geometry
new file mode 100644
index 0000000..efd9d45
--- /dev/null
+++ b/tools/Eigen/Geometry
@@ -0,0 +1,63 @@
+#ifndef EIGEN_GEOMETRY_MODULE_H
+#define EIGEN_GEOMETRY_MODULE_H
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+#include "SVD"
+#include "LU"
+#include
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+/** \defgroup Geometry_Module Geometry module
+ *
+ *
+ *
+ * This module provides support for:
+ * - fixed-size homogeneous transformations
+ * - translation, scaling, 2D and 3D rotations
+ * - quaternions
+ * - \ref MatrixBase::cross() "cross product"
+ * - \ref MatrixBase::unitOrthogonal() "orthognal vector generation"
+ * - some linear components: parametrized-lines and hyperplanes
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/Geometry/OrthoMethods.h"
+#include "src/Geometry/EulerAngles.h"
+
+#if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS
+ #include "src/Geometry/Homogeneous.h"
+ #include "src/Geometry/RotationBase.h"
+ #include "src/Geometry/Rotation2D.h"
+ #include "src/Geometry/Quaternion.h"
+ #include "src/Geometry/AngleAxis.h"
+ #include "src/Geometry/Transform.h"
+ #include "src/Geometry/Translation.h"
+ #include "src/Geometry/Scaling.h"
+ #include "src/Geometry/Hyperplane.h"
+ #include "src/Geometry/ParametrizedLine.h"
+ #include "src/Geometry/AlignedBox.h"
+ #include "src/Geometry/Umeyama.h"
+
+ #if defined EIGEN_VECTORIZE_SSE
+ #include "src/Geometry/arch/Geometry_SSE.h"
+ #endif
+#endif
+
+#ifdef EIGEN2_SUPPORT
+#include "src/Eigen2Support/Geometry/All.h"
+#endif
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_GEOMETRY_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
+
diff --git a/tools/Eigen/Householder b/tools/Eigen/Householder
new file mode 100644
index 0000000..6e348db
--- /dev/null
+++ b/tools/Eigen/Householder
@@ -0,0 +1,23 @@
+#ifndef EIGEN_HOUSEHOLDER_MODULE_H
+#define EIGEN_HOUSEHOLDER_MODULE_H
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/** \defgroup Householder_Module Householder module
+ * This module provides Householder transformations.
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/Householder/Householder.h"
+#include "src/Householder/HouseholderSequence.h"
+#include "src/Householder/BlockHouseholder.h"
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_HOUSEHOLDER_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/tools/Eigen/IterativeLinearSolvers b/tools/Eigen/IterativeLinearSolvers
new file mode 100644
index 0000000..0f4159d
--- /dev/null
+++ b/tools/Eigen/IterativeLinearSolvers
@@ -0,0 +1,40 @@
+#ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
+#define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
+
+#include "SparseCore"
+#include "OrderingMethods"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/**
+ * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module
+ *
+ * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse.
+ * Those solvers are accessible via the following classes:
+ * - ConjugateGradient for selfadjoint (hermitian) matrices,
+ * - BiCGSTAB for general square matrices.
+ *
+ * These iterative solvers are associated with some preconditioners:
+ * - IdentityPreconditioner - not really useful
+ * - DiagonalPreconditioner - also called JAcobi preconditioner, work very well on diagonal dominant matrices.
+ * - IncompleteILUT - incomplete LU factorization with dual thresholding
+ *
+ * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport.
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/misc/Solve.h"
+#include "src/misc/SparseSolve.h"
+
+#include "src/IterativeLinearSolvers/IterativeSolverBase.h"
+#include "src/IterativeLinearSolvers/BasicPreconditioners.h"
+#include "src/IterativeLinearSolvers/ConjugateGradient.h"
+#include "src/IterativeLinearSolvers/BiCGSTAB.h"
+#include "src/IterativeLinearSolvers/IncompleteLUT.h"
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
diff --git a/tools/Eigen/Jacobi b/tools/Eigen/Jacobi
new file mode 100644
index 0000000..ba8a4dc
--- /dev/null
+++ b/tools/Eigen/Jacobi
@@ -0,0 +1,26 @@
+#ifndef EIGEN_JACOBI_MODULE_H
+#define EIGEN_JACOBI_MODULE_H
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/** \defgroup Jacobi_Module Jacobi module
+ * This module provides Jacobi and Givens rotations.
+ *
+ * \code
+ * #include
+ * \endcode
+ *
+ * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation:
+ * - MatrixBase::applyOnTheLeft()
+ * - MatrixBase::applyOnTheRight().
+ */
+
+#include "src/Jacobi/Jacobi.h"
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_JACOBI_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
+
diff --git a/tools/Eigen/LU b/tools/Eigen/LU
new file mode 100644
index 0000000..db57955
--- /dev/null
+++ b/tools/Eigen/LU
@@ -0,0 +1,41 @@
+#ifndef EIGEN_LU_MODULE_H
+#define EIGEN_LU_MODULE_H
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/** \defgroup LU_Module LU module
+ * This module includes %LU decomposition and related notions such as matrix inversion and determinant.
+ * This module defines the following MatrixBase methods:
+ * - MatrixBase::inverse()
+ * - MatrixBase::determinant()
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/misc/Solve.h"
+#include "src/misc/Kernel.h"
+#include "src/misc/Image.h"
+#include "src/LU/FullPivLU.h"
+#include "src/LU/PartialPivLU.h"
+#ifdef EIGEN_USE_LAPACKE
+#include "src/LU/PartialPivLU_MKL.h"
+#endif
+#include "src/LU/Determinant.h"
+#include "src/LU/Inverse.h"
+
+#if defined EIGEN_VECTORIZE_SSE
+ #include "src/LU/arch/Inverse_SSE.h"
+#endif
+
+#ifdef EIGEN2_SUPPORT
+ #include "src/Eigen2Support/LU.h"
+#endif
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_LU_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/tools/Eigen/LeastSquares b/tools/Eigen/LeastSquares
new file mode 100644
index 0000000..35137c2
--- /dev/null
+++ b/tools/Eigen/LeastSquares
@@ -0,0 +1,32 @@
+#ifndef EIGEN_REGRESSION_MODULE_H
+#define EIGEN_REGRESSION_MODULE_H
+
+#ifndef EIGEN2_SUPPORT
+#error LeastSquares is only available in Eigen2 support mode (define EIGEN2_SUPPORT)
+#endif
+
+// exclude from normal eigen3-only documentation
+#ifdef EIGEN2_SUPPORT
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+#include "Eigenvalues"
+#include "Geometry"
+
+/** \defgroup LeastSquares_Module LeastSquares module
+ * This module provides linear regression and related features.
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/Eigen2Support/LeastSquares.h"
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN2_SUPPORT
+
+#endif // EIGEN_REGRESSION_MODULE_H
diff --git a/tools/Eigen/MetisSupport b/tools/Eigen/MetisSupport
new file mode 100644
index 0000000..6a113f7
--- /dev/null
+++ b/tools/Eigen/MetisSupport
@@ -0,0 +1,28 @@
+#ifndef EIGEN_METISSUPPORT_MODULE_H
+#define EIGEN_METISSUPPORT_MODULE_H
+
+#include "SparseCore"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+extern "C" {
+#include
+}
+
+
+/** \ingroup Support_modules
+ * \defgroup MetisSupport_Module MetisSupport module
+ *
+ * \code
+ * #include
+ * \endcode
+ * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis).
+ * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink
+ */
+
+
+#include "src/MetisSupport/MetisSupport.h"
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_METISSUPPORT_MODULE_H
diff --git a/tools/Eigen/OrderingMethods b/tools/Eigen/OrderingMethods
new file mode 100644
index 0000000..7c0f1ff
--- /dev/null
+++ b/tools/Eigen/OrderingMethods
@@ -0,0 +1,66 @@
+#ifndef EIGEN_ORDERINGMETHODS_MODULE_H
+#define EIGEN_ORDERINGMETHODS_MODULE_H
+
+#include "SparseCore"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/**
+ * \defgroup OrderingMethods_Module OrderingMethods module
+ *
+ * This module is currently for internal use only
+ *
+ * It defines various built-in and external ordering methods for sparse matrices.
+ * They are typically used to reduce the number of elements during
+ * the sparse matrix decomposition (LLT, LU, QR).
+ * Precisely, in a preprocessing step, a permutation matrix P is computed using
+ * those ordering methods and applied to the columns of the matrix.
+ * Using for instance the sparse Cholesky decomposition, it is expected that
+ * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A).
+ *
+ *
+ * Usage :
+ * \code
+ * #include
+ * \endcode
+ *
+ * A simple usage is as a template parameter in the sparse decomposition classes :
+ *
+ * \code
+ * SparseLU > solver;
+ * \endcode
+ *
+ * \code
+ * SparseQR > solver;
+ * \endcode
+ *
+ * It is possible as well to call directly a particular ordering method for your own purpose,
+ * \code
+ * AMDOrdering ordering;
+ * PermutationMatrix perm;
+ * SparseMatrix A;
+ * //Fill the matrix ...
+ *
+ * ordering(A, perm); // Call AMD
+ * \endcode
+ *
+ * \note Some of these methods (like AMD or METIS), need the sparsity pattern
+ * of the input matrix to be symmetric. When the matrix is structurally unsymmetric,
+ * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method.
+ * If your matrix is already symmetric (at leat in structure), you can avoid that
+ * by calling the method with a SelfAdjointView type.
+ *
+ * \code
+ * // Call the ordering on the pattern of the lower triangular matrix A
+ * ordering(A.selfadjointView(), perm);
+ * \endcode
+ */
+
+#ifndef EIGEN_MPL2_ONLY
+#include "src/OrderingMethods/Amd.h"
+#endif
+
+#include "src/OrderingMethods/Ordering.h"
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_ORDERINGMETHODS_MODULE_H
diff --git a/tools/Eigen/PaStiXSupport b/tools/Eigen/PaStiXSupport
new file mode 100644
index 0000000..7c616ee
--- /dev/null
+++ b/tools/Eigen/PaStiXSupport
@@ -0,0 +1,46 @@
+#ifndef EIGEN_PASTIXSUPPORT_MODULE_H
+#define EIGEN_PASTIXSUPPORT_MODULE_H
+
+#include "SparseCore"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+#include
+extern "C" {
+#include
+#include
+}
+
+#ifdef complex
+#undef complex
+#endif
+
+/** \ingroup Support_modules
+ * \defgroup PaStiXSupport_Module PaStiXSupport module
+ *
+ * This module provides an interface to the PaSTiX library.
+ * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver.
+ * It provides the two following main factorization classes:
+ * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization.
+ * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization.
+ * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern).
+ *
+ * \code
+ * #include
+ * \endcode
+ *
+ * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies.
+ * The dependencies depend on how PaSTiX has been compiled.
+ * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task.
+ *
+ */
+
+#include "src/misc/Solve.h"
+#include "src/misc/SparseSolve.h"
+
+#include "src/PaStiXSupport/PaStiXSupport.h"
+
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_PASTIXSUPPORT_MODULE_H
diff --git a/tools/Eigen/PardisoSupport b/tools/Eigen/PardisoSupport
new file mode 100644
index 0000000..99330ce
--- /dev/null
+++ b/tools/Eigen/PardisoSupport
@@ -0,0 +1,30 @@
+#ifndef EIGEN_PARDISOSUPPORT_MODULE_H
+#define EIGEN_PARDISOSUPPORT_MODULE_H
+
+#include "SparseCore"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+#include
+
+#include
+
+/** \ingroup Support_modules
+ * \defgroup PardisoSupport_Module PardisoSupport module
+ *
+ * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers.
+ *
+ * \code
+ * #include
+ * \endcode
+ *
+ * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies.
+ * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration.
+ *
+ */
+
+#include "src/PardisoSupport/PardisoSupport.h"
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_PARDISOSUPPORT_MODULE_H
diff --git a/tools/Eigen/QR b/tools/Eigen/QR
new file mode 100644
index 0000000..ac5b026
--- /dev/null
+++ b/tools/Eigen/QR
@@ -0,0 +1,45 @@
+#ifndef EIGEN_QR_MODULE_H
+#define EIGEN_QR_MODULE_H
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+#include "Cholesky"
+#include "Jacobi"
+#include "Householder"
+
+/** \defgroup QR_Module QR module
+ *
+ *
+ *
+ * This module provides various QR decompositions
+ * This module also provides some MatrixBase methods, including:
+ * - MatrixBase::qr(),
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/misc/Solve.h"
+#include "src/QR/HouseholderQR.h"
+#include "src/QR/FullPivHouseholderQR.h"
+#include "src/QR/ColPivHouseholderQR.h"
+#ifdef EIGEN_USE_LAPACKE
+#include "src/QR/HouseholderQR_MKL.h"
+#include "src/QR/ColPivHouseholderQR_MKL.h"
+#endif
+
+#ifdef EIGEN2_SUPPORT
+#include "src/Eigen2Support/QR.h"
+#endif
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#ifdef EIGEN2_SUPPORT
+#include "Eigenvalues"
+#endif
+
+#endif // EIGEN_QR_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/tools/Eigen/QtAlignedMalloc b/tools/Eigen/QtAlignedMalloc
new file mode 100644
index 0000000..46f7d83
--- /dev/null
+++ b/tools/Eigen/QtAlignedMalloc
@@ -0,0 +1,34 @@
+
+#ifndef EIGEN_QTMALLOC_MODULE_H
+#define EIGEN_QTMALLOC_MODULE_H
+
+#include "Core"
+
+#if (!EIGEN_MALLOC_ALREADY_ALIGNED)
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+void *qMalloc(size_t size)
+{
+ return Eigen::internal::aligned_malloc(size);
+}
+
+void qFree(void *ptr)
+{
+ Eigen::internal::aligned_free(ptr);
+}
+
+void *qRealloc(void *ptr, size_t size)
+{
+ void* newPtr = Eigen::internal::aligned_malloc(size);
+ memcpy(newPtr, ptr, size);
+ Eigen::internal::aligned_free(ptr);
+ return newPtr;
+}
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif
+
+#endif // EIGEN_QTMALLOC_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/tools/Eigen/SPQRSupport b/tools/Eigen/SPQRSupport
new file mode 100644
index 0000000..7f1eb47
--- /dev/null
+++ b/tools/Eigen/SPQRSupport
@@ -0,0 +1,29 @@
+#ifndef EIGEN_SPQRSUPPORT_MODULE_H
+#define EIGEN_SPQRSUPPORT_MODULE_H
+
+#include "SparseCore"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+#include "SuiteSparseQR.hpp"
+
+/** \ingroup Support_modules
+ * \defgroup SPQRSupport_Module SuiteSparseQR module
+ *
+ * This module provides an interface to the SPQR library, which is part of the suitesparse package.
+ *
+ * \code
+ * #include
+ * \endcode
+ *
+ * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...).
+ * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules
+ *
+ */
+
+#include "src/misc/Solve.h"
+#include "src/misc/SparseSolve.h"
+#include "src/CholmodSupport/CholmodSupport.h"
+#include "src/SPQRSupport/SuiteSparseQRSupport.h"
+
+#endif
diff --git a/tools/Eigen/SVD b/tools/Eigen/SVD
new file mode 100644
index 0000000..fd31001
--- /dev/null
+++ b/tools/Eigen/SVD
@@ -0,0 +1,37 @@
+#ifndef EIGEN_SVD_MODULE_H
+#define EIGEN_SVD_MODULE_H
+
+#include "QR"
+#include "Householder"
+#include "Jacobi"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/** \defgroup SVD_Module SVD module
+ *
+ *
+ *
+ * This module provides SVD decomposition for matrices (both real and complex).
+ * This decomposition is accessible via the following MatrixBase method:
+ * - MatrixBase::jacobiSvd()
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "src/misc/Solve.h"
+#include "src/SVD/JacobiSVD.h"
+#if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT)
+#include "src/SVD/JacobiSVD_MKL.h"
+#endif
+#include "src/SVD/UpperBidiagonalization.h"
+
+#ifdef EIGEN2_SUPPORT
+#include "src/Eigen2Support/SVD.h"
+#endif
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_SVD_MODULE_H
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/tools/Eigen/Sparse b/tools/Eigen/Sparse
new file mode 100644
index 0000000..7cc9c09
--- /dev/null
+++ b/tools/Eigen/Sparse
@@ -0,0 +1,27 @@
+#ifndef EIGEN_SPARSE_MODULE_H
+#define EIGEN_SPARSE_MODULE_H
+
+/** \defgroup Sparse_Module Sparse meta-module
+ *
+ * Meta-module including all related modules:
+ * - \ref SparseCore_Module
+ * - \ref OrderingMethods_Module
+ * - \ref SparseCholesky_Module
+ * - \ref SparseLU_Module
+ * - \ref SparseQR_Module
+ * - \ref IterativeLinearSolvers_Module
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#include "SparseCore"
+#include "OrderingMethods"
+#include "SparseCholesky"
+#include "SparseLU"
+#include "SparseQR"
+#include "IterativeLinearSolvers"
+
+#endif // EIGEN_SPARSE_MODULE_H
+
diff --git a/tools/Eigen/SparseCholesky b/tools/Eigen/SparseCholesky
new file mode 100644
index 0000000..9f5056a
--- /dev/null
+++ b/tools/Eigen/SparseCholesky
@@ -0,0 +1,47 @@
+// This file is part of Eigen, a lightweight C++ template library
+// for linear algebra.
+//
+// Copyright (C) 2008-2013 Gael Guennebaud
+//
+// This Source Code Form is subject to the terms of the Mozilla
+// Public License v. 2.0. If a copy of the MPL was not distributed
+// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#ifndef EIGEN_SPARSECHOLESKY_MODULE_H
+#define EIGEN_SPARSECHOLESKY_MODULE_H
+
+#include "SparseCore"
+#include "OrderingMethods"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+/**
+ * \defgroup SparseCholesky_Module SparseCholesky module
+ *
+ * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices.
+ * Those decompositions are accessible via the following classes:
+ * - SimplicialLLt,
+ * - SimplicialLDLt
+ *
+ * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module.
+ *
+ * \code
+ * #include
+ * \endcode
+ */
+
+#ifdef EIGEN_MPL2_ONLY
+#error The SparseCholesky module has nothing to offer in MPL2 only mode
+#endif
+
+#include "src/misc/Solve.h"
+#include "src/misc/SparseSolve.h"
+#include "src/SparseCholesky/SimplicialCholesky.h"
+
+#ifndef EIGEN_MPL2_ONLY
+#include "src/SparseCholesky/SimplicialCholesky_impl.h"
+#endif
+
+#include "src/Core/util/ReenableStupidWarnings.h"
+
+#endif // EIGEN_SPARSECHOLESKY_MODULE_H
diff --git a/tools/Eigen/SparseCore b/tools/Eigen/SparseCore
new file mode 100644
index 0000000..24bcf01
--- /dev/null
+++ b/tools/Eigen/SparseCore
@@ -0,0 +1,64 @@
+#ifndef EIGEN_SPARSECORE_MODULE_H
+#define EIGEN_SPARSECORE_MODULE_H
+
+#include "Core"
+
+#include "src/Core/util/DisableStupidWarnings.h"
+
+#include
+#include