From d21767f55045819f8e1907e7fe6d0dfb5f99a117 Mon Sep 17 00:00:00 2001 From: SwayZhao Date: Sun, 1 Mar 2020 23:56:06 +0800 Subject: [PATCH] first push by sway --- .DS_Store | Bin 0 -> 8196 bytes SudoDEM2D/.DS_Store | Bin 0 -> 10244 bytes SudoDEM2D/CMakeLists.txt | 440 + SudoDEM2D/cMake/CombineSources.cmake | 32 + SudoDEM2D/cMake/FindCholmod.cmake | 31 + SudoDEM2D/cMake/FindMetis.cmake | 16 + SudoDEM2D/cMake/FindNumPy.cmake | 93 + SudoDEM2D/cMake/FindPythonModule.cmake | 23 + SudoDEM2D/cMake/Findglib2.cmake | 218 + SudoDEM2D/cMake/GNUInstallDirs.cmake | 188 + SudoDEM2D/cMake/GetVersion.cmake | 77 + SudoDEM2D/core/Body.cpp | 42 + SudoDEM2D/core/Body.hpp | 131 + SudoDEM2D/core/BodyContainer.cpp | 62 + SudoDEM2D/core/BodyContainer.hpp | 76 + SudoDEM2D/core/Bound.hpp | 41 + SudoDEM2D/core/Cell.cpp | 42 + SudoDEM2D/core/Cell.hpp | 200 + SudoDEM2D/core/Clump.cpp | 272 + SudoDEM2D/core/Clump.hpp | 108 + SudoDEM2D/core/Dispatcher.hpp | 229 + SudoDEM2D/core/DisplayParameters.hpp | 27 + SudoDEM2D/core/EnergyTracker.hpp | 69 + SudoDEM2D/core/Engine.hpp | 67 + SudoDEM2D/core/FileGenerator.cpp | 70 + SudoDEM2D/core/FileGenerator.hpp | 41 + SudoDEM2D/core/ForceContainer.hpp | 325 + SudoDEM2D/core/FrontEnd.hpp | 29 + SudoDEM2D/core/Functor.hpp | 86 + SudoDEM2D/core/GLConfig.hpp | 38 + SudoDEM2D/core/GlobalEngine.hpp | 20 + SudoDEM2D/core/IGeom.hpp | 29 + SudoDEM2D/core/IPhys.hpp | 27 + SudoDEM2D/core/Interaction.cpp | 38 + SudoDEM2D/core/Interaction.hpp | 68 + SudoDEM2D/core/InteractionContainer.cpp | 168 + SudoDEM2D/core/InteractionContainer.hpp | 125 + SudoDEM2D/core/Material.cpp | 26 + SudoDEM2D/core/Material.hpp | 49 + SudoDEM2D/core/Omega.cpp | 279 + SudoDEM2D/core/Omega.hpp | 115 + SudoDEM2D/core/PartialEngine.hpp | 24 + SudoDEM2D/core/Scene.cpp | 206 + SudoDEM2D/core/Scene.hpp | 136 + SudoDEM2D/core/Shape.hpp | 36 + SudoDEM2D/core/SimulationFlow.cpp | 25 + SudoDEM2D/core/SimulationFlow.hpp | 22 + SudoDEM2D/core/State.cpp | 26 + SudoDEM2D/core/State.hpp | 82 + SudoDEM2D/core/ThreadRunner.cpp | 101 + SudoDEM2D/core/ThreadRunner.hpp | 78 + SudoDEM2D/core/ThreadWorker.cpp | 77 + SudoDEM2D/core/ThreadWorker.hpp | 63 + SudoDEM2D/core/TimeStepper.hpp | 34 + SudoDEM2D/core/Timing.hpp | 50 + SudoDEM2D/core/corePlugins.cpp | 39 + SudoDEM2D/core/main/pyboot.cpp | 45 + SudoDEM2D/core/main/sudodem.cpp | 305 + SudoDEM2D/core/main/sudodemcfg.h.in | 2 + SudoDEM2D/doc/sudodem-logo-note.png | Bin 0 -> 64984 bytes SudoDEM2D/gui/.DS_Store | Bin 0 -> 6148 bytes SudoDEM2D/gui/CMakeLists.txt | 34 + SudoDEM2D/gui/qt4/GLViewer.cpp | 500 + SudoDEM2D/gui/qt4/GLViewer.hpp | 161 + SudoDEM2D/gui/qt4/GLViewerDisplay.cpp | 281 + SudoDEM2D/gui/qt4/GLViewerMouse.cpp | 117 + SudoDEM2D/gui/qt4/Inspector.py | 285 + SudoDEM2D/gui/qt4/OpenGLManager.cpp | 76 + SudoDEM2D/gui/qt4/OpenGLManager.hpp | 47 + SudoDEM2D/gui/qt4/SerializableEditor.py | 759 + SudoDEM2D/gui/qt4/_GLViewer.cpp | 102 + SudoDEM2D/gui/qt4/__init__.py | 296 + SudoDEM2D/gui/qt4/build | 4 + SudoDEM2D/gui/qt4/controller.ui | 1015 + SudoDEM2D/gui/qt4/img.qrc | 5 + SudoDEM2D/gui/qt4/img_rc.py | 1017 + SudoDEM2D/gui/qt4/sudodem-favicon.png | Bin 0 -> 64984 bytes SudoDEM2D/gui/qt4/sudodem-favicon.xpm | 1664 ++ SudoDEM2D/gui/qt4/ui_controller.py | 393 + SudoDEM2D/lib/.DS_Store | Bin 0 -> 10244 bytes SudoDEM2D/lib/Eigen/CMakeLists.txt | 19 + SudoDEM2D/lib/Eigen/Cholesky | 46 + SudoDEM2D/lib/Eigen/CholmodSupport | 48 + SudoDEM2D/lib/Eigen/Core | 537 + SudoDEM2D/lib/Eigen/Dense | 7 + SudoDEM2D/lib/Eigen/Eigen | 2 + SudoDEM2D/lib/Eigen/Eigenvalues | 61 + SudoDEM2D/lib/Eigen/Geometry | 62 + SudoDEM2D/lib/Eigen/Householder | 30 + SudoDEM2D/lib/Eigen/IterativeLinearSolvers | 48 + SudoDEM2D/lib/Eigen/Jacobi | 33 + SudoDEM2D/lib/Eigen/LU | 50 + SudoDEM2D/lib/Eigen/MetisSupport | 35 + SudoDEM2D/lib/Eigen/OrderingMethods | 73 + SudoDEM2D/lib/Eigen/PaStiXSupport | 48 + SudoDEM2D/lib/Eigen/PardisoSupport | 35 + SudoDEM2D/lib/Eigen/QR | 51 + SudoDEM2D/lib/Eigen/QtAlignedMalloc | 40 + SudoDEM2D/lib/Eigen/SPQRSupport | 34 + SudoDEM2D/lib/Eigen/SVD | 51 + SudoDEM2D/lib/Eigen/Sparse | 36 + SudoDEM2D/lib/Eigen/SparseCholesky | 45 + SudoDEM2D/lib/Eigen/SparseCore | 69 + SudoDEM2D/lib/Eigen/SparseLU | 46 + SudoDEM2D/lib/Eigen/SparseQR | 37 + SudoDEM2D/lib/Eigen/StdDeque | 27 + SudoDEM2D/lib/Eigen/StdList | 26 + SudoDEM2D/lib/Eigen/StdVector | 27 + SudoDEM2D/lib/Eigen/SuperLUSupport | 64 + SudoDEM2D/lib/Eigen/UmfPackSupport | 40 + SudoDEM2D/lib/Eigen/src/Cholesky/LDLT.h | 672 + SudoDEM2D/lib/Eigen/src/Cholesky/LLT.h | 542 + .../lib/Eigen/src/Cholesky/LLT_LAPACKE.h | 99 + .../Eigen/src/CholmodSupport/CholmodSupport.h | 639 + SudoDEM2D/lib/Eigen/src/Core/Array.h | 331 + SudoDEM2D/lib/Eigen/src/Core/ArrayBase.h | 226 + SudoDEM2D/lib/Eigen/src/Core/ArrayWrapper.h | 209 + SudoDEM2D/lib/Eigen/src/Core/Assign.h | 90 + .../lib/Eigen/src/Core/AssignEvaluator.h | 935 + SudoDEM2D/lib/Eigen/src/Core/Assign_MKL.h | 178 + SudoDEM2D/lib/Eigen/src/Core/BandMatrix.h | 353 + SudoDEM2D/lib/Eigen/src/Core/Block.h | 452 + SudoDEM2D/lib/Eigen/src/Core/BooleanRedux.h | 164 + .../lib/Eigen/src/Core/CommaInitializer.h | 160 + .../lib/Eigen/src/Core/ConditionEstimator.h | 175 + SudoDEM2D/lib/Eigen/src/Core/CoreEvaluators.h | 1688 ++ SudoDEM2D/lib/Eigen/src/Core/CoreIterators.h | 127 + SudoDEM2D/lib/Eigen/src/Core/CwiseBinaryOp.h | 184 + SudoDEM2D/lib/Eigen/src/Core/CwiseNullaryOp.h | 866 + SudoDEM2D/lib/Eigen/src/Core/CwiseTernaryOp.h | 197 + SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryOp.h | 103 + SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryView.h | 128 + SudoDEM2D/lib/Eigen/src/Core/DenseBase.h | 611 + .../lib/Eigen/src/Core/DenseCoeffsBase.h | 681 + SudoDEM2D/lib/Eigen/src/Core/DenseStorage.h | 570 + SudoDEM2D/lib/Eigen/src/Core/Diagonal.h | 260 + SudoDEM2D/lib/Eigen/src/Core/DiagonalMatrix.h | 343 + .../lib/Eigen/src/Core/DiagonalProduct.h | 28 + SudoDEM2D/lib/Eigen/src/Core/Dot.h | 318 + SudoDEM2D/lib/Eigen/src/Core/EigenBase.h | 159 + .../lib/Eigen/src/Core/ForceAlignedAccess.h | 146 + SudoDEM2D/lib/Eigen/src/Core/Fuzzy.h | 155 + SudoDEM2D/lib/Eigen/src/Core/GeneralProduct.h | 455 + .../lib/Eigen/src/Core/GenericPacketMath.h | 593 + .../lib/Eigen/src/Core/GlobalFunctions.h | 187 + SudoDEM2D/lib/Eigen/src/Core/IO.h | 225 + SudoDEM2D/lib/Eigen/src/Core/Inverse.h | 118 + SudoDEM2D/lib/Eigen/src/Core/Map.h | 171 + SudoDEM2D/lib/Eigen/src/Core/MapBase.h | 299 + SudoDEM2D/lib/Eigen/src/Core/MathFunctions.h | 1407 ++ .../lib/Eigen/src/Core/MathFunctionsImpl.h | 101 + SudoDEM2D/lib/Eigen/src/Core/Matrix.h | 461 + SudoDEM2D/lib/Eigen/src/Core/MatrixBase.h | 521 + SudoDEM2D/lib/Eigen/src/Core/NestByValue.h | 110 + SudoDEM2D/lib/Eigen/src/Core/NoAlias.h | 108 + SudoDEM2D/lib/Eigen/src/Core/NumTraits.h | 248 + .../lib/Eigen/src/Core/PermutationMatrix.h | 633 + .../lib/Eigen/src/Core/PlainObjectBase.h | 1035 + SudoDEM2D/lib/Eigen/src/Core/Product.h | 186 + .../lib/Eigen/src/Core/ProductEvaluators.h | 1112 ++ SudoDEM2D/lib/Eigen/src/Core/Random.h | 182 + SudoDEM2D/lib/Eigen/src/Core/Redux.h | 505 + SudoDEM2D/lib/Eigen/src/Core/Ref.h | 283 + SudoDEM2D/lib/Eigen/src/Core/Replicate.h | 142 + SudoDEM2D/lib/Eigen/src/Core/ReturnByValue.h | 117 + SudoDEM2D/lib/Eigen/src/Core/Reverse.h | 211 + SudoDEM2D/lib/Eigen/src/Core/Select.h | 162 + .../lib/Eigen/src/Core/SelfAdjointView.h | 352 + .../lib/Eigen/src/Core/SelfCwiseBinaryOp.h | 47 + SudoDEM2D/lib/Eigen/src/Core/Solve.h | 188 + .../lib/Eigen/src/Core/SolveTriangular.h | 232 + SudoDEM2D/lib/Eigen/src/Core/SolverBase.h | 130 + SudoDEM2D/lib/Eigen/src/Core/StableNorm.h | 221 + SudoDEM2D/lib/Eigen/src/Core/Stride.h | 111 + SudoDEM2D/lib/Eigen/src/Core/Swap.h | 67 + SudoDEM2D/lib/Eigen/src/Core/Transpose.h | 403 + SudoDEM2D/lib/Eigen/src/Core/Transpositions.h | 407 + .../lib/Eigen/src/Core/TriangularMatrix.h | 983 + SudoDEM2D/lib/Eigen/src/Core/VectorBlock.h | 96 + SudoDEM2D/lib/Eigen/src/Core/VectorwiseOp.h | 695 + SudoDEM2D/lib/Eigen/src/Core/Visitor.h | 273 + .../lib/Eigen/src/Core/arch/AVX/Complex.h | 451 + .../Eigen/src/Core/arch/AVX/MathFunctions.h | 439 + .../lib/Eigen/src/Core/arch/AVX/PacketMath.h | 636 + .../lib/Eigen/src/Core/arch/AVX/TypeCasting.h | 51 + .../src/Core/arch/AVX512/MathFunctions.h | 391 + .../Eigen/src/Core/arch/AVX512/PacketMath.h | 1316 ++ .../lib/Eigen/src/Core/arch/AltiVec/Complex.h | 430 + .../src/Core/arch/AltiVec/MathFunctions.h | 322 + .../Eigen/src/Core/arch/AltiVec/PacketMath.h | 1061 + .../lib/Eigen/src/Core/arch/CUDA/Complex.h | 103 + SudoDEM2D/lib/Eigen/src/Core/arch/CUDA/Half.h | 651 + .../Eigen/src/Core/arch/CUDA/MathFunctions.h | 91 + .../lib/Eigen/src/Core/arch/CUDA/PacketMath.h | 333 + .../Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 1123 ++ .../Eigen/src/Core/arch/CUDA/TypeCasting.h | 212 + .../Eigen/src/Core/arch/Default/ConjHelper.h | 29 + .../Eigen/src/Core/arch/Default/Settings.h | 49 + .../lib/Eigen/src/Core/arch/NEON/Complex.h | 490 + .../Eigen/src/Core/arch/NEON/MathFunctions.h | 91 + .../lib/Eigen/src/Core/arch/NEON/PacketMath.h | 760 + .../lib/Eigen/src/Core/arch/SSE/Complex.h | 471 + .../Eigen/src/Core/arch/SSE/MathFunctions.h | 562 + .../lib/Eigen/src/Core/arch/SSE/PacketMath.h | 895 + .../lib/Eigen/src/Core/arch/SSE/TypeCasting.h | 77 + .../lib/Eigen/src/Core/arch/ZVector/Complex.h | 397 + .../src/Core/arch/ZVector/MathFunctions.h | 137 + .../Eigen/src/Core/arch/ZVector/PacketMath.h | 945 + .../src/Core/functors/AssignmentFunctors.h | 168 + .../Eigen/src/Core/functors/BinaryFunctors.h | 475 + .../Eigen/src/Core/functors/NullaryFunctors.h | 188 + .../lib/Eigen/src/Core/functors/StlFunctors.h | 136 + .../Eigen/src/Core/functors/TernaryFunctors.h | 25 + .../Eigen/src/Core/functors/UnaryFunctors.h | 792 + .../Core/products/GeneralBlockPanelKernel.h | 2149 ++ .../src/Core/products/GeneralMatrixMatrix.h | 492 + .../products/GeneralMatrixMatrixTriangular.h | 311 + .../GeneralMatrixMatrixTriangular_BLAS.h | 145 + .../Core/products/GeneralMatrixMatrix_BLAS.h | 122 + .../src/Core/products/GeneralMatrixVector.h | 619 + .../Core/products/GeneralMatrixVector_BLAS.h | 136 + .../Eigen/src/Core/products/Parallelizer.h | 163 + .../Core/products/SelfadjointMatrixMatrix.h | 521 + .../products/SelfadjointMatrixMatrix_BLAS.h | 287 + .../Core/products/SelfadjointMatrixVector.h | 260 + .../products/SelfadjointMatrixVector_BLAS.h | 118 + .../src/Core/products/SelfadjointProduct.h | 133 + .../Core/products/SelfadjointRank2Update.h | 93 + .../Core/products/TriangularMatrixMatrix.h | 466 + .../products/TriangularMatrixMatrix_BLAS.h | 315 + .../Core/products/TriangularMatrixVector.h | 350 + .../products/TriangularMatrixVector_BLAS.h | 255 + .../Core/products/TriangularSolverMatrix.h | 335 + .../products/TriangularSolverMatrix_BLAS.h | 163 + .../Core/products/TriangularSolverVector.h | 145 + SudoDEM2D/lib/Eigen/src/Core/util/BlasUtil.h | 398 + SudoDEM2D/lib/Eigen/src/Core/util/Constants.h | 547 + .../src/Core/util/DisableStupidWarnings.h | 75 + .../Eigen/src/Core/util/ForwardDeclarations.h | 302 + .../lib/Eigen/src/Core/util/MKL_support.h | 130 + SudoDEM2D/lib/Eigen/src/Core/util/Macros.h | 1001 + SudoDEM2D/lib/Eigen/src/Core/util/Memory.h | 985 + SudoDEM2D/lib/Eigen/src/Core/util/Meta.h | 512 + SudoDEM2D/lib/Eigen/src/Core/util/NonMPL2.h | 3 + .../src/Core/util/ReenableStupidWarnings.h | 27 + .../lib/Eigen/src/Core/util/StaticAssert.h | 218 + SudoDEM2D/lib/Eigen/src/Core/util/XprHelper.h | 821 + .../src/Eigenvalues/ComplexEigenSolver.h | 346 + .../lib/Eigen/src/Eigenvalues/ComplexSchur.h | 459 + .../src/Eigenvalues/ComplexSchur_LAPACKE.h | 91 + .../lib/Eigen/src/Eigenvalues/EigenSolver.h | 622 + .../src/Eigenvalues/GeneralizedEigenSolver.h | 418 + .../GeneralizedSelfAdjointEigenSolver.h | 226 + .../src/Eigenvalues/HessenbergDecomposition.h | 374 + .../src/Eigenvalues/MatrixBaseEigenvalues.h | 160 + SudoDEM2D/lib/Eigen/src/Eigenvalues/RealQZ.h | 654 + .../lib/Eigen/src/Eigenvalues/RealSchur.h | 546 + .../Eigen/src/Eigenvalues/RealSchur_LAPACKE.h | 77 + .../src/Eigenvalues/SelfAdjointEigenSolver.h | 870 + .../SelfAdjointEigenSolver_LAPACKE.h | 87 + .../src/Eigenvalues/Tridiagonalization.h | 556 + SudoDEM2D/lib/Eigen/src/Geometry/AlignedBox.h | 392 + SudoDEM2D/lib/Eigen/src/Geometry/AngleAxis.h | 247 + .../lib/Eigen/src/Geometry/EulerAngles.h | 114 + .../lib/Eigen/src/Geometry/Homogeneous.h | 497 + SudoDEM2D/lib/Eigen/src/Geometry/Hyperplane.h | 282 + .../lib/Eigen/src/Geometry/OrthoMethods.h | 234 + .../lib/Eigen/src/Geometry/ParametrizedLine.h | 195 + SudoDEM2D/lib/Eigen/src/Geometry/Quaternion.h | 814 + SudoDEM2D/lib/Eigen/src/Geometry/Rotation2D.h | 199 + .../lib/Eigen/src/Geometry/RotationBase.h | 206 + SudoDEM2D/lib/Eigen/src/Geometry/Scaling.h | 170 + SudoDEM2D/lib/Eigen/src/Geometry/Transform.h | 1542 ++ .../lib/Eigen/src/Geometry/Translation.h | 208 + SudoDEM2D/lib/Eigen/src/Geometry/Umeyama.h | 166 + .../Eigen/src/Geometry/arch/Geometry_SSE.h | 161 + .../Eigen/src/Householder/BlockHouseholder.h | 103 + .../lib/Eigen/src/Householder/Householder.h | 172 + .../src/Householder/HouseholderSequence.h | 470 + .../BasicPreconditioners.h | 226 + .../src/IterativeLinearSolvers/BiCGSTAB.h | 228 + .../ConjugateGradient.h | 245 + .../IncompleteCholesky.h | 400 + .../IterativeLinearSolvers/IncompleteLUT.h | 462 + .../IterativeSolverBase.h | 394 + .../LeastSquareConjugateGradient.h | 216 + .../IterativeLinearSolvers/SolveWithGuess.h | 115 + SudoDEM2D/lib/Eigen/src/Jacobi/Jacobi.h | 463 + SudoDEM2D/lib/Eigen/src/LU/Determinant.h | 101 + SudoDEM2D/lib/Eigen/src/LU/FullPivLU.h | 891 + SudoDEM2D/lib/Eigen/src/LU/InverseImpl.h | 415 + SudoDEM2D/lib/Eigen/src/LU/PartialPivLU.h | 611 + .../lib/Eigen/src/LU/PartialPivLU_LAPACKE.h | 83 + SudoDEM2D/lib/Eigen/src/LU/arch/Inverse_SSE.h | 338 + .../lib/Eigen/src/MetisSupport/MetisSupport.h | 137 + SudoDEM2D/lib/Eigen/src/OrderingMethods/Amd.h | 445 + .../Eigen/src/OrderingMethods/Eigen_Colamd.h | 1843 ++ .../lib/Eigen/src/OrderingMethods/Ordering.h | 157 + .../Eigen/src/PaStiXSupport/PaStiXSupport.h | 678 + .../Eigen/src/PardisoSupport/PardisoSupport.h | 543 + .../lib/Eigen/src/QR/ColPivHouseholderQR.h | 653 + .../src/QR/ColPivHouseholderQR_LAPACKE.h | 97 + .../src/QR/CompleteOrthogonalDecomposition.h | 562 + .../lib/Eigen/src/QR/FullPivHouseholderQR.h | 676 + SudoDEM2D/lib/Eigen/src/QR/HouseholderQR.h | 409 + .../lib/Eigen/src/QR/HouseholderQR_LAPACKE.h | 68 + .../src/SPQRSupport/SuiteSparseQRSupport.h | 313 + SudoDEM2D/lib/Eigen/src/SVD/BDCSVD.h | 1246 ++ SudoDEM2D/lib/Eigen/src/SVD/JacobiSVD.h | 804 + .../lib/Eigen/src/SVD/JacobiSVD_LAPACKE.h | 91 + SudoDEM2D/lib/Eigen/src/SVD/SVDBase.h | 313 + .../Eigen/src/SVD/UpperBidiagonalization.h | 414 + .../src/SparseCholesky/SimplicialCholesky.h | 689 + .../SparseCholesky/SimplicialCholesky_impl.h | 199 + .../lib/Eigen/src/SparseCore/AmbiVector.h | 377 + .../Eigen/src/SparseCore/CompressedStorage.h | 258 + .../ConservativeSparseSparseProduct.h | 352 + .../Eigen/src/SparseCore/MappedSparseMatrix.h | 67 + .../lib/Eigen/src/SparseCore/SparseAssign.h | 216 + .../lib/Eigen/src/SparseCore/SparseBlock.h | 603 + .../lib/Eigen/src/SparseCore/SparseColEtree.h | 206 + .../src/SparseCore/SparseCompressedBase.h | 341 + .../src/SparseCore/SparseCwiseBinaryOp.h | 726 + .../Eigen/src/SparseCore/SparseCwiseUnaryOp.h | 148 + .../Eigen/src/SparseCore/SparseDenseProduct.h | 320 + .../src/SparseCore/SparseDiagonalProduct.h | 138 + .../lib/Eigen/src/SparseCore/SparseDot.h | 98 + .../lib/Eigen/src/SparseCore/SparseFuzzy.h | 29 + .../lib/Eigen/src/SparseCore/SparseMap.h | 305 + .../lib/Eigen/src/SparseCore/SparseMatrix.h | 1403 ++ .../Eigen/src/SparseCore/SparseMatrixBase.h | 405 + .../Eigen/src/SparseCore/SparsePermutation.h | 178 + .../lib/Eigen/src/SparseCore/SparseProduct.h | 169 + .../lib/Eigen/src/SparseCore/SparseRedux.h | 49 + .../lib/Eigen/src/SparseCore/SparseRef.h | 397 + .../src/SparseCore/SparseSelfAdjointView.h | 656 + .../Eigen/src/SparseCore/SparseSolverBase.h | 124 + .../SparseSparseProductWithPruning.h | 198 + .../Eigen/src/SparseCore/SparseTranspose.h | 92 + .../src/SparseCore/SparseTriangularView.h | 189 + .../lib/Eigen/src/SparseCore/SparseUtil.h | 178 + .../lib/Eigen/src/SparseCore/SparseVector.h | 478 + .../lib/Eigen/src/SparseCore/SparseView.h | 253 + .../Eigen/src/SparseCore/TriangularSolver.h | 315 + SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU.h | 775 + .../lib/Eigen/src/SparseLU/SparseLUImpl.h | 66 + .../lib/Eigen/src/SparseLU/SparseLU_Memory.h | 226 + .../lib/Eigen/src/SparseLU/SparseLU_Structs.h | 110 + .../src/SparseLU/SparseLU_SupernodalMatrix.h | 301 + .../lib/Eigen/src/SparseLU/SparseLU_Utils.h | 80 + .../Eigen/src/SparseLU/SparseLU_column_bmod.h | 181 + .../Eigen/src/SparseLU/SparseLU_column_dfs.h | 179 + .../src/SparseLU/SparseLU_copy_to_ucol.h | 107 + .../Eigen/src/SparseLU/SparseLU_gemm_kernel.h | 280 + .../src/SparseLU/SparseLU_heap_relax_snode.h | 126 + .../Eigen/src/SparseLU/SparseLU_kernel_bmod.h | 130 + .../Eigen/src/SparseLU/SparseLU_panel_bmod.h | 223 + .../Eigen/src/SparseLU/SparseLU_panel_dfs.h | 258 + .../lib/Eigen/src/SparseLU/SparseLU_pivotL.h | 137 + .../lib/Eigen/src/SparseLU/SparseLU_pruneL.h | 136 + .../Eigen/src/SparseLU/SparseLU_relax_snode.h | 83 + SudoDEM2D/lib/Eigen/src/SparseQR/SparseQR.h | 745 + SudoDEM2D/lib/Eigen/src/StlSupport/StdDeque.h | 126 + SudoDEM2D/lib/Eigen/src/StlSupport/StdList.h | 106 + .../lib/Eigen/src/StlSupport/StdVector.h | 131 + SudoDEM2D/lib/Eigen/src/StlSupport/details.h | 84 + .../Eigen/src/SuperLUSupport/SuperLUSupport.h | 1027 + .../Eigen/src/UmfPackSupport/UmfPackSupport.h | 506 + SudoDEM2D/lib/Eigen/src/misc/Image.h | 82 + SudoDEM2D/lib/Eigen/src/misc/Kernel.h | 79 + SudoDEM2D/lib/Eigen/src/misc/RealSvd2x2.h | 55 + SudoDEM2D/lib/Eigen/src/misc/blas.h | 440 + SudoDEM2D/lib/Eigen/src/misc/lapack.h | 152 + SudoDEM2D/lib/Eigen/src/misc/lapacke.h | 16291 ++++++++++++++++ .../lib/Eigen/src/misc/lapacke_mangling.h | 17 + .../Eigen/src/plugins/ArrayCwiseBinaryOps.h | 332 + .../Eigen/src/plugins/ArrayCwiseUnaryOps.h | 552 + .../lib/Eigen/src/plugins/BlockMethods.h | 1058 + .../Eigen/src/plugins/CommonCwiseBinaryOps.h | 115 + .../Eigen/src/plugins/CommonCwiseUnaryOps.h | 163 + .../Eigen/src/plugins/MatrixCwiseBinaryOps.h | 152 + .../Eigen/src/plugins/MatrixCwiseUnaryOps.h | 85 + SudoDEM2D/lib/base/Logging.hpp | 60 + SudoDEM2D/lib/base/Math.cpp | 56 + SudoDEM2D/lib/base/Math.hpp | 788 + SudoDEM2D/lib/base/Singleton.hpp | 24 + SudoDEM2D/lib/base/openmp-accu.hpp | 206 + SudoDEM2D/lib/factory/ClassFactory.cpp | 128 + SudoDEM2D/lib/factory/ClassFactory.hpp | 181 + SudoDEM2D/lib/factory/DynLibManager.cpp | 88 + SudoDEM2D/lib/factory/DynLibManager.hpp | 44 + SudoDEM2D/lib/factory/Factorable.hpp | 76 + SudoDEM2D/lib/import/STLReader.hpp | 254 + .../lib/multimethods/DynLibDispatcher.hpp | 722 + SudoDEM2D/lib/multimethods/FunctorWrapper.hpp | 161 + SudoDEM2D/lib/multimethods/Indexable.hpp | 102 + SudoDEM2D/lib/multimethods/loki/EmptyType.h | 49 + SudoDEM2D/lib/multimethods/loki/Functor.h | 1789 ++ SudoDEM2D/lib/multimethods/loki/LokiExport.h | 69 + SudoDEM2D/lib/multimethods/loki/NullType.h | 34 + SudoDEM2D/lib/multimethods/loki/Sequence.h | 49 + SudoDEM2D/lib/multimethods/loki/Singleton.h | 889 + SudoDEM2D/lib/multimethods/loki/SmallObj.h | 643 + SudoDEM2D/lib/multimethods/loki/Threads.h | 609 + SudoDEM2D/lib/multimethods/loki/TypeManip.h | 284 + SudoDEM2D/lib/multimethods/loki/TypeTraits.h | 2228 +++ SudoDEM2D/lib/multimethods/loki/Typelist.h | 459 + .../lib/multimethods/loki/TypelistMacros.h | 353 + SudoDEM2D/lib/opengl/GLUtils.cpp | 77 + SudoDEM2D/lib/opengl/GLUtils.hpp | 48 + SudoDEM2D/lib/opengl/OpenGLWrapper.hpp | 221 + SudoDEM2D/lib/pyutil/README | 2 + SudoDEM2D/lib/pyutil/doc_opts.hpp | 10 + SudoDEM2D/lib/pyutil/gil.cpp | 5 + SudoDEM2D/lib/pyutil/gil.hpp | 14 + SudoDEM2D/lib/pyutil/numpy.hpp | 7 + SudoDEM2D/lib/pyutil/numpy_boost.hpp | 251 + SudoDEM2D/lib/pyutil/raw_constructor.hpp | 20 + SudoDEM2D/lib/qhull/geom.c | 1230 ++ SudoDEM2D/lib/qhull/geom.h | 177 + SudoDEM2D/lib/qhull/geom2.c | 2160 ++ SudoDEM2D/lib/qhull/global.c | 2018 ++ SudoDEM2D/lib/qhull/io.c | 4089 ++++ SudoDEM2D/lib/qhull/io.h | 149 + SudoDEM2D/lib/qhull/mem.c | 447 + SudoDEM2D/lib/qhull/mem.h | 174 + SudoDEM2D/lib/qhull/merge.c | 3626 ++++ SudoDEM2D/lib/qhull/merge.h | 171 + SudoDEM2D/lib/qhull/poly.c | 1180 ++ SudoDEM2D/lib/qhull/poly.h | 290 + SudoDEM2D/lib/qhull/poly2.c | 3070 +++ SudoDEM2D/lib/qhull/qhull.c | 1395 ++ SudoDEM2D/lib/qhull/qhull.h | 1048 + SudoDEM2D/lib/qhull/qhull_a.h | 127 + SudoDEM2D/lib/qhull/qset.c | 1301 ++ SudoDEM2D/lib/qhull/qset.h | 468 + SudoDEM2D/lib/qhull/stat.c | 700 + SudoDEM2D/lib/qhull/stat.h | 520 + SudoDEM2D/lib/qhull/user.c | 324 + SudoDEM2D/lib/qhull/user.h | 762 + SudoDEM2D/lib/serialization/ObjectIO.hpp | 75 + SudoDEM2D/lib/serialization/Serializable.cpp | 48 + SudoDEM2D/lib/serialization/Serializable.hpp | 291 + SudoDEM2D/lib/smoothing/LinearInterpolate.hpp | 48 + SudoDEM2D/lib/smoothing/WeightedAverage2d.hpp | 222 + SudoDEM2D/lib/voro++/README | 21 + SudoDEM2D/lib/voro++/c_loops.cc | 150 + SudoDEM2D/lib/voro++/c_loops.hh | 456 + SudoDEM2D/lib/voro++/cell.cc | 2252 +++ SudoDEM2D/lib/voro++/cell.hh | 514 + SudoDEM2D/lib/voro++/cmd_line.cc | 498 + SudoDEM2D/lib/voro++/common.cc | 90 + SudoDEM2D/lib/voro++/common.hh | 67 + SudoDEM2D/lib/voro++/config.hh | 127 + SudoDEM2D/lib/voro++/container.cc | 549 + SudoDEM2D/lib/voro++/container.hh | 729 + SudoDEM2D/lib/voro++/container_prd.cc | 768 + SudoDEM2D/lib/voro++/container_prd.hh | 654 + SudoDEM2D/lib/voro++/pre_container.cc | 236 + SudoDEM2D/lib/voro++/pre_container.hh | 162 + SudoDEM2D/lib/voro++/rad_option.hh | 158 + SudoDEM2D/lib/voro++/unitcell.cc | 231 + SudoDEM2D/lib/voro++/unitcell.hh | 79 + SudoDEM2D/lib/voro++/v_base.cc | 118 + SudoDEM2D/lib/voro++/v_base.hh | 88 + SudoDEM2D/lib/voro++/v_base_wl.cc | 79 + SudoDEM2D/lib/voro++/v_compute.cc | 1006 + SudoDEM2D/lib/voro++/v_compute.hh | 149 + SudoDEM2D/lib/voro++/voro++.cc | 19 + SudoDEM2D/lib/voro++/voro++.hh | 333 + SudoDEM2D/lib/voro++/wall.cc | 132 + SudoDEM2D/lib/voro++/wall.hh | 119 + SudoDEM2D/lib/voro++/worklist.hh | 32 + SudoDEM2D/pkg/.DS_Store | Bin 0 -> 6148 bytes SudoDEM2D/pkg/common/Aabb.cpp | 38 + SudoDEM2D/pkg/common/Aabb.hpp | 38 + SudoDEM2D/pkg/common/BoundaryController.hpp | 9 + SudoDEM2D/pkg/common/Callbacks.hpp | 37 + SudoDEM2D/pkg/common/Collider.cpp | 47 + SudoDEM2D/pkg/common/Collider.hpp | 51 + SudoDEM2D/pkg/common/Disk.cpp | 119 + SudoDEM2D/pkg/common/Disk.hpp | 66 + SudoDEM2D/pkg/common/Dispatching.cpp | 201 + SudoDEM2D/pkg/common/Dispatching.hpp | 138 + SudoDEM2D/pkg/common/ElastMat.hpp | 30 + SudoDEM2D/pkg/common/FieldApplier.hpp | 14 + SudoDEM2D/pkg/common/ForceEngine.cpp | 169 + SudoDEM2D/pkg/common/ForceEngine.hpp | 95 + SudoDEM2D/pkg/common/ForceResetter.hpp | 17 + SudoDEM2D/pkg/common/GLDrawFunctors.hpp | 50 + SudoDEM2D/pkg/common/GravityEngines.cpp | 72 + SudoDEM2D/pkg/common/GravityEngines.hpp | 54 + .../pkg/common/InsertionSortCollider.cpp | 569 + .../pkg/common/InsertionSortCollider.hpp | 244 + SudoDEM2D/pkg/common/InteractionLoop.cpp | 150 + SudoDEM2D/pkg/common/InteractionLoop.hpp | 45 + SudoDEM2D/pkg/common/MatchMaker.cpp | 26 + SudoDEM2D/pkg/common/MatchMaker.hpp | 45 + SudoDEM2D/pkg/common/NormShearPhys.hpp | 30 + SudoDEM2D/pkg/common/OpenGLRenderer.cpp | 424 + SudoDEM2D/pkg/common/OpenGLRenderer.hpp | 129 + SudoDEM2D/pkg/common/ParallelEngine.cpp | 52 + SudoDEM2D/pkg/common/ParallelEngine.hpp | 28 + SudoDEM2D/pkg/common/PeriodicEngines.hpp | 69 + SudoDEM2D/pkg/common/PyRunner.hpp | 17 + SudoDEM2D/pkg/common/Recorder.hpp | 33 + SudoDEM2D/pkg/common/StepDisplacer.hpp | 32 + SudoDEM2D/pkg/common/TorqueEngine.hpp | 26 + SudoDEM2D/pkg/common/Wall.cpp | 107 + SudoDEM2D/pkg/common/Wall.hpp | 97 + SudoDEM2D/pkg/common/common.cpp | 40 + SudoDEM2D/pkg/dem/ElasticContactLaw.cpp | 112 + SudoDEM2D/pkg/dem/ElasticContactLaw.hpp | 61 + SudoDEM2D/pkg/dem/FrictPhys.cpp | 76 + SudoDEM2D/pkg/dem/FrictPhys.hpp | 62 + SudoDEM2D/pkg/dem/Ig2_Basic_ScGeom.cpp | 177 + SudoDEM2D/pkg/dem/Ig2_Basic_ScGeom.hpp | 120 + SudoDEM2D/pkg/dem/NewtonIntegrator.cpp | 341 + SudoDEM2D/pkg/dem/NewtonIntegrator.hpp | 99 + SudoDEM2D/pkg/dem/PeriTriaxial.cpp | 158 + SudoDEM2D/pkg/dem/PeriTriaxial.hpp | 47 + SudoDEM2D/pkg/dem/ScGeom.cpp | 101 + SudoDEM2D/pkg/dem/ScGeom.hpp | 69 + SudoDEM2D/pkg/dem/Shop.hpp | 150 + SudoDEM2D/pkg/dem/Shop_01.cpp | 222 + SudoDEM2D/pkg/dem/Superellipse.cpp | 630 + SudoDEM2D/pkg/dem/Superellipse.hpp | 332 + SudoDEM2D/pkg/dem/Superellipse_Ig2.cpp | 973 + SudoDEM2D/pkg/dem/Superellipse_Ig2.hpp | 65 + SudoDEM2D/py/3rd-party/README | 25 + SudoDEM2D/py/3rd-party/mtTkinter-0.4/gpl.txt | 674 + SudoDEM2D/py/3rd-party/mtTkinter-0.4/lgpl.txt | 165 + .../py/3rd-party/mtTkinter-0.4/mtTkinter.py | 242 + .../py/3rd-party/pygts-0.3.1/__init__.py | 118 + SudoDEM2D/py/3rd-party/pygts-0.3.1/cleanup.c | 491 + SudoDEM2D/py/3rd-party/pygts-0.3.1/cleanup.h | 44 + SudoDEM2D/py/3rd-party/pygts-0.3.1/edge.c | 639 + SudoDEM2D/py/3rd-party/pygts-0.3.1/edge.h | 78 + SudoDEM2D/py/3rd-party/pygts-0.3.1/face.c | 646 + SudoDEM2D/py/3rd-party/pygts-0.3.1/face.h | 48 + SudoDEM2D/py/3rd-party/pygts-0.3.1/object.c | 245 + SudoDEM2D/py/3rd-party/pygts-0.3.1/object.h | 53 + SudoDEM2D/py/3rd-party/pygts-0.3.1/point.c | 1227 ++ SudoDEM2D/py/3rd-party/pygts-0.3.1/point.h | 51 + SudoDEM2D/py/3rd-party/pygts-0.3.1/pygts.c | 794 + SudoDEM2D/py/3rd-party/pygts-0.3.1/pygts.h | 59 + SudoDEM2D/py/3rd-party/pygts-0.3.1/pygts.py | 151 + SudoDEM2D/py/3rd-party/pygts-0.3.1/segment.c | 570 + SudoDEM2D/py/3rd-party/pygts-0.3.1/segment.h | 46 + SudoDEM2D/py/3rd-party/pygts-0.3.1/surface.c | 2255 +++ SudoDEM2D/py/3rd-party/pygts-0.3.1/surface.h | 48 + SudoDEM2D/py/3rd-party/pygts-0.3.1/triangle.c | 1049 + SudoDEM2D/py/3rd-party/pygts-0.3.1/triangle.h | 58 + SudoDEM2D/py/3rd-party/pygts-0.3.1/vertex.c | 874 + SudoDEM2D/py/3rd-party/pygts-0.3.1/vertex.h | 86 + SudoDEM2D/py/CMakeLists.txt | 105 + SudoDEM2D/py/WeightedAverage2d.cpp | 37 + SudoDEM2D/py/__init__.py.in | 119 + SudoDEM2D/py/_extraDocs.py | 29 + SudoDEM2D/py/_polyhedra_utils.cpp | 927 + SudoDEM2D/py/_superellipse_utils.cpp | 393 + SudoDEM2D/py/_utils.cpp | 197 + SudoDEM2D/py/deprecated/bodiesHandling.py | 255 + SudoDEM2D/py/deprecated/config.py.in | 51 + SudoDEM2D/py/deprecated/export.py | 1033 + SudoDEM2D/py/deprecated/linterpolation.py | 99 + SudoDEM2D/py/deprecated/post2d.py | 306 + SudoDEM2D/py/geom.py | 494 + SudoDEM2D/py/pack/_packObb.cpp | 70 + SudoDEM2D/py/pack/_packPredicates.cpp | 383 + SudoDEM2D/py/pack/_packSpheres.cpp | 53 + SudoDEM2D/py/pack/pack.py | 606 + SudoDEM2D/py/params.py | 3 + SudoDEM2D/py/plot.py | 738 + SudoDEM2D/py/polyhedra_utils.py | 159 + SudoDEM2D/py/runtime.py | 16 + SudoDEM2D/py/svgobjects.cpp | 331 + SudoDEM2D/py/svgobjects.hpp | 156 + SudoDEM2D/py/system.py | 153 + SudoDEM2D/py/tests/__init__.py | 40 + SudoDEM2D/py/tests/clump.py | 73 + SudoDEM2D/py/tests/cohesive-chain.py | 64 + SudoDEM2D/py/tests/core.py | 224 + SudoDEM2D/py/tests/engines.py | 61 + SudoDEM2D/py/tests/pbc.py | 92 + SudoDEM2D/py/tests/wrapper.py | 173 + SudoDEM2D/py/timing.py | 123 + SudoDEM2D/py/utils.py | 1120 ++ SudoDEM2D/py/utilspost.py | 1924 ++ SudoDEM2D/py/wrapper/customConverters.cpp | 246 + SudoDEM2D/py/wrapper/sudodemWrapper.cpp | 958 + SudoDEM2D/py/ymport.py | 398 + SudoDEM3D/.DS_Store | Bin 0 -> 10244 bytes SudoDEM3D/CMakeLists.txt | 403 + SudoDEM3D/cMake/CombineSources.cmake | 32 + SudoDEM3D/cMake/FindCholmod.cmake | 31 + SudoDEM3D/cMake/FindMetis.cmake | 16 + SudoDEM3D/cMake/FindNumPy.cmake | 93 + SudoDEM3D/cMake/FindOpenBlas.cmake | 14 + SudoDEM3D/cMake/FindPythonModule.cmake | 23 + SudoDEM3D/cMake/Findglib2.cmake | 218 + SudoDEM3D/cMake/GNUInstallDirs.cmake | 188 + SudoDEM3D/cMake/GetVersion.cmake | 77 + SudoDEM3D/core/Body.cpp | 42 + SudoDEM3D/core/Body.hpp | 131 + SudoDEM3D/core/BodyContainer.cpp | 62 + SudoDEM3D/core/BodyContainer.hpp | 76 + SudoDEM3D/core/Bound.hpp | 41 + SudoDEM3D/core/Cell.cpp | 46 + SudoDEM3D/core/Cell.hpp | 199 + SudoDEM3D/core/Clump.cpp | 262 + SudoDEM3D/core/Clump.hpp | 108 + SudoDEM3D/core/Dispatcher.hpp | 229 + SudoDEM3D/core/DisplayParameters.hpp | 27 + SudoDEM3D/core/EnergyTracker.hpp | 69 + SudoDEM3D/core/Engine.hpp | 67 + SudoDEM3D/core/FileGenerator.cpp | 70 + SudoDEM3D/core/FileGenerator.hpp | 41 + SudoDEM3D/core/ForceContainer.hpp | 321 + SudoDEM3D/core/FrontEnd.hpp | 29 + SudoDEM3D/core/Functor.hpp | 86 + SudoDEM3D/core/GLConfig.hpp | 38 + SudoDEM3D/core/GlobalEngine.hpp | 20 + SudoDEM3D/core/IGeom.hpp | 29 + SudoDEM3D/core/IPhys.hpp | 27 + SudoDEM3D/core/Interaction.cpp | 38 + SudoDEM3D/core/Interaction.hpp | 68 + SudoDEM3D/core/InteractionContainer.cpp | 168 + SudoDEM3D/core/InteractionContainer.hpp | 125 + SudoDEM3D/core/Material.cpp | 26 + SudoDEM3D/core/Material.hpp | 49 + SudoDEM3D/core/Omega.cpp | 279 + SudoDEM3D/core/Omega.hpp | 115 + SudoDEM3D/core/PartialEngine.hpp | 24 + SudoDEM3D/core/Scene.cpp | 207 + SudoDEM3D/core/Scene.hpp | 141 + SudoDEM3D/core/Shape.hpp | 36 + SudoDEM3D/core/SimulationFlow.cpp | 25 + SudoDEM3D/core/SimulationFlow.hpp | 22 + SudoDEM3D/core/State.cpp | 27 + SudoDEM3D/core/State.hpp | 81 + SudoDEM3D/core/ThreadRunner.cpp | 101 + SudoDEM3D/core/ThreadRunner.hpp | 78 + SudoDEM3D/core/ThreadWorker.cpp | 77 + SudoDEM3D/core/ThreadWorker.hpp | 63 + SudoDEM3D/core/TimeStepper.hpp | 34 + SudoDEM3D/core/Timing.hpp | 50 + SudoDEM3D/core/corePlugins.cpp | 39 + SudoDEM3D/core/main/pyboot.cpp | 45 + SudoDEM3D/core/main/sudodem.cpp | 301 + SudoDEM3D/core/main/sudodemcfg.h.in | 2 + SudoDEM3D/doc/sudodem-logo-note.png | Bin 0 -> 64984 bytes SudoDEM3D/gui/CMakeLists.txt | 34 + SudoDEM3D/gui/qt4/GLViewer.cpp | 492 + SudoDEM3D/gui/qt4/GLViewer.hpp | 161 + SudoDEM3D/gui/qt4/GLViewerDisplay.cpp | 281 + SudoDEM3D/gui/qt4/GLViewerMouse.cpp | 117 + SudoDEM3D/gui/qt4/Inspector.py | 285 + SudoDEM3D/gui/qt4/OpenGLManager.cpp | 76 + SudoDEM3D/gui/qt4/OpenGLManager.hpp | 47 + SudoDEM3D/gui/qt4/SerializableEditor.py | 762 + SudoDEM3D/gui/qt4/Thumbs.db | Bin 0 -> 2560 bytes SudoDEM3D/gui/qt4/XYZ.png | Bin 0 -> 449 bytes SudoDEM3D/gui/qt4/XYZ.xpm | 45 + SudoDEM3D/gui/qt4/YZX.png | Bin 0 -> 449 bytes SudoDEM3D/gui/qt4/YZX.xpm | 45 + SudoDEM3D/gui/qt4/ZXY.png | Bin 0 -> 457 bytes SudoDEM3D/gui/qt4/ZXY.xpm | 45 + SudoDEM3D/gui/qt4/_GLViewer.cpp | 103 + SudoDEM3D/gui/qt4/__init__.py | 296 + SudoDEM3D/gui/qt4/build | 4 + SudoDEM3D/gui/qt4/controller.ui | 1135 ++ SudoDEM3D/gui/qt4/img.qrc | 8 + SudoDEM3D/gui/qt4/img_rc.py | 1080 + SudoDEM3D/gui/qt4/sudodem-favicon.png | Bin 0 -> 64984 bytes SudoDEM3D/gui/qt4/sudodem-favicon.xpm | 1664 ++ SudoDEM3D/gui/qt4/sudodem-logo.svg | 6248 ++++++ SudoDEM3D/gui/qt4/ui_controller.py | 406 + SudoDEM3D/lib/.DS_Store | Bin 0 -> 12292 bytes SudoDEM3D/lib/Eigen/.DS_Store | Bin 0 -> 8196 bytes SudoDEM3D/lib/Eigen/CMakeLists.txt | 19 + SudoDEM3D/lib/Eigen/Cholesky | 46 + SudoDEM3D/lib/Eigen/CholmodSupport | 48 + SudoDEM3D/lib/Eigen/Core | 537 + SudoDEM3D/lib/Eigen/Dense | 7 + SudoDEM3D/lib/Eigen/Eigen | 2 + SudoDEM3D/lib/Eigen/Eigenvalues | 61 + SudoDEM3D/lib/Eigen/Geometry | 62 + SudoDEM3D/lib/Eigen/Householder | 30 + SudoDEM3D/lib/Eigen/IterativeLinearSolvers | 48 + SudoDEM3D/lib/Eigen/Jacobi | 33 + SudoDEM3D/lib/Eigen/LU | 50 + SudoDEM3D/lib/Eigen/MetisSupport | 35 + SudoDEM3D/lib/Eigen/OrderingMethods | 73 + SudoDEM3D/lib/Eigen/PaStiXSupport | 48 + SudoDEM3D/lib/Eigen/PardisoSupport | 35 + SudoDEM3D/lib/Eigen/QR | 51 + SudoDEM3D/lib/Eigen/QtAlignedMalloc | 40 + SudoDEM3D/lib/Eigen/SPQRSupport | 34 + SudoDEM3D/lib/Eigen/SVD | 51 + SudoDEM3D/lib/Eigen/Sparse | 36 + SudoDEM3D/lib/Eigen/SparseCholesky | 45 + SudoDEM3D/lib/Eigen/SparseCore | 69 + SudoDEM3D/lib/Eigen/SparseLU | 46 + SudoDEM3D/lib/Eigen/SparseQR | 37 + SudoDEM3D/lib/Eigen/StdDeque | 27 + SudoDEM3D/lib/Eigen/StdList | 26 + SudoDEM3D/lib/Eigen/StdVector | 27 + SudoDEM3D/lib/Eigen/SuperLUSupport | 64 + SudoDEM3D/lib/Eigen/UmfPackSupport | 40 + SudoDEM3D/lib/Eigen/src/Cholesky/LDLT.h | 672 + SudoDEM3D/lib/Eigen/src/Cholesky/LLT.h | 542 + .../lib/Eigen/src/Cholesky/LLT_LAPACKE.h | 99 + .../Eigen/src/CholmodSupport/CholmodSupport.h | 639 + SudoDEM3D/lib/Eigen/src/Core/Array.h | 331 + SudoDEM3D/lib/Eigen/src/Core/ArrayBase.h | 226 + SudoDEM3D/lib/Eigen/src/Core/ArrayWrapper.h | 209 + SudoDEM3D/lib/Eigen/src/Core/Assign.h | 90 + .../lib/Eigen/src/Core/AssignEvaluator.h | 935 + SudoDEM3D/lib/Eigen/src/Core/Assign_MKL.h | 178 + SudoDEM3D/lib/Eigen/src/Core/BandMatrix.h | 353 + SudoDEM3D/lib/Eigen/src/Core/Block.h | 452 + SudoDEM3D/lib/Eigen/src/Core/BooleanRedux.h | 164 + .../lib/Eigen/src/Core/CommaInitializer.h | 160 + .../lib/Eigen/src/Core/ConditionEstimator.h | 175 + SudoDEM3D/lib/Eigen/src/Core/CoreEvaluators.h | 1688 ++ SudoDEM3D/lib/Eigen/src/Core/CoreIterators.h | 127 + SudoDEM3D/lib/Eigen/src/Core/CwiseBinaryOp.h | 184 + SudoDEM3D/lib/Eigen/src/Core/CwiseNullaryOp.h | 866 + SudoDEM3D/lib/Eigen/src/Core/CwiseTernaryOp.h | 197 + SudoDEM3D/lib/Eigen/src/Core/CwiseUnaryOp.h | 103 + SudoDEM3D/lib/Eigen/src/Core/CwiseUnaryView.h | 128 + SudoDEM3D/lib/Eigen/src/Core/DenseBase.h | 611 + .../lib/Eigen/src/Core/DenseCoeffsBase.h | 681 + SudoDEM3D/lib/Eigen/src/Core/DenseStorage.h | 570 + SudoDEM3D/lib/Eigen/src/Core/Diagonal.h | 260 + SudoDEM3D/lib/Eigen/src/Core/DiagonalMatrix.h | 343 + .../lib/Eigen/src/Core/DiagonalProduct.h | 28 + SudoDEM3D/lib/Eigen/src/Core/Dot.h | 318 + SudoDEM3D/lib/Eigen/src/Core/EigenBase.h | 159 + .../lib/Eigen/src/Core/ForceAlignedAccess.h | 146 + SudoDEM3D/lib/Eigen/src/Core/Fuzzy.h | 155 + SudoDEM3D/lib/Eigen/src/Core/GeneralProduct.h | 455 + .../lib/Eigen/src/Core/GenericPacketMath.h | 593 + .../lib/Eigen/src/Core/GlobalFunctions.h | 187 + SudoDEM3D/lib/Eigen/src/Core/IO.h | 225 + SudoDEM3D/lib/Eigen/src/Core/Inverse.h | 118 + SudoDEM3D/lib/Eigen/src/Core/Map.h | 171 + SudoDEM3D/lib/Eigen/src/Core/MapBase.h | 299 + SudoDEM3D/lib/Eigen/src/Core/MathFunctions.h | 1407 ++ .../lib/Eigen/src/Core/MathFunctionsImpl.h | 101 + SudoDEM3D/lib/Eigen/src/Core/Matrix.h | 461 + SudoDEM3D/lib/Eigen/src/Core/MatrixBase.h | 521 + SudoDEM3D/lib/Eigen/src/Core/NestByValue.h | 110 + SudoDEM3D/lib/Eigen/src/Core/NoAlias.h | 108 + SudoDEM3D/lib/Eigen/src/Core/NumTraits.h | 248 + .../lib/Eigen/src/Core/PermutationMatrix.h | 633 + .../lib/Eigen/src/Core/PlainObjectBase.h | 1035 + SudoDEM3D/lib/Eigen/src/Core/Product.h | 186 + .../lib/Eigen/src/Core/ProductEvaluators.h | 1112 ++ SudoDEM3D/lib/Eigen/src/Core/Random.h | 182 + SudoDEM3D/lib/Eigen/src/Core/Redux.h | 505 + SudoDEM3D/lib/Eigen/src/Core/Ref.h | 283 + SudoDEM3D/lib/Eigen/src/Core/Replicate.h | 142 + SudoDEM3D/lib/Eigen/src/Core/ReturnByValue.h | 117 + SudoDEM3D/lib/Eigen/src/Core/Reverse.h | 211 + SudoDEM3D/lib/Eigen/src/Core/Select.h | 162 + .../lib/Eigen/src/Core/SelfAdjointView.h | 352 + .../lib/Eigen/src/Core/SelfCwiseBinaryOp.h | 47 + SudoDEM3D/lib/Eigen/src/Core/Solve.h | 188 + .../lib/Eigen/src/Core/SolveTriangular.h | 232 + SudoDEM3D/lib/Eigen/src/Core/SolverBase.h | 130 + SudoDEM3D/lib/Eigen/src/Core/StableNorm.h | 221 + SudoDEM3D/lib/Eigen/src/Core/Stride.h | 111 + SudoDEM3D/lib/Eigen/src/Core/Swap.h | 67 + SudoDEM3D/lib/Eigen/src/Core/Transpose.h | 403 + SudoDEM3D/lib/Eigen/src/Core/Transpositions.h | 407 + .../lib/Eigen/src/Core/TriangularMatrix.h | 983 + SudoDEM3D/lib/Eigen/src/Core/VectorBlock.h | 96 + SudoDEM3D/lib/Eigen/src/Core/VectorwiseOp.h | 695 + SudoDEM3D/lib/Eigen/src/Core/Visitor.h | 273 + .../lib/Eigen/src/Core/arch/AVX/Complex.h | 451 + .../Eigen/src/Core/arch/AVX/MathFunctions.h | 439 + .../lib/Eigen/src/Core/arch/AVX/PacketMath.h | 636 + .../lib/Eigen/src/Core/arch/AVX/TypeCasting.h | 51 + .../src/Core/arch/AVX512/MathFunctions.h | 391 + .../Eigen/src/Core/arch/AVX512/PacketMath.h | 1316 ++ .../lib/Eigen/src/Core/arch/AltiVec/Complex.h | 430 + .../src/Core/arch/AltiVec/MathFunctions.h | 322 + .../Eigen/src/Core/arch/AltiVec/PacketMath.h | 1061 + .../lib/Eigen/src/Core/arch/CUDA/Complex.h | 103 + SudoDEM3D/lib/Eigen/src/Core/arch/CUDA/Half.h | 651 + .../Eigen/src/Core/arch/CUDA/MathFunctions.h | 91 + .../lib/Eigen/src/Core/arch/CUDA/PacketMath.h | 333 + .../Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 1123 ++ .../Eigen/src/Core/arch/CUDA/TypeCasting.h | 212 + .../Eigen/src/Core/arch/Default/ConjHelper.h | 29 + .../Eigen/src/Core/arch/Default/Settings.h | 49 + .../lib/Eigen/src/Core/arch/NEON/Complex.h | 490 + .../Eigen/src/Core/arch/NEON/MathFunctions.h | 91 + .../lib/Eigen/src/Core/arch/NEON/PacketMath.h | 760 + .../lib/Eigen/src/Core/arch/SSE/Complex.h | 471 + .../Eigen/src/Core/arch/SSE/MathFunctions.h | 562 + .../lib/Eigen/src/Core/arch/SSE/PacketMath.h | 895 + .../lib/Eigen/src/Core/arch/SSE/TypeCasting.h | 77 + .../lib/Eigen/src/Core/arch/ZVector/Complex.h | 397 + .../src/Core/arch/ZVector/MathFunctions.h | 137 + .../Eigen/src/Core/arch/ZVector/PacketMath.h | 945 + .../src/Core/functors/AssignmentFunctors.h | 168 + .../Eigen/src/Core/functors/BinaryFunctors.h | 475 + .../Eigen/src/Core/functors/NullaryFunctors.h | 188 + .../lib/Eigen/src/Core/functors/StlFunctors.h | 136 + .../Eigen/src/Core/functors/TernaryFunctors.h | 25 + .../Eigen/src/Core/functors/UnaryFunctors.h | 792 + .../Core/products/GeneralBlockPanelKernel.h | 2149 ++ .../src/Core/products/GeneralMatrixMatrix.h | 492 + .../products/GeneralMatrixMatrixTriangular.h | 311 + .../GeneralMatrixMatrixTriangular_BLAS.h | 145 + .../Core/products/GeneralMatrixMatrix_BLAS.h | 122 + .../src/Core/products/GeneralMatrixVector.h | 619 + .../Core/products/GeneralMatrixVector_BLAS.h | 136 + .../Eigen/src/Core/products/Parallelizer.h | 163 + .../Core/products/SelfadjointMatrixMatrix.h | 521 + .../products/SelfadjointMatrixMatrix_BLAS.h | 287 + .../Core/products/SelfadjointMatrixVector.h | 260 + .../products/SelfadjointMatrixVector_BLAS.h | 118 + .../src/Core/products/SelfadjointProduct.h | 133 + .../Core/products/SelfadjointRank2Update.h | 93 + .../Core/products/TriangularMatrixMatrix.h | 466 + .../products/TriangularMatrixMatrix_BLAS.h | 315 + .../Core/products/TriangularMatrixVector.h | 350 + .../products/TriangularMatrixVector_BLAS.h | 255 + .../Core/products/TriangularSolverMatrix.h | 335 + .../products/TriangularSolverMatrix_BLAS.h | 163 + .../Core/products/TriangularSolverVector.h | 145 + SudoDEM3D/lib/Eigen/src/Core/util/BlasUtil.h | 398 + SudoDEM3D/lib/Eigen/src/Core/util/Constants.h | 547 + .../src/Core/util/DisableStupidWarnings.h | 75 + .../Eigen/src/Core/util/ForwardDeclarations.h | 302 + .../lib/Eigen/src/Core/util/MKL_support.h | 130 + SudoDEM3D/lib/Eigen/src/Core/util/Macros.h | 1001 + SudoDEM3D/lib/Eigen/src/Core/util/Memory.h | 985 + SudoDEM3D/lib/Eigen/src/Core/util/Meta.h | 512 + SudoDEM3D/lib/Eigen/src/Core/util/NonMPL2.h | 3 + .../src/Core/util/ReenableStupidWarnings.h | 27 + .../lib/Eigen/src/Core/util/StaticAssert.h | 218 + SudoDEM3D/lib/Eigen/src/Core/util/XprHelper.h | 821 + .../src/Eigenvalues/ComplexEigenSolver.h | 346 + .../lib/Eigen/src/Eigenvalues/ComplexSchur.h | 459 + .../src/Eigenvalues/ComplexSchur_LAPACKE.h | 91 + .../lib/Eigen/src/Eigenvalues/EigenSolver.h | 622 + .../src/Eigenvalues/GeneralizedEigenSolver.h | 418 + .../GeneralizedSelfAdjointEigenSolver.h | 226 + .../src/Eigenvalues/HessenbergDecomposition.h | 374 + .../src/Eigenvalues/MatrixBaseEigenvalues.h | 160 + SudoDEM3D/lib/Eigen/src/Eigenvalues/RealQZ.h | 654 + .../lib/Eigen/src/Eigenvalues/RealSchur.h | 546 + .../Eigen/src/Eigenvalues/RealSchur_LAPACKE.h | 77 + .../src/Eigenvalues/SelfAdjointEigenSolver.h | 870 + .../SelfAdjointEigenSolver_LAPACKE.h | 87 + .../src/Eigenvalues/Tridiagonalization.h | 556 + SudoDEM3D/lib/Eigen/src/Geometry/AlignedBox.h | 392 + SudoDEM3D/lib/Eigen/src/Geometry/AngleAxis.h | 247 + .../lib/Eigen/src/Geometry/EulerAngles.h | 114 + .../lib/Eigen/src/Geometry/Homogeneous.h | 497 + SudoDEM3D/lib/Eigen/src/Geometry/Hyperplane.h | 282 + .../lib/Eigen/src/Geometry/OrthoMethods.h | 234 + .../lib/Eigen/src/Geometry/ParametrizedLine.h | 195 + SudoDEM3D/lib/Eigen/src/Geometry/Quaternion.h | 814 + SudoDEM3D/lib/Eigen/src/Geometry/Rotation2D.h | 199 + .../lib/Eigen/src/Geometry/RotationBase.h | 206 + SudoDEM3D/lib/Eigen/src/Geometry/Scaling.h | 170 + SudoDEM3D/lib/Eigen/src/Geometry/Transform.h | 1542 ++ .../lib/Eigen/src/Geometry/Translation.h | 208 + SudoDEM3D/lib/Eigen/src/Geometry/Umeyama.h | 166 + .../Eigen/src/Geometry/arch/Geometry_SSE.h | 161 + .../Eigen/src/Householder/BlockHouseholder.h | 103 + .../lib/Eigen/src/Householder/Householder.h | 172 + .../src/Householder/HouseholderSequence.h | 470 + .../BasicPreconditioners.h | 226 + .../src/IterativeLinearSolvers/BiCGSTAB.h | 228 + .../ConjugateGradient.h | 245 + .../IncompleteCholesky.h | 400 + .../IterativeLinearSolvers/IncompleteLUT.h | 462 + .../IterativeSolverBase.h | 394 + .../LeastSquareConjugateGradient.h | 216 + .../IterativeLinearSolvers/SolveWithGuess.h | 115 + SudoDEM3D/lib/Eigen/src/Jacobi/Jacobi.h | 463 + SudoDEM3D/lib/Eigen/src/LU/Determinant.h | 101 + SudoDEM3D/lib/Eigen/src/LU/FullPivLU.h | 891 + SudoDEM3D/lib/Eigen/src/LU/InverseImpl.h | 415 + SudoDEM3D/lib/Eigen/src/LU/PartialPivLU.h | 611 + .../lib/Eigen/src/LU/PartialPivLU_LAPACKE.h | 83 + SudoDEM3D/lib/Eigen/src/LU/arch/Inverse_SSE.h | 338 + .../lib/Eigen/src/MetisSupport/MetisSupport.h | 137 + SudoDEM3D/lib/Eigen/src/OrderingMethods/Amd.h | 445 + .../Eigen/src/OrderingMethods/Eigen_Colamd.h | 1843 ++ .../lib/Eigen/src/OrderingMethods/Ordering.h | 157 + .../Eigen/src/PaStiXSupport/PaStiXSupport.h | 678 + .../Eigen/src/PardisoSupport/PardisoSupport.h | 543 + .../lib/Eigen/src/QR/ColPivHouseholderQR.h | 653 + .../src/QR/ColPivHouseholderQR_LAPACKE.h | 97 + .../src/QR/CompleteOrthogonalDecomposition.h | 562 + .../lib/Eigen/src/QR/FullPivHouseholderQR.h | 676 + SudoDEM3D/lib/Eigen/src/QR/HouseholderQR.h | 409 + .../lib/Eigen/src/QR/HouseholderQR_LAPACKE.h | 68 + .../src/SPQRSupport/SuiteSparseQRSupport.h | 313 + SudoDEM3D/lib/Eigen/src/SVD/BDCSVD.h | 1246 ++ SudoDEM3D/lib/Eigen/src/SVD/JacobiSVD.h | 804 + .../lib/Eigen/src/SVD/JacobiSVD_LAPACKE.h | 91 + SudoDEM3D/lib/Eigen/src/SVD/SVDBase.h | 313 + .../Eigen/src/SVD/UpperBidiagonalization.h | 414 + .../src/SparseCholesky/SimplicialCholesky.h | 689 + .../SparseCholesky/SimplicialCholesky_impl.h | 199 + .../lib/Eigen/src/SparseCore/AmbiVector.h | 377 + .../Eigen/src/SparseCore/CompressedStorage.h | 258 + .../ConservativeSparseSparseProduct.h | 352 + .../Eigen/src/SparseCore/MappedSparseMatrix.h | 67 + .../lib/Eigen/src/SparseCore/SparseAssign.h | 216 + .../lib/Eigen/src/SparseCore/SparseBlock.h | 603 + .../lib/Eigen/src/SparseCore/SparseColEtree.h | 206 + .../src/SparseCore/SparseCompressedBase.h | 341 + .../src/SparseCore/SparseCwiseBinaryOp.h | 726 + .../Eigen/src/SparseCore/SparseCwiseUnaryOp.h | 148 + .../Eigen/src/SparseCore/SparseDenseProduct.h | 320 + .../src/SparseCore/SparseDiagonalProduct.h | 138 + .../lib/Eigen/src/SparseCore/SparseDot.h | 98 + .../lib/Eigen/src/SparseCore/SparseFuzzy.h | 29 + .../lib/Eigen/src/SparseCore/SparseMap.h | 305 + .../lib/Eigen/src/SparseCore/SparseMatrix.h | 1403 ++ .../Eigen/src/SparseCore/SparseMatrixBase.h | 405 + .../Eigen/src/SparseCore/SparsePermutation.h | 178 + .../lib/Eigen/src/SparseCore/SparseProduct.h | 169 + .../lib/Eigen/src/SparseCore/SparseRedux.h | 49 + .../lib/Eigen/src/SparseCore/SparseRef.h | 397 + .../src/SparseCore/SparseSelfAdjointView.h | 656 + .../Eigen/src/SparseCore/SparseSolverBase.h | 124 + .../SparseSparseProductWithPruning.h | 198 + .../Eigen/src/SparseCore/SparseTranspose.h | 92 + .../src/SparseCore/SparseTriangularView.h | 189 + .../lib/Eigen/src/SparseCore/SparseUtil.h | 178 + .../lib/Eigen/src/SparseCore/SparseVector.h | 478 + .../lib/Eigen/src/SparseCore/SparseView.h | 253 + .../Eigen/src/SparseCore/TriangularSolver.h | 315 + SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU.h | 775 + .../lib/Eigen/src/SparseLU/SparseLUImpl.h | 66 + .../lib/Eigen/src/SparseLU/SparseLU_Memory.h | 226 + .../lib/Eigen/src/SparseLU/SparseLU_Structs.h | 110 + .../src/SparseLU/SparseLU_SupernodalMatrix.h | 301 + .../lib/Eigen/src/SparseLU/SparseLU_Utils.h | 80 + .../Eigen/src/SparseLU/SparseLU_column_bmod.h | 181 + .../Eigen/src/SparseLU/SparseLU_column_dfs.h | 179 + .../src/SparseLU/SparseLU_copy_to_ucol.h | 107 + .../Eigen/src/SparseLU/SparseLU_gemm_kernel.h | 280 + .../src/SparseLU/SparseLU_heap_relax_snode.h | 126 + .../Eigen/src/SparseLU/SparseLU_kernel_bmod.h | 130 + .../Eigen/src/SparseLU/SparseLU_panel_bmod.h | 223 + .../Eigen/src/SparseLU/SparseLU_panel_dfs.h | 258 + .../lib/Eigen/src/SparseLU/SparseLU_pivotL.h | 137 + .../lib/Eigen/src/SparseLU/SparseLU_pruneL.h | 136 + .../Eigen/src/SparseLU/SparseLU_relax_snode.h | 83 + SudoDEM3D/lib/Eigen/src/SparseQR/SparseQR.h | 745 + SudoDEM3D/lib/Eigen/src/StlSupport/StdDeque.h | 126 + SudoDEM3D/lib/Eigen/src/StlSupport/StdList.h | 106 + .../lib/Eigen/src/StlSupport/StdVector.h | 131 + SudoDEM3D/lib/Eigen/src/StlSupport/details.h | 84 + .../Eigen/src/SuperLUSupport/SuperLUSupport.h | 1027 + .../Eigen/src/UmfPackSupport/UmfPackSupport.h | 506 + SudoDEM3D/lib/Eigen/src/misc/Image.h | 82 + SudoDEM3D/lib/Eigen/src/misc/Kernel.h | 79 + SudoDEM3D/lib/Eigen/src/misc/RealSvd2x2.h | 55 + SudoDEM3D/lib/Eigen/src/misc/blas.h | 440 + SudoDEM3D/lib/Eigen/src/misc/lapack.h | 152 + SudoDEM3D/lib/Eigen/src/misc/lapacke.h | 16291 ++++++++++++++++ .../lib/Eigen/src/misc/lapacke_mangling.h | 17 + .../Eigen/src/plugins/ArrayCwiseBinaryOps.h | 332 + .../Eigen/src/plugins/ArrayCwiseUnaryOps.h | 552 + .../lib/Eigen/src/plugins/BlockMethods.h | 1058 + .../Eigen/src/plugins/CommonCwiseBinaryOps.h | 115 + .../Eigen/src/plugins/CommonCwiseUnaryOps.h | 163 + .../Eigen/src/plugins/MatrixCwiseBinaryOps.h | 152 + .../Eigen/src/plugins/MatrixCwiseUnaryOps.h | 85 + SudoDEM3D/lib/base/Logging.hpp | 60 + SudoDEM3D/lib/base/Math.cpp | 56 + SudoDEM3D/lib/base/Math.hpp | 761 + SudoDEM3D/lib/base/Singleton.hpp | 24 + SudoDEM3D/lib/base/openmp-accu.hpp | 206 + SudoDEM3D/lib/factory/ClassFactory.cpp | 128 + SudoDEM3D/lib/factory/ClassFactory.hpp | 181 + SudoDEM3D/lib/factory/DynLibManager.cpp | 88 + SudoDEM3D/lib/factory/DynLibManager.hpp | 44 + SudoDEM3D/lib/factory/Factorable.hpp | 76 + SudoDEM3D/lib/import/STLReader.hpp | 254 + .../lib/multimethods/DynLibDispatcher.hpp | 722 + SudoDEM3D/lib/multimethods/FunctorWrapper.hpp | 161 + SudoDEM3D/lib/multimethods/Indexable.hpp | 102 + SudoDEM3D/lib/multimethods/loki/EmptyType.h | 49 + SudoDEM3D/lib/multimethods/loki/Functor.h | 1789 ++ SudoDEM3D/lib/multimethods/loki/LokiExport.h | 69 + SudoDEM3D/lib/multimethods/loki/NullType.h | 34 + SudoDEM3D/lib/multimethods/loki/Sequence.h | 49 + SudoDEM3D/lib/multimethods/loki/Singleton.h | 889 + SudoDEM3D/lib/multimethods/loki/SmallObj.h | 643 + SudoDEM3D/lib/multimethods/loki/Threads.h | 609 + SudoDEM3D/lib/multimethods/loki/TypeManip.h | 284 + SudoDEM3D/lib/multimethods/loki/TypeTraits.h | 2228 +++ SudoDEM3D/lib/multimethods/loki/Typelist.h | 459 + .../lib/multimethods/loki/TypelistMacros.h | 353 + SudoDEM3D/lib/opengl/GLUtils.cpp | 61 + SudoDEM3D/lib/opengl/GLUtils.hpp | 46 + SudoDEM3D/lib/opengl/OpenGLWrapper.hpp | 217 + SudoDEM3D/lib/pyutil/README | 2 + SudoDEM3D/lib/pyutil/doc_opts.hpp | 10 + SudoDEM3D/lib/pyutil/gil.cpp | 5 + SudoDEM3D/lib/pyutil/gil.hpp | 14 + SudoDEM3D/lib/pyutil/numpy.hpp | 7 + SudoDEM3D/lib/pyutil/numpy_boost.hpp | 251 + SudoDEM3D/lib/pyutil/raw_constructor.hpp | 20 + SudoDEM3D/lib/qhull/geom.c | 1230 ++ SudoDEM3D/lib/qhull/geom.h | 177 + SudoDEM3D/lib/qhull/geom2.c | 2160 ++ SudoDEM3D/lib/qhull/global.c | 2018 ++ SudoDEM3D/lib/qhull/io.c | 4089 ++++ SudoDEM3D/lib/qhull/io.h | 149 + SudoDEM3D/lib/qhull/mem.c | 447 + SudoDEM3D/lib/qhull/mem.h | 174 + SudoDEM3D/lib/qhull/merge.c | 3626 ++++ SudoDEM3D/lib/qhull/merge.h | 171 + SudoDEM3D/lib/qhull/poly.c | 1180 ++ SudoDEM3D/lib/qhull/poly.h | 290 + SudoDEM3D/lib/qhull/poly2.c | 3070 +++ SudoDEM3D/lib/qhull/qhull.c | 1395 ++ SudoDEM3D/lib/qhull/qhull.h | 1048 + SudoDEM3D/lib/qhull/qhull_a.h | 127 + SudoDEM3D/lib/qhull/qset.c | 1301 ++ SudoDEM3D/lib/qhull/qset.h | 468 + SudoDEM3D/lib/qhull/stat.c | 700 + SudoDEM3D/lib/qhull/stat.h | 520 + SudoDEM3D/lib/qhull/user.c | 324 + SudoDEM3D/lib/qhull/user.h | 762 + SudoDEM3D/lib/serialization/ObjectIO.hpp | 75 + SudoDEM3D/lib/serialization/Serializable.cpp | 48 + SudoDEM3D/lib/serialization/Serializable.hpp | 290 + SudoDEM3D/lib/smoothing/LinearInterpolate.hpp | 48 + SudoDEM3D/lib/smoothing/WeightedAverage2d.hpp | 222 + SudoDEM3D/lib/voro++/README | 21 + SudoDEM3D/lib/voro++/c_loops.cc | 150 + SudoDEM3D/lib/voro++/c_loops.hh | 456 + SudoDEM3D/lib/voro++/cell.cc | 2252 +++ SudoDEM3D/lib/voro++/cell.hh | 514 + SudoDEM3D/lib/voro++/cmd_line.cc | 498 + SudoDEM3D/lib/voro++/common.cc | 90 + SudoDEM3D/lib/voro++/common.hh | 67 + SudoDEM3D/lib/voro++/config.hh | 127 + SudoDEM3D/lib/voro++/container.cc | 549 + SudoDEM3D/lib/voro++/container.hh | 729 + SudoDEM3D/lib/voro++/container_prd.cc | 768 + SudoDEM3D/lib/voro++/container_prd.hh | 654 + SudoDEM3D/lib/voro++/pre_container.cc | 236 + SudoDEM3D/lib/voro++/pre_container.hh | 162 + SudoDEM3D/lib/voro++/rad_option.hh | 158 + SudoDEM3D/lib/voro++/unitcell.cc | 231 + SudoDEM3D/lib/voro++/unitcell.hh | 79 + SudoDEM3D/lib/voro++/v_base.cc | 118 + SudoDEM3D/lib/voro++/v_base.hh | 88 + SudoDEM3D/lib/voro++/v_base_wl.cc | 79 + SudoDEM3D/lib/voro++/v_compute.cc | 1006 + SudoDEM3D/lib/voro++/v_compute.hh | 149 + SudoDEM3D/lib/voro++/voro++.cc | 19 + SudoDEM3D/lib/voro++/voro++.hh | 333 + SudoDEM3D/lib/voro++/wall.cc | 132 + SudoDEM3D/lib/voro++/wall.hh | 119 + SudoDEM3D/lib/voro++/worklist.hh | 32 + SudoDEM3D/pkg/.DS_Store | Bin 0 -> 8196 bytes SudoDEM3D/pkg/common/Aabb.cpp | 22 + SudoDEM3D/pkg/common/Aabb.hpp | 37 + SudoDEM3D/pkg/common/BoundaryController.hpp | 9 + SudoDEM3D/pkg/common/Box.cpp | 41 + SudoDEM3D/pkg/common/Box.hpp | 44 + SudoDEM3D/pkg/common/Callbacks.hpp | 37 + SudoDEM3D/pkg/common/Collider.cpp | 47 + SudoDEM3D/pkg/common/Collider.hpp | 51 + SudoDEM3D/pkg/common/CylScGeom6D.hpp | 58 + SudoDEM3D/pkg/common/Dispatching.cpp | 202 + SudoDEM3D/pkg/common/Dispatching.hpp | 135 + SudoDEM3D/pkg/common/ElastMat.hpp | 28 + SudoDEM3D/pkg/common/Facet.cpp | 122 + SudoDEM3D/pkg/common/Facet.hpp | 76 + SudoDEM3D/pkg/common/FieldApplier.hpp | 14 + SudoDEM3D/pkg/common/ForceEngine.cpp | 170 + SudoDEM3D/pkg/common/ForceEngine.hpp | 96 + SudoDEM3D/pkg/common/ForceResetter.hpp | 17 + SudoDEM3D/pkg/common/GLDrawFunctors.hpp | 50 + SudoDEM3D/pkg/common/Gl1_NormPhys.cpp | 97 + SudoDEM3D/pkg/common/Gl1_NormPhys.hpp | 30 + SudoDEM3D/pkg/common/GravityEngines.cpp | 86 + SudoDEM3D/pkg/common/GravityEngines.hpp | 72 + .../pkg/common/InsertionSortCollider.cpp | 561 + .../pkg/common/InsertionSortCollider.hpp | 255 + SudoDEM3D/pkg/common/InteractionLoop.cpp | 149 + SudoDEM3D/pkg/common/InteractionLoop.hpp | 45 + SudoDEM3D/pkg/common/KinematicEngines.cpp | 215 + SudoDEM3D/pkg/common/KinematicEngines.hpp | 130 + SudoDEM3D/pkg/common/MatchMaker.cpp | 26 + SudoDEM3D/pkg/common/MatchMaker.hpp | 45 + SudoDEM3D/pkg/common/NormShearPhys.hpp | 30 + SudoDEM3D/pkg/common/OpenGLRenderer.cpp | 416 + SudoDEM3D/pkg/common/OpenGLRenderer.hpp | 132 + SudoDEM3D/pkg/common/ParallelEngine.cpp | 52 + SudoDEM3D/pkg/common/ParallelEngine.hpp | 28 + SudoDEM3D/pkg/common/PeriodicEngines.hpp | 69 + SudoDEM3D/pkg/common/PyRunner.hpp | 17 + SudoDEM3D/pkg/common/Recorder.hpp | 33 + SudoDEM3D/pkg/common/Sphere.cpp | 163 + SudoDEM3D/pkg/common/Sphere.hpp | 69 + SudoDEM3D/pkg/common/StepDisplacer.hpp | 32 + SudoDEM3D/pkg/common/TorqueEngine.hpp | 28 + SudoDEM3D/pkg/common/Wall.cpp | 52 + SudoDEM3D/pkg/common/Wall.hpp | 41 + SudoDEM3D/pkg/common/common.cpp | 40 + SudoDEM3D/pkg/dem/.DS_Store | Bin 0 -> 12292 bytes SudoDEM3D/pkg/dem/Compression.cpp | 1457 ++ SudoDEM3D/pkg/dem/Compression.hpp | 252 + SudoDEM3D/pkg/dem/DemXDofGeom.hpp | 21 + SudoDEM3D/pkg/dem/Disp2DPropLoadEngine.cpp | 218 + SudoDEM3D/pkg/dem/Disp2DPropLoadEngine.hpp | 78 + SudoDEM3D/pkg/dem/DomainLimiter.cpp | 344 + SudoDEM3D/pkg/dem/DomainLimiter.hpp | 98 + SudoDEM3D/pkg/dem/ElasticContactLaw.cpp | 111 + SudoDEM3D/pkg/dem/ElasticContactLaw.hpp | 64 + SudoDEM3D/pkg/dem/Expander.cpp | 103 + SudoDEM3D/pkg/dem/Expander.hpp | 60 + SudoDEM3D/pkg/dem/FacetTopologyAnalyzer.cpp | 142 + SudoDEM3D/pkg/dem/FacetTopologyAnalyzer.hpp | 63 + SudoDEM3D/pkg/dem/FlatGridCollider.cpp | 105 + SudoDEM3D/pkg/dem/FlatGridCollider.hpp | 45 + SudoDEM3D/pkg/dem/FrictPhys.cpp | 69 + SudoDEM3D/pkg/dem/FrictPhys.hpp | 62 + SudoDEM3D/pkg/dem/FrictViscoPM.cpp | 228 + SudoDEM3D/pkg/dem/FrictViscoPM.hpp | 118 + SudoDEM3D/pkg/dem/GJK.hpp | 552 + SudoDEM3D/pkg/dem/GJKParticle.cpp | 1322 ++ SudoDEM3D/pkg/dem/GJKParticle.hpp | 372 + SudoDEM3D/pkg/dem/GJKParticle_Ig2.cpp | 739 + SudoDEM3D/pkg/dem/GJKParticle_Ig2.hpp | 823 + SudoDEM3D/pkg/dem/GJKParticle_shapes.cpp | 619 + SudoDEM3D/pkg/dem/GJKParticle_shapes.h | 651 + ...GeneralIntegratorInsertionSortCollider.cpp | 226 + ...GeneralIntegratorInsertionSortCollider.hpp | 39 + .../pkg/dem/GlobalStiffnessTimeStepper.cpp | 211 + .../pkg/dem/GlobalStiffnessTimeStepper.hpp | 56 + SudoDEM3D/pkg/dem/HertzMindlin.cpp | 608 + SudoDEM3D/pkg/dem/HertzMindlin.hpp | 223 + SudoDEM3D/pkg/dem/Ig2_Basic_ScGeom.cpp | 443 + SudoDEM3D/pkg/dem/Ig2_Basic_ScGeom.hpp | 151 + SudoDEM3D/pkg/dem/ImpulseDynamic.cpp | 450 + SudoDEM3D/pkg/dem/ImpulseDynamic.hpp | 99 + SudoDEM3D/pkg/dem/Integrator.cpp | 350 + SudoDEM3D/pkg/dem/Integrator.hpp | 112 + SudoDEM3D/pkg/dem/Ip2_ElastMat.cpp | 63 + SudoDEM3D/pkg/dem/Ip2_ElastMat.hpp | 24 + SudoDEM3D/pkg/dem/L3Geom.cpp | 364 + SudoDEM3D/pkg/dem/L3Geom.hpp | 196 + SudoDEM3D/pkg/dem/NewtonIntegrator.cpp | 477 + SudoDEM3D/pkg/dem/NewtonIntegrator.hpp | 101 + SudoDEM3D/pkg/dem/PeriIsoCompressor.cpp | 414 + SudoDEM3D/pkg/dem/PeriIsoCompressor.hpp | 120 + SudoDEM3D/pkg/dem/PolyCompression.cpp | 338 + SudoDEM3D/pkg/dem/PolyCompression.hpp | 164 + SudoDEM3D/pkg/dem/PolySuperellipsoid.cpp | 986 + SudoDEM3D/pkg/dem/PolySuperellipsoid.hpp | 327 + SudoDEM3D/pkg/dem/PolySuperellipsoid_Ig2.cpp | 1246 ++ SudoDEM3D/pkg/dem/PolySuperellipsoid_Ig2.hpp | 46 + SudoDEM3D/pkg/dem/RollingResistanceLaw.cpp | 236 + SudoDEM3D/pkg/dem/RollingResistanceLaw.hpp | 110 + SudoDEM3D/pkg/dem/STLImporter.cpp | 50 + SudoDEM3D/pkg/dem/STLImporter.hpp | 19 + SudoDEM3D/pkg/dem/ScGeom.cpp | 133 + SudoDEM3D/pkg/dem/ScGeom.hpp | 127 + SudoDEM3D/pkg/dem/Shop.hpp | 146 + SudoDEM3D/pkg/dem/Shop_01.cpp | 444 + SudoDEM3D/pkg/dem/Shop_02.cpp | 497 + SudoDEM3D/pkg/dem/SnapshotEngine.cpp | 41 + SudoDEM3D/pkg/dem/SnapshotEngine.hpp | 25 + SudoDEM3D/pkg/dem/SpherePack.cpp | 555 + SudoDEM3D/pkg/dem/SpherePack.hpp | 134 + SudoDEM3D/pkg/dem/SpheresFactory.cpp | 221 + SudoDEM3D/pkg/dem/SpheresFactory.hpp | 80 + SudoDEM3D/pkg/dem/Superquadrics.cpp | 1557 ++ SudoDEM3D/pkg/dem/Superquadrics.hpp | 461 + SudoDEM3D/pkg/dem/Superquadrics_Ig2.cpp | 2760 +++ SudoDEM3D/pkg/dem/Superquadrics_Ig2.hpp | 77 + .../pkg/dem/UnbalancedForceCallbacks.cpp | 51 + .../pkg/dem/UnbalancedForceCallbacks.hpp | 27 + SudoDEM3D/pkg/dem/ViscoelasticPM.cpp | 273 + SudoDEM3D/pkg/dem/ViscoelasticPM.hpp | 102 + SudoDEM3D/pkg/dem/VolumeFric.cpp | 80 + SudoDEM3D/pkg/dem/VolumeFric.hpp | 84 + SudoDEM3D/pkg/fem/FEContainer.cpp | 41 + SudoDEM3D/pkg/fem/FEContainer.hpp | 125 + SudoDEM3D/pkg/fem/FEMdriver.cpp | 215 + SudoDEM3D/pkg/fem/FEMdriver.hpp | 68 + SudoDEM3D/pkg/fem/FlexCompression.cpp | 894 + SudoDEM3D/pkg/fem/FlexCompression.hpp | 231 + SudoDEM3D/pkg/fem/Node.cpp | 74 + SudoDEM3D/pkg/fem/Node.hpp | 188 + SudoDEM3D/pkg/fem/NodeForceContainer.hpp | 321 + SudoDEM3D/pkg/fem/TriElement.cpp | 773 + SudoDEM3D/pkg/fem/TriElement.hpp | 185 + SudoDEM3D/py/.DS_Store | Bin 0 -> 8196 bytes SudoDEM3D/py/3rd-party/README | 25 + SudoDEM3D/py/3rd-party/mtTkinter-0.4/gpl.txt | 674 + SudoDEM3D/py/3rd-party/mtTkinter-0.4/lgpl.txt | 165 + .../py/3rd-party/mtTkinter-0.4/mtTkinter.py | 242 + SudoDEM3D/py/CMakeLists.txt | 50 + SudoDEM3D/py/__init__.py.in | 119 + SudoDEM3D/py/_extraDocs.py | 163 + SudoDEM3D/py/_fem_utils.cpp | 119 + SudoDEM3D/py/_gjkparticle_utils.cpp | 709 + SudoDEM3D/py/_superquadrics_utils.cpp | 1271 ++ SudoDEM3D/py/_utils.cpp | 607 + SudoDEM3D/py/geom.py | 494 + SudoDEM3D/py/params.py | 3 + SudoDEM3D/py/plot.py | 738 + SudoDEM3D/py/runtime.py | 16 + SudoDEM3D/py/snapshot.py | 119 + SudoDEM3D/py/system.py | 153 + SudoDEM3D/py/timing.py | 123 + SudoDEM3D/py/utils.py | 1100 ++ SudoDEM3D/py/utilspost.py | 1998 ++ SudoDEM3D/py/wrapper/customConverters.cpp | 222 + SudoDEM3D/py/wrapper/sudodemWrapper.cpp | 1112 ++ SudoDEM3D/py/ymport.py | 398 + 1233 files changed, 430156 insertions(+) create mode 100644 .DS_Store create mode 100644 SudoDEM2D/.DS_Store create mode 100644 SudoDEM2D/CMakeLists.txt create mode 100644 SudoDEM2D/cMake/CombineSources.cmake create mode 100644 SudoDEM2D/cMake/FindCholmod.cmake create mode 100644 SudoDEM2D/cMake/FindMetis.cmake create mode 100644 SudoDEM2D/cMake/FindNumPy.cmake create mode 100644 SudoDEM2D/cMake/FindPythonModule.cmake create mode 100644 SudoDEM2D/cMake/Findglib2.cmake create mode 100644 SudoDEM2D/cMake/GNUInstallDirs.cmake create mode 100644 SudoDEM2D/cMake/GetVersion.cmake create mode 100644 SudoDEM2D/core/Body.cpp create mode 100644 SudoDEM2D/core/Body.hpp create mode 100644 SudoDEM2D/core/BodyContainer.cpp create mode 100644 SudoDEM2D/core/BodyContainer.hpp create mode 100644 SudoDEM2D/core/Bound.hpp create mode 100644 SudoDEM2D/core/Cell.cpp create mode 100644 SudoDEM2D/core/Cell.hpp create mode 100644 SudoDEM2D/core/Clump.cpp create mode 100644 SudoDEM2D/core/Clump.hpp create mode 100644 SudoDEM2D/core/Dispatcher.hpp create mode 100644 SudoDEM2D/core/DisplayParameters.hpp create mode 100644 SudoDEM2D/core/EnergyTracker.hpp create mode 100644 SudoDEM2D/core/Engine.hpp create mode 100644 SudoDEM2D/core/FileGenerator.cpp create mode 100644 SudoDEM2D/core/FileGenerator.hpp create mode 100644 SudoDEM2D/core/ForceContainer.hpp create mode 100644 SudoDEM2D/core/FrontEnd.hpp create mode 100644 SudoDEM2D/core/Functor.hpp create mode 100644 SudoDEM2D/core/GLConfig.hpp create mode 100644 SudoDEM2D/core/GlobalEngine.hpp create mode 100644 SudoDEM2D/core/IGeom.hpp create mode 100644 SudoDEM2D/core/IPhys.hpp create mode 100644 SudoDEM2D/core/Interaction.cpp create mode 100644 SudoDEM2D/core/Interaction.hpp create mode 100644 SudoDEM2D/core/InteractionContainer.cpp create mode 100644 SudoDEM2D/core/InteractionContainer.hpp create mode 100644 SudoDEM2D/core/Material.cpp create mode 100644 SudoDEM2D/core/Material.hpp create mode 100644 SudoDEM2D/core/Omega.cpp create mode 100644 SudoDEM2D/core/Omega.hpp create mode 100644 SudoDEM2D/core/PartialEngine.hpp create mode 100644 SudoDEM2D/core/Scene.cpp create mode 100644 SudoDEM2D/core/Scene.hpp create mode 100644 SudoDEM2D/core/Shape.hpp create mode 100644 SudoDEM2D/core/SimulationFlow.cpp create mode 100644 SudoDEM2D/core/SimulationFlow.hpp create mode 100644 SudoDEM2D/core/State.cpp create mode 100644 SudoDEM2D/core/State.hpp create mode 100644 SudoDEM2D/core/ThreadRunner.cpp create mode 100644 SudoDEM2D/core/ThreadRunner.hpp create mode 100644 SudoDEM2D/core/ThreadWorker.cpp create mode 100644 SudoDEM2D/core/ThreadWorker.hpp create mode 100644 SudoDEM2D/core/TimeStepper.hpp create mode 100644 SudoDEM2D/core/Timing.hpp create mode 100644 SudoDEM2D/core/corePlugins.cpp create mode 100644 SudoDEM2D/core/main/pyboot.cpp create mode 100644 SudoDEM2D/core/main/sudodem.cpp create mode 100644 SudoDEM2D/core/main/sudodemcfg.h.in create mode 100644 SudoDEM2D/doc/sudodem-logo-note.png create mode 100644 SudoDEM2D/gui/.DS_Store create mode 100644 SudoDEM2D/gui/CMakeLists.txt create mode 100644 SudoDEM2D/gui/qt4/GLViewer.cpp create mode 100644 SudoDEM2D/gui/qt4/GLViewer.hpp create mode 100644 SudoDEM2D/gui/qt4/GLViewerDisplay.cpp create mode 100644 SudoDEM2D/gui/qt4/GLViewerMouse.cpp create mode 100644 SudoDEM2D/gui/qt4/Inspector.py create mode 100644 SudoDEM2D/gui/qt4/OpenGLManager.cpp create mode 100644 SudoDEM2D/gui/qt4/OpenGLManager.hpp create mode 100644 SudoDEM2D/gui/qt4/SerializableEditor.py create mode 100644 SudoDEM2D/gui/qt4/_GLViewer.cpp create mode 100644 SudoDEM2D/gui/qt4/__init__.py create mode 100755 SudoDEM2D/gui/qt4/build create mode 100644 SudoDEM2D/gui/qt4/controller.ui create mode 100644 SudoDEM2D/gui/qt4/img.qrc create mode 100644 SudoDEM2D/gui/qt4/img_rc.py create mode 100644 SudoDEM2D/gui/qt4/sudodem-favicon.png create mode 100644 SudoDEM2D/gui/qt4/sudodem-favicon.xpm create mode 100644 SudoDEM2D/gui/qt4/ui_controller.py create mode 100644 SudoDEM2D/lib/.DS_Store create mode 100644 SudoDEM2D/lib/Eigen/CMakeLists.txt create mode 100644 SudoDEM2D/lib/Eigen/Cholesky create mode 100644 SudoDEM2D/lib/Eigen/CholmodSupport create mode 100644 SudoDEM2D/lib/Eigen/Core create mode 100644 SudoDEM2D/lib/Eigen/Dense create mode 100644 SudoDEM2D/lib/Eigen/Eigen create mode 100644 SudoDEM2D/lib/Eigen/Eigenvalues create mode 100644 SudoDEM2D/lib/Eigen/Geometry create mode 100644 SudoDEM2D/lib/Eigen/Householder create mode 100644 SudoDEM2D/lib/Eigen/IterativeLinearSolvers create mode 100644 SudoDEM2D/lib/Eigen/Jacobi create mode 100644 SudoDEM2D/lib/Eigen/LU create mode 100644 SudoDEM2D/lib/Eigen/MetisSupport create mode 100644 SudoDEM2D/lib/Eigen/OrderingMethods create mode 100644 SudoDEM2D/lib/Eigen/PaStiXSupport create mode 100755 SudoDEM2D/lib/Eigen/PardisoSupport create mode 100644 SudoDEM2D/lib/Eigen/QR create mode 100644 SudoDEM2D/lib/Eigen/QtAlignedMalloc create mode 100644 SudoDEM2D/lib/Eigen/SPQRSupport create mode 100644 SudoDEM2D/lib/Eigen/SVD create mode 100644 SudoDEM2D/lib/Eigen/Sparse create mode 100644 SudoDEM2D/lib/Eigen/SparseCholesky create mode 100644 SudoDEM2D/lib/Eigen/SparseCore create mode 100644 SudoDEM2D/lib/Eigen/SparseLU create mode 100644 SudoDEM2D/lib/Eigen/SparseQR create mode 100644 SudoDEM2D/lib/Eigen/StdDeque create mode 100644 SudoDEM2D/lib/Eigen/StdList create mode 100644 SudoDEM2D/lib/Eigen/StdVector create mode 100644 SudoDEM2D/lib/Eigen/SuperLUSupport create mode 100644 SudoDEM2D/lib/Eigen/UmfPackSupport create mode 100644 SudoDEM2D/lib/Eigen/src/Cholesky/LDLT.h create mode 100644 SudoDEM2D/lib/Eigen/src/Cholesky/LLT.h create mode 100644 SudoDEM2D/lib/Eigen/src/Cholesky/LLT_LAPACKE.h create mode 100644 SudoDEM2D/lib/Eigen/src/CholmodSupport/CholmodSupport.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Array.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/ArrayBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/ArrayWrapper.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Assign.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/AssignEvaluator.h create mode 100755 SudoDEM2D/lib/Eigen/src/Core/Assign_MKL.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/BandMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Block.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/BooleanRedux.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/CommaInitializer.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/ConditionEstimator.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/CoreEvaluators.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/CoreIterators.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/CwiseBinaryOp.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/CwiseNullaryOp.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/CwiseTernaryOp.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryOp.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryView.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/DenseBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/DenseCoeffsBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/DenseStorage.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Diagonal.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/DiagonalMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/DiagonalProduct.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Dot.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/EigenBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/ForceAlignedAccess.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Fuzzy.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/GeneralProduct.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/GenericPacketMath.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/GlobalFunctions.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/IO.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Inverse.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Map.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/MapBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/MathFunctions.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/MathFunctionsImpl.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Matrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/MatrixBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/NestByValue.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/NoAlias.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/NumTraits.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/PermutationMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/PlainObjectBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Product.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/ProductEvaluators.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Random.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Redux.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Ref.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Replicate.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/ReturnByValue.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Reverse.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Select.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/SelfAdjointView.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/SelfCwiseBinaryOp.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Solve.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/SolveTriangular.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/SolverBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/StableNorm.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Stride.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Swap.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Transpose.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Transpositions.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/TriangularMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/VectorBlock.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/VectorwiseOp.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/Visitor.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/AVX/Complex.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/AVX/MathFunctions.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/AVX/PacketMath.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/AVX/TypeCasting.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/AVX512/MathFunctions.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/AVX512/PacketMath.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/AltiVec/Complex.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/AltiVec/MathFunctions.h create mode 100755 SudoDEM2D/lib/Eigen/src/Core/arch/AltiVec/PacketMath.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/CUDA/Complex.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/CUDA/Half.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/CUDA/MathFunctions.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/CUDA/PacketMath.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/CUDA/PacketMathHalf.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/CUDA/TypeCasting.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/Default/ConjHelper.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/Default/Settings.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/NEON/Complex.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/NEON/MathFunctions.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/NEON/PacketMath.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/SSE/Complex.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/SSE/MathFunctions.h create mode 100755 SudoDEM2D/lib/Eigen/src/Core/arch/SSE/PacketMath.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/SSE/TypeCasting.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/ZVector/Complex.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/arch/ZVector/MathFunctions.h create mode 100755 SudoDEM2D/lib/Eigen/src/Core/arch/ZVector/PacketMath.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/functors/AssignmentFunctors.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/functors/BinaryFunctors.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/functors/NullaryFunctors.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/functors/StlFunctors.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/functors/TernaryFunctors.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/functors/UnaryFunctors.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/GeneralBlockPanelKernel.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/GeneralMatrixMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/GeneralMatrixVector.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/Parallelizer.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/SelfadjointMatrixMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/SelfadjointMatrixVector.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/SelfadjointProduct.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/SelfadjointRank2Update.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/TriangularMatrixMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/TriangularMatrixVector.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/TriangularSolverMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/products/TriangularSolverVector.h create mode 100755 SudoDEM2D/lib/Eigen/src/Core/util/BlasUtil.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/util/Constants.h create mode 100755 SudoDEM2D/lib/Eigen/src/Core/util/DisableStupidWarnings.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/util/ForwardDeclarations.h create mode 100755 SudoDEM2D/lib/Eigen/src/Core/util/MKL_support.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/util/Macros.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/util/Memory.h create mode 100755 SudoDEM2D/lib/Eigen/src/Core/util/Meta.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/util/NonMPL2.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/util/ReenableStupidWarnings.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/util/StaticAssert.h create mode 100644 SudoDEM2D/lib/Eigen/src/Core/util/XprHelper.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/ComplexEigenSolver.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/ComplexSchur.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/EigenSolver.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/HessenbergDecomposition.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/RealQZ.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/RealSchur.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h create mode 100644 SudoDEM2D/lib/Eigen/src/Eigenvalues/Tridiagonalization.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/AlignedBox.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/AngleAxis.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/EulerAngles.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/Homogeneous.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/Hyperplane.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/OrthoMethods.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/ParametrizedLine.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/Quaternion.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/Rotation2D.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/RotationBase.h create mode 100755 SudoDEM2D/lib/Eigen/src/Geometry/Scaling.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/Transform.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/Translation.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/Umeyama.h create mode 100644 SudoDEM2D/lib/Eigen/src/Geometry/arch/Geometry_SSE.h create mode 100644 SudoDEM2D/lib/Eigen/src/Householder/BlockHouseholder.h create mode 100644 SudoDEM2D/lib/Eigen/src/Householder/Householder.h create mode 100644 SudoDEM2D/lib/Eigen/src/Householder/HouseholderSequence.h create mode 100644 SudoDEM2D/lib/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h create mode 100644 SudoDEM2D/lib/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h create mode 100644 SudoDEM2D/lib/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h create mode 100644 SudoDEM2D/lib/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h create mode 100644 SudoDEM2D/lib/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h create mode 100644 SudoDEM2D/lib/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h create mode 100644 SudoDEM2D/lib/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h create mode 100644 SudoDEM2D/lib/Eigen/src/Jacobi/Jacobi.h create mode 100644 SudoDEM2D/lib/Eigen/src/LU/Determinant.h create mode 100644 SudoDEM2D/lib/Eigen/src/LU/FullPivLU.h create mode 100644 SudoDEM2D/lib/Eigen/src/LU/InverseImpl.h create mode 100644 SudoDEM2D/lib/Eigen/src/LU/PartialPivLU.h create mode 100644 SudoDEM2D/lib/Eigen/src/LU/PartialPivLU_LAPACKE.h create mode 100644 SudoDEM2D/lib/Eigen/src/LU/arch/Inverse_SSE.h create mode 100644 SudoDEM2D/lib/Eigen/src/MetisSupport/MetisSupport.h create mode 100644 SudoDEM2D/lib/Eigen/src/OrderingMethods/Amd.h create mode 100644 SudoDEM2D/lib/Eigen/src/OrderingMethods/Eigen_Colamd.h create mode 100644 SudoDEM2D/lib/Eigen/src/OrderingMethods/Ordering.h create mode 100644 SudoDEM2D/lib/Eigen/src/PaStiXSupport/PaStiXSupport.h create mode 100644 SudoDEM2D/lib/Eigen/src/PardisoSupport/PardisoSupport.h create mode 100644 SudoDEM2D/lib/Eigen/src/QR/ColPivHouseholderQR.h create mode 100644 SudoDEM2D/lib/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h create mode 100644 SudoDEM2D/lib/Eigen/src/QR/CompleteOrthogonalDecomposition.h create mode 100644 SudoDEM2D/lib/Eigen/src/QR/FullPivHouseholderQR.h create mode 100644 SudoDEM2D/lib/Eigen/src/QR/HouseholderQR.h create mode 100644 SudoDEM2D/lib/Eigen/src/QR/HouseholderQR_LAPACKE.h create mode 100644 SudoDEM2D/lib/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h create mode 100644 SudoDEM2D/lib/Eigen/src/SVD/BDCSVD.h create mode 100644 SudoDEM2D/lib/Eigen/src/SVD/JacobiSVD.h create mode 100644 SudoDEM2D/lib/Eigen/src/SVD/JacobiSVD_LAPACKE.h create mode 100644 SudoDEM2D/lib/Eigen/src/SVD/SVDBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/SVD/UpperBidiagonalization.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCholesky/SimplicialCholesky.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/AmbiVector.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/CompressedStorage.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/MappedSparseMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseAssign.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseBlock.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseColEtree.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseCompressedBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseCwiseBinaryOp.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseCwiseUnaryOp.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseDenseProduct.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseDiagonalProduct.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseDot.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseFuzzy.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseMap.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseMatrixBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparsePermutation.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseProduct.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseRedux.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseRef.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseSelfAdjointView.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseSolverBase.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseSparseProductWithPruning.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseTranspose.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseTriangularView.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseUtil.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseVector.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/SparseView.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseCore/TriangularSolver.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLUImpl.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_Memory.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_Structs.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_Utils.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_column_bmod.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_column_dfs.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_gemm_kernel.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_kernel_bmod.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_panel_bmod.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_panel_dfs.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_pivotL.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_pruneL.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseLU/SparseLU_relax_snode.h create mode 100644 SudoDEM2D/lib/Eigen/src/SparseQR/SparseQR.h create mode 100644 SudoDEM2D/lib/Eigen/src/StlSupport/StdDeque.h create mode 100644 SudoDEM2D/lib/Eigen/src/StlSupport/StdList.h create mode 100644 SudoDEM2D/lib/Eigen/src/StlSupport/StdVector.h create mode 100644 SudoDEM2D/lib/Eigen/src/StlSupport/details.h create mode 100644 SudoDEM2D/lib/Eigen/src/SuperLUSupport/SuperLUSupport.h create mode 100644 SudoDEM2D/lib/Eigen/src/UmfPackSupport/UmfPackSupport.h create mode 100644 SudoDEM2D/lib/Eigen/src/misc/Image.h create mode 100644 SudoDEM2D/lib/Eigen/src/misc/Kernel.h create mode 100644 SudoDEM2D/lib/Eigen/src/misc/RealSvd2x2.h create mode 100644 SudoDEM2D/lib/Eigen/src/misc/blas.h create mode 100644 SudoDEM2D/lib/Eigen/src/misc/lapack.h create mode 100755 SudoDEM2D/lib/Eigen/src/misc/lapacke.h create mode 100644 SudoDEM2D/lib/Eigen/src/misc/lapacke_mangling.h create mode 100644 SudoDEM2D/lib/Eigen/src/plugins/ArrayCwiseBinaryOps.h create mode 100644 SudoDEM2D/lib/Eigen/src/plugins/ArrayCwiseUnaryOps.h create mode 100644 SudoDEM2D/lib/Eigen/src/plugins/BlockMethods.h create mode 100644 SudoDEM2D/lib/Eigen/src/plugins/CommonCwiseBinaryOps.h create mode 100644 SudoDEM2D/lib/Eigen/src/plugins/CommonCwiseUnaryOps.h create mode 100644 SudoDEM2D/lib/Eigen/src/plugins/MatrixCwiseBinaryOps.h create mode 100644 SudoDEM2D/lib/Eigen/src/plugins/MatrixCwiseUnaryOps.h create mode 100644 SudoDEM2D/lib/base/Logging.hpp create mode 100644 SudoDEM2D/lib/base/Math.cpp create mode 100644 SudoDEM2D/lib/base/Math.hpp create mode 100644 SudoDEM2D/lib/base/Singleton.hpp create mode 100644 SudoDEM2D/lib/base/openmp-accu.hpp create mode 100644 SudoDEM2D/lib/factory/ClassFactory.cpp create mode 100644 SudoDEM2D/lib/factory/ClassFactory.hpp create mode 100644 SudoDEM2D/lib/factory/DynLibManager.cpp create mode 100644 SudoDEM2D/lib/factory/DynLibManager.hpp create mode 100644 SudoDEM2D/lib/factory/Factorable.hpp create mode 100644 SudoDEM2D/lib/import/STLReader.hpp create mode 100644 SudoDEM2D/lib/multimethods/DynLibDispatcher.hpp create mode 100644 SudoDEM2D/lib/multimethods/FunctorWrapper.hpp create mode 100644 SudoDEM2D/lib/multimethods/Indexable.hpp create mode 100644 SudoDEM2D/lib/multimethods/loki/EmptyType.h create mode 100644 SudoDEM2D/lib/multimethods/loki/Functor.h create mode 100644 SudoDEM2D/lib/multimethods/loki/LokiExport.h create mode 100644 SudoDEM2D/lib/multimethods/loki/NullType.h create mode 100644 SudoDEM2D/lib/multimethods/loki/Sequence.h create mode 100644 SudoDEM2D/lib/multimethods/loki/Singleton.h create mode 100644 SudoDEM2D/lib/multimethods/loki/SmallObj.h create mode 100644 SudoDEM2D/lib/multimethods/loki/Threads.h create mode 100644 SudoDEM2D/lib/multimethods/loki/TypeManip.h create mode 100644 SudoDEM2D/lib/multimethods/loki/TypeTraits.h create mode 100644 SudoDEM2D/lib/multimethods/loki/Typelist.h create mode 100644 SudoDEM2D/lib/multimethods/loki/TypelistMacros.h create mode 100644 SudoDEM2D/lib/opengl/GLUtils.cpp create mode 100644 SudoDEM2D/lib/opengl/GLUtils.hpp create mode 100644 SudoDEM2D/lib/opengl/OpenGLWrapper.hpp create mode 100644 SudoDEM2D/lib/pyutil/README create mode 100644 SudoDEM2D/lib/pyutil/doc_opts.hpp create mode 100644 SudoDEM2D/lib/pyutil/gil.cpp create mode 100644 SudoDEM2D/lib/pyutil/gil.hpp create mode 100644 SudoDEM2D/lib/pyutil/numpy.hpp create mode 100644 SudoDEM2D/lib/pyutil/numpy_boost.hpp create mode 100644 SudoDEM2D/lib/pyutil/raw_constructor.hpp create mode 100644 SudoDEM2D/lib/qhull/geom.c create mode 100644 SudoDEM2D/lib/qhull/geom.h create mode 100644 SudoDEM2D/lib/qhull/geom2.c create mode 100644 SudoDEM2D/lib/qhull/global.c create mode 100644 SudoDEM2D/lib/qhull/io.c create mode 100644 SudoDEM2D/lib/qhull/io.h create mode 100644 SudoDEM2D/lib/qhull/mem.c create mode 100644 SudoDEM2D/lib/qhull/mem.h create mode 100644 SudoDEM2D/lib/qhull/merge.c create mode 100644 SudoDEM2D/lib/qhull/merge.h create mode 100644 SudoDEM2D/lib/qhull/poly.c create mode 100644 SudoDEM2D/lib/qhull/poly.h create mode 100644 SudoDEM2D/lib/qhull/poly2.c create mode 100644 SudoDEM2D/lib/qhull/qhull.c create mode 100644 SudoDEM2D/lib/qhull/qhull.h create mode 100644 SudoDEM2D/lib/qhull/qhull_a.h create mode 100644 SudoDEM2D/lib/qhull/qset.c create mode 100644 SudoDEM2D/lib/qhull/qset.h create mode 100644 SudoDEM2D/lib/qhull/stat.c create mode 100644 SudoDEM2D/lib/qhull/stat.h create mode 100644 SudoDEM2D/lib/qhull/user.c create mode 100644 SudoDEM2D/lib/qhull/user.h create mode 100644 SudoDEM2D/lib/serialization/ObjectIO.hpp create mode 100644 SudoDEM2D/lib/serialization/Serializable.cpp create mode 100644 SudoDEM2D/lib/serialization/Serializable.hpp create mode 100644 SudoDEM2D/lib/smoothing/LinearInterpolate.hpp create mode 100644 SudoDEM2D/lib/smoothing/WeightedAverage2d.hpp create mode 100644 SudoDEM2D/lib/voro++/README create mode 100644 SudoDEM2D/lib/voro++/c_loops.cc create mode 100644 SudoDEM2D/lib/voro++/c_loops.hh create mode 100644 SudoDEM2D/lib/voro++/cell.cc create mode 100644 SudoDEM2D/lib/voro++/cell.hh create mode 100644 SudoDEM2D/lib/voro++/cmd_line.cc create mode 100644 SudoDEM2D/lib/voro++/common.cc create mode 100644 SudoDEM2D/lib/voro++/common.hh create mode 100644 SudoDEM2D/lib/voro++/config.hh create mode 100644 SudoDEM2D/lib/voro++/container.cc create mode 100644 SudoDEM2D/lib/voro++/container.hh create mode 100644 SudoDEM2D/lib/voro++/container_prd.cc create mode 100644 SudoDEM2D/lib/voro++/container_prd.hh create mode 100644 SudoDEM2D/lib/voro++/pre_container.cc create mode 100644 SudoDEM2D/lib/voro++/pre_container.hh create mode 100644 SudoDEM2D/lib/voro++/rad_option.hh create mode 100644 SudoDEM2D/lib/voro++/unitcell.cc create mode 100644 SudoDEM2D/lib/voro++/unitcell.hh create mode 100644 SudoDEM2D/lib/voro++/v_base.cc create mode 100644 SudoDEM2D/lib/voro++/v_base.hh create mode 100644 SudoDEM2D/lib/voro++/v_base_wl.cc create mode 100644 SudoDEM2D/lib/voro++/v_compute.cc create mode 100644 SudoDEM2D/lib/voro++/v_compute.hh create mode 100644 SudoDEM2D/lib/voro++/voro++.cc create mode 100644 SudoDEM2D/lib/voro++/voro++.hh create mode 100644 SudoDEM2D/lib/voro++/wall.cc create mode 100644 SudoDEM2D/lib/voro++/wall.hh create mode 100644 SudoDEM2D/lib/voro++/worklist.hh create mode 100644 SudoDEM2D/pkg/.DS_Store create mode 100644 SudoDEM2D/pkg/common/Aabb.cpp create mode 100644 SudoDEM2D/pkg/common/Aabb.hpp create mode 100644 SudoDEM2D/pkg/common/BoundaryController.hpp create mode 100644 SudoDEM2D/pkg/common/Callbacks.hpp create mode 100644 SudoDEM2D/pkg/common/Collider.cpp create mode 100644 SudoDEM2D/pkg/common/Collider.hpp create mode 100644 SudoDEM2D/pkg/common/Disk.cpp create mode 100644 SudoDEM2D/pkg/common/Disk.hpp create mode 100644 SudoDEM2D/pkg/common/Dispatching.cpp create mode 100644 SudoDEM2D/pkg/common/Dispatching.hpp create mode 100644 SudoDEM2D/pkg/common/ElastMat.hpp create mode 100644 SudoDEM2D/pkg/common/FieldApplier.hpp create mode 100644 SudoDEM2D/pkg/common/ForceEngine.cpp create mode 100644 SudoDEM2D/pkg/common/ForceEngine.hpp create mode 100644 SudoDEM2D/pkg/common/ForceResetter.hpp create mode 100644 SudoDEM2D/pkg/common/GLDrawFunctors.hpp create mode 100644 SudoDEM2D/pkg/common/GravityEngines.cpp create mode 100644 SudoDEM2D/pkg/common/GravityEngines.hpp create mode 100644 SudoDEM2D/pkg/common/InsertionSortCollider.cpp create mode 100644 SudoDEM2D/pkg/common/InsertionSortCollider.hpp create mode 100644 SudoDEM2D/pkg/common/InteractionLoop.cpp create mode 100644 SudoDEM2D/pkg/common/InteractionLoop.hpp create mode 100644 SudoDEM2D/pkg/common/MatchMaker.cpp create mode 100644 SudoDEM2D/pkg/common/MatchMaker.hpp create mode 100644 SudoDEM2D/pkg/common/NormShearPhys.hpp create mode 100644 SudoDEM2D/pkg/common/OpenGLRenderer.cpp create mode 100644 SudoDEM2D/pkg/common/OpenGLRenderer.hpp create mode 100644 SudoDEM2D/pkg/common/ParallelEngine.cpp create mode 100644 SudoDEM2D/pkg/common/ParallelEngine.hpp create mode 100644 SudoDEM2D/pkg/common/PeriodicEngines.hpp create mode 100644 SudoDEM2D/pkg/common/PyRunner.hpp create mode 100644 SudoDEM2D/pkg/common/Recorder.hpp create mode 100644 SudoDEM2D/pkg/common/StepDisplacer.hpp create mode 100644 SudoDEM2D/pkg/common/TorqueEngine.hpp create mode 100644 SudoDEM2D/pkg/common/Wall.cpp create mode 100644 SudoDEM2D/pkg/common/Wall.hpp create mode 100644 SudoDEM2D/pkg/common/common.cpp create mode 100644 SudoDEM2D/pkg/dem/ElasticContactLaw.cpp create mode 100644 SudoDEM2D/pkg/dem/ElasticContactLaw.hpp create mode 100644 SudoDEM2D/pkg/dem/FrictPhys.cpp create mode 100644 SudoDEM2D/pkg/dem/FrictPhys.hpp create mode 100644 SudoDEM2D/pkg/dem/Ig2_Basic_ScGeom.cpp create mode 100644 SudoDEM2D/pkg/dem/Ig2_Basic_ScGeom.hpp create mode 100644 SudoDEM2D/pkg/dem/NewtonIntegrator.cpp create mode 100644 SudoDEM2D/pkg/dem/NewtonIntegrator.hpp create mode 100644 SudoDEM2D/pkg/dem/PeriTriaxial.cpp create mode 100644 SudoDEM2D/pkg/dem/PeriTriaxial.hpp create mode 100644 SudoDEM2D/pkg/dem/ScGeom.cpp create mode 100644 SudoDEM2D/pkg/dem/ScGeom.hpp create mode 100644 SudoDEM2D/pkg/dem/Shop.hpp create mode 100644 SudoDEM2D/pkg/dem/Shop_01.cpp create mode 100644 SudoDEM2D/pkg/dem/Superellipse.cpp create mode 100644 SudoDEM2D/pkg/dem/Superellipse.hpp create mode 100644 SudoDEM2D/pkg/dem/Superellipse_Ig2.cpp create mode 100644 SudoDEM2D/pkg/dem/Superellipse_Ig2.hpp create mode 100644 SudoDEM2D/py/3rd-party/README create mode 100644 SudoDEM2D/py/3rd-party/mtTkinter-0.4/gpl.txt create mode 100644 SudoDEM2D/py/3rd-party/mtTkinter-0.4/lgpl.txt create mode 100644 SudoDEM2D/py/3rd-party/mtTkinter-0.4/mtTkinter.py create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/__init__.py create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/cleanup.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/cleanup.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/edge.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/edge.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/face.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/face.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/object.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/object.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/point.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/point.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/pygts.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/pygts.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/pygts.py create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/segment.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/segment.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/surface.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/surface.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/triangle.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/triangle.h create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/vertex.c create mode 100644 SudoDEM2D/py/3rd-party/pygts-0.3.1/vertex.h create mode 100644 SudoDEM2D/py/CMakeLists.txt create mode 100644 SudoDEM2D/py/WeightedAverage2d.cpp create mode 100644 SudoDEM2D/py/__init__.py.in create mode 100644 SudoDEM2D/py/_extraDocs.py create mode 100644 SudoDEM2D/py/_polyhedra_utils.cpp create mode 100644 SudoDEM2D/py/_superellipse_utils.cpp create mode 100644 SudoDEM2D/py/_utils.cpp create mode 100644 SudoDEM2D/py/deprecated/bodiesHandling.py create mode 100644 SudoDEM2D/py/deprecated/config.py.in create mode 100644 SudoDEM2D/py/deprecated/export.py create mode 100644 SudoDEM2D/py/deprecated/linterpolation.py create mode 100644 SudoDEM2D/py/deprecated/post2d.py create mode 100644 SudoDEM2D/py/geom.py create mode 100644 SudoDEM2D/py/pack/_packObb.cpp create mode 100644 SudoDEM2D/py/pack/_packPredicates.cpp create mode 100644 SudoDEM2D/py/pack/_packSpheres.cpp create mode 100644 SudoDEM2D/py/pack/pack.py create mode 100644 SudoDEM2D/py/params.py create mode 100644 SudoDEM2D/py/plot.py create mode 100644 SudoDEM2D/py/polyhedra_utils.py create mode 100644 SudoDEM2D/py/runtime.py create mode 100644 SudoDEM2D/py/svgobjects.cpp create mode 100644 SudoDEM2D/py/svgobjects.hpp create mode 100644 SudoDEM2D/py/system.py create mode 100644 SudoDEM2D/py/tests/__init__.py create mode 100644 SudoDEM2D/py/tests/clump.py create mode 100644 SudoDEM2D/py/tests/cohesive-chain.py create mode 100644 SudoDEM2D/py/tests/core.py create mode 100644 SudoDEM2D/py/tests/engines.py create mode 100644 SudoDEM2D/py/tests/pbc.py create mode 100644 SudoDEM2D/py/tests/wrapper.py create mode 100644 SudoDEM2D/py/timing.py create mode 100644 SudoDEM2D/py/utils.py create mode 100644 SudoDEM2D/py/utilspost.py create mode 100644 SudoDEM2D/py/wrapper/customConverters.cpp create mode 100644 SudoDEM2D/py/wrapper/sudodemWrapper.cpp create mode 100644 SudoDEM2D/py/ymport.py create mode 100644 SudoDEM3D/.DS_Store create mode 100644 SudoDEM3D/CMakeLists.txt create mode 100644 SudoDEM3D/cMake/CombineSources.cmake create mode 100644 SudoDEM3D/cMake/FindCholmod.cmake create mode 100644 SudoDEM3D/cMake/FindMetis.cmake create mode 100644 SudoDEM3D/cMake/FindNumPy.cmake create mode 100644 SudoDEM3D/cMake/FindOpenBlas.cmake create mode 100644 SudoDEM3D/cMake/FindPythonModule.cmake create mode 100644 SudoDEM3D/cMake/Findglib2.cmake create mode 100644 SudoDEM3D/cMake/GNUInstallDirs.cmake create mode 100644 SudoDEM3D/cMake/GetVersion.cmake create mode 100644 SudoDEM3D/core/Body.cpp create mode 100644 SudoDEM3D/core/Body.hpp create mode 100644 SudoDEM3D/core/BodyContainer.cpp create mode 100644 SudoDEM3D/core/BodyContainer.hpp create mode 100644 SudoDEM3D/core/Bound.hpp create mode 100644 SudoDEM3D/core/Cell.cpp create mode 100644 SudoDEM3D/core/Cell.hpp create mode 100644 SudoDEM3D/core/Clump.cpp create mode 100644 SudoDEM3D/core/Clump.hpp create mode 100644 SudoDEM3D/core/Dispatcher.hpp create mode 100644 SudoDEM3D/core/DisplayParameters.hpp create mode 100644 SudoDEM3D/core/EnergyTracker.hpp create mode 100644 SudoDEM3D/core/Engine.hpp create mode 100644 SudoDEM3D/core/FileGenerator.cpp create mode 100644 SudoDEM3D/core/FileGenerator.hpp create mode 100644 SudoDEM3D/core/ForceContainer.hpp create mode 100644 SudoDEM3D/core/FrontEnd.hpp create mode 100644 SudoDEM3D/core/Functor.hpp create mode 100644 SudoDEM3D/core/GLConfig.hpp create mode 100644 SudoDEM3D/core/GlobalEngine.hpp create mode 100644 SudoDEM3D/core/IGeom.hpp create mode 100644 SudoDEM3D/core/IPhys.hpp create mode 100644 SudoDEM3D/core/Interaction.cpp create mode 100644 SudoDEM3D/core/Interaction.hpp create mode 100644 SudoDEM3D/core/InteractionContainer.cpp create mode 100644 SudoDEM3D/core/InteractionContainer.hpp create mode 100644 SudoDEM3D/core/Material.cpp create mode 100644 SudoDEM3D/core/Material.hpp create mode 100644 SudoDEM3D/core/Omega.cpp create mode 100644 SudoDEM3D/core/Omega.hpp create mode 100644 SudoDEM3D/core/PartialEngine.hpp create mode 100644 SudoDEM3D/core/Scene.cpp create mode 100644 SudoDEM3D/core/Scene.hpp create mode 100644 SudoDEM3D/core/Shape.hpp create mode 100644 SudoDEM3D/core/SimulationFlow.cpp create mode 100644 SudoDEM3D/core/SimulationFlow.hpp create mode 100644 SudoDEM3D/core/State.cpp create mode 100644 SudoDEM3D/core/State.hpp create mode 100644 SudoDEM3D/core/ThreadRunner.cpp create mode 100644 SudoDEM3D/core/ThreadRunner.hpp create mode 100644 SudoDEM3D/core/ThreadWorker.cpp create mode 100644 SudoDEM3D/core/ThreadWorker.hpp create mode 100644 SudoDEM3D/core/TimeStepper.hpp create mode 100644 SudoDEM3D/core/Timing.hpp create mode 100644 SudoDEM3D/core/corePlugins.cpp create mode 100644 SudoDEM3D/core/main/pyboot.cpp create mode 100644 SudoDEM3D/core/main/sudodem.cpp create mode 100644 SudoDEM3D/core/main/sudodemcfg.h.in create mode 100644 SudoDEM3D/doc/sudodem-logo-note.png create mode 100644 SudoDEM3D/gui/CMakeLists.txt create mode 100644 SudoDEM3D/gui/qt4/GLViewer.cpp create mode 100644 SudoDEM3D/gui/qt4/GLViewer.hpp create mode 100644 SudoDEM3D/gui/qt4/GLViewerDisplay.cpp create mode 100644 SudoDEM3D/gui/qt4/GLViewerMouse.cpp create mode 100644 SudoDEM3D/gui/qt4/Inspector.py create mode 100644 SudoDEM3D/gui/qt4/OpenGLManager.cpp create mode 100644 SudoDEM3D/gui/qt4/OpenGLManager.hpp create mode 100644 SudoDEM3D/gui/qt4/SerializableEditor.py create mode 100644 SudoDEM3D/gui/qt4/Thumbs.db create mode 100644 SudoDEM3D/gui/qt4/XYZ.png create mode 100644 SudoDEM3D/gui/qt4/XYZ.xpm create mode 100644 SudoDEM3D/gui/qt4/YZX.png create mode 100644 SudoDEM3D/gui/qt4/YZX.xpm create mode 100644 SudoDEM3D/gui/qt4/ZXY.png create mode 100644 SudoDEM3D/gui/qt4/ZXY.xpm create mode 100644 SudoDEM3D/gui/qt4/_GLViewer.cpp create mode 100644 SudoDEM3D/gui/qt4/__init__.py create mode 100644 SudoDEM3D/gui/qt4/build create mode 100644 SudoDEM3D/gui/qt4/controller.ui create mode 100644 SudoDEM3D/gui/qt4/img.qrc create mode 100644 SudoDEM3D/gui/qt4/img_rc.py create mode 100644 SudoDEM3D/gui/qt4/sudodem-favicon.png create mode 100644 SudoDEM3D/gui/qt4/sudodem-favicon.xpm create mode 100755 SudoDEM3D/gui/qt4/sudodem-logo.svg create mode 100644 SudoDEM3D/gui/qt4/ui_controller.py create mode 100644 SudoDEM3D/lib/.DS_Store create mode 100644 SudoDEM3D/lib/Eigen/.DS_Store create mode 100644 SudoDEM3D/lib/Eigen/CMakeLists.txt create mode 100644 SudoDEM3D/lib/Eigen/Cholesky create mode 100644 SudoDEM3D/lib/Eigen/CholmodSupport create mode 100644 SudoDEM3D/lib/Eigen/Core create mode 100644 SudoDEM3D/lib/Eigen/Dense create mode 100644 SudoDEM3D/lib/Eigen/Eigen create mode 100644 SudoDEM3D/lib/Eigen/Eigenvalues create mode 100644 SudoDEM3D/lib/Eigen/Geometry create mode 100644 SudoDEM3D/lib/Eigen/Householder create mode 100644 SudoDEM3D/lib/Eigen/IterativeLinearSolvers create mode 100644 SudoDEM3D/lib/Eigen/Jacobi create mode 100644 SudoDEM3D/lib/Eigen/LU create mode 100644 SudoDEM3D/lib/Eigen/MetisSupport create mode 100644 SudoDEM3D/lib/Eigen/OrderingMethods create mode 100644 SudoDEM3D/lib/Eigen/PaStiXSupport create mode 100755 SudoDEM3D/lib/Eigen/PardisoSupport create mode 100644 SudoDEM3D/lib/Eigen/QR create mode 100644 SudoDEM3D/lib/Eigen/QtAlignedMalloc create mode 100644 SudoDEM3D/lib/Eigen/SPQRSupport create mode 100644 SudoDEM3D/lib/Eigen/SVD create mode 100644 SudoDEM3D/lib/Eigen/Sparse create mode 100644 SudoDEM3D/lib/Eigen/SparseCholesky create mode 100644 SudoDEM3D/lib/Eigen/SparseCore create mode 100644 SudoDEM3D/lib/Eigen/SparseLU create mode 100644 SudoDEM3D/lib/Eigen/SparseQR create mode 100644 SudoDEM3D/lib/Eigen/StdDeque create mode 100644 SudoDEM3D/lib/Eigen/StdList create mode 100644 SudoDEM3D/lib/Eigen/StdVector create mode 100644 SudoDEM3D/lib/Eigen/SuperLUSupport create mode 100644 SudoDEM3D/lib/Eigen/UmfPackSupport create mode 100644 SudoDEM3D/lib/Eigen/src/Cholesky/LDLT.h create mode 100644 SudoDEM3D/lib/Eigen/src/Cholesky/LLT.h create mode 100644 SudoDEM3D/lib/Eigen/src/Cholesky/LLT_LAPACKE.h create mode 100644 SudoDEM3D/lib/Eigen/src/CholmodSupport/CholmodSupport.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Array.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/ArrayBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/ArrayWrapper.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Assign.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/AssignEvaluator.h create mode 100755 SudoDEM3D/lib/Eigen/src/Core/Assign_MKL.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/BandMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Block.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/BooleanRedux.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/CommaInitializer.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/ConditionEstimator.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/CoreEvaluators.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/CoreIterators.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/CwiseBinaryOp.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/CwiseNullaryOp.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/CwiseTernaryOp.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/CwiseUnaryOp.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/CwiseUnaryView.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/DenseBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/DenseCoeffsBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/DenseStorage.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Diagonal.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/DiagonalMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/DiagonalProduct.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Dot.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/EigenBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/ForceAlignedAccess.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Fuzzy.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/GeneralProduct.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/GenericPacketMath.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/GlobalFunctions.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/IO.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Inverse.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Map.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/MapBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/MathFunctions.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/MathFunctionsImpl.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Matrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/MatrixBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/NestByValue.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/NoAlias.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/NumTraits.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/PermutationMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/PlainObjectBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Product.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/ProductEvaluators.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Random.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Redux.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Ref.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Replicate.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/ReturnByValue.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Reverse.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Select.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/SelfAdjointView.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/SelfCwiseBinaryOp.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Solve.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/SolveTriangular.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/SolverBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/StableNorm.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Stride.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Swap.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Transpose.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Transpositions.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/TriangularMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/VectorBlock.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/VectorwiseOp.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/Visitor.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/AVX/Complex.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/AVX/MathFunctions.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/AVX/PacketMath.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/AVX/TypeCasting.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/AVX512/MathFunctions.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/AVX512/PacketMath.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/AltiVec/Complex.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/AltiVec/MathFunctions.h create mode 100755 SudoDEM3D/lib/Eigen/src/Core/arch/AltiVec/PacketMath.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/CUDA/Complex.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/CUDA/Half.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/CUDA/MathFunctions.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/CUDA/PacketMath.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/CUDA/PacketMathHalf.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/CUDA/TypeCasting.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/Default/ConjHelper.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/Default/Settings.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/NEON/Complex.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/NEON/MathFunctions.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/NEON/PacketMath.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/SSE/Complex.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/SSE/MathFunctions.h create mode 100755 SudoDEM3D/lib/Eigen/src/Core/arch/SSE/PacketMath.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/SSE/TypeCasting.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/ZVector/Complex.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/arch/ZVector/MathFunctions.h create mode 100755 SudoDEM3D/lib/Eigen/src/Core/arch/ZVector/PacketMath.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/functors/AssignmentFunctors.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/functors/BinaryFunctors.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/functors/NullaryFunctors.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/functors/StlFunctors.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/functors/TernaryFunctors.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/functors/UnaryFunctors.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/GeneralBlockPanelKernel.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/GeneralMatrixMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/GeneralMatrixVector.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/Parallelizer.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/SelfadjointMatrixMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/SelfadjointMatrixVector.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/SelfadjointProduct.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/SelfadjointRank2Update.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/TriangularMatrixMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/TriangularMatrixVector.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/TriangularSolverMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/products/TriangularSolverVector.h create mode 100755 SudoDEM3D/lib/Eigen/src/Core/util/BlasUtil.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/util/Constants.h create mode 100755 SudoDEM3D/lib/Eigen/src/Core/util/DisableStupidWarnings.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/util/ForwardDeclarations.h create mode 100755 SudoDEM3D/lib/Eigen/src/Core/util/MKL_support.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/util/Macros.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/util/Memory.h create mode 100755 SudoDEM3D/lib/Eigen/src/Core/util/Meta.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/util/NonMPL2.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/util/ReenableStupidWarnings.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/util/StaticAssert.h create mode 100644 SudoDEM3D/lib/Eigen/src/Core/util/XprHelper.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/ComplexEigenSolver.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/ComplexSchur.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/EigenSolver.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/HessenbergDecomposition.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/RealQZ.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/RealSchur.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h create mode 100644 SudoDEM3D/lib/Eigen/src/Eigenvalues/Tridiagonalization.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/AlignedBox.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/AngleAxis.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/EulerAngles.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/Homogeneous.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/Hyperplane.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/OrthoMethods.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/ParametrizedLine.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/Quaternion.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/Rotation2D.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/RotationBase.h create mode 100755 SudoDEM3D/lib/Eigen/src/Geometry/Scaling.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/Transform.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/Translation.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/Umeyama.h create mode 100644 SudoDEM3D/lib/Eigen/src/Geometry/arch/Geometry_SSE.h create mode 100644 SudoDEM3D/lib/Eigen/src/Householder/BlockHouseholder.h create mode 100644 SudoDEM3D/lib/Eigen/src/Householder/Householder.h create mode 100644 SudoDEM3D/lib/Eigen/src/Householder/HouseholderSequence.h create mode 100644 SudoDEM3D/lib/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h create mode 100644 SudoDEM3D/lib/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h create mode 100644 SudoDEM3D/lib/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h create mode 100644 SudoDEM3D/lib/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h create mode 100644 SudoDEM3D/lib/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h create mode 100644 SudoDEM3D/lib/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h create mode 100644 SudoDEM3D/lib/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h create mode 100644 SudoDEM3D/lib/Eigen/src/Jacobi/Jacobi.h create mode 100644 SudoDEM3D/lib/Eigen/src/LU/Determinant.h create mode 100644 SudoDEM3D/lib/Eigen/src/LU/FullPivLU.h create mode 100644 SudoDEM3D/lib/Eigen/src/LU/InverseImpl.h create mode 100644 SudoDEM3D/lib/Eigen/src/LU/PartialPivLU.h create mode 100644 SudoDEM3D/lib/Eigen/src/LU/PartialPivLU_LAPACKE.h create mode 100644 SudoDEM3D/lib/Eigen/src/LU/arch/Inverse_SSE.h create mode 100644 SudoDEM3D/lib/Eigen/src/MetisSupport/MetisSupport.h create mode 100644 SudoDEM3D/lib/Eigen/src/OrderingMethods/Amd.h create mode 100644 SudoDEM3D/lib/Eigen/src/OrderingMethods/Eigen_Colamd.h create mode 100644 SudoDEM3D/lib/Eigen/src/OrderingMethods/Ordering.h create mode 100644 SudoDEM3D/lib/Eigen/src/PaStiXSupport/PaStiXSupport.h create mode 100644 SudoDEM3D/lib/Eigen/src/PardisoSupport/PardisoSupport.h create mode 100644 SudoDEM3D/lib/Eigen/src/QR/ColPivHouseholderQR.h create mode 100644 SudoDEM3D/lib/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h create mode 100644 SudoDEM3D/lib/Eigen/src/QR/CompleteOrthogonalDecomposition.h create mode 100644 SudoDEM3D/lib/Eigen/src/QR/FullPivHouseholderQR.h create mode 100644 SudoDEM3D/lib/Eigen/src/QR/HouseholderQR.h create mode 100644 SudoDEM3D/lib/Eigen/src/QR/HouseholderQR_LAPACKE.h create mode 100644 SudoDEM3D/lib/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h create mode 100644 SudoDEM3D/lib/Eigen/src/SVD/BDCSVD.h create mode 100644 SudoDEM3D/lib/Eigen/src/SVD/JacobiSVD.h create mode 100644 SudoDEM3D/lib/Eigen/src/SVD/JacobiSVD_LAPACKE.h create mode 100644 SudoDEM3D/lib/Eigen/src/SVD/SVDBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/SVD/UpperBidiagonalization.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCholesky/SimplicialCholesky.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/AmbiVector.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/CompressedStorage.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/MappedSparseMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseAssign.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseBlock.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseColEtree.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseCompressedBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseCwiseBinaryOp.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseCwiseUnaryOp.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseDenseProduct.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseDiagonalProduct.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseDot.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseFuzzy.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseMap.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseMatrixBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparsePermutation.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseProduct.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseRedux.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseRef.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseSelfAdjointView.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseSolverBase.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseSparseProductWithPruning.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseTranspose.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseTriangularView.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseUtil.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseVector.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/SparseView.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseCore/TriangularSolver.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLUImpl.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_Memory.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_Structs.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_Utils.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_column_bmod.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_column_dfs.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_gemm_kernel.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_kernel_bmod.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_panel_bmod.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_panel_dfs.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_pivotL.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_pruneL.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseLU/SparseLU_relax_snode.h create mode 100644 SudoDEM3D/lib/Eigen/src/SparseQR/SparseQR.h create mode 100644 SudoDEM3D/lib/Eigen/src/StlSupport/StdDeque.h create mode 100644 SudoDEM3D/lib/Eigen/src/StlSupport/StdList.h create mode 100644 SudoDEM3D/lib/Eigen/src/StlSupport/StdVector.h create mode 100644 SudoDEM3D/lib/Eigen/src/StlSupport/details.h create mode 100644 SudoDEM3D/lib/Eigen/src/SuperLUSupport/SuperLUSupport.h create mode 100644 SudoDEM3D/lib/Eigen/src/UmfPackSupport/UmfPackSupport.h create mode 100644 SudoDEM3D/lib/Eigen/src/misc/Image.h create mode 100644 SudoDEM3D/lib/Eigen/src/misc/Kernel.h create mode 100644 SudoDEM3D/lib/Eigen/src/misc/RealSvd2x2.h create mode 100644 SudoDEM3D/lib/Eigen/src/misc/blas.h create mode 100644 SudoDEM3D/lib/Eigen/src/misc/lapack.h create mode 100755 SudoDEM3D/lib/Eigen/src/misc/lapacke.h create mode 100644 SudoDEM3D/lib/Eigen/src/misc/lapacke_mangling.h create mode 100644 SudoDEM3D/lib/Eigen/src/plugins/ArrayCwiseBinaryOps.h create mode 100644 SudoDEM3D/lib/Eigen/src/plugins/ArrayCwiseUnaryOps.h create mode 100644 SudoDEM3D/lib/Eigen/src/plugins/BlockMethods.h create mode 100644 SudoDEM3D/lib/Eigen/src/plugins/CommonCwiseBinaryOps.h create mode 100644 SudoDEM3D/lib/Eigen/src/plugins/CommonCwiseUnaryOps.h create mode 100644 SudoDEM3D/lib/Eigen/src/plugins/MatrixCwiseBinaryOps.h create mode 100644 SudoDEM3D/lib/Eigen/src/plugins/MatrixCwiseUnaryOps.h create mode 100644 SudoDEM3D/lib/base/Logging.hpp create mode 100644 SudoDEM3D/lib/base/Math.cpp create mode 100644 SudoDEM3D/lib/base/Math.hpp create mode 100644 SudoDEM3D/lib/base/Singleton.hpp create mode 100644 SudoDEM3D/lib/base/openmp-accu.hpp create mode 100644 SudoDEM3D/lib/factory/ClassFactory.cpp create mode 100644 SudoDEM3D/lib/factory/ClassFactory.hpp create mode 100644 SudoDEM3D/lib/factory/DynLibManager.cpp create mode 100644 SudoDEM3D/lib/factory/DynLibManager.hpp create mode 100644 SudoDEM3D/lib/factory/Factorable.hpp create mode 100644 SudoDEM3D/lib/import/STLReader.hpp create mode 100644 SudoDEM3D/lib/multimethods/DynLibDispatcher.hpp create mode 100644 SudoDEM3D/lib/multimethods/FunctorWrapper.hpp create mode 100644 SudoDEM3D/lib/multimethods/Indexable.hpp create mode 100644 SudoDEM3D/lib/multimethods/loki/EmptyType.h create mode 100644 SudoDEM3D/lib/multimethods/loki/Functor.h create mode 100644 SudoDEM3D/lib/multimethods/loki/LokiExport.h create mode 100644 SudoDEM3D/lib/multimethods/loki/NullType.h create mode 100644 SudoDEM3D/lib/multimethods/loki/Sequence.h create mode 100644 SudoDEM3D/lib/multimethods/loki/Singleton.h create mode 100644 SudoDEM3D/lib/multimethods/loki/SmallObj.h create mode 100644 SudoDEM3D/lib/multimethods/loki/Threads.h create mode 100644 SudoDEM3D/lib/multimethods/loki/TypeManip.h create mode 100644 SudoDEM3D/lib/multimethods/loki/TypeTraits.h create mode 100644 SudoDEM3D/lib/multimethods/loki/Typelist.h create mode 100644 SudoDEM3D/lib/multimethods/loki/TypelistMacros.h create mode 100644 SudoDEM3D/lib/opengl/GLUtils.cpp create mode 100644 SudoDEM3D/lib/opengl/GLUtils.hpp create mode 100644 SudoDEM3D/lib/opengl/OpenGLWrapper.hpp create mode 100644 SudoDEM3D/lib/pyutil/README create mode 100644 SudoDEM3D/lib/pyutil/doc_opts.hpp create mode 100644 SudoDEM3D/lib/pyutil/gil.cpp create mode 100644 SudoDEM3D/lib/pyutil/gil.hpp create mode 100644 SudoDEM3D/lib/pyutil/numpy.hpp create mode 100644 SudoDEM3D/lib/pyutil/numpy_boost.hpp create mode 100644 SudoDEM3D/lib/pyutil/raw_constructor.hpp create mode 100644 SudoDEM3D/lib/qhull/geom.c create mode 100644 SudoDEM3D/lib/qhull/geom.h create mode 100644 SudoDEM3D/lib/qhull/geom2.c create mode 100644 SudoDEM3D/lib/qhull/global.c create mode 100644 SudoDEM3D/lib/qhull/io.c create mode 100644 SudoDEM3D/lib/qhull/io.h create mode 100644 SudoDEM3D/lib/qhull/mem.c create mode 100644 SudoDEM3D/lib/qhull/mem.h create mode 100644 SudoDEM3D/lib/qhull/merge.c create mode 100644 SudoDEM3D/lib/qhull/merge.h create mode 100644 SudoDEM3D/lib/qhull/poly.c create mode 100644 SudoDEM3D/lib/qhull/poly.h create mode 100644 SudoDEM3D/lib/qhull/poly2.c create mode 100644 SudoDEM3D/lib/qhull/qhull.c create mode 100644 SudoDEM3D/lib/qhull/qhull.h create mode 100644 SudoDEM3D/lib/qhull/qhull_a.h create mode 100644 SudoDEM3D/lib/qhull/qset.c create mode 100644 SudoDEM3D/lib/qhull/qset.h create mode 100644 SudoDEM3D/lib/qhull/stat.c create mode 100644 SudoDEM3D/lib/qhull/stat.h create mode 100644 SudoDEM3D/lib/qhull/user.c create mode 100644 SudoDEM3D/lib/qhull/user.h create mode 100644 SudoDEM3D/lib/serialization/ObjectIO.hpp create mode 100644 SudoDEM3D/lib/serialization/Serializable.cpp create mode 100644 SudoDEM3D/lib/serialization/Serializable.hpp create mode 100644 SudoDEM3D/lib/smoothing/LinearInterpolate.hpp create mode 100644 SudoDEM3D/lib/smoothing/WeightedAverage2d.hpp create mode 100644 SudoDEM3D/lib/voro++/README create mode 100644 SudoDEM3D/lib/voro++/c_loops.cc create mode 100644 SudoDEM3D/lib/voro++/c_loops.hh create mode 100644 SudoDEM3D/lib/voro++/cell.cc create mode 100644 SudoDEM3D/lib/voro++/cell.hh create mode 100644 SudoDEM3D/lib/voro++/cmd_line.cc create mode 100644 SudoDEM3D/lib/voro++/common.cc create mode 100644 SudoDEM3D/lib/voro++/common.hh create mode 100644 SudoDEM3D/lib/voro++/config.hh create mode 100644 SudoDEM3D/lib/voro++/container.cc create mode 100644 SudoDEM3D/lib/voro++/container.hh create mode 100644 SudoDEM3D/lib/voro++/container_prd.cc create mode 100644 SudoDEM3D/lib/voro++/container_prd.hh create mode 100644 SudoDEM3D/lib/voro++/pre_container.cc create mode 100644 SudoDEM3D/lib/voro++/pre_container.hh create mode 100644 SudoDEM3D/lib/voro++/rad_option.hh create mode 100644 SudoDEM3D/lib/voro++/unitcell.cc create mode 100644 SudoDEM3D/lib/voro++/unitcell.hh create mode 100644 SudoDEM3D/lib/voro++/v_base.cc create mode 100644 SudoDEM3D/lib/voro++/v_base.hh create mode 100644 SudoDEM3D/lib/voro++/v_base_wl.cc create mode 100644 SudoDEM3D/lib/voro++/v_compute.cc create mode 100644 SudoDEM3D/lib/voro++/v_compute.hh create mode 100644 SudoDEM3D/lib/voro++/voro++.cc create mode 100644 SudoDEM3D/lib/voro++/voro++.hh create mode 100644 SudoDEM3D/lib/voro++/wall.cc create mode 100644 SudoDEM3D/lib/voro++/wall.hh create mode 100644 SudoDEM3D/lib/voro++/worklist.hh create mode 100644 SudoDEM3D/pkg/.DS_Store create mode 100644 SudoDEM3D/pkg/common/Aabb.cpp create mode 100644 SudoDEM3D/pkg/common/Aabb.hpp create mode 100644 SudoDEM3D/pkg/common/BoundaryController.hpp create mode 100644 SudoDEM3D/pkg/common/Box.cpp create mode 100644 SudoDEM3D/pkg/common/Box.hpp create mode 100644 SudoDEM3D/pkg/common/Callbacks.hpp create mode 100644 SudoDEM3D/pkg/common/Collider.cpp create mode 100644 SudoDEM3D/pkg/common/Collider.hpp create mode 100644 SudoDEM3D/pkg/common/CylScGeom6D.hpp create mode 100644 SudoDEM3D/pkg/common/Dispatching.cpp create mode 100644 SudoDEM3D/pkg/common/Dispatching.hpp create mode 100644 SudoDEM3D/pkg/common/ElastMat.hpp create mode 100644 SudoDEM3D/pkg/common/Facet.cpp create mode 100644 SudoDEM3D/pkg/common/Facet.hpp create mode 100644 SudoDEM3D/pkg/common/FieldApplier.hpp create mode 100644 SudoDEM3D/pkg/common/ForceEngine.cpp create mode 100644 SudoDEM3D/pkg/common/ForceEngine.hpp create mode 100644 SudoDEM3D/pkg/common/ForceResetter.hpp create mode 100644 SudoDEM3D/pkg/common/GLDrawFunctors.hpp create mode 100644 SudoDEM3D/pkg/common/Gl1_NormPhys.cpp create mode 100644 SudoDEM3D/pkg/common/Gl1_NormPhys.hpp create mode 100644 SudoDEM3D/pkg/common/GravityEngines.cpp create mode 100644 SudoDEM3D/pkg/common/GravityEngines.hpp create mode 100644 SudoDEM3D/pkg/common/InsertionSortCollider.cpp create mode 100644 SudoDEM3D/pkg/common/InsertionSortCollider.hpp create mode 100644 SudoDEM3D/pkg/common/InteractionLoop.cpp create mode 100644 SudoDEM3D/pkg/common/InteractionLoop.hpp create mode 100644 SudoDEM3D/pkg/common/KinematicEngines.cpp create mode 100644 SudoDEM3D/pkg/common/KinematicEngines.hpp create mode 100644 SudoDEM3D/pkg/common/MatchMaker.cpp create mode 100644 SudoDEM3D/pkg/common/MatchMaker.hpp create mode 100644 SudoDEM3D/pkg/common/NormShearPhys.hpp create mode 100644 SudoDEM3D/pkg/common/OpenGLRenderer.cpp create mode 100644 SudoDEM3D/pkg/common/OpenGLRenderer.hpp create mode 100644 SudoDEM3D/pkg/common/ParallelEngine.cpp create mode 100644 SudoDEM3D/pkg/common/ParallelEngine.hpp create mode 100644 SudoDEM3D/pkg/common/PeriodicEngines.hpp create mode 100644 SudoDEM3D/pkg/common/PyRunner.hpp create mode 100644 SudoDEM3D/pkg/common/Recorder.hpp create mode 100644 SudoDEM3D/pkg/common/Sphere.cpp create mode 100644 SudoDEM3D/pkg/common/Sphere.hpp create mode 100644 SudoDEM3D/pkg/common/StepDisplacer.hpp create mode 100644 SudoDEM3D/pkg/common/TorqueEngine.hpp create mode 100644 SudoDEM3D/pkg/common/Wall.cpp create mode 100644 SudoDEM3D/pkg/common/Wall.hpp create mode 100644 SudoDEM3D/pkg/common/common.cpp create mode 100644 SudoDEM3D/pkg/dem/.DS_Store create mode 100644 SudoDEM3D/pkg/dem/Compression.cpp create mode 100644 SudoDEM3D/pkg/dem/Compression.hpp create mode 100644 SudoDEM3D/pkg/dem/DemXDofGeom.hpp create mode 100644 SudoDEM3D/pkg/dem/Disp2DPropLoadEngine.cpp create mode 100644 SudoDEM3D/pkg/dem/Disp2DPropLoadEngine.hpp create mode 100644 SudoDEM3D/pkg/dem/DomainLimiter.cpp create mode 100644 SudoDEM3D/pkg/dem/DomainLimiter.hpp create mode 100644 SudoDEM3D/pkg/dem/ElasticContactLaw.cpp create mode 100644 SudoDEM3D/pkg/dem/ElasticContactLaw.hpp create mode 100644 SudoDEM3D/pkg/dem/Expander.cpp create mode 100644 SudoDEM3D/pkg/dem/Expander.hpp create mode 100644 SudoDEM3D/pkg/dem/FacetTopologyAnalyzer.cpp create mode 100644 SudoDEM3D/pkg/dem/FacetTopologyAnalyzer.hpp create mode 100644 SudoDEM3D/pkg/dem/FlatGridCollider.cpp create mode 100644 SudoDEM3D/pkg/dem/FlatGridCollider.hpp create mode 100644 SudoDEM3D/pkg/dem/FrictPhys.cpp create mode 100644 SudoDEM3D/pkg/dem/FrictPhys.hpp create mode 100644 SudoDEM3D/pkg/dem/FrictViscoPM.cpp create mode 100644 SudoDEM3D/pkg/dem/FrictViscoPM.hpp create mode 100644 SudoDEM3D/pkg/dem/GJK.hpp create mode 100644 SudoDEM3D/pkg/dem/GJKParticle.cpp create mode 100644 SudoDEM3D/pkg/dem/GJKParticle.hpp create mode 100644 SudoDEM3D/pkg/dem/GJKParticle_Ig2.cpp create mode 100644 SudoDEM3D/pkg/dem/GJKParticle_Ig2.hpp create mode 100644 SudoDEM3D/pkg/dem/GJKParticle_shapes.cpp create mode 100644 SudoDEM3D/pkg/dem/GJKParticle_shapes.h create mode 100644 SudoDEM3D/pkg/dem/GeneralIntegratorInsertionSortCollider.cpp create mode 100644 SudoDEM3D/pkg/dem/GeneralIntegratorInsertionSortCollider.hpp create mode 100644 SudoDEM3D/pkg/dem/GlobalStiffnessTimeStepper.cpp create mode 100644 SudoDEM3D/pkg/dem/GlobalStiffnessTimeStepper.hpp create mode 100644 SudoDEM3D/pkg/dem/HertzMindlin.cpp create mode 100644 SudoDEM3D/pkg/dem/HertzMindlin.hpp create mode 100644 SudoDEM3D/pkg/dem/Ig2_Basic_ScGeom.cpp create mode 100644 SudoDEM3D/pkg/dem/Ig2_Basic_ScGeom.hpp create mode 100644 SudoDEM3D/pkg/dem/ImpulseDynamic.cpp create mode 100644 SudoDEM3D/pkg/dem/ImpulseDynamic.hpp create mode 100644 SudoDEM3D/pkg/dem/Integrator.cpp create mode 100644 SudoDEM3D/pkg/dem/Integrator.hpp create mode 100644 SudoDEM3D/pkg/dem/Ip2_ElastMat.cpp create mode 100644 SudoDEM3D/pkg/dem/Ip2_ElastMat.hpp create mode 100644 SudoDEM3D/pkg/dem/L3Geom.cpp create mode 100644 SudoDEM3D/pkg/dem/L3Geom.hpp create mode 100644 SudoDEM3D/pkg/dem/NewtonIntegrator.cpp create mode 100644 SudoDEM3D/pkg/dem/NewtonIntegrator.hpp create mode 100644 SudoDEM3D/pkg/dem/PeriIsoCompressor.cpp create mode 100644 SudoDEM3D/pkg/dem/PeriIsoCompressor.hpp create mode 100644 SudoDEM3D/pkg/dem/PolyCompression.cpp create mode 100644 SudoDEM3D/pkg/dem/PolyCompression.hpp create mode 100644 SudoDEM3D/pkg/dem/PolySuperellipsoid.cpp create mode 100644 SudoDEM3D/pkg/dem/PolySuperellipsoid.hpp create mode 100644 SudoDEM3D/pkg/dem/PolySuperellipsoid_Ig2.cpp create mode 100644 SudoDEM3D/pkg/dem/PolySuperellipsoid_Ig2.hpp create mode 100755 SudoDEM3D/pkg/dem/RollingResistanceLaw.cpp create mode 100755 SudoDEM3D/pkg/dem/RollingResistanceLaw.hpp create mode 100644 SudoDEM3D/pkg/dem/STLImporter.cpp create mode 100644 SudoDEM3D/pkg/dem/STLImporter.hpp create mode 100644 SudoDEM3D/pkg/dem/ScGeom.cpp create mode 100644 SudoDEM3D/pkg/dem/ScGeom.hpp create mode 100644 SudoDEM3D/pkg/dem/Shop.hpp create mode 100644 SudoDEM3D/pkg/dem/Shop_01.cpp create mode 100644 SudoDEM3D/pkg/dem/Shop_02.cpp create mode 100644 SudoDEM3D/pkg/dem/SnapshotEngine.cpp create mode 100644 SudoDEM3D/pkg/dem/SnapshotEngine.hpp create mode 100644 SudoDEM3D/pkg/dem/SpherePack.cpp create mode 100644 SudoDEM3D/pkg/dem/SpherePack.hpp create mode 100644 SudoDEM3D/pkg/dem/SpheresFactory.cpp create mode 100644 SudoDEM3D/pkg/dem/SpheresFactory.hpp create mode 100644 SudoDEM3D/pkg/dem/Superquadrics.cpp create mode 100644 SudoDEM3D/pkg/dem/Superquadrics.hpp create mode 100644 SudoDEM3D/pkg/dem/Superquadrics_Ig2.cpp create mode 100644 SudoDEM3D/pkg/dem/Superquadrics_Ig2.hpp create mode 100644 SudoDEM3D/pkg/dem/UnbalancedForceCallbacks.cpp create mode 100644 SudoDEM3D/pkg/dem/UnbalancedForceCallbacks.hpp create mode 100644 SudoDEM3D/pkg/dem/ViscoelasticPM.cpp create mode 100644 SudoDEM3D/pkg/dem/ViscoelasticPM.hpp create mode 100644 SudoDEM3D/pkg/dem/VolumeFric.cpp create mode 100644 SudoDEM3D/pkg/dem/VolumeFric.hpp create mode 100644 SudoDEM3D/pkg/fem/FEContainer.cpp create mode 100644 SudoDEM3D/pkg/fem/FEContainer.hpp create mode 100644 SudoDEM3D/pkg/fem/FEMdriver.cpp create mode 100644 SudoDEM3D/pkg/fem/FEMdriver.hpp create mode 100644 SudoDEM3D/pkg/fem/FlexCompression.cpp create mode 100644 SudoDEM3D/pkg/fem/FlexCompression.hpp create mode 100644 SudoDEM3D/pkg/fem/Node.cpp create mode 100644 SudoDEM3D/pkg/fem/Node.hpp create mode 100644 SudoDEM3D/pkg/fem/NodeForceContainer.hpp create mode 100644 SudoDEM3D/pkg/fem/TriElement.cpp create mode 100644 SudoDEM3D/pkg/fem/TriElement.hpp create mode 100644 SudoDEM3D/py/.DS_Store create mode 100644 SudoDEM3D/py/3rd-party/README create mode 100644 SudoDEM3D/py/3rd-party/mtTkinter-0.4/gpl.txt create mode 100644 SudoDEM3D/py/3rd-party/mtTkinter-0.4/lgpl.txt create mode 100644 SudoDEM3D/py/3rd-party/mtTkinter-0.4/mtTkinter.py create mode 100644 SudoDEM3D/py/CMakeLists.txt create mode 100644 SudoDEM3D/py/__init__.py.in create mode 100644 SudoDEM3D/py/_extraDocs.py create mode 100644 SudoDEM3D/py/_fem_utils.cpp create mode 100644 SudoDEM3D/py/_gjkparticle_utils.cpp create mode 100644 SudoDEM3D/py/_superquadrics_utils.cpp create mode 100644 SudoDEM3D/py/_utils.cpp create mode 100644 SudoDEM3D/py/geom.py create mode 100644 SudoDEM3D/py/params.py create mode 100644 SudoDEM3D/py/plot.py create mode 100644 SudoDEM3D/py/runtime.py create mode 100644 SudoDEM3D/py/snapshot.py create mode 100644 SudoDEM3D/py/system.py create mode 100644 SudoDEM3D/py/timing.py create mode 100644 SudoDEM3D/py/utils.py create mode 100644 SudoDEM3D/py/utilspost.py create mode 100644 SudoDEM3D/py/wrapper/customConverters.cpp create mode 100644 SudoDEM3D/py/wrapper/sudodemWrapper.cpp create mode 100644 SudoDEM3D/py/ymport.py diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..da327d8d37736415eacee7f5abc89ac67dd5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93}(|5v;}U|1U=W|9_a4q+`_xXaxQe z0TwHkiUoAqyEYp2=XdQE)-9~OaJzw!~_ZJJA7u%DN5AS8}p g`R{)Q9JV_koX-F8>h+IrPj&tepydC*0Po`E6aWAK literal 0 HcmV?d00001 diff --git a/SudoDEM2D/CMakeLists.txt b/SudoDEM2D/CMakeLists.txt new file mode 100644 index 0000000..6c4ba33 --- /dev/null +++ b/SudoDEM2D/CMakeLists.txt @@ -0,0 +1,440 @@ +# The SUDODEM has the following parameters to configure: +# INSTALL_PREFIX: path, where SudoDEM will be installed (/usr/local by default) +# LIBRARY_OUTPUT_PATH: path to install libraries (lib by default) +# DEBUG: compile in debug-mode (OFF by default) +# CLUSTER: compile on a cluster +# CMAKE_VERBOSE_MAKEFILE: output additional information during compiling (OFF by default) +# SUFFIX: suffix, added after binary-names (version number by default) +# NOSUFFIX: do not add a suffix after binary-name (OFF by default) +# SUDODEM_VERSION: explicitely set version number (is defined from git-directory by default) +# ENABLE_GUI: enable GUI option (ON by default) +# ENABLE_OPENMP: enable OpenMP-parallelizing option (ON by default) +# runtimePREFIX: used for packaging, when install directory is not the same is runtime directory (/usr/local by default) +# CHUNKSIZE: set >1, if you want several sources to be compiled at once. Increases compilation speed and RAM-consumption during it (1 by default). +# VECTORIZE: enables vectorization and alignment in Eigen3 library, experimental (OFF by default) + +project(sudoDEM C CXX) +cmake_minimum_required(VERSION 2.8) + +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cMake") +set(Python_ADDITIONAL_VERSIONS 2.7)###zhswee + +find_program(LSB_RELEASE_EXEC lsb_release) +execute_process(COMMAND ${LSB_RELEASE_EXEC} -is + OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +OPTION(CLUSTER "Compilation on a cluster" ON) +IF ( ${LSB_RELEASE_ID_SHORT} MATCHES "Ubuntu") + SET(CLUSTER OFF) +ENDIF ( ${LSB_RELEASE_ID_SHORT} MATCHES "Ubuntu") + +MESSAGE("The distribution is: ${LSB_RELEASE_ID_SHORT}; and Option CLUSTER is set as ${CLUSTER}") + +#INCLUDE(FindPythonLibs) +#INCLUDE(FindPythonInterp) +find_package( PythonInterp 2.7 REQUIRED ) + +IF (CLUSTER) +#find_package( PythonLibs 2.7 REQUIRED PATHS '/opt/rh/python27/root/usr/lib64') +MESSAGE("Specify Python lib on a cluster manually.") +set(PythonLibs_DIR '/opt/rh/python27/root/usr/lib64') +set(PYTHON_LIBRARIES /opt/rh/python27/root/usr/lib64/libpython2.7.so) +ELSE (CLUSTER) +find_package( PythonLibs 2.7 REQUIRED) +MESSAGE("Specify Python lib on a cluster automatically.") +ENDIF (CLUSTER) + +#find_package( PythonLibs ) + +INCLUDE(FindOpenMP) +INCLUDE(FindQt4) +INCLUDE(FindPkgConfig) +INCLUDE(GetVersion) +INCLUDE(FindOpenGL) +INCLUDE(FindNumPy) + +INCLUDE(FindPythonModule) +INCLUDE(GNUInstallDirs) + +MESSAGE(STATUS "PYTHON_LIBRARIES:${PYTHON_LIBRARIES}") + +#=========================================================== +# HACK!!! If the version of gcc is 4.8 or greater, we add -ftrack-macro-expansion=0 +# and -save-temps into compiler to reduce the memory consumption during compilation. +# See http://bugs.debian.org/726009 for more information +# Can be removed later, if gcc fixes its regression +# Taken from http://stackoverflow.com/questions/4058565/check-gcc-minor-in-cmake + +EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) +IF (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8) + MESSAGE(STATUS "GCC Version >= 4.8. Adding -ftrack-macro-expansion=0 and -save-temps") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrack-macro-expansion=0 -save-temps") +ENDIF() + +#=========================================================== + +IF ("${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" MATCHES ".*clang") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-512") +ENDIF() + +#=========================================================== + +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations") +#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")#sway + +#=========================================================== + +IF (CMAKE_CXX_FLAGS) + #If flags are set, add only neccessary flags + IF (DEBUG) + SET(CMAKE_VERBOSE_MAKEFILE 1) + SET(CMAKE_BUILD_TYPE Debug) + ADD_DEFINITIONS("-DSUDODEM_DEBUG") + ELSE (DEBUG) + SET(CMAKE_BUILD_TYPE Release) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + ENDIF (DEBUG) +ELSE (CMAKE_CXX_FLAGS) + #If flags are not set, add all useful flags + IF (DEBUG) + SET(CMAKE_VERBOSE_MAKEFILE 1) + SET(CMAKE_BUILD_TYPE Debug) + ADD_DEFINITIONS("-DSUDODEM_DEBUG") + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fPIC -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security") + ELSE (DEBUG) + SET(CMAKE_BUILD_TYPE Release) + SET(CMAKE_CXX_FLAGS "-Wall -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -s") + ENDIF (DEBUG) +ENDIF (CMAKE_CXX_FLAGS) +#=========================================================== +# Add possibility to use local boost installation (e.g. -DLocalBoost=1.46.1) +#set(CMAKE_MODULE_PATH "/scratch/softwares/boostinstall/lib/;${CMAKE_MODULE_PATH}") +set(Boost_NO_SYSTEM_PATHS TRUE) +#if (Boost_NO_SYSTEM_PATHS) +IF (CLUSTER) + set(BOOST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../libsinstall") +ELSE (CLUSTER) + set(BOOST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../3rdlib/boost167") +ENDIF (CLUSTER) + #set(BOOST_ROOT "/tmp/project/") + set(BOOST_INCLUDE_DIRS "${BOOST_ROOT}/include") + set(BOOST_LIBRARY_DIRS "${BOOST_ROOT}/lib") + #set(BOOST_LIBRARYDIR "${BOOST_ROOT}/lib") + #set(BOOST_LIBRARYDIR "/opt/SudoDEM/lib/3rdlibs/") + + +#endif (Boost_NO_SYSTEM_PATHS) +FIND_PACKAGE(Boost 1.67 COMPONENTS python27 thread filesystem iostreams regex serialization system date_time REQUIRED) +#FIND_PACKAGE(Boost COMPONENTS python thread filesystem iostreams regex serialization system date_time REQUIRED PATHS ${BOOST_LIBRARYDIR} NO_DEFAULT_PATH) + +#set(Boost_LIBRARIES "-lboost_python -lboost_thread -lboost_filesystem -lboost_iostreams -lboost_regex -lboost_serialization -lboost_system -lboost_date_time -lpthread") #"/home/sway/software/DEM/3rdlib/boost159/lib/libboost_python.so/home/sway/software/DEM/3rdlib/boost159/lib/libboost_thread.so/home/sway/software/DEM/3rdlib/boost159/lib/libboost_filesystem.so/home/sway/software/DEM/3rdlib/boost159/lib/libboost_iostreams.so/home/sway/software/DEM/3rdlib/boost159/lib/libboost_regex.so/home/sway/software/DEM/3rdlib/boost159/lib/libboost_serialization.so/home/sway/software/DEM/3rdlib/boost159/lib/libboost_system.so/home/sway/software/DEM/3rdlib/boost159/lib/libboos#t_date_time.so/usr/lib/x86_64-linux-gnu/libpthread.so") +#set(Boost_LIBRARIES "${BOOST_LIBRARY_DIRS}libboost_python.so${BOOST_LIBRARY_DIRS}libboost_thread.so${BOOST_LIBRARY_DIRS}libboost_filesystem.so${BOOST_LIBRARY_DIRS}libboost_iostreams.so${BOOST_LIBRARY_DIRS}libboost_regex.so${BOOST_LIBRARY_DIRS}libboost_serialization.so${BOOST_LIBRARY_DIRS}libboost_system.so${BOOST_LIBRARY_DIRS}libbost_date_time.so") +INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS}) +#LINK_DIRECTORIES( ${BOOST_LIBRARYDIR} ) +# for checking purpose +MESSAGE("-- Boost_VERSION: " ${Boost_VERSION}) +MESSAGE("-- Boost_LIB_VERSION: " ${Boost_LIB_VERSION}) +MESSAGE("-- BOOST_LIBRARYDIR: " ${BOOST_LIBRARYDIR}) +MESSAGE("-- Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS}) +MESSAGE("-- Boost_LIBRARIES: " ${Boost_LIBRARIES}) + +#=========================================================== +FIND_PACKAGE(NumPy REQUIRED) + INCLUDE_DIRECTORIES(${NUMPY_INCLUDE_DIRS}) + +FIND_PACKAGE(BZip2 REQUIRED) +FIND_PACKAGE(ZLIB REQUIRED) +#=========================================================== + +SET(DEFAULT ON CACHE INTERNAL "Default value for enabled by default options") +SET(LINKLIBS "") +SET(CONFIGURED_FEATS "") +SET(DISABLED_FEATS "") + + +OPTION(NOSUFFIX "NOSUFFIX" ON) +OPTION(ENABLE_VTK "Enable VTK" ${DEFAULT}) +OPTION(ENABLE_OPENMP "Enable OpenMP" ${DEFAULT}) +OPTION(ENABLE_GUI "Enable GUI" ${DEFAULT}) + +IF (CLUSTER) +SET (ENABLE_GUI OFF) +ENDIF (CLUSTER) +#=========================================================== +# Use Eigen3 by default +# Use Eigen3 by default +#IF (EIGEN3_FOUND) +#set(EIGEN3_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../3rdlib/eigen-3.2.3/") +set(EIGEN3_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/") + INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR}) + MESSAGE(STATUS "Found Eigen3, at: ${EIGEN3_INCLUDE_DIR}") + + # Minimal required version 3.2.1 + #IF ((${EIGEN3_MAJOR_VERSION} LESS 2) OR ((${EIGEN3_MAJOR_VERSION} EQUAL 2) AND (${EIGEN3_MINOR_VERSION} LESS 1))) + # MESSAGE(FATAL_ERROR "Minimal required Eigen3 version is 3.2.1, please update Eigen3!") + # ENDIF ((${EIGEN3_MAJOR_VERSION} LESS 2) OR ((${EIGEN3_MAJOR_VERSION} EQUAL 2) AND (${EIGEN3_MINOR_VERSION} LESS 1))) + + IF (NOT VECTORIZE) + MESSAGE(STATUS "Disable vectorization") + ADD_DEFINITIONS("-DEIGEN_DONT_VECTORIZE -DEIGEN_DONT_ALIGN -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT") + ELSE (NOT VECTORIZE) + MESSAGE(STATUS "Enable vectorization") + ENDIF (NOT VECTORIZE) + +#ENDIF(EIGEN3_FOUND) +#=========================================================== +INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS}) +SET(LINKLIBS "${LINKLIBS};${BZIP2_LIBRARIES};${ZLIB_LIBRARIES};") + +SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} Odeint") +ADD_DEFINITIONS("-DSUDODEM_ODEINT") +#=========================================================== +IF(ENABLE_OPENMP) + FIND_PACKAGE(OpenMP) + IF(OPENMP_FOUND) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSUDODEM_OPENMP ${OpenMP_CXX_FLAGS}") + MESSAGE(STATUS "Found OpenMP") + SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} OpenMP") + ELSE(OPENMP_FOUND) + MESSAGE(STATUS "OpenMP NOT found") + SET(ENABLE_OPENMP OFF) + SET(DISABLED_FEATS "${DISABLED_FEATS} OPENMP") + ENDIF(OPENMP_FOUND) +ELSE(ENABLE_OPENMP) + SET(DISABLED_FEATS "${DISABLED_FEATS} OPENMP") +ENDIF(ENABLE_OPENMP) +#=========================================================== +IF(ENABLE_GUI) + FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL) + FIND_PACKAGE(OpenGL) + FIND_PACKAGE(GLUT) + + FIND_PACKAGE(glib2) + #FIND_PACKAGE(QGLVIEWER) + set(QGLVIEWER_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../3rdlib/libQGLViewer-2.6.3/") + set(QGLVIEWER_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../3rdlib/libQGLViewer-2.6.3/QGLViewer/libQGLViewer.so") + #set(QGLVIEWER_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../3rdlib/libQGLViewer-2.6.3/QGLViewer/libQGLViewer.a")#using static library + SET(QGLVIEWER_FOUND TRUE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQGLVIEWER_FOUND") +SET(LINKLIBS "${LINKLIBS};${QGLVIEWER_LIBRARIES}") + + IF(QT4_FOUND AND OPENGL_FOUND AND GLUT_FOUND AND GLIB2_FOUND AND QGLVIEWER_FOUND) + SET(GUI_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${QGLVIEWER_LIBRARIES}) + SET(GUI_SRC_LIB "lib/opengl/GLUtils.cpp") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSUDODEM_OPENGL") + INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES(${QT_INCLUDES}) + + MESSAGE(STATUS "Found GUI-LIBS") + SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} GUI") + ELSE(QT4_FOUND AND OPENGL_FOUND AND GLUT_FOUND AND GLIB2_FOUND AND QGLVIEWER_FOUND) + MESSAGE(STATUS "GUI-LIBS NOT found") + MESSAGE(STATUS "qt4 ${QT4_FOUND} opengl${OPENGL_FOUND} glut ${GLUT_FOUND} glib2 ${GLIB2_FOUND} qglviewer ${QGLVIEWER_FOUND}") + SET(DISABLED_FEATS "${DISABLED_FEATS} GUI") + SET(ENABLE_GUI OFF) + ENDIF(QT4_FOUND AND OPENGL_FOUND AND GLUT_FOUND AND GLIB2_FOUND AND QGLVIEWER_FOUND) +ELSE(ENABLE_GUI) + SET(DISABLED_FEATS "${DISABLED_FEATS} GUI") +ENDIF(ENABLE_GUI) + +#=========================================================== + +INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) + +#=========================================================== + +IF (NOT INSTALL_PREFIX) + #SET(CMAKE_INSTALL_PREFIX "/usr/local") + IF (CLUSTER) + SET(CMAKE_INSTALL_PREFIX "~/software/FDEMpackage/SudoDEM") + ELSE (CLUSTER) + SET(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/../dem2dinstall/SudoDEM") + ENDIF (CLUSTER) + MESSAGE("SudoDEM will be installed to default path ${CMAKE_INSTALL_PREFIX}, if you want to override it use -DINSTALL_PREFIX option.") +ELSE (NOT INSTALL_PREFIX) + GET_FILENAME_COMPONENT(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} ABSOLUTE) + MESSAGE("SudoDEM will be installed to ${CMAKE_INSTALL_PREFIX}") +ENDIF (NOT INSTALL_PREFIX) + +IF (NOT SUFFIX) + SET (SUFFIX "-${SUDODEM_VERSION}") + #SET (SUFFIX "") +ENDIF (NOT SUFFIX) + +IF(NOSUFFIX) #For packaging + SET (SUFFIX "") +ENDIF(NOSUFFIX) #For packaging +SET (LIBRARY_OUTPUT_PATH lib) +IF(NOT LIBRARY_OUTPUT_PATH) #For packaging + SET (LIBRARY_OUTPUT_PATH ${CMAKE_INSTALL_LIBDIR}) +ENDIF(NOT LIBRARY_OUTPUT_PATH) #For packaging + +IF (NOT runtimePREFIX) + SET (runtimePREFIX ${CMAKE_INSTALL_PREFIX}) +ENDIF (NOT runtimePREFIX) + +MESSAGE (STATUS "Suffix is set to " ${SUFFIX}) +MESSAGE (STATUS "LIBRARY_OUTPUT_PATH is set to " ${LIBRARY_OUTPUT_PATH}) +MESSAGE (STATUS "runtimePREFIX is set to " ${runtimePREFIX}) +#=========================================================== + +#SET(SUDODEM_LIB_PATH ${CMAKE_INSTALL_PREFIX}/${LIBRARY_OUTPUT_PATH}/sudodem${SUFFIX}) +SET(SUDODEM_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/sudodem${SUFFIX}) +SET(SUDODEM_EXEC_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}) +SET(SUDODEM_PY_PATH ${SUDODEM_LIB_PATH}/py) +SET(SUDODEM_DOC_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/doc/sudodem${SUFFIX}) +SET(SUDODEM_MAN_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_MANDIR}) + + +SET(CMAKE_SKIP_BUILD_RPATH FALSE) + +IF (CLUSTER) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + SET(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../../;$ORIGIN/../../../3rdlibs") + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +ELSE (CLUSTER) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + #SET(CMAKE_INSTALL_RPATH "${SUDODEM_LIB_PATH};${SUDODEM_PY_PATH};${SUDODEM_PY_PATH}/sudodem/;${SUDODEM_PY_PATH}/sudodem/qt;${QGLVIEWER_INCLUDE_DIR}/QGLViewer") + #SET(CMAKE_INSTALL_RPATH "${SUDODEM_LIB_PATH};${SUDODEM_PY_PATH};${SUDODEM_PY_PATH}/sudodem/;${SUDODEM_PY_PATH}/sudodem/qt;$ORIGIN/../../../../../3rdlibs") + SET(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../../;$ORIGIN/../../../3rdlibs")#this is specified to python modules in ${SUDODEM_PY_PATH}/sudodem/. + + #SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) +ENDIF (CLUSTER) + +#=========================================================== +IF(ENABLE_GUI) + ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui") +ENDIF(ENABLE_GUI) +ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/py") +#=========================================================== + +# this is only a temporary hack, headers should be installed in the build-dir directly +# perhaps there is a proper way, have to ask +IF(NOT EXISTS "${CMAKE_BINARY_DIR}/sudodem") + EXECUTE_PROCESS(COMMAND ln -s ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/sudodem) +ENDIF () +#=========================================================== + +#SET(QHULL_INCLUDE_DIR,"lib/") +#MESSAGE(STATUS "Found QHULL: ${QHULL_INCLUDE_DIR}, ${QHULL_LIBRARIES}") +#INCLUDE_DIRECTORIES(${QHULL_INCLUDE_DIR}) + +FILE(GLOB QHULL_SRC_LIB "lib/qhull/*.c") +ADD_LIBRARY(qhull SHARED ${QHULL_SRC_LIB}) +SET_TARGET_PROPERTIES(qhull PROPERTIES PREFIX "" INSTALL_RPATH "$ORIGIN;$ORIGIN/../3rdlibs/") +TARGET_LINK_LIBRARIES(qhull) +INSTALL(TARGETS qhull DESTINATION ${SUDODEM_LIB_PATH}) +#=========================================================== +FILE(GLOB VORO_SRC_LIB "lib/voro++/voro++.cc") +ADD_LIBRARY(voro++ SHARED ${VORO_SRC_LIB}) +SET_TARGET_PROPERTIES(voro++ PROPERTIES PREFIX "" INSTALL_RPATH "$ORIGIN;$ORIGIN/../3rdlibs/") +TARGET_LINK_LIBRARIES(voro++) +INSTALL(TARGETS voro++ DESTINATION ${SUDODEM_LIB_PATH}) +#=========================================================== + + +FILE(GLOB SRC_CORE "core/*.cpp") +FILE(GLOB_RECURSE SRC_PKG "pkg/*.cpp") +FILE(GLOB SRC_LIB "lib/*.cpp") + +SET(SRC_LIB "${SRC_LIB};lib/base/Math.cpp;lib/factory/ClassFactory.cpp;lib/factory/DynLibManager.cpp") +SET(SRC_LIB "${SRC_LIB};lib/serialization/Serializable.cpp;lib/pyutil/gil.cpp;core/main/pyboot.cpp;${GUI_SRC_LIB};${CGAL_SRC_LIB}") + +#=========================================================== + +IF (CHUNKSIZE) + INCLUDE(CombineSources) + COMBINE_SOURCES(${CMAKE_BINARY_DIR}/core "${SRC_CORE}" ${CHUNKSIZE}) + FILE(GLOB SRC_CORE_COMBINED "${CMAKE_BINARY_DIR}/core.*.cpp") + COMBINE_SOURCES(${CMAKE_BINARY_DIR}/pkg "${SRC_PKG}" ${CHUNKSIZE}) + FILE(GLOB SRC_PKG_COMBINED "${CMAKE_BINARY_DIR}/pkg.*.cpp") + COMBINE_SOURCES(${CMAKE_BINARY_DIR}/lib "${SRC_LIB}" ${CHUNKSIZE}) + FILE(GLOB SRC_LIB_COMBINED "${CMAKE_BINARY_DIR}/lib.*.cpp") + ADD_LIBRARY(sudodem SHARED ${SRC_LIB_COMBINED} ${SRC_CORE_COMBINED} ${SRC_PKG_COMBINED}) +ELSE (CHUNKSIZE) + ADD_LIBRARY(sudodem SHARED ${SRC_CORE} ${SRC_PKG} ${SRC_LIB}) +ENDIF (CHUNKSIZE) +#=========================================================== +find_python_module(minieigen) +IF (PY_minieigen) + MESSAGE(STATUS "Use system minieigen version") +ELSE (PY_minieigen) + MESSAGE(STATUS "Use embedded version of minieigen. Please, consider installing the corresponding package") +ENDIF (PY_minieigen) +IF (NOT CLUSTER) +find_python_module(Tkinter REQUIRED) +ENDIF (NOT CLUSTER) +#=========================================================== + + +ADD_EXECUTABLE(sudodem2d ${CMAKE_CURRENT_SOURCE_DIR}/core/main/sudodem.cpp) +SET_TARGET_PROPERTIES(sudodem2d PROPERTIES INSTALL_RPATH "$ORIGIN;$ORIGIN/../lib/3rdlibs/;") + +ADD_LIBRARY(boot SHARED ${CMAKE_CURRENT_SOURCE_DIR}/core/main/pyboot.cpp) +SET_TARGET_PROPERTIES(boot PROPERTIES PREFIX "" LINK_FLAGS "-Wl,-z,origin,--as-needed" INSTALL_RPATH "$ORIGIN;$ORIGIN/../../;$ORIGIN/../../../3rdlibs;") #add -z,origin +TARGET_LINK_LIBRARIES(sudodem qhull ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${LINKLIBS} -lrt) + +MESSAGE("link libraries: " ${LINKLIBS}) +#TARGET_LINK_LIBRARIES(sudodem qhull -lboost_python -lboost_thread -lboost_filesystem -lboost_iostreams -lboost_regex -lboost_serialization -lboost_system -lboost_date_time -lpthread ${PYTHON_LIBRARIES} ${LINKLIBS} -lrt) +#TARGET_LINK_LIBRARIES(sudodem qhull -L/opt/SudoDEM/lib/3rdlibslibboost_python.so libboost_thread.so libboost_filesystem.so libboost_iostreams.so libboost_regex.so libboost_serialization.so libboost_system.so libboost_date_time.so libthread.so ${PYTHON_LIBRARIES} ${LINKLIBS} -lrt) +#SET_TARGET_PROPERTIES(sudodem PROPERTIES LINK_FLAGS "-Wl,-z,origin,--as-needed" ) #add -z,origin +SET_TARGET_PROPERTIES(sudodem PROPERTIES LINK_FLAGS "-Wl,--as-needed" INSTALL_RPATH "$ORIGIN;$ORIGIN/../3rdlibs;$ORIGIN/../3rdlibs/py;$ORIGIN/py/sudodem/qt" ) +TARGET_LINK_LIBRARIES(boot sudodem) + +IF (CLUSTER) + TARGET_LINK_LIBRARIES(sudodem2d ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) +ELSE (CLUSTER) + TARGET_LINK_LIBRARIES(sudodem2d boot ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})#FIXME:sudodem2d is not dependent on boot on Ubuntu, but not on CentOS +ENDIF (CLUSTER) + +IF(ENABLE_GUI) + TARGET_LINK_LIBRARIES(sudodem _GLViewer ${GUI_LIBS}) +ENDIF(ENABLE_GUI) + +#==================================== +#IF (NOT (PY_minieigen)) +# ADD_LIBRARY(miniEigen SHARED py/mathWrap/miniEigen.cpp) +# SET_TARGET_PROPERTIES(miniEigen PROPERTIES PREFIX "") +# TARGET_LINK_LIBRARIES(miniEigen ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) +# INSTALL(TARGETS miniEigen DESTINATION ${SUDODEM_PY_PATH}) +#ENDIF (NOT (PY_minieigen)) + +#==================================== +#Back compatibility with scons +SET (realVersion ${SUDODEM_VERSION}) +SET (version ${SUDODEM_VERSION}) +SET (pyExecutable ${PYTHON_EXECUTABLE}) +SET (profile "default") +SET (sourceRoot "${CMAKE_CURRENT_SOURCE_DIR}") +#==================================== +CONFIGURE_FILE(core/main/sudodemcfg.h.in "${CMAKE_BINARY_DIR}/sudodemcfg.h") +CONFIGURE_FILE(py/__init__.py.in "${CMAKE_BINARY_DIR}/__init__.py") +#=========================================================== + +INSTALL(FILES "${CMAKE_BINARY_DIR}/__init__.py" DESTINATION ${SUDODEM_PY_PATH}/sudodem/) +INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/sudodem-logo-note.png" DESTINATION "${SUDODEM_DOC_PATH}/img") + +INSTALL(TARGETS boot DESTINATION "${SUDODEM_PY_PATH}/sudodem/") +INSTALL(TARGETS sudodem DESTINATION ${SUDODEM_LIB_PATH}) +INSTALL(TARGETS sudodem2d DESTINATION ${SUDODEM_EXEC_PATH}/) + +#=========================================================== +MESSAGE(STATUS "===========================================================") +MESSAGE(STATUS "SudoDEM configured with following features:${CONFIGURED_FEATS}") +MESSAGE(STATUS "Disabled features:${DISABLED_FEATS}") +IF (DEBUG) + MESSAGE(STATUS "Debug build") + SET (debugbuild " (debug build)") +ELSE (DEBUG) + MESSAGE(STATUS "Optimized build") +ENDIF (DEBUG) +IF (CHUNKSIZE) + MESSAGE(STATUS "CHUNKSIZE is set to " ${CHUNKSIZE}) +ENDIF (CHUNKSIZE) +MESSAGE(STATUS "===========================================================") +#=========================================================== diff --git a/SudoDEM2D/cMake/CombineSources.cmake b/SudoDEM2D/cMake/CombineSources.cmake new file mode 100644 index 0000000..9bd551e --- /dev/null +++ b/SudoDEM2D/cMake/CombineSources.cmake @@ -0,0 +1,32 @@ +# include several source files (in SRCS) in one or more +# combined files; each combined file holds maximally +# MAXNUM files. +# BASE gives basename for created files; +# files corresponding to the pattern are deleted +# first, so that there are no relicts from previous runs +# with possibly different MAXNUM +MACRO(COMBINE_SOURCES BASE SRCS MAXNUM) + LIST(LENGTH SRCS SRCS_LENGTH) + SET(COMB_COUNTER 0) + FILE(GLOB EXISTING "${BASE}.*.cpp") + IF("$EXISTING") + FILE(REMOVE ${EXISTING}) + ENDIF() + SET(OUT "${BASE}.${COMB_COUNTER}.cpp") + FILE(WRITE ${OUT}) + SET(COUNTER 0) + FOREACH(SRC ${SRCS}) + if(${SRC} MATCHES "^/.*$") # absolute filename + FILE(APPEND ${OUT} "#include<${SRC}>\n") + else() + FILE(APPEND ${OUT} "#include<${CMAKE_SOURCE_DIR}/${SRC}>\n") + endif() + MATH(EXPR COUNTER "${COUNTER}+1") + IF(${COUNTER} EQUAL ${MAXNUM}) + SET(COUNTER 0) + MATH(EXPR COMB_COUNTER ${COMB_COUNTER}+1) + SET(OUT "${BASE}.${COMB_COUNTER}.cpp") + FILE(WRITE ${OUT}) + ENDIF() + ENDFOREACH() +ENDMACRO() diff --git a/SudoDEM2D/cMake/FindCholmod.cmake b/SudoDEM2D/cMake/FindCholmod.cmake new file mode 100644 index 0000000..6d8bdea --- /dev/null +++ b/SudoDEM2D/cMake/FindCholmod.cmake @@ -0,0 +1,31 @@ +# - Try to find CHOLMOD +# This will define +# +# CHOLMOD_FOUND - system has CHOLMOD +# CHOLMOD_LIBRARIES - library to link against to use Cholmod +# CHOLMOD_INCLUDE_DIR - where to find cholmod.h, etc. +# AMD_LIBRARY - needed by CHOLMOD +# COLAMD_LIBRARY - needed by CHOLMOD +# CCOLAMD_LIBRARY - needed by CHOLMOD +# CAMD_LIBRARY - needed by CHOLMOD + +FIND_LIBRARY(CHOLMOD_LIBRARIES NAMES cholmod libcholmod + PATHS + /usr/lib + /usr/local/lib + /usr/lib/CGAL + /usr/lib64 + /usr/local/lib64 + /usr/lib64/CGAL + ) + +FIND_LIBRARY(AMD_LIBRARY NAMES amd PATHS /usr/lib /usr/local/lib /usr/lib/CGAL /usr/lib64 /usr/local/lib64 /usr/lib64/CGAL) +FIND_LIBRARY(CAMD_LIBRARY NAMES camd PATHS /usr/lib /usr/local/lib /usr/lib/CGAL /usr/lib64 /usr/local/lib64 /usr/lib64/CGAL) +FIND_LIBRARY(COLAMD_LIBRARY NAMES colamd PATHS /usr/lib /usr/local/lib /usr/lib/CGAL /usr/lib64 /usr/local/lib64 /usr/lib64/CGAL) +FIND_LIBRARY(CCOLAMD_LIBRARY NAMES ccolamd PATHS /usr/lib /usr/local/lib /usr/lib/CGAL /usr/lib64 /usr/local/lib64 /usr/lib64/CGAL) + +FIND_PATH(CHOLMOD_INCLUDE_DIR cholmod.h PATH /usr/include /usr/include/suitesparse) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cholmod DEFAULT_MSG CHOLMOD_LIBRARIES CHOLMOD_INCLUDE_DIR AMD_LIBRARY CAMD_LIBRARY COLAMD_LIBRARY CCOLAMD_LIBRARY) +MARK_AS_ADVANCED(CHOLMOD_LIBRARIES CHOLMOD_INCLUDE_DIR AMD_LIBRARY CAMD_LIBRARY COLAMD_LIBRARY CCOLAMD_LIBRARY) diff --git a/SudoDEM2D/cMake/FindMetis.cmake b/SudoDEM2D/cMake/FindMetis.cmake new file mode 100644 index 0000000..3866bdc --- /dev/null +++ b/SudoDEM2D/cMake/FindMetis.cmake @@ -0,0 +1,16 @@ +# - Find Metis library +# +# This module defines +# METIS_INCLUDE_DIR, where to find loki/Typelist.h, etc. +# METIS_LIBRARY, libraries to link against to use GL2PS. +# METIS_FOUND, If false, do not try to use GL2PS. + +FIND_PATH(METIS_INCLUDE_DIR metis.h PATHS /usr/include/metis) +FIND_LIBRARY(METIS_LIBRARY NAMES metis parmetis PATHS /usr/lib) + +# handle the QUIETLY and REQUIRED arguments and set LOKI_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Metis DEFAULT_MSG METIS_INCLUDE_DIR METIS_LIBRARY) + +MARK_AS_ADVANCED(METIS_INCLUDE_DIR METIS_LIBRARY) diff --git a/SudoDEM2D/cMake/FindNumPy.cmake b/SudoDEM2D/cMake/FindNumPy.cmake new file mode 100644 index 0000000..d33f4a3 --- /dev/null +++ b/SudoDEM2D/cMake/FindNumPy.cmake @@ -0,0 +1,93 @@ +# https://github.com/ContinuumIO/dynd-python/blob/master/FindNumPy.cmake + +# - Find the NumPy libraries +# This module finds if NumPy is installed, and sets the following variables +# indicating where it is. +# +# TODO: Update to provide the libraries and paths for linking npymath lib. +# +# NUMPY_FOUND - was NumPy found +# NUMPY_VERSION - the version of NumPy found as a string +# NUMPY_VERSION_MAJOR - the major version number of NumPy +# NUMPY_VERSION_MINOR - the minor version number of NumPy +# NUMPY_VERSION_PATCH - the patch version number of NumPy +# NUMPY_VERSION_DECIMAL - e.g. version 1.6.1 is 10601 +# NUMPY_INCLUDE_DIRS - path to the NumPy include files + +#============================================================================ +# Copyright 2012 Continuum Analytics, Inc. +# +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files +# (the "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +#============================================================================ + +# Finding NumPy involves calling the Python interpreter +if(NumPy_FIND_REQUIRED) + find_package(PythonInterp REQUIRED) +else() + find_package(PythonInterp) +endif() + +if(NOT PYTHONINTERP_FOUND) + set(NUMPY_FOUND FALSE) + return() +endif() +set(DPDIR "${CMAKE_CURRENT_SOURCE_DIR}/../dem2dinstall/SudoDEM/lib/3rdlibs/py/") +execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" + "import sys;sys.path.insert(0,'${DPDIR}');import numpy as n; print(n.__version__); print(n.get_include());" + RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS + OUTPUT_VARIABLE _NUMPY_VALUES + ERROR_VARIABLE _NUMPY_ERROR_VALUE + OUTPUT_STRIP_TRAILING_WHITESPACE) + +if(NOT _NUMPY_SEARCH_SUCCESS MATCHES 0) + if(NumPy_FIND_REQUIRED) + message(FATAL_ERROR + "NumPy import failure:\n${_NUMPY_ERROR_VALUE}") + endif() + set(NUMPY_FOUND FALSE) + return() +endif() + +# Convert the process output into a list +string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES}) +string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES}) +list(GET _NUMPY_VALUES 0 NUMPY_VERSION) +list(GET _NUMPY_VALUES 1 NUMPY_INCLUDE_DIRS) + +# Make sure all directory separators are '/' +string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS}) + +# Get the major and minor version numbers +string(REGEX REPLACE "\\." ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION}) +list(GET _NUMPY_VERSION_LIST 0 NUMPY_VERSION_MAJOR) +list(GET _NUMPY_VERSION_LIST 1 NUMPY_VERSION_MINOR) +list(GET _NUMPY_VERSION_LIST 2 NUMPY_VERSION_PATCH) +string(REGEX MATCH "[0-9]*" NUMPY_VERSION_PATCH ${NUMPY_VERSION_PATCH}) +math(EXPR NUMPY_VERSION_DECIMAL + "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}") + +find_package_message(NUMPY + "Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}" + "${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}") + +set(NUMPY_FOUND TRUE) diff --git a/SudoDEM2D/cMake/FindPythonModule.cmake b/SudoDEM2D/cMake/FindPythonModule.cmake new file mode 100644 index 0000000..72db37c --- /dev/null +++ b/SudoDEM2D/cMake/FindPythonModule.cmake @@ -0,0 +1,23 @@ +# http://www.cmake.org/pipermail/cmake/2011-January/041666.html +# +# - Find Python Module + +FUNCTION(find_python_module module) + STRING(TOUPPER ${module} module_upper) + + IF(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED") + SET(${module}_FIND_REQUIRED TRUE) + ENDIF(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED") + + EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}" "-c" + "import re, ${module}; print re.compile('/__init__.py.*').sub('',${module}.__file__)" + RESULT_VARIABLE _${module}_status + OUTPUT_VARIABLE _${module}_location + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + + IF(_${module}_status MATCHES 0) + SET(PY_${module} ${_${module}_location} CACHE STRING "Location of Python module ${module}") + ENDIF(_${module}_status MATCHES 0) + + FIND_PACKAGE_HANDLE_STANDARD_ARGS(${module} DEFAULT_MSG PY_${module}) +ENDFUNCTION(find_python_module) diff --git a/SudoDEM2D/cMake/Findglib2.cmake b/SudoDEM2D/cMake/Findglib2.cmake new file mode 100644 index 0000000..52b3382 --- /dev/null +++ b/SudoDEM2D/cMake/Findglib2.cmake @@ -0,0 +1,218 @@ +# Downloaded from http://opensource.bolloretelecom.eu/projects/boc-wimax/browser/cmake/modules/FindGLIB2.cmake?rev=8f5b254534bd304923d4cc7bc7e9d6552c119ea2 +# - Try to find GLib2 +# Once done this will define +# +# GLIB2_FOUND - system has GLib2 +# GLIB2_INCLUDE_DIRS - the GLib2 include directory +# GLIB2_LIBRARIES - Link these to use GLib2 +# +# HAVE_GLIB_GREGEX_H glib has gregex.h header and +# supports g_regex_match_simple +# +# Copyright (c) 2006 Andreas Schneider +# Copyright (c) 2006 Philippe Bernery +# Copyright (c) 2007 Daniel Gollub +# Copyright (c) 2007 Alban Browaeys +# Copyright (c) 2008 Michael Bell +# Copyright (c) 2008 Bjoern Ricks +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS ) + # in cache already + SET(GLIB2_FOUND TRUE) +ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS ) + + INCLUDE(FindPkgConfig) + + ## Glib + IF ( GLIB2_FIND_REQUIRED ) + SET( _pkgconfig_REQUIRED "REQUIRED" ) + ELSE ( GLIB2_FIND_REQUIRED ) + SET( _pkgconfig_REQUIRED "" ) + ENDIF ( GLIB2_FIND_REQUIRED ) + + IF ( GLIB2_MIN_VERSION ) + PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} ) + ELSE ( GLIB2_MIN_VERSION ) + PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 ) + ENDIF ( GLIB2_MIN_VERSION ) + IF ( PKG_CONFIG_FOUND ) + IF ( GLIB2_FOUND ) + SET ( GLIB2_CORE_FOUND TRUE ) + ELSE ( GLIB2_FOUND ) + SET ( GLIB2_CORE_FOUND FALSE ) + ENDIF ( GLIB2_FOUND ) + ENDIF ( PKG_CONFIG_FOUND ) + + # Look for glib2 include dir and libraries w/o pkgconfig + IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND ) + FIND_PATH( + _glibconfig_include_DIR + NAMES + glibconfig.h + PATHS + /opt/gnome/lib64 + /opt/gnome/lib + /opt/lib/ + /opt/local/lib + /sw/lib/ + /usr/lib64 + /usr/lib + /usr/local/include + ${CMAKE_LIBRARY_PATH} + PATH_SUFFIXES + glib-2.0/include + ) + + FIND_PATH( + _glib2_include_DIR + NAMES + glib.h + PATHS + /opt/gnome/include + /opt/local/include + /sw/include + /usr/include + /usr/local/include + PATH_SUFFIXES + glib-2.0 + ) + + #MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}") + + FIND_LIBRARY( + _glib2_link_DIR + NAMES + glib-2.0 + glib + PATHS + /opt/gnome/lib + /opt/local/lib + /sw/lib + /usr/lib + /usr/local/lib + ) + IF ( _glib2_include_DIR AND _glib2_link_DIR ) + SET ( _glib2_FOUND TRUE ) + ENDIF ( _glib2_include_DIR AND _glib2_link_DIR ) + + + IF ( _glib2_FOUND ) + SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} ) + SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} ) + SET ( GLIB2_CORE_FOUND TRUE ) + ELSE ( _glib2_FOUND ) + SET ( GLIB2_CORE_FOUND FALSE ) + ENDIF ( _glib2_FOUND ) + + # Handle dependencies + # libintl + IF ( NOT LIBINTL_FOUND ) + FIND_PATH(LIBINTL_INCLUDE_DIR + NAMES + libintl.h + PATHS + /opt/gnome/include + /opt/local/include + /sw/include + /usr/include + /usr/local/include + ) + + FIND_LIBRARY(LIBINTL_LIBRARY + NAMES + intl + PATHS + /opt/gnome/lib + /opt/local/lib + /sw/lib + /usr/local/lib + /usr/lib + ) + + IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR) + SET (LIBINTL_FOUND TRUE) + ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR) + ENDIF ( NOT LIBINTL_FOUND ) + + # libiconv + IF ( NOT LIBICONV_FOUND ) + FIND_PATH(LIBICONV_INCLUDE_DIR + NAMES + iconv.h + PATHS + /opt/gnome/include + /opt/local/include + /opt/local/include + /sw/include + /sw/include + /usr/local/include + /usr/include + PATH_SUFFIXES + glib-2.0 + ) + + FIND_LIBRARY(LIBICONV_LIBRARY + NAMES + iconv + PATHS + /opt/gnome/lib + /opt/local/lib + /sw/lib + /usr/lib + /usr/local/lib + ) + + IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR) + SET (LIBICONV_FOUND TRUE) + ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR) + ENDIF ( NOT LIBICONV_FOUND ) + + IF (LIBINTL_FOUND) + SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBINTL_LIBRARY}) + SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBINTL_INCLUDE_DIR}) + ENDIF (LIBINTL_FOUND) + + IF (LIBICONV_FOUND) + SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBICONV_LIBRARY}) + SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBICONV_INCLUDE_DIR}) + ENDIF (LIBICONV_FOUND) + + ENDIF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND ) + ## + + IF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES) + SET (GLIB2_FOUND TRUE) + ENDIF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES) + + IF (GLIB2_FOUND) + IF (NOT GLIB2_FIND_QUIETLY) + MESSAGE (STATUS "Found GLib2: ${GLIB2_LIBRARIES} ${GLIB2_INCLUDE_DIRS}") + ENDIF (NOT GLIB2_FIND_QUIETLY) + ELSE (GLIB2_FOUND) + IF (GLIB2_FIND_REQUIRED) + MESSAGE (SEND_ERROR "Could not find GLib2") + ENDIF (GLIB2_FIND_REQUIRED) + ENDIF (GLIB2_FOUND) + + # show the GLIB2_INCLUDE_DIRS and GLIB2_LIBRARIES variables only in the advanced view + MARK_AS_ADVANCED(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES) + MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARY) + MARK_AS_ADVANCED(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARY) + +ENDIF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS) + +IF ( GLIB2_FOUND ) + # Check if system has a newer version of glib + # which supports g_regex_match_simple + INCLUDE( CheckIncludeFiles ) + SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} ) + CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H ) + # Reset CMAKE_REQUIRED_INCLUDES + SET( CMAKE_REQUIRED_INCLUDES "" ) +ENDIF( GLIB2_FOUND ) diff --git a/SudoDEM2D/cMake/GNUInstallDirs.cmake b/SudoDEM2D/cMake/GNUInstallDirs.cmake new file mode 100644 index 0000000..4dc2d68 --- /dev/null +++ b/SudoDEM2D/cMake/GNUInstallDirs.cmake @@ -0,0 +1,188 @@ +# - Define GNU standard installation directories +# Provides install directory variables as defined for GNU software: +# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html +# Inclusion of this module defines the following variables: +# CMAKE_INSTALL_ - destination for files of a given type +# CMAKE_INSTALL_FULL_ - corresponding absolute path +# where is one of: +# BINDIR - user executables (bin) +# SBINDIR - system admin executables (sbin) +# LIBEXECDIR - program executables (libexec) +# SYSCONFDIR - read-only single-machine data (etc) +# SHAREDSTATEDIR - modifiable architecture-independent data (com) +# LOCALSTATEDIR - modifiable single-machine data (var) +# LIBDIR - object code libraries (lib or lib64 or lib/ on Debian) +# INCLUDEDIR - C header files (include) +# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) +# DATAROOTDIR - read-only architecture-independent data root (share) +# DATADIR - read-only architecture-independent data (DATAROOTDIR) +# INFODIR - info documentation (DATAROOTDIR/info) +# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) +# MANDIR - man documentation (DATAROOTDIR/man) +# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) +# Each CMAKE_INSTALL_ value may be passed to the DESTINATION options of +# install() commands for the corresponding file type. If the includer does +# not define a value the above-shown default will be used and the value will +# appear in the cache for editing by the user. +# Each CMAKE_INSTALL_FULL_ value contains an absolute path constructed +# from the corresponding destination by prepending (if necessary) the value +# of CMAKE_INSTALL_PREFIX. + +#============================================================================= +# Copyright 2011 Nikita Krupen'ko +# Copyright 2011 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Installation directories +# +if(NOT DEFINED CMAKE_INSTALL_BINDIR) + set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SBINDIR) + set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR) + set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR) + set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR) + set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR) + set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LIBDIR) + set(_LIBDIR_DEFAULT "lib") + # Override this default 'lib' with 'lib64' iff: + # - we are on Linux system but NOT cross-compiling + # - we are NOT on debian + # - we are on a 64 bits system + # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf + # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if + # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu" + # See http://wiki.debian.org/Multiarch + if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU") + AND NOT CMAKE_CROSSCOMPILING) + if (EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE) + set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}") + endif() + else() # not debian, rely on CMAKE_SIZEOF_VOID_P: + if(NOT DEFINED CMAKE_SIZEOF_VOID_P) + message(AUTHOR_WARNING + "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " + "Please enable at least one language before including GNUInstallDirs.") + else() + if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") + set(_LIBDIR_DEFAULT "lib64") + endif() + endif() + endif() + endif() + set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})") +endif() + +if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR) + set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR) + set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR) + set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)") +endif() + +#----------------------------------------------------------------------------- +# Values whose defaults are relative to DATAROOTDIR. Store empty values in +# the cache and store the defaults in local variables if the cache values are +# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes. + +if(NOT CMAKE_INSTALL_DATADIR) + set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)") + set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}") +endif() + +if(NOT CMAKE_INSTALL_INFODIR) + set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)") + set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info") +endif() + +if(NOT CMAKE_INSTALL_LOCALEDIR) + set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)") + set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale") +endif() + +if(NOT CMAKE_INSTALL_MANDIR) + set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)") + set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man") +endif() + +if(NOT CMAKE_INSTALL_DOCDIR) + set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)") + set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}") +endif() + +#----------------------------------------------------------------------------- + +mark_as_advanced( + CMAKE_INSTALL_BINDIR + CMAKE_INSTALL_SBINDIR + CMAKE_INSTALL_LIBEXECDIR + CMAKE_INSTALL_SYSCONFDIR + CMAKE_INSTALL_SHAREDSTATEDIR + CMAKE_INSTALL_LOCALSTATEDIR + CMAKE_INSTALL_LIBDIR + CMAKE_INSTALL_INCLUDEDIR + CMAKE_INSTALL_OLDINCLUDEDIR + CMAKE_INSTALL_DATAROOTDIR + CMAKE_INSTALL_DATADIR + CMAKE_INSTALL_INFODIR + CMAKE_INSTALL_LOCALEDIR + CMAKE_INSTALL_MANDIR + CMAKE_INSTALL_DOCDIR + ) + +# Result directories +# +foreach(dir + BINDIR + SBINDIR + LIBEXECDIR + SYSCONFDIR + SHAREDSTATEDIR + LOCALSTATEDIR + LIBDIR + INCLUDEDIR + OLDINCLUDEDIR + DATAROOTDIR + DATADIR + INFODIR + LOCALEDIR + MANDIR + DOCDIR + ) + if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) + set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") + else() + set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") + endif() +endforeach() diff --git a/SudoDEM2D/cMake/GetVersion.cmake b/SudoDEM2D/cMake/GetVersion.cmake new file mode 100644 index 0000000..5084e59 --- /dev/null +++ b/SudoDEM2D/cMake/GetVersion.cmake @@ -0,0 +1,77 @@ +# Define version or set it from git + +IF (NOT SUDODEM_VERSION) + IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/RELEASE ) + #Release file is found + SET(READFILE cat) + exec_program( + ${READFILE} + ${CMAKE_CURRENT_SOURCE_DIR} + ARGS "RELEASE" + OUTPUT_VARIABLE SUDODEM_VERSION + ) + ELSEIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/config) + #Use git for version defining + exec_program( + "git" + ${CMAKE_CURRENT_SOURCE_DIR} + ARGS "log" + ARGS "-n1" + ARGS "--pretty=oneline" + ARGS "|" + ARGS "cut" + ARGS "-c1-7" + OUTPUT_VARIABLE VERSION_GIT + ) + exec_program( + "git" + ${CMAKE_CURRENT_SOURCE_DIR} + ARGS "log" + ARGS "-n1" + ARGS "--pretty=fuller" + ARGS "--date=iso" + ARGS "|" + ARGS "grep" + ARGS "AuthorDate" + ARGS "|" + ARGS "cut" + ARGS "-c13-22" + OUTPUT_VARIABLE VERSION_DATE + ) + SET(SUDODEM_VERSION "${VERSION_DATE}.git-${VERSION_GIT}") + + #git log -n1 --pretty=format:"%ai_%h" + ELSEIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.bzr/branch/last-revision) + #Use bzr for version defining + exec_program( + "less" + ${CMAKE_CURRENT_SOURCE_DIR}/.bzr/branch/ + ARGS "last-revision" + ARGS "|" + ARGS "cut" + ARGS "-c13-20" + OUTPUT_VARIABLE VERSION_GIT + ) + exec_program( + "bzr" + ${CMAKE_CURRENT_SOURCE_DIR} + ARGS "log" + ARGS "-l" + ARGS "1" + ARGS "--gnu-changelog" + ARGS "|" + ARGS "head" + ARGS "-n1" + ARGS "|" + ARGS "cut" + ARGS "-c1-10" + OUTPUT_VARIABLE VERSION_DATE + ) + SET(SUDODEM_VERSION "${VERSION_DATE}.git-${VERSION_GIT}") + ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/config ) + SET (SUDODEM_VERSION "Unknown") + ENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/RELEASE ) +ENDIF (NOT SUDODEM_VERSION) + + +MESSAGE (STATUS "Version is set to " ${SUDODEM_VERSION}) diff --git a/SudoDEM2D/core/Body.cpp b/SudoDEM2D/core/Body.cpp new file mode 100644 index 0000000..232cada --- /dev/null +++ b/SudoDEM2D/core/Body.cpp @@ -0,0 +1,42 @@ + +#include +#include +#include +#include + +//! This could be -1 if id_t is re-typedef'ed as `int' +const Body::id_t Body::ID_NONE=Body::id_t(-1); + +const shared_ptr& Body::byId(Body::id_t _id, Scene* rb){return (*((rb?rb:Omega::instance().getScene().get())->bodies))[_id];} +const shared_ptr& Body::byId(Body::id_t _id, shared_ptr rb){return (*(rb->bodies))[_id];} + +// return list of interactions of this particle +boost::python::list Body::py_intrs(){ + boost::python::list ret; + for(Body::MapId2IntrT::iterator it=this->intrs.begin(),end=this->intrs.end(); it!=end; ++it) { //Iterate over all bodie's interactions + if(!(*it).second->isReal()) continue; + ret.append((*it).second); + } + return ret; +} + +// return list of interactions of this particle +unsigned int Body::coordNumber(){ + unsigned int intrSize = 0; + for(Body::MapId2IntrT::iterator it=this->intrs.begin(),end=this->intrs.end(); it!=end; ++it) { //Iterate over all bodie's interactions + if(!(*it).second->isReal()) continue; + intrSize++; + } + return intrSize; +} + + +bool Body::maskOk(int mask) const { return (mask==0 || ((groupMask & mask) != 0)); } +bool Body::maskCompatible(int mask) const { return (groupMask & mask) != 0; } +#ifdef SUDODEM_MASK_ARBITRARY +bool Body::maskOk(const mask_t& mask) const { return (mask==0 || ((groupMask & mask) != 0)); } +bool Body::maskCompatible(const mask_t& mask) const { return (groupMask & mask) != 0; } +#endif + + + diff --git a/SudoDEM2D/core/Body.hpp b/SudoDEM2D/core/Body.hpp new file mode 100644 index 0000000..0f836f1 --- /dev/null +++ b/SudoDEM2D/core/Body.hpp @@ -0,0 +1,131 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ +#pragma once +#include//zhswee, fix _POXIC_C_SOURCE warning +#include"Shape.hpp" +#include"Bound.hpp" +#include"State.hpp" +#include"Material.hpp" + +//#include +#include +#include + + + + +class Scene; +class Interaction; + +class Body: public Serializable{ + public: + // numerical types for storing ids + typedef int id_t; + // internal structure to hold some interaction of a body; used by InteractionContainer; + typedef std::map > MapId2IntrT; + // groupMask type + + // bits for Body::flags + enum { FLAG_BOUNDED=1, FLAG_ASPHERICAL=2 }; /* add powers of 2 as needed */ + //! symbolic constant for body that doesn't exist. + static const Body::id_t ID_NONE; + //! get Body pointer given its id. + static const shared_ptr& byId(Body::id_t _id,Scene* rb=NULL); + static const shared_ptr& byId(Body::id_t _id,shared_ptr rb); + + + //! Whether this Body is a Clump. + //! @note The following is always true: \code (Body::isClump() XOR Body::isClumpMember() XOR Body::isStandalone()) \endcode + bool isClump() const {return clumpId!=ID_NONE && id==clumpId;} + //! Whether this Body is member of a Clump. + bool isClumpMember() const {return clumpId!=ID_NONE && id!=clumpId;} + //! Whether this body is standalone (neither Clump, nor member of a Clump) + bool isStandalone() const {return clumpId==ID_NONE;} + + //! Whether this body has all DOFs blocked + // inline accessors + // logic: http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c + bool isDynamic() const { assert(state); return state->blockedDOFs!=State::DOF_ALL; } + void setDynamic(bool d){ assert(state); if(d){ state->blockedDOFs=State::DOF_NONE; } else { state->blockedDOFs=State::DOF_ALL; state->vel=Vector2r::Zero();state->angVel=0.0;} } + bool isBounded() const {return flags & FLAG_BOUNDED; } + void setBounded(bool d){ if(d) flags|=FLAG_BOUNDED; else flags&=~(FLAG_BOUNDED); } + bool isAspherical() const {return flags & FLAG_ASPHERICAL; } + void setAspherical(bool d){ if(d) flags|=FLAG_ASPHERICAL; else flags&=~(FLAG_ASPHERICAL); } + + /*! Hook for clump to update position of members when user-forced reposition and redraw (through GUI) occurs. + * This is useful only in cases when engines that do that in every iteration are not active - i.e. when the simulation is paused. + * (otherwise, GLViewer would depend on Clump and therefore Clump would have to go to core...) */ + virtual void userForcedDisplacementRedrawHook(){return;} + + boost::python::list py_intrs(); + + Body::id_t getId() const {return id;}; + unsigned int coordNumber(); // Number of neighboring particles + + mask_t getGroupMask() const {return groupMask; }; + bool maskOk(int mask) const; + bool maskCompatible(int mask) const; +#ifdef SUDODEM_MASK_ARBITRARY + bool maskOk(const mask_t& mask) const; + bool maskCompatible(const mask_t& mask) const; +#endif + + // only BodyContainer can set the id of a body + friend class BodyContainer; + + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(Body,Serializable,"A particle, basic element of simulation; interacts with other bodies.", + ((Body::id_t,id,Body::ID_NONE,Attr::readonly,"Unique id of this body.")) + + ((mask_t,groupMask,1,,"Bitmask for determining interactions.")) + ((int,flags,FLAG_BOUNDED,Attr::readonly,"Bits of various body-related flags. *Do not access directly*. In c++, use isDynamic/setDynamic, isBounded/setBounded, isAspherical/setAspherical. In python, use :yref:`Body.dynamic`, :yref:`Body.bounded`, :yref:`Body.aspherical`.")) + + ((shared_ptr,material,,,":yref:`Material` instance associated with this body.")) + ((shared_ptr,state,new State,,"Physical :yref:`state`.")) + ((shared_ptr,shape,,,"Geometrical :yref:`Shape`.")) + ((shared_ptr,bound,,,":yref:`Bound`, approximating volume for the purposes of collision detection.")) + ((MapId2IntrT,intrs,,Attr::hidden,"Map from otherId to Interaction with otherId, managed by InteractionContainer. NOTE: (currently) does not contain all interactions with this body (only those where otherId>id), since performance issues with such data duplication have not yet been investigated.")) + ((int,clumpId,Body::ID_NONE,Attr::readonly,"Id of clump this body makes part of; invalid number if not part of clump; see :yref:`Body::isStandalone`, :yref:`Body::isClump`, :yref:`Body::isClumpMember` properties. \n\nNot meant to be modified directly from Python, use :yref:`O.bodies.appendClumped` instead.")) + ((long,chain,-1,,"Id of chain to which the body belongs.")) + ((long,iterBorn,-1,,"Step number at which the body was added to simulation.")) + ((Real,timeBorn,-1,,"Time at which the body was added to simulation.")) +#ifdef SUDODEM_SPH + ((Real,rho, -1.0,, "Current density (only for SPH-model)")) // [Mueller2003], (12) + ((Real,rho0,-1.0,, "Rest density (only for SPH-model)")) // [Mueller2003], (12) + ((Real,press,0.0,, "Pressure (only for SPH-model)")) // [Mueller2003], (12) + ((Real,Cs,0.0,, "Color field (only for SPH-model)")) // [Mueller2003], (15) +#endif +#ifdef SUDODEM_LIQMIGRATION + ((Real,Vf, 0.0,, "Individual amount of liquid")) + ((Real,Vmin, 0.0,, "Minimal amount of liquid")) +#endif + , + /* ctor */, + /* py */ + // + .def_readwrite("mat",&Body::material,"Shorthand for :yref:`Body::material`") + .add_property("dynamic",&Body::isDynamic,&Body::setDynamic,"Whether this body will be moved by forces. (In c++, use ``Body::isDynamic``/``Body::setDynamic``) :ydefault:`true`") + .add_property("bounded",&Body::isBounded,&Body::setBounded,"Whether this body should have :yref:`Body.bound` created. Note that bodies without a :yref:`bound ` do not participate in collision detection. (In c++, use ``Body::isBounded``/``Body::setBounded``) :ydefault:`true`") + .add_property("aspherical",&Body::isAspherical,&Body::setAspherical,"Whether this body has different inertia along principal axes; :yref:`NewtonIntegrator` makes use of this flag to call rotation integration routine for aspherical bodies, which is more expensive. :ydefault:`false`") + .add_property("mask",boost::python::make_getter(&Body::groupMask,boost::python::return_value_policy()),boost::python::make_setter(&Body::groupMask,boost::python::return_value_policy()),"Shorthand for :yref:`Body::groupMask`") + .add_property("isStandalone",&Body::isStandalone,"True if this body is neither clump, nor clump member; false otherwise.") + .add_property("isClumpMember",&Body::isClumpMember,"True if this body is clump member, false otherwise.") + .add_property("isClump",&Body::isClump,"True if this body is clump itself, false otherwise.") + .add_property("iterBorn",&Body::iterBorn,"Returns step number at which the body was added to simulation.") + .add_property("timeBorn",&Body::timeBorn,"Returns time at which the body was added to simulation.") + .def_readwrite("chain",&Body::chain,"Returns Id of chain to which the body belongs.") + .def("intrs",&Body::py_intrs,"Return all interactions in which this body participates.") +#ifdef SUDODEM_SPH + .add_property("rho", &Body::rho, "Returns the current density (only for SPH-model).") + .add_property("rho0", &Body::rho0,"Returns the rest density (only for SPH-model).") + .add_property("press",&Body::press,"Returns the pressure (only for SPH-model).") +#endif + ); +}; +REGISTER_SERIALIZABLE(Body); diff --git a/SudoDEM2D/core/BodyContainer.cpp b/SudoDEM2D/core/BodyContainer.cpp new file mode 100644 index 0000000..033dadc --- /dev/null +++ b/SudoDEM2D/core/BodyContainer.cpp @@ -0,0 +1,62 @@ +// 2010 © Václav Šmilauer + +#include "Scene.hpp" +#include "Body.hpp" +#include "BodyContainer.hpp" +#include "Clump.hpp" +#ifdef SUDODEM_OPENMP + #include +#endif + + +CREATE_LOGGER(BodyContainer); + +void BodyContainer::clear(){ + body.clear(); +} + +Body::id_t BodyContainer::insert(shared_ptr& b){ + const shared_ptr& scene=Omega::instance().getScene(); + b->iterBorn=scene->iter; + b->timeBorn=scene->time; + b->id=body.size(); + scene->doSort = true; + body.push_back(b); + // Notify ForceContainer about new id + scene->forces.addMaxId(b->id); + return b->id; +} + +bool BodyContainer::erase(Body::id_t id, bool eraseClumpMembers){//default is false (as before) + if(!body[id]) return false; + const shared_ptr& b=Body::byId(id); + if ((b) and (b->isClumpMember())) { + const shared_ptr clumpBody=Body::byId(b->clumpId); + const shared_ptr clump=SUDODEM_PTR_CAST(clumpBody->shape); + Clump::del(clumpBody, b); + if (clump->members.size()==0) this->erase(clumpBody->id,false); //Clump has no members any more. Remove it + } + + if ((b) and (b->isClump())){ + //erase all members if eraseClumpMembers is true: + const shared_ptr& clump=SUDODEM_PTR_CAST(b->shape); + std::map& members = clump->members; + FOREACH(MemberMap::value_type& mm, members){ + const Body::id_t& memberId=mm.first; + if (eraseClumpMembers) { + this->erase(memberId,false); // erase members + } else { + //when the last members is erased, the clump will be erased automatically, see above + Body::byId(memberId)->clumpId=Body::ID_NONE; // make members standalones + } + } + body[id].reset(); + return true; + } + const shared_ptr& scene=Omega::instance().getScene(); + for(Body::MapId2IntrT::iterator it=b->intrs.begin(),end=b->intrs.end(); it!=end; ++it) { //Iterate over all body's interactions + scene->interactions->requestErase((*it).second); + } + body[id].reset(); + return true; +} diff --git a/SudoDEM2D/core/BodyContainer.hpp b/SudoDEM2D/core/BodyContainer.hpp new file mode 100644 index 0000000..7f0f183 --- /dev/null +++ b/SudoDEM2D/core/BodyContainer.hpp @@ -0,0 +1,76 @@ +// 2004 © Olivier Galizzi +// 2004 © Janek Kozicki +// 2010 © Václav Šmilauer + +#pragma once + +#include +#include + +class Body; +class InteractionContainer; + +#if SUDODEM_OPENMP + #define SUDODEM_PARALLEL_FOREACH_BODY_BEGIN(b_,bodies) const Body::id_t _sz(bodies->size()); _Pragma("omp parallel for") for(Body::id_t _id=0; _id<_sz; _id++){ if(!(*bodies)[_id]) continue; b_((*bodies)[_id]); + #define SUDODEM_PARALLEL_FOREACH_BODY_END() } +#else + #define SUDODEM_PARALLEL_FOREACH_BODY_BEGIN(b,bodies) FOREACH(b,*(bodies)){ + #define SUDODEM_PARALLEL_FOREACH_BODY_END() } +#endif + +/* +Container of bodies implemented as flat std::vector. It handles body removal and +intelligently reallocates free ids for newly added ones. +The nested iterators and the specialized FOREACH_BODY macros above will silently skip null body pointers which may exist after removal. The null pointers can still be accessed via the [] operator. + +Any alternative implementation should use the same API. +*/ +class BodyContainer: public Serializable{ + private: + typedef std::vector > ContainerT; + typedef std::map MemberMap; + ContainerT body; + public: + friend class InteractionContainer; // accesses the body vector directly + + //An iterator that will automatically jump slots with null bodies + class smart_iterator : public ContainerT::iterator { + public: + ContainerT::iterator end; + smart_iterator& operator++() { + ContainerT::iterator::operator++(); + while (!(this->operator*()) && end!=(*this)) ContainerT::iterator::operator++(); + return *this;} + smart_iterator operator++(int) {smart_iterator temp(*this); operator++(); return temp;} + smart_iterator& operator=(const ContainerT::iterator& rhs) {ContainerT::iterator::operator=(rhs); return *this;} + smart_iterator& operator=(const smart_iterator& rhs) {ContainerT::iterator::operator=(rhs); end=rhs.end; return *this;} + smart_iterator() {} + smart_iterator(const ContainerT::iterator& source) {(*this)=source;} + smart_iterator(const smart_iterator& source) {(*this)=source; end=source.end;} + }; + typedef smart_iterator iterator; + typedef const smart_iterator const_iterator; + + BodyContainer() {}; + virtual ~BodyContainer() {}; + Body::id_t insert(shared_ptr&); + void clear(); + iterator begin() { + iterator temp(body.begin()); temp.end=body.end(); + return (body.begin()==body.end() || *temp)?temp:++temp;} + iterator end() { iterator temp(body.end()); temp.end=body.end(); return temp;} + const_iterator begin() const { return begin();} + const_iterator end() const { return end();} + + size_t size() const { return body.size(); } + shared_ptr& operator[](unsigned int id){ return body[id];} + const shared_ptr& operator[](unsigned int id) const { return body[id]; } + + bool exists(Body::id_t id) const { return (id>=0) && ((size_t)id +#include +#include +#include + +/*! Interface for approximate body locations in space + + Note: the min and max members refer to shear coordinates, in periodic + and sheared space, not cartesian coordinates in the physical space. + +*/ + +class Bound: public Serializable, public Indexable{ + public: + SUDODEM_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(Bound,Serializable,"Object bounding part of space taken by associated body; might be larger, used to optimalize collision detection", + ((int,lastUpdateIter,0,Attr::readonly,"record iteration of last reference position update |yupdate|")) + ((Vector2r,refPos,Vector2r(NaN,NaN),Attr::readonly,"Reference position, updated at current body position each time the bound dispatcher update bounds |yupdate|")) +// ((bool,isBounding,false,Attr::readonly,"A flag used to tell when the body moves out of bounds - only used if oriVerlet striding is active :yref:`BoundDispatcher::updatingDispFactor`>0 |yupdate|")) + ((Real,sweepLength,0, Attr::readonly,"The length used to increase the bounding boxe size, can be adjusted on the basis of previous displacement if :yref:`BoundDispatcher::targetInterv`>0. |yupdate|")) + ((Vector3r,color,Vector3r(1,1,1),,"Color for rendering this object")) + ((Vector2r,min,Vector2r(NaN,NaN),(Attr::noSave | Attr::readonly),"Lower corner of box containing this bound (and the :yref:`Body` as well)")) + ((Vector2r,max,Vector2r(NaN,NaN),(Attr::noSave | Attr::readonly),"Upper corner of box containing this bound (and the :yref:`Body` as well)")) + , + /*deprec*/, + /* init */, + /* ctor*/, + /*py*/ + SUDODEM_PY_TOPINDEXABLE(Bound) + ); + REGISTER_INDEX_COUNTER(Bound); +}; +REGISTER_SERIALIZABLE(Bound); diff --git a/SudoDEM2D/core/Cell.cpp b/SudoDEM2D/core/Cell.cpp new file mode 100644 index 0000000..ed3104d --- /dev/null +++ b/SudoDEM2D/core/Cell.cpp @@ -0,0 +1,42 @@ + +#include + +CREATE_LOGGER(Cell); + +void Cell::integrateAndUpdate(Real dt){ + //incremental displacement gradient + _trsfInc=dt*velGrad; + // total transformation; M = (Id+G).M = F.M + trsf+=_trsfInc*trsf; + _invTrsf=trsf.inverse(); + // hSize contains colums with updated base vectors + prevHSize=hSize; + _vGradTimesPrevH = velGrad*prevHSize; + hSize+=_trsfInc*hSize; + if(hSize.determinant()==0){ throw runtime_error("Cell is degenerate (zero volume)."); } + // lengths of transformed cell vectors, skew cosines + Matrix2r Hnorm; // normalized transformed base vectors + for(int i=0; i<2; i++){ + Vector2r base(hSize.col(i)); + _size[i]=base.norm(); base/=_size[i]; //base is normalized now + Hnorm(0,i)=base[0]; Hnorm(1,i)=base[1];}; + // skew cosines + // sin between axes is cos of skew + //_cos=(Hnorm.col(0).cross(Hnorm.col(1))).squaredNorm(); + _cos=1 - pow(Hnorm.col(0).dot(Hnorm.col(1)),2); + // pure shear trsf: ones on diagonal + _shearTrsf=Hnorm; + // pure unshear transformation + _unshearTrsf=_shearTrsf.inverse(); + // some parts can branch depending on presence/absence of shear + _hasShear=(hSize(0,1)!=0 || hSize(1,0)!=0); + // OpenGL shear matrix (used frequently) + fillGlShearTrsfMatrix(_glShearTrsfMatrix); +} + +void Cell::fillGlShearTrsfMatrix(double m[16]){ + m[0]=_shearTrsf(0,0); m[4]=_shearTrsf(0,1); m[8]=0; m[12]=0; + m[1]=_shearTrsf(1,0); m[5]=_shearTrsf(1,1); m[9]=0; m[13]=0; + m[2]=0; m[6]=0; m[10]=0;m[14]=0; + m[3]=0; m[7]=0; m[11]=0;m[15]=1; +} diff --git a/SudoDEM2D/core/Cell.hpp b/SudoDEM2D/core/Cell.hpp new file mode 100644 index 0000000..53340a7 --- /dev/null +++ b/SudoDEM2D/core/Cell.hpp @@ -0,0 +1,200 @@ +// 2009 © Václav Šmilauer + +/*! Periodic cell parameters and routines. Usually instantiated as Scene::cell. + +The Cell has current box configuration represented by the parallelepiped's base vectors (*hSize*). Lengths of the base vectors can be accessed via *size*. + +* Matrix2r *trsf* is "deformation gradient tensor" F (http://en.wikipedia.org/wiki/Finite_strain_theory) +* Matrix2r *velGrad* is "velocity gradient tensor" (http://www.cs.otago.ac.nz/postgrads/alexis/FluidMech/node7.html) + +The transformation is split between "normal" part and "rotation/shear" part for contact detection algorithms. The shearPt, unshearPt, getShearTrsf etc functions refer to both shear and rotation. This decomposition is frame-dependant and does not correspond to the rotation/stretch decomposition of mechanics (with stretch further decomposed into isotropic and deviatoric). Therefore, using the shearPt family in equations of mechanics is not recommended. Similarly, attributes assuming the existence of a "reference" state are considered deprecated (refSize, hSize0). It is better to not use them since there is no guarantee that the so-called "reference state" will be maintained consistently in the future. + +*/ + +#pragma once +#include +#include +//#include + +//#include + +class Cell: public Serializable{ + public: + //! Get/set sizes of cell base vectors + const Vector2r& getSize() const { return _size; } + void setSize(const Vector2r& s){for (int k=0;k<2;k++) hSize.col(k)*=s[k]/hSize.col(k).norm(); refHSize=hSize; postLoad(*this);} + //! Return copy of the current size (used only by the python wrapper) + Vector2r getSize_copy() const { return _size; } + //! return vector of consines of skew angle in xy plane between transformed base vectors + const Real& getCos() const {return _cos;} + //! transformation matrix applying pure shear&rotation (scaling removed) + const Matrix2r& getShearTrsf() const { return _shearTrsf; } + //! inverse of getShearTrsfMatrix(). + const Matrix2r& getUnshearTrsf() const {return _unshearTrsf;} + //! transformation increment matrix applying arbitrary field (remove if not used in NewtonIntegrator! ) + // const Matrix2r& getTrsfInc() const { return _trsfInc; } + + /*! return pointer to column-major OpenGL 4x4 matrix applying pure shear. This matrix is suitable as argument for glMultMatrixd. + + Note: the order of OpenGL transoformations matters; for instance, if you draw sheared wire box of size *size*, + centered at *center*, the order is: + + 1. translation: glTranslatev(center); + 3. shearing: glMultMatrixd(scene->cell->getGlShearTrsfMatrix()); + 2. scaling: glScalev(size); + 4. draw: glutWireCube(1); + + See also http://www.songho.ca/opengl/gl_transform.html#matrix . + */ + const double* getGlShearTrsfMatrix() const { return _glShearTrsfMatrix; } + //! Whether any shear (non-diagonal) component of the strain matrix is nonzero. + bool hasShear() const {return _hasShear; } + + // caches; private + private: + Matrix2r _invTrsf; + Matrix2r _trsfInc; + Matrix2r _vGradTimesPrevH; + Vector2r _size; + Real _cos; + Vector2r _refSize; + bool _hasShear; + Matrix2r _shearTrsf, _unshearTrsf; + double _glShearTrsfMatrix[16]; + void fillGlShearTrsfMatrix(double m[16]); + public: + + DECLARE_LOGGER; + + //! "integrate" velGrad, update cached values used by public getter. + void integrateAndUpdate(Real dt); + /*! Return point inside periodic cell, even if shear is applied */ + Vector2r wrapShearedPt(const Vector2r& pt) const { return shearPt(wrapPt(unshearPt(pt))); } + /*! Return point inside periodic cell, even if shear is applied; store cell coordinates in period. */ + Vector2r wrapShearedPt(const Vector2r& pt, Vector2i& period) const { return shearPt(wrapPt(unshearPt(pt),period)); } + /*! Apply inverse shear on point; to put it inside (unsheared) periodic cell, apply wrapPt on the returned value. */ + Vector2r unshearPt(const Vector2r& pt) const { return _unshearTrsf*pt; } + //! Apply shear on point. + Vector2r shearPt(const Vector2r& pt) const { return _shearTrsf*pt; } + /*! Wrap point to inside the periodic cell; don't compute number of periods wrapped */ + Vector2r wrapPt(const Vector2r& pt) const { + Vector2r ret; for(int i=0;i<2;i++) ret[i]=wrapNum(pt[i],_size[i]); return ret;} + /*! Wrap point to inside the periodic cell; period will contain by how many cells it was wrapped. */ + Vector2r wrapPt(const Vector2r& pt, Vector2i& period) const { + Vector2r ret; for(int i=0; i<2; i++){ ret[i]=wrapNum(pt[i],_size[i],period[i]); } return ret;} + /*! Wrap number to interval 0…sz */ + static Real wrapNum(const Real& x, const Real& sz) { + Real norm=x/sz; return (norm-floor(norm))*sz;} + /*! Wrap number to interval 0…sz; store how many intervals were wrapped in period */ + static Real wrapNum(const Real& x, const Real& sz, int& period) { + Real norm=x/sz; period=(int)floor(norm); return (norm-period)*sz;} + + // relative position and velocity for interaction accross multiple cells + Vector2r intrShiftPos(const Vector2i& cellDist) const { return hSize*cellDist.cast(); } + Vector2r intrShiftVel(const Vector2i& cellDist) const { return _vGradTimesPrevH*cellDist.cast(); } + // return body velocity while taking away mean field velocity (coming from velGrad) if the mean field velocity is applied on velocity + Vector2r bodyFluctuationVel(const Vector2r& pos, const Vector2r& vel, const Matrix2r& prevVelGrad) const { return (vel-prevVelGrad*pos); } + + // get/set current shape; setting resets trsf to identity + Matrix2r getHSize() const { return hSize; } + void setHSize(const Matrix2r& m){ hSize=refHSize=m; postLoad(*this); } + // set current transformation; has no influence on current configuration (hSize); sets display refHSize as side-effect + Matrix2r getTrsf() const { return trsf; } + void setTrsf(const Matrix2r& m){ trsf=m; postLoad(*this); } + Matrix2r getVelGrad() const { return velGrad; } + void setVelGrad(const Matrix2r& m){ nextVelGrad=m; velGradChanged=true;} + //BEGIN Deprecated (see refSize property) + // get undeformed shape + Matrix2r getHSize0() const { return _invTrsf*hSize; } + // edge lengths of the undeformed shape + Vector2r getRefSize() const { Matrix2r h=getHSize0(); return Vector2r(h.col(0).norm(),h.col(1).norm()); } + // temporary, will be removed in favor of more descriptive setBox(...) + void setRefSize(const Vector2r& s){ + // if refSize is set to the current size and the cell is a box (used in older scripts), say it is not necessary + Matrix2r hSizeEigen3=hSize.diagonal().asDiagonal(); //Eigen3 support + if(s==_size && hSize==hSizeEigen3){ LOG_WARN("Setting O.cell.refSize=O.cell.size is useless, O.trsf=Matrix3.Identity is enough now."); } + else {LOG_WARN("Setting Cell.refSize is deprecated, use Cell.setBox(...) instead.");} + setBox(s); postLoad(*this); + } + //END Deprecated + // set box shape of the cell + void setBox(const Vector2r& size){ setHSize(size.asDiagonal()); trsf=Matrix2r::Identity(); postLoad(*this); } + //void setBox3(const Real& s0, const Real& s1){ setBox(Vector2r(s0,s1)); } + + + // return current cell volume + Real getVolume() const {return hSize.determinant();} + void postLoad(Cell&){ integrateAndUpdate(0); } + + // to resolve overloads + Vector2r wrapShearedPt_py(const Vector2r& pt) const { return wrapShearedPt(pt);} + Vector2r wrapPt_py(const Vector2r& pt) const { return wrapPt(pt);} + + // strain measures + Matrix2r getDefGrad() { return trsf; } + Matrix2r getSmallStrain() { return .5*(trsf+trsf.transpose()) - Matrix2r::Identity(); } + Matrix2r getRCauchyGreenDef() { return trsf.transpose()*trsf; } + Matrix2r getLCauchyGreenDef() { return trsf*trsf.transpose(); } + Matrix2r getLagrangianStrain() { return .5*(getRCauchyGreenDef()-Matrix2r::Identity()); } + Matrix2r getEulerianAlmansiStrain() { return .5*(Matrix2r::Identity()-getLCauchyGreenDef().inverse()); } + void computePolarDecOfDefGrad(Matrix2r& R, Matrix2r& U) { Matrix_computeUnitaryPositive(trsf,&R,&U); } + boost::python::tuple getPolarDecOfDefGrad(){ Matrix2r R,U; computePolarDecOfDefGrad(R,U); return boost::python::make_tuple(R,U); } + Matrix2r getRotation() { Matrix2r R,U; computePolarDecOfDefGrad(R,U); return R; } + Matrix2r getLeftStretch() { Matrix2r R,U; computePolarDecOfDefGrad(R,U); return U; } + Matrix2r getRightStretch() { Matrix2r R,U; computePolarDecOfDefGrad(R,U); return trsf*R.transpose(); } + + // stress measures + //Matrix2r getStress() { return Shop::getStress(); } + //Matrix2r getCauchyStress() { Matrix2r s=getStress(); return .5*(s+s.transpose()); } + + enum { HOMO_NONE=0, HOMO_POS=1, HOMO_VEL=2, HOMO_VEL_2ND=3 }; + SUDODEM_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(Cell,Serializable,"Parameters of periodic boundary conditions. Only applies if O.isPeriodic==True.", + /* overridden below to be modified by getters/setters because of intended side-effects */ + ((Matrix2r,trsf,Matrix2r::Identity(),,"[overridden]")) //"Current transformation matrix of the cell, which defines how far is the current cell geometry (:yref:`hSize`) from the reference configuration. Changing trsf will not change :yref:`hSize`, it serves only as accumulator for transformations applied via :yref:`velGrad`.")) + ((Matrix2r,refHSize,Matrix2r::Identity(),,"Reference cell configuration, only used with :yref:`OpenGLRenderer.dispScale`. Updated automatically when :yref:`hSize` or :yref:`trsf` is assigned directly; also modified by :yref:`sudodem.utils.setRefPos` (called e.g. by the ``Reference`` button in the UI).")) + ((Matrix2r,hSize,Matrix2r::Identity(),,"[overridden below]")) + ((Matrix2r,prevHSize,Matrix2r::Identity(),Attr::readonly,":yref:`hSize` from the previous step, used in the definition of relative velocity across periods.")) + /* normal attributes */ + ((Matrix2r,velGrad,Matrix2r::Zero(),,"[overridden below]")) + ((Matrix2r,nextVelGrad,Matrix2r::Zero(),Attr::readonly,"see :yref:`Cell.velGrad`.")) + ((Matrix2r,prevVelGrad,Matrix2r::Zero(),Attr::readonly,"Velocity gradient in the previous step.")) + ((bool,homoDeform,true,,"Deform (:yref:`velGrad`) the cell homothetically, by adjusting positions and velocities of bodies. The velocity change is obtained by deriving the expression v=∇v.x, where ∇v is the macroscopic velocity gradient, giving in an incremental form: Δv=Δ ∇v x + ∇v Δx. As a result, velocities are modified as soon as ``velGrad`` changes, according to the first term: Δv(t)=Δ ∇v x(t), while the 2nd term reflects a convective term: Δv'= ∇v v(t-dt/2).")) + ((bool,velGradChanged,false,Attr::readonly,"true when velGrad has been changed manually (see also :yref:`Cell.nextVelGrad`)")), + /*deprec*/ + ((Hsize,hSize,"conform to SudoDEM's names convention.")), + /*init*/ , + /*ctor*/ _invTrsf=Matrix2r::Identity(); integrateAndUpdate(0), + /*py*/ + // override some attributes above + .add_property("hSize",&Cell::getHSize,&Cell::setHSize,"Base cell vectors (columns of the matrix), updated at every step from :yref:`velGrad` (:yref:`trsf` accumulates applied :yref:`velGrad` transformations). Setting *hSize* during a simulation is not supported by most contact laws, it is only meant to be used at iteration 0 before any interactions have been created.") + .add_property("size",&Cell::getSize_copy,&Cell::setSize,"Current size of the cell, i.e. lengths of the 3 cell lateral vectors contained in :yref:`Cell.hSize` columns. Updated automatically at every step. Assigning a value will change the lengths of base vectors (see :yref:`Cell.hSize`), keeping their orientations unchanged.") + .add_property("refSize",&Cell::getRefSize,&Cell::setRefSize,"Reference size of the cell (lengths of initial cell vectors, i.e. column norms of :yref:`hSize`).\n\n.. note::\n\t Modifying this value is deprecated, use :yref:`setBox` instead.") + // useful properties + .add_property("trsf",&Cell::getTrsf,&Cell::setTrsf,"Current transformation matrix of the cell, obtained from time integration of :yref:`Cell.velGrad`.") + .add_property("velGrad",&Cell::getVelGrad,&Cell::setVelGrad,"Velocity gradient of the transformation; used in :yref:`NewtonIntegrator`. Values of :yref:`velGrad` accumulate in :yref:`trsf` at every step.\n\n NOTE: changing velGrad at the beginning of a simulation loop would lead to inacurate integration for one step, as it should normaly be changed after the contact laws (but before Newton). To avoid this problem, assignment is deferred automatically. The target value typed in terminal is actually stored in :yref:`Cell.nextVelGrad` and will be applied right in time by Newton integrator. \n\n.. note::\n\t Assigning individual components of velGrad is not possible (it will not return any error but it will have no effect). Instead, you can assign to :yref:`Cell.nextVelGrad`, as in O.cell.nextVelGrad[1,2]=1.") + .def_readonly("size",&Cell::getSize_copy,"Current size of the cell, i.e. lengths of the 3 cell lateral vectors contained in :yref:`Cell.hSize` columns. Updated automatically at every step.") + .add_property("volume",&Cell::getVolume,"Current volume of the cell.") + // functions + .def("setBox",&Cell::setBox,"Set :yref:`Cell` shape to be rectangular, with dimensions along axes specified by given argument. Shorthand for assigning diagonal matrix with respective entries to :yref:`hSize`.") + //.def("setBox",&Cell::setBox3,"Set :yref:`Cell` shape to be rectangular, with dimensions along $x$, $y$, $z$ specified by arguments. Shorthand for assigning diagonal matrix with the respective entries to :yref:`hSize`.") + // debugging only + .def("wrap",&Cell::wrapShearedPt_py,"Transform an arbitrary point into a point in the reference cell") + .def("unshearPt",&Cell::unshearPt,"Apply inverse shear on the point (removes skew+rot of the cell)") + .def("shearPt",&Cell::shearPt,"Apply shear (cell skew+rot) on the point") + .def("wrapPt",&Cell::wrapPt_py,"Wrap point inside the reference cell, assuming the cell has no skew+rot.") + .def("getDefGrad",&Cell::getDefGrad,"Returns deformation gradient tensor $\\mat{F}$ of the cell deformation (http://en.wikipedia.org/wiki/Finite_strain_theory)") + .def("getSmallStrain",&Cell::getSmallStrain,"Returns small strain tensor $\\mat{\\varepsilon}=\\frac{1}{2}(\\mat{F}+\\mat{F}^T)-\\mat{I}$ of the cell (http://en.wikipedia.org/wiki/Finite_strain_theory)") + .def("getRCauchyGreenDef",&Cell::getRCauchyGreenDef,"Returns right Cauchy-Green deformation tensor $\\mat{C}=\\mat{F}^T\\mat{F}$ of the cell (http://en.wikipedia.org/wiki/Finite_strain_theory)") + .def("getLCauchyGreenDef",&Cell::getLCauchyGreenDef,"Returns left Cauchy-Green deformation tensor $\\mat{b}=\\mat{F}\\mat{F}^T$ of the cell (http://en.wikipedia.org/wiki/Finite_strain_theory)") + .def("getLagrangianStrain",&Cell::getLagrangianStrain,"Returns Lagrangian strain tensor $\\mat{E}=\\frac{1}{2}(\\mat{C}-\\mat{I})=\\frac{1}{2}(\\mat{F}^T\\mat{F}-\\mat{I})=\\frac{1}{2}(\\mat{U}^2-\\mat{I})$ of the cell (http://en.wikipedia.org/wiki/Finite_strain_theory)") + .def("getEulerianAlmansiStrain",&Cell::getEulerianAlmansiStrain,"Returns Eulerian-Almansi strain tensor $\\mat{e}=\\frac{1}{2}(\\mat{I}-\\mat{b}^{-1})=\\frac{1}{2}(\\mat{I}-(\\mat{F}\\mat{F}^T)^{-1})$ of the cell (http://en.wikipedia.org/wiki/Finite_strain_theory)") + .def("getPolarDecOfDefGrad",&Cell::getPolarDecOfDefGrad,"Returns orthogonal matrix $\\mat{R}$ and symmetric positive semi-definite matrix $\\mat{U}$ as polar decomposition of deformation gradient $\\mat{F}$ of the cell ( $\\mat{F}=\\mat{RU}$ )") + .def("getRotation",&Cell::getRotation,"Returns rotation of the cell (orthogonal matrix $\\mat{R}$ from polar decomposition $\\mat{F}=\\mat{RU}$ )") + .def("getLeftStretch",&Cell::getLeftStretch,"Returns left (spatial) stretch tensor of the cell (matrix $\\mat{U}$ from polar decomposition $\\mat{F}=\\mat{RU}$ )") + .def("getRightStretch",&Cell::getRightStretch,"Returns right (material) stretch tensor of the cell (matrix $\\mat{V}$ from polar decomposition $\\mat{F}=\\mat{RU}=\\mat{VR}\\ \\rightarrow\\ \\mat{V}=\\mat{FR}^T$ )") + .def_readonly("shearTrsf",&Cell::_shearTrsf,"Current skew+rot transformation (no resize)") + .def_readonly("unshearTrsf",&Cell::_unshearTrsf,"Inverse of the current skew+rot transformation (no resize)") + .add_property("hSize0",&Cell::getHSize0,"Value of untransformed hSize, with respect to current :yref:`trsf` (computed as :yref:`trsf` ⁻¹ × :yref:`hSize`.") + ); +}; +REGISTER_SERIALIZABLE(Cell); diff --git a/SudoDEM2D/core/Clump.cpp b/SudoDEM2D/core/Clump.cpp new file mode 100644 index 0000000..3c303a4 --- /dev/null +++ b/SudoDEM2D/core/Clump.cpp @@ -0,0 +1,272 @@ +// (c) 2007-2010 Vaclav Smilauer + +#include"Clump.hpp" +#include +#include +#include +#include + +SUDODEM_PLUGIN((Clump)); +CREATE_LOGGER(Clump); + +boost::python::dict Clump::members_get(){ + boost::python::dict ret; + FOREACH(MemberMap::value_type& b, members){ + ret[b.first]=boost::python::make_tuple(b.second.position,b.second.rotation); + } + return ret; +} + +void Clump::add(const shared_ptr& clumpBody, const shared_ptr& subBody){ + Body::id_t subId=subBody->getId(); + const shared_ptr clump=SUDODEM_PTR_CAST(clumpBody->shape); + if(clump->members.count(subId)!=0) throw std::invalid_argument(("Body #"+boost::lexical_cast(subId)+" is already part of this clump #"+boost::lexical_cast(clumpBody->id)).c_str()); + if(subBody->isClumpMember()) throw std::invalid_argument(("Body #"+boost::lexical_cast(subId)+" is already a clump member of #"+boost::lexical_cast(subBody->clumpId)).c_str()); + else if(subBody->isClump()){ + const shared_ptr subClump=SUDODEM_PTR_CAST(subBody->shape); + FOREACH(const MemberMap::value_type& mm, subClump->members){ + const Body::id_t& memberId=mm.first; + Scene* scene(Omega::instance().getScene().get()); // get scene + const shared_ptr& member=Body::byId(memberId,scene); + assert(member->isClumpMember()); + member->clumpId=clumpBody->id; + clump->members[memberId]=Se2r();// meaningful values will be put in by Clump::updateProperties + //LOG_DEBUG("Added body #"<id<<" to clump #"<id); + } + //LOG_DEBUG("Clump #"<id<<" will be erased.");// see addToClump() in sudodemWrapper.cpp + } + else{ // subBody must be a standalone! + clump->members[subId]=Se2r();// meaningful values will be put in by Clump::updateProperties + subBody->clumpId=clumpBody->id; + } + clumpBody->clumpId=clumpBody->id; // just to make sure + clumpBody->setBounded(false); // disallow collisions with the clump itself + if(subBody->isStandalone()){LOG_DEBUG("Added body #"<id<<" to clump #"<id);} +} + +void Clump::del(const shared_ptr& clumpBody, const shared_ptr& subBody){ + // erase the subBody; removing body that is not part of the clump throws + const shared_ptr clump=SUDODEM_PTR_CAST(clumpBody->shape); + if(clump->members.erase(subBody->id)!=1) throw std::invalid_argument(("Body #"+boost::lexical_cast(subBody->id)+" not part of clump #"+boost::lexical_cast(clumpBody->id)+"; not removing.").c_str()); + subBody->clumpId=Body::ID_NONE; + LOG_DEBUG("Removed body #"<id<<" from clump #"<id); +} + +void Clump::addForceTorqueFromMembers(const State* clumpState, Scene* scene, Vector2r& F, Real& T){ + FOREACH(const MemberMap::value_type& mm, members){ + const Body::id_t& memberId=mm.first; + const shared_ptr& member=Body::byId(memberId,scene); + assert(member->isClumpMember()); + State* memberState=member->state.get(); + const Vector2r& f=scene->forces.getForce(memberId); + const Real& t=scene->forces.getTorque(memberId); + F+=f; + Vector2r d = memberState->pos-clumpState->pos; + double theta = atan2(f[1],f[0]) - atan2(d[1],d[0]);//theta from d to f: -pi,pi + T+=t+d.norm()*f.norm()*sin(theta); + } +} + +/*! Clump's se3 will be updated (origin at centroid and axes coincident with principal inertia axes) and subSe3 modified in such a way that members positions in world coordinates will not change. + + Note: velocities and angularVelocities of constituents are zeroed. + + OLD DOCS (will be cleaned up): + + -# Clump::members values and Clump::physicalParameters::se3 are invalid from this point + -# M=0; S=vector3r(0,0,0); I=zero tensor; (ALL calculations are in world coordinates!) + -# loop over Clump::members (position x_i, mass m_i, inertia at subBody's centroid I_i) [this loop will be replaced by numerical integration (rasterization) for the intersecting case; the rest will be the same] + - M+=m_i + - S+=m_i*x_i (local static moments are zero (centroid) + - get inertia tensor of subBody in world coordinates, by rotating the principal (local) tensor against subBody->se3->orientation; then translate it to world origin (parallel axes theorem), then I+=I_i_world + -# clumpPos=S/M + -# translate aggregate's inertia tensor; parallel axes on I (R=clumpPos): I^c_jk=I'_jk-M*(delta_jk R.R - R_j*R_k) [http://en.wikipedia.org/wiki/Moments_of_inertia#Parallel_axes_theorem] + -# eigen decomposition of I, get principal inertia and rotation matrix of the clump + -# se3->orientation=quaternion(rotation_matrix); se3->position=clumpPos + -# update subSe3s + +*/ + +void Clump::updateProperties(const shared_ptr& clumpBody, unsigned int discretization){ + LOG_DEBUG("Updating clump #"<id<<" parameters"); + const shared_ptr state(clumpBody->state); + const shared_ptr clump(SUDODEM_PTR_CAST(clumpBody->shape)); + + if(clump->members.empty()){ throw std::runtime_error("Clump::updateProperties: clump has zero members."); } + // trivial case + if(clump->members.size()==1){ + LOG_DEBUG("Clump of size one will be treated specially.") + MemberMap::iterator I=clump->members.begin(); + shared_ptr subBody=Body::byId(I->first); + //const shared_ptr& subRBP(SUDODEM_PTR_CAST(subBody->physicalParameters)); + State* subState=subBody->state.get(); + // se3 of the clump as whole is the same as the member's se3 + state->pos=subState->pos; + state->ori=subState->ori; + // relative member's se2 is identity + I->second.position=Vector2r::Zero(); I->second.rotation=Rotationr::Identity(); + state->inertia=subState->inertia; + state->mass=subState->mass; + state->vel=Vector2r::Zero(); + state->angVel=0.0; + return; + } + //check for intersections: + bool intersecting = false; + shared_ptr sph (new Disk); + int Sph_Index = sph->getClassIndexStatic(); // get disk index for checking if bodies are disks + if (discretization>0){ + FOREACH(MemberMap::value_type& mm, clump->members){ + const shared_ptr subBody1=Body::byId(mm.first); + FOREACH(MemberMap::value_type& mm, clump->members){ + const shared_ptr subBody2=Body::byId(mm.first); + if ((subBody1->shape->getClassIndex() == Sph_Index) && (subBody2->shape->getClassIndex() == Sph_Index) && (subBody1!=subBody2)){//clump members should be disks + Vector2r dist = subBody1->state->pos - subBody2->state->pos; + const Disk* disk1 = SUDODEM_CAST (subBody1->shape.get()); + const Disk* disk2 = SUDODEM_CAST (subBody2->shape.get()); + Real un = (disk1->radius+disk2->radius) - dist.norm(); + if (un > 0.001*min(disk1->radius,disk2->radius)) {intersecting = true; break;} + } + } + if (intersecting) break; + } + } + /* quantities suffixed by + g: global (world) coordinates + s: local subBody's coordinates + c: local clump coordinates + */ + Real M=0; // mass + Real dens=0;//density + Vector2r Sg(0,0); // static moment, for getting clump's centroid + //Matrix3r Ig(Matrix3r::Zero()), Ic(Matrix3r::Zero()); // tensors of inertia; is upper triangular, zeros instead of symmetric elements + Real Ig,Ic; + Ig = Ic = 0.0; + /** + algorithm for estimation of volumes and inertia tensor from clumps using summation/integration scheme with regular grid spacing + (some parts copied from woo: http://bazaar.launchpad.net/~eudoxos/woo/trunk/view/head:/pkg/dem/Clump.cpp) + */ + if(intersecting){ + //get boundaries and minimum radius of clump: + Real rMin=1./0.; AlignedBox2r aabb; + FOREACH(MemberMap::value_type& mm, clump->members){ + const shared_ptr subBody = Body::byId(mm.first); + if (subBody->shape->getClassIndex() == Sph_Index){//clump member should be a disk + const Disk* disk = SUDODEM_CAST (subBody->shape.get()); + aabb.extend(subBody->state->pos + Vector2r::Constant(disk->radius)); + aabb.extend(subBody->state->pos - Vector2r::Constant(disk->radius)); + rMin=min(rMin,disk->radius); + } + } + //get volume and inertia tensor using regular cubic cell array inside bounding box of the clump: + Real dx = rMin/discretization; //edge length of cell + //Real aabbMax = max(max(aabb.max().x()-aabb.min().x(),aabb.max().y()-aabb.min().y()),aabb.max().z()-aabb.min().z()); + //if (aabbMax/dx > 150) dx = aabbMax/150;//limit dx: leads to bug, when long chain of clump members is created (https://bugs.launchpad.net/sudodem/+bug/1273172) + Real dv = pow(dx,2); //volume of cell + long nCells=(aabb.sizes()/dx).prod(); + if(nCells>1e7) LOG_WARN("Clump::updateProperties: Cell array has "<members){ + const shared_ptr subBody = Body::byId(mm.first); + if (subBody->shape->getClassIndex() == Sph_Index){//clump member should be a disk + dens = subBody->material->density; + const Disk* disk = SUDODEM_CAST (subBody->shape.get()); + if((x-subBody->state->pos).squaredNorm() < pow(disk->radius,2)){ + M += dv; + Sg += dv*x; + //inertia I = sum_i( mass_i*dist^2 + I_s) ) //steiners theorem + //Ig += dv*( x.dot(x)*Matrix3r::Identity()-x*x.transpose())/*dist^2*/+Matrix3r(Vector2r::Constant(dv*pow(dx,2)/6.).asDiagonal())/*I_s/m = d^2: along princial axes of dv; perhaps negligible?*/; + Ig += dv* x.dot(x)+ dv*pow(dx,2)/6.;/*I_s/m = d^2: along princial axes of dv; perhaps negligible?*/; + + break; + } + } + } + + } + } + } + if(!intersecting){ + FOREACH(MemberMap::value_type& mm, clump->members){ + // mm.first is Body::id_t, mm.second is Se3r of that body + const shared_ptr subBody=Body::byId(mm.first); + dens = subBody->material->density; + if (subBody->shape->getClassIndex() == Sph_Index){//clump member should be a disk + State* subState=subBody->state.get(); + const Disk* disk = SUDODEM_CAST (subBody->shape.get()); + Real vol = (4./3.)*Mathr::PI*pow(disk->radius,3.); + M+=vol; + Sg+=vol*subState->pos; + //Ig+=Clump::inertiaTensorTranslate(Vector2r::Constant((2/5.)*vol*pow(disk->radius,2)).asDiagonal(),vol,-1.*subState->pos); + Ig+=(2/5.)*vol*pow(disk->radius,2)+vol*(subState->pos).dot(subState->pos); + + } + } + } + assert(M>0); LOG_TRACE("M=\n"<pos=Sg/M; + // this will calculate translation only, since rotation is zero + //Matrix3r Ic_orientG=inertiaTensorTranslate(Ig, -M /* negative mass means towards centroid */, state->pos); // inertia at clump's centroid but with world orientation + Real Ic_orientG=Ig - M*(state->pos).dot(state->pos); // inertia at clump's centroid but with world orientation + + LOG_TRACE("Ic_orientG=\n"< decomposed(Ic_orientG); + //const Matrix3r& R_g2c(decomposed.eigenvectors()); + // has NaNs for identity matrix?? + //LOG_TRACE("R_g2c=\n"<ori=Rotationr::Identity(); //state->ori.normalize(); + state->inertia=Ic_orientG;//dens*decomposed.eigenvalues(); + state->mass=dens*M; + + // TODO: these might be calculated from members... but complicated... - someone needs that?! + state->vel=Vector2r::Zero();state->angVel=0.0; + clumpBody->setAspherical(state->inertia);//no need for 2d + + // update subBodySe3s; subtract clump orientation (=apply its inverse first) to subBody's orientation + FOREACH(MemberMap::value_type& I, clump->members){ + shared_ptr subBody=Body::byId(I.first); + State* subState=subBody->state.get(); + I.second.rotation=state->ori.inverse()*subState->ori; + I.second.position=state->ori.inverse()*(subState->pos-state->pos); + } +} + +/*! @brief Recalculates inertia tensor of a body after translation away from (default) or towards its centroid. + * + * @param I inertia tensor in the original coordinates; it is assumed to be upper-triangular (elements below the diagonal are ignored). + * @param m mass of the body; if positive, translation is away from the centroid; if negative, towards centroid. + * @param off offset of the new origin from the original origin + * @return inertia tensor in the new coordinate system; the matrix is symmetric. + */ +/*Matrix3r Clump::inertiaTensorTranslate(const Matrix3r& I,const Real m, const Vector2r& off){ + return I+m*(off.dot(off)*Matrix3r::Identity()-off*off.transpose()); +}*/ + +/*! @brief Recalculate body's inertia tensor in rotated coordinates. + * + * @param I inertia tensor in old coordinates + * @param T rotation matrix from old to new coordinates + * @return inertia tensor in new coordinates + */ +/*Matrix3r Clump::inertiaTensorRotate(const Matrix3r& I,const Matrix3r& T){ + // [http://www.kwon3d.com/theory/moi/triten.html] + return T.transpose()*I*T; +}*/ + +/*! @brief Recalculate body's inertia tensor in rotated coordinates. + * + * @param I inertia tensor in old coordinates + * @param rot quaternion that describes rotation from old to new coordinates + * @return inertia tensor in new coordinates + */ + /* +Matrix3r Clump::inertiaTensorRotate(const Matrix3r& I, const Quaternionr& rot){ + Matrix3r T=rot.toRotationMatrix(); + return inertiaTensorRotate(I,T); +} +*/ diff --git a/SudoDEM2D/core/Clump.hpp b/SudoDEM2D/core/Clump.hpp new file mode 100644 index 0000000..6501ab2 --- /dev/null +++ b/SudoDEM2D/core/Clump.hpp @@ -0,0 +1,108 @@ +// (c) 2007 Vaclav Smilauer + +#pragma once + +#include +#include +#include +#include + + +/*! Body representing clump (rigid aggregate) composed by other existing bodies. + + Clump is one of bodies that reside in scene->bodies. + When an existing body is added to ::Clump, it's ::Body::dynamic flag is set to false + (it is still subscribed to all its engines, to make it possible to remove it from the clump again). + All forces acting on Clump::members are made to act on the clump itself, which will ensure that they + influence all Clump::members as if the clump were a rigid particle. + + What are clump requirements so that they function? + -# Given any body, tell + - if it is a clump member: Body::isClumpMember() + - if it is a clump: Body:: isClump(). (Correct result is assured at each call to Clump::add). + (we could use RTTI instead? Would that be more reliable?) + - if it is a standalone Body: Body::isStandalone() + - what is it's clump id (Body::clumpId) + -# given the root body, tell + - what clumps it contains (enumerate all bodies and filter clumps, see above) + -# given a clump, tell + - what bodies it contains (keys of ::Clump::members) + - what are se3 of these bodies (values of ::Clump::members) + -# add/delete bodies from/to clump (::Clump::add, ::Clump::del) + - This includes saving se3 of the subBody: it \em must be in clump's local coordinates so that it is constant. The transformation from global to local is given by clump's se3 at the moment of addition. Clump's se3 is initially (origin,identity) + -# Update clump's physical properties (Clump::updateProperties) + - This \em must reposition members so that they have the same se3 globally + -# Apply forces acting on members to the clump instead (done in NewtonsForceLaw, NewtonsMomentumLaw) - uses world coordinates to calculate effect on the clump's centroid + -# Integrate position and orientation of the clump + - LeapFrogPositionIntegrator and LeapFrogOrientationIntegrator move clump as whole + - clump members are skipped, since they have Body::dynamic==false. + - ClumpMemberMover is an engine that updates positions of the clump memebers in each timestep (calls Clump::moveSubBodies internally) + + Some more information can be found http://beta.arcig.cz/~eudoxos/phd/index.cgi/YaDe/HighLevelClumps + + For an example how to generate a clump, see ClumpTestGen::createOneClump. + + @todo GravityEngine should be applied to members, not to clump as such?! Still not sure. Perhaps Clumps should have mass and inertia set to zeros so that engines unaware of clumps do not act on it. It would have some private mass and insertia that would be used in NewtonsForceLaw etc for clumps specially... + + @note Collider::mayCollide (should be used by all colliders) bypasses Clumps explicitly. This no longer depends on the absence of bound. + @note Clump relies on its id being assigned (as well as id of its components); therefore, only bodies that have already been inserted to the container may be added to Clump which has been itself already added to the container. We further requier that clump id is greater than ids of clumped bodies + + */ + +class NewtonIntegrator; + +class Clump: public Shape { + public: + typedef std::map MemberMap; + + static void add(const shared_ptr& clump, const shared_ptr& subBody); + static void del(const shared_ptr& clump, const shared_ptr& subBody); + //! Recalculate physical properties of Clump. + static void updateProperties(const shared_ptr& clump, unsigned int discretization); + //! Calculate positions and orientations of members based on relative Se3; newton pointer (if non-NULL) calls NewtonIntegrator::saveMaximaVelocity + // done as template to avoid cross-dependency between clump and newton (not necessary if all plugins are linked together) + template + static void moveMembers(const shared_ptr& clumpBody, Scene* scene, IntegratorT* integrator=NULL){ + const shared_ptr& clump=SUDODEM_PTR_CAST(clumpBody->shape); + const shared_ptr& clumpState=clumpBody->state; + FOREACH(MemberMap::value_type& B, clump->members){ + // B.first is Body::id_t, B.second is local Se3r of that body in the clump + const shared_ptr& b = Body::byId(B.first,scene); + const shared_ptr& subState=b->state; const Vector2r& subPos(B.second.position); const Rotationr& subOri(B.second.rotation); + // position update + subState->pos=clumpState->pos+clumpState->ori*subPos; + subState->ori=clumpState->ori*subOri; + // velocity update + subState->vel=clumpState->vel+clumpState->angVel*(subState->pos-clumpState->pos); + subState->angVel=clumpState->angVel; + if(integrator) integrator->saveMaximaDisplacement(b); + } + } + + + //! update member positions after clump being moved by mouse (in case simulation is paused and engines will not do that). + void userForcedDisplacementRedrawHook(){ throw runtime_error("Clump::userForcedDisplacementRedrawHook not yet implemented (with Clump as subclass of Shape).");} + + //! get force and torque on the clump itself, from forces/torques on members; does not include force on clump itself + void addForceTorqueFromMembers(const State* clumpState, Scene* scene, Vector2r& F, Real& T); + + + //! Recalculates inertia tensor of a body after translation away from (default) or towards its centroid. + //static Real inertiaTensorTranslate(const Matrix3r& I,const Real m, const Vector2r& off); + //! Recalculate body's inertia tensor in rotated coordinates. + //static Real inertiaTensorRotate(const Matrix3r& I, const Matrix3r& T); + //! Recalculate body's inertia tensor in rotated coordinates. + //static Real inertiaTensorRotate(const Matrix3r& I, const Quaternionr& rot); + + boost::python::dict members_get(); + + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(Clump,Shape,"Rigid aggregate of bodies", + ((MemberMap,members,,Attr::hidden,"Ids and relative positions+orientations of members of the clump (should not be accessed directly)")) + // ((vector,ids,,Attr::readonly,"Ids of constituent particles (only informative; direct modifications will have no effect).")) + ,/*ctor*/ createIndex(); + ,/*py*/ .add_property("members",&Clump::members_get,"Return clump members as {'id1':(relPos,relOri),...}") + ); + DECLARE_LOGGER; + REGISTER_CLASS_INDEX(Clump,Shape); +}; +REGISTER_SERIALIZABLE(Clump); diff --git a/SudoDEM2D/core/Dispatcher.hpp b/SudoDEM2D/core/Dispatcher.hpp new file mode 100644 index 0000000..3fbfaee --- /dev/null +++ b/SudoDEM2D/core/Dispatcher.hpp @@ -0,0 +1,229 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + + +#include +#include +#include +#include + +#include + +// real base class for all dispatchers (the other one are templates) +class Dispatcher: public Engine{ + public: + // these functions look to be completely unused...? + virtual string getFunctorType() { throw; }; + virtual int getDimension() { throw; }; + virtual string getBaseClassType(unsigned int ) { throw; }; + // + virtual ~Dispatcher() {}; + SUDODEM_CLASS_BASE_DOC(Dispatcher,Engine,"Engine dispatching control to its associated functors, based on types of argument it receives. This abstract base class provides no functionality in itself.") +}; +REGISTER_SERIALIZABLE(Dispatcher); + +/* Each real dispatcher derives from Dispatcher1D or Dispatcher2D (both templates), which in turn derive from Dispatcher (an Engine) and DynLibDispatcher (the dispatch logic). +Because we need literal functor and class names for registration in python, we provide macro that creates the real dispatcher class with everything needed. +*/ + +#define _SUDODEM_DISPATCHER1D_FUNCTOR_ADD(FunctorT,f) virtual void addFunctor(shared_ptr f){ add1DEntry(f->get1DFunctorType1(),f); } +#define _SUDODEM_DISPATCHER2D_FUNCTOR_ADD(FunctorT,f) virtual void addFunctor(shared_ptr f){ add2DEntry(f->get2DFunctorType1(),f->get2DFunctorType2(),f); } + +#define _SUDODEM_DIM_DISPATCHER_FUNCTOR_DOC_ATTRS_CTOR_PY(Dim,DispatcherT,FunctorT,doc,attrs,ctor,py) \ + typedef FunctorT FunctorType; \ + void updateScenePtr(){ FOREACH(shared_ptr f, functors){ f->scene=scene; }} \ + void postLoad(DispatcherT&){ clearMatrix(); FOREACH(shared_ptr f, functors) add(SUDODEM_PTR_CAST(f)); } \ + virtual void add(FunctorT* f){ add(shared_ptr(f)); } \ + virtual void add(shared_ptr f){ bool dupe=false; string fn=f->getClassName(); FOREACH(const shared_ptr& f, functors) { if(fn==f->getClassName()) dupe=true; } if(!dupe) functors.push_back(f); addFunctor(f); } \ + BOOST_PP_CAT(_SUDODEM_DISPATCHER,BOOST_PP_CAT(Dim,D_FUNCTOR_ADD))(FunctorT,f) \ + boost::python::list functors_get(void) const { boost::python::list ret; FOREACH(const shared_ptr& f, functors){ ret.append(f); } return ret; } \ + void functors_set(const vector >& ff){ functors.clear(); FOREACH(const shared_ptr& f, ff) add(f); postLoad(*this); } \ + void pyHandleCustomCtorArgs(boost::python::tuple& t, boost::python::dict& d){ if(boost::python::len(t)==0)return; if(boost::python::len(t)!=1) throw invalid_argument("Exactly one list of " BOOST_PP_STRINGIZE(FunctorT) " must be given."); typedef std::vector > vecF; vecF vf=boost::python::extract(t[0])(); functors_set(vf); t=boost::python::tuple(); } \ + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(DispatcherT,Dispatcher,"Dispatcher calling :yref:`functors<" BOOST_PP_STRINGIZE(FunctorT) ">` based on received argument type(s).\n\n" doc, \ + ((vector >,functors,,,"Functors active in the dispatch mechanism [overridden below].")) /*additional attrs*/ attrs, \ + /*ctor*/ ctor, /*py*/ py .add_property("functors",&DispatcherT::functors_get,&DispatcherT::functors_set,"Functors associated with this dispatcher." " :yattrtype:`vector >` ") \ + .def("dispMatrix",&DispatcherT::dump,boost::python::arg("names")=true,"Return dictionary with contents of the dispatch matrix.").def("dispFunctor",&DispatcherT::getFunctor,"Return functor that would be dispatched for given argument(s); None if no dispatch; ambiguous dispatch throws."); \ + ) + +#define SUDODEM_DISPATCHER1D_FUNCTOR_DOC_ATTRS_CTOR_PY(DispatcherT,FunctorT,doc,attrs,ctor,py) _SUDODEM_DIM_DISPATCHER_FUNCTOR_DOC_ATTRS_CTOR_PY(1,DispatcherT,FunctorT,doc,attrs,ctor,py) +#define SUDODEM_DISPATCHER2D_FUNCTOR_DOC_ATTRS_CTOR_PY(DispatcherT,FunctorT,doc,attrs,ctor,py) _SUDODEM_DIM_DISPATCHER_FUNCTOR_DOC_ATTRS_CTOR_PY(2,DispatcherT,FunctorT,doc,attrs,ctor,py) + +// HELPER FUNCTIONS + +/*! Function returning class name (as string) for given index and topIndexable (top-level indexable, such as Shape, Material and so on) +This function exists solely for debugging, is quite slow: it has to traverse all classes and ask for inheritance information. +It should be used primarily to convert indices to names in Dispatcher::dictDispatchMatrix?D; since it relies on Omega for RTTI, +this code could not be in Dispatcher itself. +s*/ +template +std::string Dispatcher_indexToClassName(int idx){ + boost::scoped_ptr top(new topIndexable); + std::string topName=top->getClassName(); + typedef std::pair classItemType; + FOREACH(classItemType clss, Omega::instance().getDynlibsDescriptor()){ + if(Omega::instance().isInheritingFrom_recursive(clss.first,topName) || clss.first==topName){ + // create instance, to ask for index + shared_ptr inst=SUDODEM_PTR_DYN_CAST(ClassFactory::instance().createShared(clss.first)); + assert(inst); + if(inst->getClassIndex()<0 && inst->getClassName()!=top->getClassName()){ + throw logic_error("Class "+inst->getClassName()+" didn't use REGISTER_CLASS_INDEX("+inst->getClassName()+","+top->getClassName()+") and/or forgot to call createIndex() in the ctor. [[ Please fix that! ]]"); + } + if(inst->getClassIndex()==idx) return clss.first; + } + } + throw runtime_error("No class with index "+boost::lexical_cast(idx)+" found (top-level indexable is "+topName+")"); +} + +//! Return class index of given indexable +template +int Indexable_getClassIndex(const shared_ptr i){return i->getClassIndex();} + +//! Return sequence (hierarchy) of class indices of given indexable; optionally convert to names +template +boost::python::list Indexable_getClassIndices(const shared_ptr i, bool convertToNames){ + int depth=1; boost::python::list ret; int idx0=i->getClassIndex(); + if(convertToNames) ret.append(Dispatcher_indexToClassName(idx0)); + else ret.append(idx0); + if(idx0<0) return ret; // don't continue and call getBaseClassIndex(), since we are at the top already + while(true){ + int idx=i->getBaseClassIndex(depth++); + if(convertToNames) ret.append(Dispatcher_indexToClassName(idx)); + else ret.append(idx); + if(idx<0) return ret; + } +} + + + +//! Return functors of this dispatcher, as list of functors of appropriate type +template +std::vector > Dispatcher_functors_get(shared_ptr self){ + std::vector > ret; + FOREACH(const shared_ptr& functor, self->functors){ shared_ptr functorRightType(SUDODEM_PTR_DYN_CAST(functor)); if(!functorRightType) throw logic_error("Internal error: Dispatcher of type "+self->getClassName()+" did not contain Functor of the required type "+typeid(typename DispatcherT::functorType).name()+"?"); ret.push_back(functorRightType); } + return ret; +} + +template +void Dispatcher_functors_set(shared_ptr self, std::vector > functors){ + self->clear(); + FOREACH(const shared_ptr& item, functors) self->add(item); +} + +// Dispatcher is not a template, hence converting this into a real constructor would be complicated; keep it separated, at least for now... +//! Create dispatcher of given type, with functors given as list in argument +template +shared_ptr Dispatcher_ctor_list(const std::vector >& functors){ + shared_ptr instance(new DispatcherT); + Dispatcher_functors_set(instance,functors); + return instance; +} + + + +template +< + class FunctorType, + bool autoSymmetry=true +> +class Dispatcher1D : public Dispatcher, + public DynLibDispatcher + < TYPELIST_1(typename FunctorType::DispatchType1) // base classes for dispatch + , FunctorType // class that provides multivirtual call + , typename FunctorType::ReturnType // return type + , typename FunctorType::ArgumentTypes + , autoSymmetry + > +{ + + public : + typedef typename FunctorType::DispatchType1 baseClass; + typedef baseClass argType1; + typedef FunctorType functorType; + typedef DynLibDispatcher dispatcherBase; + + shared_ptr getFunctor(shared_ptr arg){ return dispatcherBase::getExecutor(arg); } + boost::python::dict dump(bool convertIndicesToNames){ + boost::python::dict ret; + FOREACH(const DynLibDispatcher_Item1D& item, dispatcherBase::dataDispatchMatrix1D()){ + if(convertIndicesToNames){ + string arg1=Dispatcher_indexToClassName(item.ix1); + ret[boost::python::make_tuple(arg1)]=item.functorName; + } else ret[boost::python::make_tuple(item.ix1)]=item.functorName; + } + return ret; + } + + int getDimension() { return 1; } + + virtual string getFunctorType(){ + shared_ptr eu(new FunctorType); + return eu->getClassName(); + } + + virtual string getBaseClassType(unsigned int i){ + if (i==0) { shared_ptr bc(new baseClass); return bc->getClassName(); } + else return ""; + } + + + public: + REGISTER_ATTRIBUTES(Dispatcher,); + REGISTER_CLASS_AND_BASE(Dispatcher1D,Dispatcher DynLibDispatcher); +}; + + +template +< + class FunctorType, + bool autoSymmetry=true +> +class Dispatcher2D : public Dispatcher, + public DynLibDispatcher + < TYPELIST_2(typename FunctorType::DispatchType1,typename FunctorType::DispatchType2) // base classes for dispatch + , FunctorType // class that provides multivirtual call + , typename FunctorType::ReturnType // return type + , typename FunctorType::ArgumentTypes // argument of engine unit + , autoSymmetry + > +{ + public : + typedef typename FunctorType::DispatchType1 baseClass1; typedef typename FunctorType::DispatchType2 baseClass2; + typedef baseClass1 argType1; + typedef baseClass2 argType2; + typedef FunctorType functorType; + typedef DynLibDispatcher dispatcherBase; + shared_ptr getFunctor(shared_ptr arg1, shared_ptr arg2){ return dispatcherBase::getExecutor(arg1,arg2); } + boost::python::dict dump(bool convertIndicesToNames){ + boost::python::dict ret; + FOREACH(const DynLibDispatcher_Item2D& item, dispatcherBase::dataDispatchMatrix2D()){ + if(convertIndicesToNames){ + string arg1=Dispatcher_indexToClassName(item.ix1), arg2=Dispatcher_indexToClassName(item.ix2); + ret[boost::python::make_tuple(arg1,arg2)]=item.functorName; + } else ret[boost::python::make_tuple(item.ix1,item.ix2)]=item.functorName; + } + return ret; + } + + virtual int getDimension() { return 2; } + + virtual string getFunctorType(){ + shared_ptr eu(new FunctorType); + return eu->getClassName(); + } + virtual string getBaseClassType(unsigned int i){ + if (i==0){ shared_ptr bc(new baseClass1); return bc->getClassName(); } + else if (i==1){ shared_ptr bc(new baseClass2); return bc->getClassName();} + else return ""; + } + public: + REGISTER_ATTRIBUTES(Dispatcher,); + REGISTER_CLASS_AND_BASE(Dispatcher2D,Dispatcher DynLibDispatcher); +}; + diff --git a/SudoDEM2D/core/DisplayParameters.hpp b/SudoDEM2D/core/DisplayParameters.hpp new file mode 100644 index 0000000..7fb35fd --- /dev/null +++ b/SudoDEM2D/core/DisplayParameters.hpp @@ -0,0 +1,27 @@ +#pragma once + +/* Class for storing set of display parameters. + * + * The interface sort of emulates map string->string (which is not handled by sudodem-serialization). + * + * The "keys" (called displayTypes) are intended to be "OpenGLRenderer" or "GLViewer" (and perhaps other). + * The "values" are intended to be XML representation of display parameters, obtained either by sudodem-serialization + * with OpenGLRenderer and saveStateToStream with QGLViewer (and GLViewer). + * + */ + +class DisplayParameters: public Serializable{ + private: + std::vector values; + std::vector displayTypes; + public: + //! Get value of given display type and put it in string& value and return true; if there is no such display type, return false. + bool getValue(std::string displayType, std::string& value){assert(values.size()==displayTypes.size()); vector::iterator I=std::find(displayTypes.begin(),displayTypes.end(),displayType); if(I==displayTypes.end()) return false; value=values[std::distance(displayTypes.begin(),I)]; return true;} + //! Set value of given display type; if such display type exists, it is overwritten, otherwise a new one is created. + void setValue(std::string displayType, std::string value){assert(values.size()==displayTypes.size()); vector::iterator I=std::find(displayTypes.begin(),displayTypes.end(),displayType); if(I==displayTypes.end()){displayTypes.push_back(displayType); values.push_back(value);} else {values[std::distance(displayTypes.begin(),I)]=value;};} + DisplayParameters(){} + virtual ~DisplayParameters(){} + REGISTER_ATTRIBUTES(Serializable,(displayTypes)(values)); + REGISTER_CLASS_AND_BASE(DisplayParameters,Serializable); +}; +REGISTER_SERIALIZABLE(DisplayParameters); diff --git a/SudoDEM2D/core/EnergyTracker.hpp b/SudoDEM2D/core/EnergyTracker.hpp new file mode 100644 index 0000000..65a222e --- /dev/null +++ b/SudoDEM2D/core/EnergyTracker.hpp @@ -0,0 +1,69 @@ +#pragma once +#include +#include + +namespace py=boost::python; + +class EnergyTracker: public Serializable{ + public: + ~EnergyTracker(); + void findId(const std::string& name, int& id, bool reset=false, bool newIfNotFound=true){ + if(id>0) return; // the caller should have checked this already + if(names.count(name)) id=names[name]; + else if(newIfNotFound) { + #ifdef SUDODEM_OPENMP + #pragma omp critical + #endif + { energies.resize(energies.size()+1); id=energies.size()-1; resetStep.resize(id+1); resetStep[id]=reset; names[name]=id; assert(id<(int)energies.size()); assert(id>=0); } + } + } + // set value of the accumulator; note: must NOT be called from parallel sections! + void set(const Real& val, const std::string& name, int &id){ + if(id<0) findId(name,id,/* do not reset value that is set directly */ false); + energies.set(id,val); + } + // add value to the accumulator; safely called from parallel sections + void add(const Real& val, const std::string& name, int &id, bool reset=false){ + if(id<0) findId(name,id,reset); + energies.add(id,val); + } + Real getItem_py(const std::string& name){ + int id=-1; findId(name,id,false,false); + if (id<0) {PyErr_SetString(PyExc_KeyError,("Unknown energy name '"+name+"'.").c_str()); py::throw_error_already_set(); } + return energies.get(id); + } + void setItem_py(const std::string& name, Real val){ + int id=-1; set(val,name,id); + } + void clear(){ energies.clear(); names.clear(); resetStep.clear();} + void resetResettables(){ size_t sz=energies.size(); for(size_t id=0; id > dta=energies.getPerThreadData(); + FOREACH(pairStringInt p,names) ret[p.first]=dta[p.second]; + return ret; + }; + + typedef std::map mapStringInt; + typedef std::pair pairStringInt; + + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(EnergyTracker,Serializable,"Storage for tracing energies. Only to be used if :yref:`O.trackEnergy` is True.", + ((OpenMPArrayAccumulator,energies,,,"Energy values, in linear array")) + ((mapStringInt,names,,Attr::hidden,"Associate textual name to an index in the energies array.")) + ((vector,resetStep,,Attr::hidden,"Whether the respective energy value should be reset at every step.")) + ,/*ctor*/ + ,/*py*/ + .def("__getitem__",&EnergyTracker::getItem_py,"Get energy value for given name.") + .def("__setitem__",&EnergyTracker::setItem_py,"Set energy value for given name (will create a non-resettable item, if it does not exist yet).") + .def("clear",&EnergyTracker::clear,"Clear all stored values.") + .def("keys",&EnergyTracker::keys_py,"Return defined energies.") + .def("items",&EnergyTracker::items_py,"Return contents as list of (name,value) tuples.") + .def("total",&EnergyTracker::total,"Return sum of all energies.") + .add_property("_perThreadData",&EnergyTracker::perThreadData,"Contents as dictionary, where each value is tuple of individual threads' values (for debugging)") + ) +}; +REGISTER_SERIALIZABLE(EnergyTracker); diff --git a/SudoDEM2D/core/Engine.hpp b/SudoDEM2D/core/Engine.hpp new file mode 100644 index 0000000..17bdb89 --- /dev/null +++ b/SudoDEM2D/core/Engine.hpp @@ -0,0 +1,67 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include +#include +#include + +class Body; +class Scene; + +CREATE_LOGGER(Engine); + +class Engine: public Serializable{ + public: + // pointer to the simulation, set at every step by Scene::moveToNextTimeStep + Scene* scene; + //! high-level profiling information; not serializable + TimingInfo timingInfo; + //! precise profiling information (timing of fragments of the engine) + shared_ptr timingDeltas; + virtual ~Engine() {}; + + virtual bool isActivated() { return true; }; + virtual void action() { + LOG_FATAL("Engine "<(new TimingDeltas); + #endif + , + /* py */ + .add_property("execTime",&Engine::timingInfo_nsec_get,&Engine::timingInfo_nsec_set,"Cummulative time this Engine took to run (only used if :yref:`O.timingEnabled`\\ ==\\ ``True``).") + .add_property("execCount",&Engine::timingInfo_nExec_get,&Engine::timingInfo_nExec_set,"Cummulative count this engine was run (only used if :yref:`O.timingEnabled`\\ ==\\ ``True``).") + .def_readonly("timingDeltas",&Engine::timingDeltas,"Detailed information about timing inside the Engine itself. Empty unless enabled in the source code and :yref:`O.timingEnabled`\\ ==\\ ``True``.") + .def("__call__",&Engine::explicitAction) + ); +}; +REGISTER_SERIALIZABLE(Engine); + + + diff --git a/SudoDEM2D/core/FileGenerator.cpp b/SudoDEM2D/core/FileGenerator.cpp new file mode 100644 index 0000000..3f233a3 --- /dev/null +++ b/SudoDEM2D/core/FileGenerator.cpp @@ -0,0 +1,70 @@ +/************************************************************************* +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#include +#include +#include +#include + +#include"FileGenerator.hpp" + +CREATE_LOGGER(FileGenerator); + + +bool FileGenerator::generate(std::string& msg){ throw invalid_argument("Calling abstract FileGenerator::generate() does not make sense."); } + + +bool FileGenerator::generateAndSave(const string& outputFileName, string& message) +{ + bool status; + message=""; + boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); + try { + status=generate(message); // will modify message + } + catch(std::exception& e){ + LOG_FATAL("Unhandled exception: "< +#include + +#include "Scene.hpp" +#include "ThreadWorker.hpp" + +class FileGenerator: public Serializable +{ + protected: + shared_ptr scene; + public: + bool generateAndSave(const string& outFile, string& message); + protected : + //! Returns whether the generation was successful; message for user is in FileGenerator::message + virtual bool generate(std::string& msg); + + void pyGenerate(const string& out); + void pyLoad(); + + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(FileGenerator,Serializable,"Base class for scene generators, preprocessors.", + /*attrs*/, + /*ctor*/ + , + .def("generate",&FileGenerator::pyGenerate,(boost::python::arg("out")),"Generate scene, save to given file") + .def("load",&FileGenerator::pyLoad,"Generate scene, save to temporary file and load immediately"); + ); + DECLARE_LOGGER; +}; +REGISTER_SERIALIZABLE(FileGenerator); + + diff --git a/SudoDEM2D/core/ForceContainer.hpp b/SudoDEM2D/core/ForceContainer.hpp new file mode 100644 index 0000000..2178bb6 --- /dev/null +++ b/SudoDEM2D/core/ForceContainer.hpp @@ -0,0 +1,325 @@ +// 2009 © Václav Šmilauer +#pragma once + +#include +#include + +#include +// make sure that (void*)&vec[0]==(void*)&vec +BOOST_STATIC_ASSERT(sizeof(Vector3r)==3*sizeof(Real)); + + +#ifdef SUDODEM_OPENMP + +#include +/*! Container for Body External Variables (forces), typically forces and torques from interactions. + * Values should be reset at every iteration by calling ForceContainer::reset(); + * If you want to add your own force type, you need to: + * + * 1. Create storage vector + * 2. Create accessor function + * 3. Update the resize function + * 4. Update the reset function + * 5. update the sync function (for the multithreaded implementation) + * + * This class exists in two flavors: non-parallel and parallel. The parallel one stores + * force increments separately for every thread and sums those when sync() is called. + * The reason of this design is that the container is not truly random-access, but rather + * is written to everywhere in one phase and read in the next one. Adding to force/torque + * marks the container as dirty and sync() must be performed before reading the stored data. + * Calling getForce/getTorque when the container is not synchronized throws an exception. + * + * It is intentional that sync() needs to be called exlicitly, since syncs are expensive and + * the programmer should be aware of that. Sync is however performed only if the container + * is dirty. Every full sync increments the syncCount variable, that should ideally equal + * the number of steps (one per step). + * + * The number of threads (omp_get_max_threads) may not change once ForceContainer is constructed. + * + * The non-parallel flavor has the same interface, but sync() is no-op and synchronization + * is not enforced at all. + */ + +//! This is the parallel flavor of ForceContainer +class ForceContainer{ + private: + typedef std::vector vvector; + typedef std::vector vector; + std::vector _forceData; + std::vector _torqueData; + std::vector _moveData; + std::vector _rotData; + std::vector _maxId; + vvector _force, _move, _permForce; + vector _torque, _rot, _permTorque; + std::vector sizeOfThreads; + size_t size; + size_t permSize; + bool syncedSizes; + int nThreads; + bool synced,moveRotUsed,permForceUsed; + boost::mutex globalMutex; + Vector2r _zero; + Real _zeror; + + inline void ensureSize(Body::id_t id, int threadN){ + assert(nThreads>omp_get_thread_num()); + const Body::id_t idMaxTmp = max(id, _maxId[threadN]); + _maxId[threadN] = 0; + if (threadN<0) { + resizePerm(min((size_t)1.5*(idMaxTmp+100),(size_t)(idMaxTmp+2000))); + } else if (sizeOfThreads[threadN]<=(size_t)idMaxTmp) { + resize(min((size_t)1.5*(idMaxTmp+100),(size_t)(idMaxTmp+2000)),threadN); + } + } + inline void ensureSynced(){ if(!synced) throw runtime_error("ForceContainer not thread-synchronized; call sync() first!"); } + + // dummy function to avoid template resolution failure + friend class boost::serialization::access; template void serialize(ArchiveT & ar, unsigned int version){} + public: + ForceContainer(): size(0), permSize(0),syncedSizes(true),synced(true),moveRotUsed(false),permForceUsed(false),_zero(Vector2r::Zero()),syncCount(0),lastReset(0){ + nThreads=omp_get_max_threads(); + for(int i=0; i 0) { synced = false;} + } + if(synced) return; + boost::mutex::scoped_lock lock(globalMutex); + if(synced) return; // if synced meanwhile + + for(int i=0; i 0) { ensureSize(_maxId[i],i);} + } + + syncSizesOfContainers(); + + for(long id=0; id<(long)size; id++){ + Vector2r sumF(Vector2r::Zero());Real sumT(0.0); + for(int thread=0; thread _force; + std::vector _torque; + std::vector _move; + std::vector _rot; + std::vector _permForce; + std::vector _permTorque; + Body::id_t _maxId; + size_t size; + size_t permSize; + inline void ensureSize(Body::id_t id){ + const Body::id_t idMaxTmp = max(id, _maxId); + _maxId = 0; + if(size<=(size_t)idMaxTmp) resize(min((size_t)1.5*(idMaxTmp+100),(size_t)(idMaxTmp+2000))); + } + #if 0 + const Vector2r& getForceUnsynced (Body::id_t id){ return getForce(id);} + const Vector3r& getTorqueUnsynced(Body::id_t id){ return getForce(id);} + #endif + bool moveRotUsed, permForceUsed; + // dummy function to avoid template resolution failure + friend class boost::serialization::access; template void serialize(ArchiveT & ar, unsigned int version){} + public: + ForceContainer(): size(0), permSize(0), moveRotUsed(false), permForceUsed(false), syncCount(0), lastReset(0), _maxId(0){} + const Vector2r& getForce(Body::id_t id){ensureSize(id); return _force[id];} + void addForce(Body::id_t id,const Vector2r& f){ensureSize(id); _force[id]+=f;} + const Real& getTorque(Body::id_t id){ensureSize(id); return _torque[id];} + void addTorque(Body::id_t id,const Real& t){ensureSize(id); _torque[id]+=t;} + const Vector2r& getMove(Body::id_t id){ensureSize(id); return _move[id];} + void addMove(Body::id_t id,const Vector2r& f){ensureSize(id); moveRotUsed=true; _move[id]+=f;} + const Real& getRot(Body::id_t id){ensureSize(id); return _rot[id];} + void addRot(Body::id_t id,const Real& f){ensureSize(id); moveRotUsed=true; _rot[id]+=f;} + void addPermForce(Body::id_t id, const Vector2r& f){ ensureSize(id); _permForce[id]=f; permForceUsed=true;} + void addPermTorque(Body::id_t id, const Real& t){ ensureSize(id); _permTorque[id]=t; permForceUsed=true;} + void addMaxId(Body::id_t id) { _maxId=id;} + const Vector2r& getPermForce(Body::id_t id) { ensureSize(id); return _permForce[id]; } + const Real& getPermTorque(Body::id_t id) { ensureSize(id); return _permTorque[id]; } + // single getters do the same as globally synced ones in the non-parallel flavor + const Vector2r getForceSingle (Body::id_t id){ + ensureSize(id); + if (permForceUsed) { + return _force [id] + _permForce[id]; + } else { + return _force [id]; + } + } + const Real getTorqueSingle(Body::id_t id){ + ensureSize(id); + if (permForceUsed) { + return _torque[id] + _permTorque[id]; + } else { + return _torque[id]; + } + } + const Vector2r& getMoveSingle (Body::id_t id){ ensureSize(id); return _move [id]; } + const Real& getRotSingle (Body::id_t id){ ensureSize(id); return _rot [id]; } + + //! Set all forces to zero + void reset(long iter, bool resetAll=false){ + memset(&_force [0],0,sizeof(Vector2r)*size); + memset(&_torque[0],0,sizeof(Real)*size); + if(moveRotUsed){ + memset(&_move [0],0,sizeof(Vector2r)*size); + memset(&_rot [0],0,sizeof(Real)*size); + moveRotUsed=false; + } + if (resetAll){ + memset(&_permForce [0], 0,sizeof(Vector2r)*size); + memset(&_permTorque[0], 0,sizeof(Real)*size); + permForceUsed = false; + } + lastReset=iter; + } + + void sync() { + if (_maxId>0) {ensureSize(_maxId); _maxId=0;} + if (permForceUsed) { + for(long id=0; id<(long)size; id++) { + _force[id]+=_permForce[id]; + _torque[id]+=_permTorque[id]; + } + } + return; + } + unsigned long syncCount; + // interaction in which the container was last reset; used by NewtonIntegrator to detect whether ForceResetter was not forgotten + long lastReset; + /*! Resize the container; this happens automatically, + * but you may want to set the size beforehand to avoid resizes as the simulation grows. */ + void resize(size_t newSize){ + _force.resize(newSize,Vector2r::Zero()); + _torque.resize(newSize,0.0); + _permForce.resize(newSize,Vector2r::Zero()); + _permTorque.resize(newSize,0.0); + _move.resize(newSize,Vector2r::Zero()); + _rot.resize(newSize,0.0); + size=newSize; + } + const int getNumAllocatedThreads() const {return 1;} + const bool& getMoveRotUsed() const {return moveRotUsed;} + const bool& getPermForceUsed() const {return permForceUsed;} +}; + +#endif diff --git a/SudoDEM2D/core/FrontEnd.hpp b/SudoDEM2D/core/FrontEnd.hpp new file mode 100644 index 0000000..04fcb32 --- /dev/null +++ b/SudoDEM2D/core/FrontEnd.hpp @@ -0,0 +1,29 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include "Omega.hpp" + +#include + +class FrontEnd : public Factorable +{ + public : + FrontEnd () {}; + virtual ~FrontEnd () {}; + + virtual int run(int , char * []) { return -1;}; + // called before actually invoking it + virtual bool available(){return false;} + + REGISTER_CLASS_AND_BASE(FrontEnd,Factorable); +}; +REGISTER_FACTORABLE(FrontEnd); + + diff --git a/SudoDEM2D/core/Functor.hpp b/SudoDEM2D/core/Functor.hpp new file mode 100644 index 0000000..1dd8aff --- /dev/null +++ b/SudoDEM2D/core/Functor.hpp @@ -0,0 +1,86 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include +#include + +class TimingDeltas; +class Scene; + +class Functor: public Serializable +{ + public: virtual vector getFunctorTypes(){throw;} + shared_ptr timingDeltas; + //! updated before every dispatch loop by the dispatcher; DO NOT ABUSE access to scene, except for getting global variables like scene->dt. + Scene* scene; + virtual ~Functor() {}; // defined in Dispatcher.cpp + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(Functor,Serializable,"Function-like object that is called by Dispatcher, if types of arguments match those the Functor declares to accept.", + ((string,label,,,"Textual label for this object; must be a valid python identifier, you can refer to it directly from python.")), + /*ctor*/ + #ifdef USE_TIMING_DELTAS + timingDeltas=shared_ptr(new TimingDeltas); + #endif + , + .def_readonly("timingDeltas",&Functor::timingDeltas,"Detailed information about timing inside the Dispatcher itself. Empty unless enabled in the source code and O.timingEnabled==True.") + .add_property("bases",&Functor::getFunctorTypes,"Ordered list of types (as strings) this functor accepts.") + ); +}; +REGISTER_SERIALIZABLE(Functor); + + + +template +< + class _DispatchType1, + class _ReturnType, + class _ArgumentTypes +> +class Functor1D: public Functor, + public FunctorWrapper<_ReturnType, _ArgumentTypes> +{ + public: + typedef _DispatchType1 DispatchType1; typedef _ReturnType ReturnType; typedef _ArgumentTypes ArgumentTypes; + #define FUNCTOR1D(type1) public: std::string get1DFunctorType1(void){return string(#type1);} int checkArgTypes(const shared_ptr& arg1){ return (bool)SUDODEM_PTR_DYN_CAST(arg1)?1:0; } + virtual std::string get1DFunctorType1(void){throw runtime_error("Class "+this->getClassName()+" did not use FUNCTOR1D to declare its argument type?"); } + virtual vector getFunctorTypes(void){vector ret; ret.push_back(get1DFunctorType1()); return ret;}; + // check that the object can be correctly cast to the derived class handled by the functor (will be used if ever utils.createInteraction can be called with list of functors only) + // virtual bool checkArgTypes(const shared_ptr& arg1){ throw runtime_error("Class "+this->getClassName()+" did not use FUNCTOR1D to declare its argument type?"); } + REGISTER_CLASS_AND_BASE(Functor1D,Functor FunctorWrapper); + /* do not REGISTER_ATTRIBUTES here, since we are template; derived classes should call REGISTER_ATTRIBUTES(Functor,(their)(own)(attributes)), bypassing Functor1D */ +}; + + +template +< + class _DispatchType1, + class _DispatchType2, + class _ReturnType, + class _ArgumentTypes +> +class Functor2D: public Functor, + public FunctorWrapper<_ReturnType, _ArgumentTypes> +{ + public: + typedef _DispatchType1 DispatchType1; typedef _DispatchType2 DispatchType2; typedef _ReturnType ReturnType; typedef _ArgumentTypes ArgumentTypes; + #define FUNCTOR2D(type1,type2) public: std::string get2DFunctorType1(void){return string(#type1);}; std::string get2DFunctorType2(void){return string(#type2);}; int checkArgTypes(const shared_ptr& arg1, const shared_ptr& arg2){ if(SUDODEM_PTR_DYN_CAST(arg1)&&SUDODEM_PTR_DYN_CAST(arg2)) return 1; if(SUDODEM_PTR_DYN_CAST(arg2)&&SUDODEM_PTR_DYN_CAST(arg1)) return -1; return 0; } + virtual std::string get2DFunctorType1(void){throw logic_error("Class "+this->getClassName()+" did not use FUNCTOR2D to declare its argument types?");} + virtual std::string get2DFunctorType2(void){throw logic_error("Class "+this->getClassName()+" did not use FUNCTOR2D to declare its argument types?");} + virtual vector getFunctorTypes(){vector ret; ret.push_back(get2DFunctorType1()); ret.push_back(get2DFunctorType2()); return ret;}; + // check that objects can be correctly cast to derived classes handled by the functor (see comment in Functor1D:: checkArgTypes) + // virtual bool checkArgTypes(const shared_ptr&, const shared_ptr&){ throw logic_error("Class "+this->getClassName()+" did not use FUNCTOR2D to declare its argument types?"); } + REGISTER_CLASS_AND_BASE(Functor2D,Functor FunctorWrapper); + /* do not REGISTER_ATTRIBUTES here, since we are template; derived classes should call REGISTER_ATTRIBUTES(Functor,(their)(own)(attributes)), bypassing Functor2D */ +}; + + + diff --git a/SudoDEM2D/core/GLConfig.hpp b/SudoDEM2D/core/GLConfig.hpp new file mode 100644 index 0000000..6e97bc8 --- /dev/null +++ b/SudoDEM2D/core/GLConfig.hpp @@ -0,0 +1,38 @@ +// code not yet for use (6/12/2009); if long here uselessly, delete. +// + +// 2009 © Václav Šmilauer +#include +/*! Storage for general 3d view settings. + +Is saved along with simulation and passed to every call to render(...). +Contains more or less what used to be inside OpenGLRenderer. + +*/ +class GLConfig: public Serializable{ + + Vector3r lightPos,bgColor; + Body::id_t currSel; + bool dof,id,bbox,geom,wire,intrGeom,intrPhys; + int mask; + bool scaleDisplacements,scaleRotations; + Vector3r displacementScale; Real rotationScale; + vector clipPlaneSe3; + vector clipPlaneActive; // should be bool, but serialization doesn't handle vector + + // not saved + Vector3r highlightEmission0; + Vector3r highlightEmission1; + + // normalized saw signal with given periodicity, with values ∈ 〈0,1〉 */ + Real normSaw(Real t, Real period){ Real xi=(t-period*((int)(t/period)))/period; /* normalized value, (0-1〉 */ return (xi<.5?2*xi:2-2*xi); } + Real normSquare(Real t, Real period){ Real xi=(t-period*((int)(t/period)))/period; /* normalized value, (0-1〉 */ return (xi<.5?0:1); } + + //! wrap number to interval x0…x1 + Real wrapCell(const Real x, const Real x0, const Real x1); + //! wrap point to inside Scene's cell (identity if !Scene::isPeriodic) + Vector3r wrapCellPt(const Vector3r& pt, Scene* rb); + void drawPeriodicCell(Scene*); + + REGISTER_ATTRIBUTES(Serializable,(dof)(id)(bbox)(geom)(wire)(intrGeom)(intrPhys)(mask)(scaleDisplacements)(scaleRotations)(displacementScale)(rotationScale)(clipPlaneSe3)(clipPlaneActive)); +}; diff --git a/SudoDEM2D/core/GlobalEngine.hpp b/SudoDEM2D/core/GlobalEngine.hpp new file mode 100644 index 0000000..7ca693a --- /dev/null +++ b/SudoDEM2D/core/GlobalEngine.hpp @@ -0,0 +1,20 @@ +/************************************************************************* +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include "Engine.hpp" + +class GlobalEngine: public Engine{ + public : + virtual ~GlobalEngine() {}; + SUDODEM_CLASS_BASE_DOC(GlobalEngine,Engine,"Engine that will generally affect the whole simulation (contrary to PartialEngine)."); +}; +REGISTER_SERIALIZABLE(GlobalEngine); + + diff --git a/SudoDEM2D/core/IGeom.hpp b/SudoDEM2D/core/IGeom.hpp new file mode 100644 index 0000000..3c6c05f --- /dev/null +++ b/SudoDEM2D/core/IGeom.hpp @@ -0,0 +1,29 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include +#include +#include + +class IGeom : public Serializable, public Indexable +{ + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(IGeom,Serializable,"Geometrical configuration of interaction", + /*no attrs*/, + /*ctor*/, + /*py*/ + SUDODEM_PY_TOPINDEXABLE(IGeom) + ); + REGISTER_INDEX_COUNTER(IGeom); +}; + +REGISTER_SERIALIZABLE(IGeom); + + diff --git a/SudoDEM2D/core/IPhys.hpp b/SudoDEM2D/core/IPhys.hpp new file mode 100644 index 0000000..0cda24d --- /dev/null +++ b/SudoDEM2D/core/IPhys.hpp @@ -0,0 +1,27 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include +#include +#include + +class IPhys : public Serializable, public Indexable +{ + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(IPhys,Serializable,"Physical (material) properties of :yref:`interaction`.", + /*attrs*/, + /*ctor*/, + /*py*/SUDODEM_PY_TOPINDEXABLE(IPhys) + ); + REGISTER_INDEX_COUNTER(IPhys); +}; +REGISTER_SERIALIZABLE(IPhys); + + diff --git a/SudoDEM2D/core/Interaction.cpp b/SudoDEM2D/core/Interaction.cpp new file mode 100644 index 0000000..087cb3e --- /dev/null +++ b/SudoDEM2D/core/Interaction.cpp @@ -0,0 +1,38 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#include"Interaction.hpp" + +#include + +Interaction::Interaction(Body::id_t newId1,Body::id_t newId2): id1(newId1), id2(newId2), cellDist(Vector2i(0,0)){ reset(); } + +bool Interaction::isFresh(Scene* rb){ return iterMadeReal==rb->iter;} + +void Interaction::init(){ + iterMadeReal=-1; + functorCache.geomExists=true; + isActive=true; +} + +void Interaction::reset(){ + geom=shared_ptr(); + phys=shared_ptr(); + init(); +} + + +void Interaction::swapOrder(){ + if(geom || phys){ + throw std::logic_error("Bodies in interaction cannot be swapped if they have geom or phys."); + } + std::swap(id1,id2); + cellDist*=-1; +} diff --git a/SudoDEM2D/core/Interaction.hpp b/SudoDEM2D/core/Interaction.hpp new file mode 100644 index 0000000..e416f6c --- /dev/null +++ b/SudoDEM2D/core/Interaction.hpp @@ -0,0 +1,68 @@ +#pragma once +#include +// keep those two here, template instantiation & boost::python gets broken otherwise, e.g. https://bugs.launchpad.net/bugs/618766 +#include +#include +#include + + +class IGeomFunctor; +class IPhysFunctor; +class LawFunctor; +class Scene; + +class Interaction: public Serializable{ + private: + friend class IPhysDispatcher; + friend class InteractionLoop; + public: + bool isReal() const {return (bool)geom && (bool)phys;} + //! If this interaction was just created in this step (for the constitutive law, to know that it is the first time there) + bool isFresh(Scene* rb); + bool isActive; + + Interaction(Body::id_t newId1,Body::id_t newId2); + + const Body::id_t& getId1() const {return id1;}; + const Body::id_t& getId2() const {return id2;}; + + //! swaps order of bodies within the interaction + void swapOrder(); + + bool operator<(const Interaction& other) const { return getId1() geom; + shared_ptr phys; + shared_ptr constLaw; + } functorCache; + + //! Reset interaction to the intial state (keep only body ids) + void reset(); + //! common initialization called from both constructor and reset() + void init(); + + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(Interaction,Serializable,"Interaction between pair of bodies.", + ((Body::id_t,id1,0,Attr::readonly,":yref:`Id` of the first body in this interaction.")) + ((Body::id_t,id2,0,Attr::readonly,":yref:`Id` of the second body in this interaction.")) + ((long,iterMadeReal,-1,,"Step number at which the interaction was fully (in the sense of geom and phys) created. (Should be touched only by :yref:`IPhysDispatcher` and :yref:`InteractionLoop`, therefore they are made friends of Interaction")) + ((long,iterLastSeen,-1,(Attr::noSave|Attr::hidden),"At which step this interaction was last detected by the collider. InteractionLoop will remove it if InteractionContainer::iterColliderLastRun==scene->iter, InteractionContainer::iterColliderLastRun is positive (some colliders manage interaction deletion themselves, such as :yref:`InsertionSortCollider`) and iterLastSeeniter.")) + ((shared_ptr,geom,,,"Geometry part of the interaction.")) + ((shared_ptr,phys,,,"Physical (material) part of the interaction.")) + ((Vector2i,cellDist,Vector2i(0,0),,"Distance of bodies in cell size units, if using periodic boundary conditions; id2 is shifted by this number of cells from its :yref:`State::pos` coordinates for this interaction to exist. Assigned by the collider.\n\n.. warning::\n\t(internal) cellDist must survive Interaction::reset(), it is only initialized in ctor. Interaction that was cancelled by the constitutive law, was reset() and became only potential must have thepriod information if the geometric functor again makes it real. Good to know after few days of debugging that :-)")) + ((int,linIx,-1,(Attr::noSave|Attr::hidden),"Index in the linear interaction container. For internal use by InteractionContainer only.")) + ((long,iterBorn,-1,,"Step number at which the interaction was added to simulation.")) + , + /* ctor */ init(), + /*py*/ + .add_property("isReal",&Interaction::isReal,"True if this interaction has both geom and phys; False otherwise.") + .def_readwrite("isActive",&Interaction::isActive,"True if this interaction is active. Otherwise the forces from this interaction will not be taken into account. True by default.") + ); +}; + +REGISTER_SERIALIZABLE(Interaction); diff --git a/SudoDEM2D/core/InteractionContainer.cpp b/SudoDEM2D/core/InteractionContainer.cpp new file mode 100644 index 0000000..db9c90e --- /dev/null +++ b/SudoDEM2D/core/InteractionContainer.cpp @@ -0,0 +1,168 @@ +// 2008 © Sergei Dorofeenko +// 2009,2010 © Václav Šmilauer + +#include "InteractionContainer.hpp" +#include "Scene.hpp" + +#ifdef SUDODEM_OPENMP + #include +#endif +CREATE_LOGGER(InteractionContainer); +// begin internal functions + +bool InteractionContainer::insert(const shared_ptr& i){ + assert(bodies); + boost::mutex::scoped_lock lock(drawloopmutex); + + Body::id_t id1=i->getId1(); + Body::id_t id2=i->getId2(); + + if (id1>id2) swap(id1,id2); + + assert((Body::id_t)bodies->size()>id1); // the bodies must exist already + assert((Body::id_t)bodies->size()>id2); + + const shared_ptr& b1=(*bodies)[id1]; + const shared_ptr& b2=(*bodies)[id2]; + + if(!b1->intrs.insert(Body::MapId2IntrT::value_type(id2,i)).second) return false; // already exists + if(!b2->intrs.insert(Body::MapId2IntrT::value_type(id1,i)).second) return false; + + linIntrs.resize(++currSize); // currSize updated + linIntrs[currSize-1]=i; // assign last element + i->linIx=currSize-1; // store the index back-reference in the interaction (so that it knows how to erase/move itself) + + const shared_ptr& scene=Omega::instance().getScene(); + i->iterBorn=scene->iter; + + return true; +} + + +void InteractionContainer::clear(){ + assert(bodies); + boost::mutex::scoped_lock lock(drawloopmutex); + FOREACH(const shared_ptr& b, *bodies) { + if (b) b->intrs.clear(); // delete interactions from bodies + } + linIntrs.clear(); // clear the linear container + currSize=0; + dirty=true; +} + + +bool InteractionContainer::erase(Body::id_t id1,Body::id_t id2, int linPos){ + assert(bodies); + boost::mutex::scoped_lock lock(drawloopmutex); + if (id1>id2) swap(id1,id2); + if(id2>=(Body::id_t)bodies->size()) return false; // no such interaction + + const shared_ptr& b1((*bodies)[id1]); + const shared_ptr& b2((*bodies)[id2]); + LOG_DEBUG("InteractionContainer erase intrs id1=" << id1 << " id2=" << id2); + int linIx=-1; + if(!b1) linIx=linPos; + else { + Body::MapId2IntrT::iterator I(b1->intrs.find(id2)); + if(I==b1->intrs.end()) linIx=linPos; + else { + linIx=I->second->linIx; + LOG_DEBUG("InteractionContainer linIx=" << linIx << " linPos=" << linPos); + assert(linIx==linPos); + //erase from body, we also erase from linIntrs below + b1->intrs.erase(I); + if (b2) { + Body::MapId2IntrT::iterator I2(b2->intrs.find(id1)); + if (not(I2==b2->intrs.end())) { + b2->intrs.erase(I2); + } + } + } + } + if(linIx<0) { + LOG_ERROR("InteractionContainer::erase: attempt to delete interaction with a deleted body (the definition of linPos in the call to erase() should fix the problem) for ##"+boost::lexical_cast(id1)+"+"+boost::lexical_cast(id2)); + return false;} + // iid is not the last element; we have to move last one to its place + if (linIx<(int)currSize-1) { + linIntrs[linIx]=linIntrs[currSize-1]; + linIntrs[linIx]->linIx=linIx; // update the back-reference inside the interaction + } + // in either case, last element can be removed now + linIntrs.resize(--currSize); // currSize updated + return true; +} + + +const shared_ptr& InteractionContainer::find(Body::id_t id1,Body::id_t id2){ + assert(bodies); + if (id1>id2) swap(id1,id2); + // those checks could be perhaps asserts, but pyInteractionContainer has no access to the body container... + if(id2>=(Body::id_t)bodies->size()){ empty=shared_ptr(); return empty; } + const shared_ptr& b1((*bodies)[id1]); + if(!b1) { empty=shared_ptr(); return empty; } + Body::MapId2IntrT::iterator I(b1->intrs.find(id2)); + if (I!=b1->intrs.end()) return I->second; + else { empty=shared_ptr(); return empty; } +} + +// end internal functions + +// the rest uses internal functions to access data structures, and does not have to be modified if they change + +bool InteractionContainer::insert(Body::id_t id1,Body::id_t id2) +{ + shared_ptr i(new Interaction(id1,id2) ); + return insert(i); +} + + +void InteractionContainer::requestErase(Body::id_t id1, Body::id_t id2){ + const shared_ptr I=find(id1,id2); if(!I) return; + I->reset(); +} + +void InteractionContainer::requestErase(const shared_ptr& I){ + I->reset(); +} + +void InteractionContainer::requestErase(Interaction* I){ + I->reset(); +} + +void InteractionContainer::eraseNonReal(){ + FOREACH(const shared_ptr& i, *this) if(!i->isReal()) this->erase(i->getId1(),i->getId2()); +} + +// compare interaction based on their first id +struct compPtrInteraction{ + bool operator() (const shared_ptr& i1, const shared_ptr& i2) const { + return (*i1)<(*i2); + } +}; + +void InteractionContainer::preSave(InteractionContainer&){ + FOREACH(const shared_ptr& I, *this){ + if(I->geom || I->phys) interaction.push_back(I); + // since requestErase'd interactions have no interaction physics/geom, they are not saved + } + if(serializeSorted) std::sort(interaction.begin(),interaction.end(),compPtrInteraction()); +} +void InteractionContainer::postSave(InteractionContainer&){ interaction.clear(); } + + +void InteractionContainer::preLoad(InteractionContainer&){ interaction.clear(); } + +void InteractionContainer::postLoad__calledFromScene(const shared_ptr& bb){ + bodies=&bb->body; // update the internal pointer + clear(); + FOREACH(const shared_ptr& I, interaction){ + Body::id_t id1=I->getId1(), id2=I->getId2(); + if (!(*bodies)[id1] || !(*bodies)[id2]) { + return; + } else { + insert(I); + } + } + interaction.clear(); +} + diff --git a/SudoDEM2D/core/InteractionContainer.hpp b/SudoDEM2D/core/InteractionContainer.hpp new file mode 100644 index 0000000..b0d6f6b --- /dev/null +++ b/SudoDEM2D/core/InteractionContainer.hpp @@ -0,0 +1,125 @@ +// 2004 © Olivier Galizzi +// 2004 © Janek Kozicki +// 2010 © Václav Šmilauer + +#pragma once + +#include +#include + +#ifdef SUDODEM_OPENMP + #include +#endif + +#include +#include + +/* This InteractionContainer implementation has reference to the body container and +stores interactions in 2 places: + +* Internally in a std::vector; that allows for const-time linear traversal. + Each interaction internally holds back-reference to the position in this container in Interaction::linIx. +* Inside Body::intrs (in the body with min(id1,id2)). + +Both must be kep in sync, which is handled by insert & erase methods. + +It was originally written by 2008 © Sergei Dorofeenko , +later devirtualized and put here. + +Alternative implementations of InteractionContainer should implement the same API. Due to performance +reasons, no base class with virtual methods defining such API programatically is defined (it could +be possible to create class template for this, though). + +Future (?): + +* the linear vector might be removed; in favor of linear traversal of bodies by their subdomains, + then traversing the map in each body. If the previous point would come to realization, half of the + interactions would have to be skipped explicitly in such a case. + +*/ +class InteractionContainer: public Serializable{ + private: + typedef vector > ContainerT; + // linear array of container interactions + ContainerT linIntrs; + // pointer to body container, since each body holds (some) interactions + // this must always point to scene->bodies->body + const BodyContainer::ContainerT* bodies; + // always in sync with intrs.size(), to avoid that function call + size_t currSize; + shared_ptr empty; + // used only during serialization/deserialization + vector > interaction; + public: + // flag for notifying the collider that persistent data should be invalidated + bool dirty; + // required by the class factory... :-| + InteractionContainer(): currSize(0),dirty(false),serializeSorted(false),iterColliderLastRun(-1){ + bodies=NULL; +// #ifdef SUDODEM_OPENMP +// threadsPendingErase.resize(omp_get_max_threads()); +// #endif + } + void clear(); + // iterators + typedef ContainerT::iterator iterator; + typedef ContainerT::const_iterator const_iterator; + iterator begin(){return linIntrs.begin();} + iterator end() {return linIntrs.end();} + const_iterator begin() const {return linIntrs.begin();} + const_iterator end() const {return linIntrs.end();} + // insertion/deletion + bool insert(Body::id_t id1,Body::id_t id2); + bool insert(const shared_ptr& i); + //3rd parameter is used to remove I from linIntrs (in conditionalyEraseNonReal()) when body b1 has been removed + bool erase(Body::id_t id1,Body::id_t id2,int linPos=-1); + const shared_ptr& find(Body::id_t id1,Body::id_t id2); +// bool found(Body::id_t id1,Body::id_t id2); + inline bool found(const Body::id_t& id1,const Body::id_t& id2){ + assert(bodies); return (id1>id2)?(*bodies)[id2]->intrs.count(id1):(*bodies)[id1]->intrs.count(id2);} + // index access + shared_ptr& operator[](size_t id){return linIntrs[id];} + const shared_ptr& operator[](size_t id) const { return linIntrs[id];} + size_t size(){ return currSize; } + // simulation API + + //! Erase all non-real (in term of Interaction::isReal()) interactions + void eraseNonReal(); + + // mutual exclusion to avoid crashes in the rendering loop + boost::mutex drawloopmutex; + // sort interactions before serializations; useful if comparing XML files from different runs (false by default) + bool serializeSorted; + // iteration number when the collider was last run; set by the collider, if it wants interactions that were not encoutered in that step to be deleted by InteractionLoop (such as SpatialQuickSortCollider). Other colliders (such as InsertionSortCollider) set it it -1, which is the default + long iterColliderLastRun; + //! Ask for erasing the interaction given (from the constitutive law); this resets the interaction (to the initial=potential state) and collider should traverse potential interactions to decide whether to delete them completely or keep them potential + void requestErase(Body::id_t id1, Body::id_t id2); + void requestErase(const shared_ptr& I); + void requestErase(Interaction* I); + + /*! Traverse all interactions and erase them if they are not real and the (T*)->shouldBeErased(id1,id2) return true, or if body(id1) has been deleted + Class using this interface (which is presumably a collider) must define the + bool shouldBeErased(Body::id_t, Body::id_t) const + */ + template size_t conditionalyEraseNonReal(const T& t, Scene* rb){ + // beware iterators here, since erase is invalidating them. We need to iterate carefully, and keep in mind that erasing one interaction is moving the last one to the current position. + size_t initSize=currSize; + for (size_t linPos=0; linPos& i=linIntrs[linPos]; + if(!i->isReal() && t.shouldBeErased(i->getId1(),i->getId2(),rb)) erase(i->getId1(),i->getId2(),linPos); + else linPos++;} + return initSize-currSize; + } + + // we must call Scene's ctor (and from Scene::postLoad), since we depend on the existing BodyContainer at that point. + void postLoad__calledFromScene(const shared_ptr&); + void preLoad(InteractionContainer&); + void preSave(InteractionContainer&); + void postSave(InteractionContainer&); + + + REGISTER_ATTRIBUTES(Serializable,(interaction)(serializeSorted)(dirty)); + REGISTER_CLASS_AND_BASE(InteractionContainer,Serializable); + DECLARE_LOGGER; +}; +REGISTER_SERIALIZABLE(InteractionContainer); diff --git a/SudoDEM2D/core/Material.cpp b/SudoDEM2D/core/Material.cpp new file mode 100644 index 0000000..8ffc278 --- /dev/null +++ b/SudoDEM2D/core/Material.cpp @@ -0,0 +1,26 @@ +#include +#include +#include + +const shared_ptr Material::byId(int id, Scene* w_){ + Scene* w=w_?w_:Omega::instance().getScene().get(); + assert(id>=0 && (size_t)idmaterials.size()); + assert(w->materials[id]->id == id); + return w->materials[id]; +} + +const shared_ptr Material::byLabel(const std::string& label, Scene* w_){ + Scene* w=w_?w_:Omega::instance().getScene().get(); + FOREACH(const shared_ptr& m, w->materials){ + if(m->label == label) return m; + } + throw std::runtime_error(("No material labeled `"+label+"'.").c_str()); +} + +const int Material::byLabelIndex(const std::string& label, Scene* w_){ + Scene* w=w_?w_:Omega::instance().getScene().get(); size_t iMax=w->materials.size(); + for(size_t i=0; imaterials[i]->label==label) return i; + } + throw std::runtime_error(("No material labeled `"+label+"'.").c_str()); +} diff --git a/SudoDEM2D/core/Material.hpp b/SudoDEM2D/core/Material.hpp new file mode 100644 index 0000000..552bbed --- /dev/null +++ b/SudoDEM2D/core/Material.hpp @@ -0,0 +1,49 @@ +// 2009 © Václav Šmilauer +#pragma once +#include +#include +#include +#include + + +class Scene; +/*! Material properties associated with a body. + +Historical note: this used to be part of the PhysicalParameters class. +The other data are now in the State class. +*/ +class Material: public Serializable, public Indexable{ + public: + virtual ~Material() {}; + + //! Function to return empty default-initialized instance of State that + // is supposed to go along with this Material. Don't override unless you need + // something else than basic State. + virtual shared_ptr newAssocState() const { return shared_ptr(new State); } + /*! Function that returns true if given State instance is what this material expects. + + Base Material class has no requirements, but the check would normally look like this: + + return (bool)dynamic_cast state; + */ + virtual bool stateTypeOk(State*) const { return true; } + + static const shared_ptr byId(int id, Scene* scene=NULL); + static const shared_ptr byId(int id, shared_ptr scene) {return byId(id,scene.get());} + static const shared_ptr byLabel(const std::string& label, Scene* scene=NULL); + static const shared_ptr byLabel(const std::string& label, shared_ptr scene) {return byLabel(label,scene.get());} + // return index of material, given its label + static const int byLabelIndex(const std::string& label, Scene* scene=NULL); + + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(Material,Serializable,"Material properties of a :yref:`body`.", + ((int,id,((void)"not shared",-1),Attr::readonly,"Numeric id of this material; is non-negative only if this Material is shared (i.e. in O.materials), -1 otherwise. This value is set automatically when the material is inserted to the simulation via :yref:`O.materials.append`. (This id was necessary since before boost::serialization was used, shared pointers were not tracked properly; it might disappear in the future)")) + ((string,label,,,"Textual identifier for this material; can be used for shared materials lookup in :yref:`MaterialContainer`.")) + ((Real,density,1000,,"Density of the material [kg/m³]")), + /* ctor */, + /*py*/ + .def("newAssocState",&Material::newAssocState,"Return new :yref:`State` instance, which is associated with this :yref:`Material`. Some materials have special requirement on :yref:`Body::state` type and calling this function when the body is created will ensure that they match. (This is done automatically if you use utils.disk, … functions from python).") + SUDODEM_PY_TOPINDEXABLE(Material) + ); + REGISTER_INDEX_COUNTER(Material); +}; +REGISTER_SERIALIZABLE(Material); diff --git a/SudoDEM2D/core/Omega.cpp b/SudoDEM2D/core/Omega.cpp new file mode 100644 index 0000000..4c1ca8a --- /dev/null +++ b/SudoDEM2D/core/Omega.cpp @@ -0,0 +1,279 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#include"Omega.hpp" +#include"Scene.hpp" +#include"TimeStepper.hpp" +#include"ThreadRunner.hpp" +#include +#include +#include +#include +#include + +#include + + +#include + +#if BOOST_VERSION<103500 +class RenderMutexLock: public boost::try_mutex::scoped_try_lock{ + public: + RenderMutexLock(): boost::try_mutex::scoped_try_lock(Omega::instance().renderMutex,true){/*cerr<<"Lock renderMutex"<& Omega::getDynlibsDescriptor(){return dynlibs;} + +const shared_ptr& Omega::getScene(){return scenes.at(currentSceneNb);} +void Omega::resetCurrentScene(){ RenderMutexLock lock; scenes.at(currentSceneNb) = shared_ptr(new Scene);} +void Omega::resetScene(){ resetCurrentScene(); }//RenderMutexLock lock; scene = shared_ptr(new Scene);} +void Omega::resetAllScenes(){ + RenderMutexLock lock; + scenes.resize(1); + scenes[0] = shared_ptr(new Scene); + currentSceneNb=0; +} +int Omega::addScene(){ + scenes.push_back(shared_ptr(new Scene)); + return scenes.size()-1; +} +void Omega::switchToScene(int i) { + if (i<0 || i>=int(scenes.size())) { + LOG_ERROR("Scene "<(tmpFileCounter++); +} + +void Omega::reset(){ + stop(); + init(); +} + +void Omega::init(){ + sceneFile=""; + //resetScene(); + resetAllScenes(); + sceneAnother=shared_ptr(new Scene); + timeInit(); + createSimulationLoop(); +} + +void Omega::timeInit(){ + startupLocalTime=boost::posix_time::microsec_clock::local_time(); +} + +void Omega::createSimulationLoop(){ simulationLoop=shared_ptr(new ThreadRunner(&simulationFlow_));} +void Omega::stop(){ LOG_DEBUG(""); if (simulationLoop&&simulationLoop->looping())simulationLoop->stop(); if (simulationLoop) simulationLoop=shared_ptr(); } + +/* WARNING: even a single simulation step is run asynchronously; the call will return before the iteration is finished. */ +void Omega::step(){ + if (simulationLoop){ + simulationLoop->spawnSingleAction(); + } +} + +void Omega::run(){ + if(!simulationLoop){ LOG_ERROR("No Omega::simulationLoop? Creating one (please report bug)."); createSimulationLoop(); } + if (simulationLoop && !simulationLoop->looping()){ + simulationLoop->start(); + } +} + + +void Omega::pause(){ + if (simulationLoop && simulationLoop->looping()){ + simulationLoop->stop(); + } +} + +bool Omega::isRunning(){ if(simulationLoop) return simulationLoop->looping(); else return false; } + +void Omega::buildDynlibDatabase(const vector& dynlibsList){ + LOG_DEBUG("called with "< pythonables; + FOREACH(string name, dynlibsList){ + shared_ptr f; + try { + LOG_DEBUG("Factoring plugin "<(f)).get()!=0); + for(int i=0;igetBaseClassNumber();i++){ + dynlibs[name].baseClasses.insert(f->getBaseClassName(i)); + } + if(dynlibs[name].isSerializable) pythonables.push_back(name); + } + catch (std::runtime_error& e){ + /* FIXME: this catches all errors! Some of them are not harmful, however: + * when a class is not factorable, it is OK to skip it; */ + } + } + // handle Serializable specially + //Serializable().pyRegisterClass(wrapperScope); + /* python classes must be registered such that base classes come before derived ones; + for now, just loop until we succeed; proper solution will be to build graphs of classes + and traverse it from the top. It will be done once all classes are pythonable. */ + for(int i=0; i<100 && pythonables.size()>0; i++){ + if(getenv("SUDODEM_DEBUG")) cerr< done; + for(std::list::iterator I=pythonables.begin(); I!=pythonables.end(); ){ + shared_ptr s=boost::static_pointer_cast(ClassFactory::instance().createShared(*I)); + try{ + if(getenv("SUDODEM_DEBUG")) cerr<<"{{"<<*I<<"}}"; + s->pyRegisterClass(wrapperScope); + std::list::iterator prev=I++; + pythonables.erase(prev); + } catch (...){ + if(getenv("SUDODEM_DEBUG")){ cerr<<"["<<*I<<"]"; PyErr_Print(); } + boost::python::handle_exception(); + I++; + } + } + } + + map::iterator dli = dynlibs.begin(); + map::iterator dliEnd = dynlibs.end(); + for( ; dli!=dliEnd ; ++dli){ + set::iterator bci = (*dli).second.baseClasses.begin(); + set::iterator bciEnd = (*dli).second.baseClasses.end(); + for( ; bci!=bciEnd ; ++bci){ + string name = *bci; + if (name=="Dispatcher1D" || name=="Dispatcher2D") (*dli).second.baseClasses.insert("Dispatcher"); + else if (name=="Functor1D" || name=="Functor2D") (*dli).second.baseClasses.insert("Functor"); + else if (name=="Serializable") (*dli).second.baseClasses.insert("Factorable"); + else if (name!="Factorable" && name!="Indexable") { + shared_ptr f = ClassFactory::instance().createShared(name); + for(int i=0;igetBaseClassNumber();i++) + dynlibs[name].baseClasses.insert(f->getBaseClassName(i)); + } + } + } +} + + +bool Omega::isInheritingFrom(const string& className, const string& baseClassName){ + return (dynlibs[className].baseClasses.find(baseClassName)!=dynlibs[className].baseClasses.end()); +} + +bool Omega::isInheritingFrom_recursive(const string& className, const string& baseClassName){ + if (dynlibs[className].baseClasses.find(baseClassName)!=dynlibs[className].baseClasses.end()) return true; + FOREACH(const string& parent,dynlibs[className].baseClasses){ + if(isInheritingFrom_recursive(parent,baseClassName)) return true; + } + return false; +} + +void Omega::loadPlugins(vector pluginFiles){ + FOREACH(const string& plugin, pluginFiles){ + LOG_DEBUG("Loading plugin "<& plugins(ClassFactory::instance().pluginClasses); + plugins.sort(); plugins.unique(); + buildDynlibDatabase(vector(plugins.begin(),plugins.end())); +} + +void Omega::loadSimulation(const string& f, bool quiet){ + bool isMem=boost::algorithm::starts_with(f,":memory:"); + if(!isMem && !boost::filesystem::exists(f)) throw runtime_error("Simulation file to load doesn't exist: "+f); + if(isMem && memSavedSimulations.count(f)==0) throw runtime_error("Cannot load nonexistent memory-saved simulation "+f); + + if(!quiet) LOG_INFO("Loading file "+f); + //shared_ptr scene = getScene(); + shared_ptr& scene = scenes[currentSceneNb]; + //shared_ptr& scene = getScene(); + { + stop(); // stop current simulation if running + resetScene(); + RenderMutexLock lock; + if(isMem){ + istringstream iss(memSavedSimulations[f]); + sudodem::ObjectIO::load(iss,"scene",scene); + } else { + sudodem::ObjectIO::load(f,"scene",scene); + } + } + if(scene->getClassName()!="Scene") throw logic_error("Wrong file format (scene is not a Scene!?) in "+f); + sceneFile=f; + timeInit(); + if(!quiet) LOG_DEBUG("Simulation loaded"); +} + + + +void Omega::saveSimulation(const string& f, bool quiet){ + if(f.size()==0) throw runtime_error("f of file to save has zero length."); + if(!quiet) LOG_INFO("Saving file " << f); + //shared_ptr scene = getScene(); + shared_ptr& scene = scenes[currentSceneNb]; + //shared_ptr& scene = getScene(); + if(boost::algorithm::starts_with(f,":memory:")){ + if(memSavedSimulations.count(f)>0 && !quiet) LOG_INFO("Overwriting in-memory saved simulation "<(oss,"scene",scene); + memSavedSimulations[f]=oss.str(); + } + else { + // handles automatically the XML/binary distinction as well as gz/bz2 compression + sudodem::ObjectIO::save(f,"scene",scene); + } + sceneFile=f; +} + + + + diff --git a/SudoDEM2D/core/Omega.hpp b/SudoDEM2D/core/Omega.hpp new file mode 100644 index 0000000..e7a6d41 --- /dev/null +++ b/SudoDEM2D/core/Omega.hpp @@ -0,0 +1,115 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "SimulationFlow.hpp" + + +#ifndef FOREACH +# define FOREACH BOOST_FOREACH +#endif + +class Scene; +class ThreadRunner; + +struct DynlibDescriptor{ + set baseClasses; + bool isSerializable; +}; + +class Omega: public Singleton{ + shared_ptr simulationLoop; + SimulationFlow simulationFlow_; + map dynlibs; // FIXME : should store that in ClassFactory ? + void buildDynlibDatabase(const vector& dynlibsList); // FIXME - maybe in ClassFactory ? + + vector > scenes; + int currentSceneNb; + shared_ptr sceneAnother; // used for temporarily running different simulation, in Omega().switchscene() + + boost::posix_time::ptime startupLocalTime; + + map memSavedSimulations; + + // to avoid accessing simulation when it is being loaded (should avoid crashes with the UI) + boost::mutex loadingSimulationMutex; + boost::mutex tmpFileCounterMutex; + long tmpFileCounter; + std::string tmpFileDir; + + public: + // management, not generally useful + void init(); + void reset(); + void timeInit(); + void initTemps(); + void cleanupTemps(); + const map& getDynlibsDescriptor(); + void loadPlugins(vector pluginFiles); + bool isInheritingFrom(const string& className, const string& baseClassName ); + bool isInheritingFrom_recursive(const string& className, const string& baseClassName ); + void createSimulationLoop(); + bool hasSimulationLoop(){return (bool)(simulationLoop);} + string gdbCrashBatch; + char** origArgv; int origArgc; + // do not change by hand + /* Mutex for: + * 1. GLViewer::paintGL (deffered lock: if fails, no GL painting is done) + * 2. other threads that wish to manipulate GL + * 3. Omega when substantial changes to the scene are being made (bodies being deleted, simulation loaded etc) so that GL doesn't access those and crash */ + boost::try_mutex renderMutex; + + + void run(); + void pause(); + void step(); + void stop(); // resets the simulationLoop + bool isRunning(); + std::string sceneFile; // updated at load/save automatically + void loadSimulation(const string& name, bool quiet=false); + void saveSimulation(const string& name, bool quiet=false); + + void resetScene(); + void resetCurrentScene(); + void resetAllScenes(); + const shared_ptr& getScene(); + int addScene(); + void switchToScene(int i); + //! Return unique temporary filename. May be deleted by the user; if not, will be deleted at shutdown. + string tmpFilename(); + Real getRealTime(); + boost::posix_time::time_duration getRealTime_duration(); + + // configuration directory used for logging config and possibly other things + std::string confDir; + + DECLARE_LOGGER; + + Omega(){ LOG_DEBUG("Constructing Omega."); } + ~Omega(){} + + FRIEND_SINGLETON(Omega); + friend class pyOmega; +}; + + diff --git a/SudoDEM2D/core/PartialEngine.hpp b/SudoDEM2D/core/PartialEngine.hpp new file mode 100644 index 0000000..bb04610 --- /dev/null +++ b/SudoDEM2D/core/PartialEngine.hpp @@ -0,0 +1,24 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once +#include +#include +#include + +class PartialEngine: public Engine{ + public: + virtual ~PartialEngine() {}; + SUDODEM_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(PartialEngine,Engine,"Engine affecting only particular bodies in the simulation, defined by *ids*.", + ((std::vector,ids,,,":yref:`Ids` of bodies affected by this PartialEngine.")), + /*deprec*/, /*init*/, /* ctor */, /* py */ + ); +}; +REGISTER_SERIALIZABLE(PartialEngine); + + diff --git a/SudoDEM2D/core/Scene.cpp b/SudoDEM2D/core/Scene.cpp new file mode 100644 index 0000000..08f70b6 --- /dev/null +++ b/SudoDEM2D/core/Scene.cpp @@ -0,0 +1,206 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#include"Scene.hpp" +#include +#include +#include + +#include +#include +#include + +#include +#include + + +// POSIX-only +#include +#include +#include + +namespace py=boost::python; + +SUDODEM_PLUGIN((Scene)); +CREATE_LOGGER(Scene); +// should be elsewhere, probably +bool TimingInfo::enabled=false; + +void Scene::fillDefaultTags(){ + // fill default tags + struct passwd* pw; + char hostname[HOST_NAME_MAX]; + gethostname(hostname,HOST_NAME_MAX); + pw=getpwuid(geteuid()); if(!pw) throw runtime_error("getpwuid(geteuid()) failed!"); + // a few default tags + // real name: will have all non-ASCII characters replaced by ? since serialization doesn't handle that + // the standard GECOS format is Real Name,,, - first comma and after will be discarded + string gecos(pw->pw_gecos), gecos2; size_t p=gecos.find(","); if(p!=string::npos) boost::algorithm::erase_tail(gecos,gecos.size()-p); for(size_t i=0;ipw_name)+"@"+hostname+")"," ","~")); + tags.push_back(string("isoTime="+boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time()))); + string id=boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time())+"p"+boost::lexical_cast(getpid()); + tags.push_back("id="+id); + tags.push_back("d.id="+id); + tags.push_back("id.d="+id); + // tags.push_back("revision="+py::extract(py::import("sudodem.config").attr("revision"))());; +} + + + +void Scene::postLoad(Scene&){ + // update the interaction container; must be done in Scene ctor as well; important! + interactions->postLoad__calledFromScene(bodies); + + // this might be removed at some point, since it is checked by regression tests now + FOREACH(const shared_ptr& b, *bodies){ + if(!b || !b->material || b->material->id<0) continue; // not a shared material + if(b->material!=materials[b->material->id]) throw std::logic_error("Scene::postLoad: Internal inconsistency, shared materials not preserved when loaded; please report bug."); + } +} + + + +void Scene::moveToNextTimeStep(){ + if(runInternalConsistencyChecks){ + runInternalConsistencyChecks=false; + checkStateTypes(); + } + // substepping or not, update engines from _nextEngines, if defined, at the beginning of step + // subStep can be 0, which happens if simulations is saved in the middle of step (without substepping) + // this assumes that prologue will not set _nextEngines, which is safe hopefully + if(!_nextEngines.empty() && (subStep<0 || (subStep<=0 && !subStepping))){ + engines=_nextEngines; + _nextEngines.clear(); + // hopefully this will not break in some margin cases (subStepping with setting _nextEngines and such) + subStep=-1; + } + if(!subStepping && subStep<0){ + /* set substep to 0 during the loop, so that engines/nextEngines handler know whether we are inside the loop currently */ + subStep=0; + // ** 1. ** prologue + if(isPeriodic) cell->integrateAndUpdate(dt); + //forces.reset(); // uncomment if ForceResetter is removed + const bool TimingInfo_enabled=TimingInfo::enabled; // cache the value, so that when it is changed inside the step, the engine that was just running doesn't get bogus values + TimingInfo::delta last=TimingInfo::getNow(); // actually does something only if TimingInfo::enabled, no need to put the condition here + // ** 2. ** engines + FOREACH(const shared_ptr& e, engines){ + e->scene=this; + if(e->dead || !e->isActivated()) continue; + e->action(); + if(TimingInfo_enabled) {TimingInfo::delta now=TimingInfo::getNow(); e->timingInfo.nsec+=now-last; e->timingInfo.nExec+=1; last=now;} + } + // ** 3. ** epilogue + // Calculation speed + if (iter==0) { //For the first time + prevTime = boost::posix_time::microsec_clock::local_time(); + } else { + boost::posix_time::ptime timeNow = boost::posix_time::microsec_clock::local_time(); + boost::posix_time::time_duration duration = timeNow - prevTime; + long dif = duration.total_microseconds(); + SpeedElements(iter%nSpeedIter,0)=1000000.0 / dif; + + speed = SpeedElements.mean(); + + prevTime = timeNow; + } + + iter++; + time+=dt; + subStep=-1; + } else { + /* IMPORTANT: take care to copy EXACTLY the same sequence as is in the block above !! */ + if(TimingInfo::enabled){ TimingInfo::enabled=false; LOG_INFO("O.timingEnabled disabled, since O.subStepping is used."); } + if(subStep<-1 || subStep>(int)engines.size()){ LOG_ERROR("Invalid value of Scene::subStep ("<=-1 && subs<=(int)engines.size()); + // ** 1. ** prologue + if(subs==-1){ if(isPeriodic) cell->integrateAndUpdate(dt); } + // ** 2. ** engines + else if(subs>=0 && subs<(int)engines.size()){ const shared_ptr& e(engines[subs]); e->scene=this; if(!e->dead && e->isActivated()) e->action(); } + // ** 3. ** epilogue + else if(subs==(int)engines.size()){ iter++; time+=dt; /* gives -1 along with the increment afterwards */ subStep=-2; } + // (?!) + else { /* never reached */ assert(false); } + } + subStep++; // if not substepping, this will make subStep=-2+1=-1, which is what we want + } +} + + + +shared_ptr Scene::engineByName(const string& s){ + FOREACH(shared_ptr e, engines){ + if(e->getClassName()==s) return e; + } + return shared_ptr(); +} + +bool Scene::timeStepperPresent(){ + int n=0; + FOREACH(const shared_ptr&e, engines){ if(dynamic_cast(e.get())) n++; } + if(n>1) throw std::runtime_error(string("Multiple ("+boost::lexical_cast(n)+") TimeSteppers in the simulation?!").c_str()); + return n>0; +} + +bool Scene::timeStepperActive(){ + int n=0; bool ret=false; + FOREACH(const shared_ptr&e, engines){ + TimeStepper* ts=dynamic_cast(e.get()); if(ts) { ret=ts->active; n++; } + } + if(n>1) throw std::runtime_error(string("Multiple ("+boost::lexical_cast(n)+") TimeSteppers in the simulation?!").c_str()); + return ret; +} + +bool Scene::timeStepperActivate(bool a){ + int n=0; + FOREACH(const shared_ptr e, engines){ + TimeStepper* ts=dynamic_cast(e.get()); + if(ts) { ts->setActive(a); n++; } + } + if(n>1) throw std::runtime_error(string("Multiple ("+boost::lexical_cast(n)+") TimeSteppers in the simulation?!").c_str()); + return n>0; +} + + + +void Scene::checkStateTypes(){ + FOREACH(const shared_ptr& b, *bodies){ + if(!b || !b->material) continue; + if(b->material && !b->state) throw std::runtime_error("Body #"+boost::lexical_cast(b->getId())+": has Body::material, but NULL Body::state."); + if(!b->material->stateTypeOk(b->state.get())){ + throw std::runtime_error("Body #"+boost::lexical_cast(b->getId())+": Body::material type "+b->material->getClassName()+" doesn't correspond to Body::state type "+b->state->getClassName()+" (should be "+b->material->newAssocState()->getClassName()+" instead)."); + } + } +} + +void Scene::updateBound(){ + if(!bound) bound=shared_ptr(new Bound); + const Real& inf=std::numeric_limits::infinity(); + Vector2r mx(-inf,-inf); + Vector2r mn(inf,inf); + FOREACH(const shared_ptr& b, *bodies){ + if(!b) continue; + if(b->bound){ + for(int i=0; i<2; i++){ + if(!std::isinf(b->bound->max[i])) mx[i]=max(mx[i],b->bound->max[i]); + if(!std::isinf(b->bound->min[i])) mn[i]=min(mn[i],b->bound->min[i]); + } + } else { + mx=mx.cwiseMax(b->state->pos); + mn=mn.cwiseMin(b->state->pos); + } + } + bound->min=mn; + bound->max=mx; +} diff --git a/SudoDEM2D/core/Scene.hpp b/SudoDEM2D/core/Scene.hpp new file mode 100644 index 0000000..c4f0c79 --- /dev/null +++ b/SudoDEM2D/core/Scene.hpp @@ -0,0 +1,136 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2004 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 255 +#endif +#ifdef SUDODEM_OPENMP + #include +#endif + +class Bound; +#ifdef SUDODEM_OPENGL + class OpenGLRenderer; +#endif + +#ifdef SUDODEM_LIQMIGRATION +struct intReal { + public: + id_t id; + Real Vol; +}; +#endif + +class Scene: public Serializable{ + public: + //! Adds material to Scene::materials. It also sets id of the material accordingly and returns it. + int addMaterial(shared_ptr m){ materials.push_back(m); m->id=(int)materials.size()-1; return m->id; } + //! Checks that type of Body::state satisfies Material::stateTypeOk. Throws runtime_error if not. (Is called from BoundDispatcher the first time it runs) + void checkStateTypes(); + //! update our bound; used directly instead of a BoundFunctor, since we don't derive from Body anymore + void updateBound(); + + // neither serialized, nor accessible from python (at least not directly) + ForceContainer forces; + // NodeForceContainer nodeforces; + // initialize tags (author, date, time) + void fillDefaultTags(); + // advance by one iteration by running all engines + void moveToNextTimeStep(); + + /* Functions operating on TimeStepper; they all throw exception if there is more than 1 */ + // return whether a TimeStepper is present + bool timeStepperPresent(); + // true if TimeStepper is present and active, false otherwise + bool timeStepperActive(); + // (de)activate TimeStepper; returns whether the operation was successful (i.e. whether a TimeStepper was found) + bool timeStepperActivate(bool activate); + static const int nSpeedIter = 10; //Number of iterations, which are taking into account for speed calculation + Eigen::Matrix SpeedElements; //Array for saving speed-values for last "nSpeedIter"-iterations + + + shared_ptr engineByName(const string& s); + + #ifdef SUDODEM_LIQMIGRATION + OpenMPVector addIntrs; //Array of added interactions, needed for liquid migration. + OpenMPVector delIntrs; //Array of deleted interactions, needed for liquid migration. + #endif + + #ifdef SUDODEM_OPENGL + shared_ptr renderer; + #endif + + void postLoad(Scene&); + + // bits for Scene::flags + enum { LOCAL_COORDS=1, COMPRESSION_NEGATIVE=2 }; /* add powers of 2 as needed */ + // convenience accessors + bool usesLocalCoords() const { return flags & LOCAL_COORDS; } + void setLocalCoords(bool d){ if(d) flags|=LOCAL_COORDS; else flags&=~(LOCAL_COORDS); } + bool compressionNegative() const { return flags & COMPRESSION_NEGATIVE; } + void setCompressionNegative(bool d){ if(d) flags|=COMPRESSION_NEGATIVE; else flags&=~(COMPRESSION_NEGATIVE); } + boost::posix_time::ptime prevTime; //Time value on the previous step + + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(Scene,Serializable,"Object comprising the whole simulation.", + ((Real,dt,1e-8,,"Current timestep for integration.")) + ((long,iter,0,Attr::readonly,"Current iteration (computational step) number")) + ((bool,subStepping,false,,"Whether we currently advance by one engine in every step (rather than by single run through all engines).")) + ((int,subStep,-1,Attr::readonly,"Number of sub-step; not to be changed directly. -1 means to run loop prologue (cell integration), 0…n-1 runs respective engines (n is number of engines), n runs epilogue (increment step number and time.")) + ((Real,time,0,Attr::readonly,"Simulation time (virtual time) [s]")) + ((Real,speed,0,Attr::readonly,"Current calculation speed [iter/s]")) + ((long,stopAtIter,0,,"Iteration after which to stop the simulation.")) + ((Real,stopAtTime,0,,"Time after which to stop the simulation")) + ((bool,isPeriodic,false,Attr::readonly,"Whether periodic boundary conditions are active.")) + ((bool,trackEnergy,false,Attr::readonly,"Whether energies are being traced.")) + ((bool,doSort,false,Attr::readonly,"Used, when new body is added to the scene.")) + ((bool,runInternalConsistencyChecks,true,Attr::hidden,"Run internal consistency check, right before the very first simulation step.")) + ((Body::id_t,selectedBody,-1,,"Id of body that is selected by the user")) + ((int,flags,0,Attr::readonly,"Various flags of the scene; 1 (Scene::LOCAL_COORDS): use local coordinate system rather than global one for per-interaction quantities (set automatically from the functor).")) + + ((list,tags,,,"Arbitrary key=value associations (tags like mp3 tags: author, date, version, description etc.)")) + ((vector >,engines,,Attr::hidden,"Engines sequence in the simulation.")) + ((vector >,_nextEngines,,Attr::hidden,"Engines to be used from the next step on; is returned transparently by O.engines if in the middle of the loop (controlled by subStep>=0).")) + // NOTE: bodies must come before interactions, since InteractionContainer is initialized with a reference to BodyContainer::body + ((shared_ptr,bodies,new BodyContainer,Attr::hidden,"Bodies contained in the scene.")) + // ((shared_ptr,nodes,new NodeContainer,Attr::hidden,"Nodes contained in the scene.")) + // ((shared_ptr,elements,new FEContainer,Attr::hidden,"FE elements contained in the scene.")) + ((shared_ptr,interactions,new InteractionContainer,Attr::hidden,"All interactions between bodies.")) + ((shared_ptr,energy,new EnergyTracker,Attr::hidden,"Energy values, if energy tracking is enabled.")) + ((vector >,materials,,Attr::hidden,"Container of shared materials. Add elements using Scene::addMaterial, not directly. Do NOT remove elements from here unless you know what you are doing!")) + ((shared_ptr,bound,,Attr::hidden,"Bounding box of the scene (only used for rendering and initialized if needed).")) + + ((shared_ptr,cell,new Cell,Attr::hidden,"Information on periodicity; only should be used if Scene::isPeriodic.")) + ((vector >,miscParams,,Attr::hidden,"Store for arbitrary Serializable objects; will set static parameters during deserialization (primarily for GLDraw functors which otherwise have no attribute access)")) + ((vector >,dispParams,,Attr::hidden,"'hash maps' of display parameters (since sudodem::serialization had no support for maps, emulate it via vector of strings in format key=value)")) + , + /*ctor*/ + fillDefaultTags(); + interactions->postLoad__calledFromScene(bodies); + SpeedElements.Zero(); + , + /* py */ + .add_property("localCoords",&Scene::usesLocalCoords,"Whether local coordianate system is used on interactions (set by :yref:`IGeomFunctor`).") + .add_property("compressionNegative",&Scene::usesLocalCoords,"Whether the convention is that compression has negative sign (set by :yref:`IGeomFunctor`).") + ); + DECLARE_LOGGER; +}; +REGISTER_SERIALIZABLE(Scene); diff --git a/SudoDEM2D/core/Shape.hpp b/SudoDEM2D/core/Shape.hpp new file mode 100644 index 0000000..933ff73 --- /dev/null +++ b/SudoDEM2D/core/Shape.hpp @@ -0,0 +1,36 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include +#include + +#define BV_FUNCTOR_CACHE + +class BoundFunctor; + +class Shape: public Serializable, public Indexable { + public: + ~Shape() {}; // vtable + #ifdef BV_FUNCTOR_CACHE + shared_ptr boundFunctor; + #endif + + SUDODEM_CLASS_BASE_DOC_ATTRS_CTOR_PY(Shape,Serializable,"Geometry of a body", + ((Vector3r,color,Vector3r(1,1,1),,"Color for rendering (normalized RGB).")) + ((bool,wire,false,,"Whether this Shape is rendered using color surfaces, or only wireframe (can still be overridden by global config of the renderer).")) + ((bool,highlight,false,,"Whether this Shape will be highlighted when rendered.")), + /*ctor*/, + /*py*/ SUDODEM_PY_TOPINDEXABLE(Shape) + ); + REGISTER_INDEX_COUNTER(Shape); +}; +REGISTER_SERIALIZABLE(Shape); + diff --git a/SudoDEM2D/core/SimulationFlow.cpp b/SudoDEM2D/core/SimulationFlow.cpp new file mode 100644 index 0000000..c4021bd --- /dev/null +++ b/SudoDEM2D/core/SimulationFlow.cpp @@ -0,0 +1,25 @@ +/************************************************************************* +* Copyright (C) 2006 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ +#include "Scene.hpp" +#include +#include "SimulationFlow.hpp" +//#include "Scene.hpp" +#include "Omega.hpp" + +CREATE_LOGGER(SimulationFlow); + +void SimulationFlow::singleAction() +{ + Scene* scene=Omega::instance().getScene().get(); + if (!scene) throw logic_error("SimulationFlow::singleAction: no Scene object?!"); + if(scene->subStepping) { LOG_INFO("Sub-stepping disabled when running simulation continuously."); scene->subStepping=false; } + scene->moveToNextTimeStep(); + if(scene->stopAtIter>0 && scene->iter==scene->stopAtIter) setTerminate(true); + if(scene->stopAtTime>0 && scene->time==scene->stopAtTime) setTerminate(true); +}; + diff --git a/SudoDEM2D/core/SimulationFlow.hpp b/SudoDEM2D/core/SimulationFlow.hpp new file mode 100644 index 0000000..f8f79b2 --- /dev/null +++ b/SudoDEM2D/core/SimulationFlow.hpp @@ -0,0 +1,22 @@ +/************************************************************************* +* Copyright (C) 2006 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include "ThreadWorker.hpp" + +class SimulationFlow // FIXME ; bad name + : public ThreadWorker +{ + public: + virtual void singleAction(); + DECLARE_LOGGER; +}; + + + diff --git a/SudoDEM2D/core/State.cpp b/SudoDEM2D/core/State.cpp new file mode 100644 index 0000000..26a3727 --- /dev/null +++ b/SudoDEM2D/core/State.cpp @@ -0,0 +1,26 @@ +// 2009 © Václav Šmilauer +#include + +CREATE_LOGGER(State); + +void State::setDOFfromVector3r(Vector3r disp_rot){ + blockedDOFs=((disp_rot[0]==1.0)?DOF_X :0)|((disp_rot[1]==1.0)?DOF_Y :0)|((disp_rot[2]==1.0)?DOF_RZ :0); +} + +std::string State::blockedDOFs_vec_get() const { + std::string ret; + #define _SET_DOF(DOF_ANY,ch) if((blockedDOFs & State::DOF_ANY)!=0) ret.push_back(ch); + _SET_DOF(DOF_X,'x'); _SET_DOF(DOF_Y,'y'); _SET_DOF(DOF_RZ,'Z'); + #undef _SET_DOF + return ret; +} + +void State::blockedDOFs_vec_set(const std::string& dofs){ + blockedDOFs=0; + FOREACH(char c, dofs){ + #define _GET_DOF(DOF_ANY,ch) if(c==ch) { blockedDOFs|=State::DOF_ANY; continue; } + _GET_DOF(DOF_X,'x'); _GET_DOF(DOF_Y,'y'); _GET_DOF(DOF_RZ,'Z'); + #undef _GET_DOF + throw std::invalid_argument("Invalid DOF specification `"+boost::lexical_cast(c)+"' in '"+dofs+"', characters must be ∈{x,y,Z}."); + } +} diff --git a/SudoDEM2D/core/State.hpp b/SudoDEM2D/core/State.hpp new file mode 100644 index 0000000..3c99cc0 --- /dev/null +++ b/SudoDEM2D/core/State.hpp @@ -0,0 +1,82 @@ +// 2009 © Václav Šmilauer +#pragma once +#include +#include +#include + +// delete later and remove relevant code, to not support old State.blockedDOFs=['x','y','rz'] syntax anymore +//#define SUDODEM_DEPREC_DOF_LIST + +class State: public Serializable, public Indexable{ + public: + /// linear motion (references to inside se3) + Vector2r& pos; + /// rotational motion (reference to inside se3) + Rotationr& ori; + + //! mutex for updating the parameters from within the interaction loop (only used rarely) + boost::mutex updateMutex; + + // bits for blockedDOFs + enum {DOF_NONE=0,DOF_X=1,DOF_Y=2,DOF_RZ=4}; + //! shorthand for all DOFs blocked + static const unsigned DOF_ALL=DOF_X|DOF_Y|DOF_RZ; + //! shorthand for all displacements blocked + static const unsigned DOF_XY=DOF_X|DOF_Y; + //! shorthand for all rotations blocked + //static const unsigned DOF_RZ=DOF_RX|DOF_RY|DOF_RZ; + + //! Return DOF_* constant for given axis∈{0,1} and rotationalDOF∈{false(default),true}; e.g. axisDOF(0,true)==DOF_RX + static unsigned axisDOF(int axis, bool rotationalDOF=false){return 1<<(axis+(rotationalDOF?3:0));} + //! set DOFs according to two Vector3r arguments (blocked is when disp[i]==1.0 or rot[i]==1.0) + void setDOFfromVector3r(Vector3r disp_rot);//disp_rot(X,Y,RZ) + //! Getter of blockedDOFs for list of strings (e.g. DOF_X | DOR_RX | DOF_RZ → 'xXZ') + std::string blockedDOFs_vec_get() const; + //! Setter of blockedDOFs from string ('xXZ' → DOF_X | DOR_RX | DOF_RZ) + #ifdef SUDODEM_DEPREC_DOF_LIST + void blockedDOFs_vec_set(const python::object&); + #else + void blockedDOFs_vec_set(const std::string& dofs); + #endif + + //! Return displacement (current-reference position) + Vector2r displ() const {return pos-refPos;} + //! Return rotation (current-reference orientation, as Vector3r)//debug for 2D + Real rot() const { return ori.angle(); } + + // python access functions: pos and ori are references to inside Se3r and cannot be pointed to directly + Vector2r pos_get() const {return pos;} + void pos_set(const Vector2r p) {pos=p;} + Rotationr ori_get() const {return ori; } + void ori_set(const Rotationr o){ori=o;} + + SUDODEM_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY(State,Serializable,"State of a body (spatial configuration, internal variables).", + ((Se2r,se2,Se2r(Vector2r::Zero(),Rotationr::Identity()),,"Position and orientation as one object.")) + ((Vector2r,vel,Vector2r::Zero(),,"Current linear velocity.")) + ((Real,mass,0,,"Mass of this body")) + ((Real,angVel,0.0,,"Current angular velocity")) + ((Real,angMom,0.0,,"Current angular momentum")) + ((Real,inertia,0.0,,"Inertia of associated body, in local coordinate system.")) + ((Vector2r,refPos,Vector2r::Zero(),,"Reference position")) + ((Rotationr,refOri,Rotationr::Identity(),,"Reference orientation")) + ((unsigned,blockedDOFs,,,"[Will be overridden]")) + ((bool,isDamped,true,,"Damping in :yref:`Newtonintegrator` can be deactivated for individual particles by setting this variable to FALSE. E.g. damping is inappropriate for particles in free flight under gravity but it might still be applicable to other particles in the same simulation.")) + ((Real,densityScaling,1,,"|yupdate| see :yref:`GlobalStiffnessTimeStepper::targetDt`.")), + /* additional initializers */ + ((pos,se2.position)) + ((ori,se2.rotation)), + /* ctor */, + /*py*/ + SUDODEM_PY_TOPINDEXABLE(State) + .add_property("blockedDOFs",&State::blockedDOFs_vec_get,&State::blockedDOFs_vec_set,"Degress of freedom where linear/angular velocity will be always constant (equal to zero, or to an user-defined value), regardless of applied force/torque. String that may contain 'xyzXYZ' (translations and rotations).") + // references must be set using wrapper funcs + .add_property("pos",&State::pos_get,&State::pos_set,"Current position.") + .add_property("ori",&State::ori_get,&State::ori_set,"Current orientation.") + .def("displ",&State::displ,"Displacement from :yref:`reference position` (:yref:`pos` - :yref:`refPos`)") + .def("rot",&State::rot,"Rotation from :yref:`reference orientation` (as rotation vector)") + ); + REGISTER_INDEX_COUNTER(State); + DECLARE_LOGGER; +}; + +REGISTER_SERIALIZABLE(State); diff --git a/SudoDEM2D/core/ThreadRunner.cpp b/SudoDEM2D/core/ThreadRunner.cpp new file mode 100644 index 0000000..440c8af --- /dev/null +++ b/SudoDEM2D/core/ThreadRunner.cpp @@ -0,0 +1,101 @@ +/************************************************************************* +* Copyright (C) 2006 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#include +#include "ThreadRunner.hpp" +#include "ThreadWorker.hpp" + +#include +#include +#include + +CREATE_LOGGER(ThreadRunner); + +void ThreadRunner::run() +{ + // this is the body of execution of separate thread + boost::mutex::scoped_lock lock(m_runmutex); + try{ + workerThrew=false; + while(looping()) { + call(); + if(m_thread_worker->shouldTerminate()){ stop(); return; } + } + } catch (std::exception& e){ + LOG_FATAL("Exception occured: "<setTerminate(false); + m_thread_worker->callSingleAction(); +} + +void ThreadRunner::pleaseTerminate() +{ + stop(); + m_thread_worker->setTerminate(true); +} + +void ThreadRunner::spawnSingleAction() +{ + boost::mutex::scoped_lock boollock(m_boolmutex); + boost::mutex::scoped_lock calllock(m_callmutex); + if(m_looping) return; + boost::function0 call( boost::bind( &ThreadRunner::call , this ) ); + boost::thread th(call); +} + +void ThreadRunner::start() +{ + boost::mutex::scoped_lock lock(m_boolmutex); + if(m_looping) return; + m_looping=true; + boost::function0 run( boost::bind( &ThreadRunner::run , this ) ); + boost::thread th(run); +} + +void ThreadRunner::stop() +{ + //std::cerr<<__FILE__<<":"<<__LINE__<<":"<<__FUNCTION__< + +/*! +\brief ThreadRunner takes care of starting/stopping (executing) the + ThreadWorker in the separate thread. + + It is achieved by either: + - one execution of { ThreadWorker::singleAction(); } in separate thread + - a loop { while(looping() ) ThreadWorker::singleAction(); } in separate thread + + Lifetime of ThreadRunner is guaranteed to be longer or equal to + the lifetime of the separate thread of execution. + + The ThreadRunner owner must make sure that ThreadWorker has longer or + equal lifetime than instance of ThreadRunner. Otherwise ThreadRunner + will try to execute a dead object, which will lead to crash. + + Do not destroy immediately after call to singleAction(). Destructor can + kick in before a separate thread starts, which will lead to a crash. + + User can explicitly ask the running thread to terminate execution. If + the thread supports it, it will terminate. + +\note This code is reentrant. Simultaneous requests from other threads to + start/stop or perform singleAction() are expected. + + So ThreadWorker(s) are running, while the user is interacting with the + UI frontend (doesn't matter whether the UI is graphical, ncurses or + any other). + + */ + +class ThreadWorker; + +class ThreadRunner +{ + private : + ThreadWorker* m_thread_worker; + bool m_looping; + boost::mutex m_boolmutex; + boost::mutex m_callmutex; + boost::mutex m_runmutex; + void run(); + void call(); + + DECLARE_LOGGER; + + public : + ThreadRunner(ThreadWorker* c) : m_thread_worker(c), m_looping(false), workerThrew(false) {}; + ~ThreadRunner(); + + /// perform ThreadWorker::singleAction() in separate thread + void spawnSingleAction(); + /// start doing singleAction() in a loop in separate thread + void start(); + /// stop the loop (changes the flag checked by looping() ) + void stop(); + /// kindly ask the separate thread to terminate + void pleaseTerminate(); + /// precondition for the loop started with start(). + bool looping(); + //! if true, workerException is copy of the exception thrown by the worker + bool workerThrew; + //! last exception thrown by the worker, if any + std::exception workerException; +}; + + diff --git a/SudoDEM2D/core/ThreadWorker.cpp b/SudoDEM2D/core/ThreadWorker.cpp new file mode 100644 index 0000000..d43fcf4 --- /dev/null +++ b/SudoDEM2D/core/ThreadWorker.cpp @@ -0,0 +1,77 @@ +/************************************************************************* +* Copyright (C) 2006 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#include "ThreadWorker.hpp" + +void ThreadWorker::setTerminate(bool b) +{ + boost::mutex::scoped_lock lock(m_mutex); + m_should_terminate=b; +}; + +bool ThreadWorker::shouldTerminate() +{ + boost::mutex::scoped_lock lock(m_mutex); + return m_should_terminate; +}; + +void ThreadWorker::setProgress(float i) +{ + boost::mutex::scoped_lock lock(m_mutex); + m_progress=i; +}; + +void ThreadWorker::setStatus(std::string s) +{ + boost::mutex::scoped_lock lock(m_mutex); + m_status=s; +}; + +float ThreadWorker::progress() +{ + boost::mutex::scoped_lock lock(m_mutex); + return m_progress; +}; + +std::string ThreadWorker::getStatus() +{ + boost::mutex::scoped_lock lock(m_mutex); + return m_status; +}; + +void ThreadWorker::setReturnValue(boost::any a) +{ + boost::mutex::scoped_lock lock(m_mutex); + m_val = a; +}; + +boost::any ThreadWorker::getReturnValue() +{ + boost::mutex::scoped_lock lock(m_mutex); + return m_val; +}; + +bool ThreadWorker::done() +{ + boost::mutex::scoped_lock lock(m_mutex); + return m_done; +}; + +void ThreadWorker::callSingleAction() +{ + { + boost::mutex::scoped_lock lock(m_mutex); + m_done = false; + } + this->singleAction(); + { + boost::mutex::scoped_lock lock(m_mutex); + m_done = true; + } +}; + diff --git a/SudoDEM2D/core/ThreadWorker.hpp b/SudoDEM2D/core/ThreadWorker.hpp new file mode 100644 index 0000000..b6ff701 --- /dev/null +++ b/SudoDEM2D/core/ThreadWorker.hpp @@ -0,0 +1,63 @@ +/************************************************************************* +* Copyright (C) 2006 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include + +class ThreadRunner; + +/*! +\brief ThreadWorker contains information about tasks to be performed when + the separate thread is executed. + */ + +class ThreadWorker // perhaps simulation steps, or stage? as it is a single stage + // of the simulation, that consists of several steps + // Update: it is more general now. simulation stages perhaps will be derived from this class +{ + private: + /// You should check out ThreadRunner, it is used for execution control of this class + friend class ThreadRunner; + bool m_should_terminate; + bool m_done; + boost::mutex m_mutex; + boost::any m_val; + float m_progress; + std::string m_status; + void callSingleAction(); + + protected: + void setTerminate(bool); + /// singleAction() can check whether someone asked for termination, and terminate if/when possible + bool shouldTerminate(); + /// if something must be returned, set the result using this method + void setReturnValue(boost::any); + /// if you feel monitored for progress, you can set it here: a value between 0.0 and 1.0 + void setProgress(float); + /// if you feel being monitored for what currently is done, set the message here + void setStatus(std::string); + /// derived classes must define this method, that's what is executed in separate thread + virtual void singleAction() = 0; + + public: + ThreadWorker() : m_should_terminate(false), m_done(false), m_progress(0) {}; + virtual ~ThreadWorker() {}; + + /// Returns a value between 0.0 and 1.0. Useful for updating a progress bar. + float progress(); // get_progress ? (pick a naming convention, efngh) + /// You can display a message in GUI about what is the current work status + std::string getStatus(); + /// Check whether execution is finished, + bool done(); + /// then get the result. + boost::any getReturnValue(); +}; + + diff --git a/SudoDEM2D/core/TimeStepper.hpp b/SudoDEM2D/core/TimeStepper.hpp new file mode 100644 index 0000000..db522d6 --- /dev/null +++ b/SudoDEM2D/core/TimeStepper.hpp @@ -0,0 +1,34 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#pragma once + +#include +#include +#include "Interaction.hpp" +#include "GlobalEngine.hpp" +#include "Scene.hpp" + +class Body; + +class TimeStepper: public GlobalEngine{ + public: + virtual void computeTimeStep(Scene* ) { throw; }; + virtual bool isActivated() {return (active && (scene->iter % timeStepUpdateInterval == 0));}; + virtual void action() { computeTimeStep(scene);} ; + void setActive(bool a, int nb=-1) {active = a; if (nb>0) {timeStepUpdateInterval = (unsigned int)nb;}} + + SUDODEM_CLASS_BASE_DOC_ATTRS( + TimeStepper,GlobalEngine,"Engine defining time-step (fundamental class)", + ((bool,active,true,,"is the engine active?")) + ((unsigned int,timeStepUpdateInterval,1,,"dt update interval"))); +}; + +REGISTER_SERIALIZABLE(TimeStepper); + + diff --git a/SudoDEM2D/core/Timing.hpp b/SudoDEM2D/core/Timing.hpp new file mode 100644 index 0000000..94bd113 --- /dev/null +++ b/SudoDEM2D/core/Timing.hpp @@ -0,0 +1,50 @@ +// 2009 © Václav Šmilauer +#pragma once +#include + +struct TimingInfo{ + typedef unsigned long long delta; + long nExec; + delta nsec; + TimingInfo():nExec(0),nsec(0){} + static delta getNow(bool evenIfDisabled=false) + { + if(!enabled && !evenIfDisabled) return 0L; +#ifdef __APPLE__ + std::cerr << "ERROR: Time profiling (TimingInfo) not implemented on Apples." << std::endl; + return 0L; +#else + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC,&ts); + return delta(1e9*ts.tv_sec+ts.tv_nsec); +#endif + } + static bool enabled; +}; + +/* Create TimingDeltas object, then every call to checkpoint() will add + * (or use existing) TimingInfo to data. It increases its nExec by 1 + * and nsec by time elapsed since construction or last checkpoint. + */ +class TimingDeltas{ + TimingInfo::delta last; + size_t i; + public: + vector data; + vector labels; + TimingDeltas():i(0){} + void start(){if(!TimingInfo::enabled)return; i=0;last=TimingInfo::getNow();} + void checkpoint(const string& label){ + if(!TimingInfo::enabled) return; + if(data.size()<=i) { data.resize(i+1); labels.resize(i+1); labels[i]=label;} + TimingInfo::delta now=TimingInfo::getNow(); + data[i].nExec+=1; data[i].nsec+=now-last; last=now; i++; + } + void reset(){ data.clear(); labels.clear(); } + // python access + boost::python::list pyData(){ + boost::python::list ret; + for(size_t i=0; i +// make core classes known to the class factory +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// these two are not accessible from python directly (though they should be in the future, perhaps) + +#if BOOST_VERSION>=104200 + BOOST_CLASS_EXPORT_IMPLEMENT(BodyContainer); + BOOST_CLASS_EXPORT_IMPLEMENT(InteractionContainer); +#else + BOOST_CLASS_EXPORT(BodyContainer); + BOOST_CLASS_EXPORT(InteractionContainer); +#endif + +SUDODEM_PLUGIN((Body)(Bound)(Cell)(Dispatcher)(EnergyTracker)(Engine)(FileGenerator)(Functor)(GlobalEngine)(Interaction)(IGeom)(IPhys)(Material)(PartialEngine)(Shape)(State)(TimeStepper)); + +EnergyTracker::~EnergyTracker(){} // vtable + +//BOOST_CLASS_EXPORT(OpenMPArrayAccumulator); +//BOOST_CLASS_EXPORT(OpenMPAccumulator); diff --git a/SudoDEM2D/core/main/pyboot.cpp b/SudoDEM2D/core/main/pyboot.cpp new file mode 100644 index 0000000..e5f65dc --- /dev/null +++ b/SudoDEM2D/core/main/pyboot.cpp @@ -0,0 +1,45 @@ +#include +#include + +#include + +#ifdef SUDODEM_DEBUG + void crashHandler(int sig){ + switch(sig){ + case SIGABRT: + case SIGSEGV: + signal(SIGSEGV,SIG_DFL); signal(SIGABRT,SIG_DFL); // prevent loops - default handlers + cerr<<"SIGSEGV/SIGABRT handler called; gdb batch file is `"<(getpid())<<"\nset pagination off\nthread info\nthread apply all backtrace\ndetach\nquit\n"; gdbBatch.close(); + signal(SIGABRT,crashHandler); + signal(SIGSEGV,crashHandler); + #endif + vector ppp; for(int i=0; i(pp[i])); + Omega::instance().loadPlugins(ppp); +} +void sudodemFinalize(){ Omega::instance().cleanupTemps(); } + +BOOST_PYTHON_MODULE(boot){ + boost::python::scope().attr("initialize")=&sudodemInitialize; + boost::python::scope().attr("finalize")=&sudodemFinalize; //,"Finalize sudodem (only to be used internally).") +} diff --git a/SudoDEM2D/core/main/sudodem.cpp b/SudoDEM2D/core/main/sudodem.cpp new file mode 100644 index 0000000..57f05e7 --- /dev/null +++ b/SudoDEM2D/core/main/sudodem.cpp @@ -0,0 +1,305 @@ +#include +#include + +#include +#include +#include +#include + +#include + +//#include + +#include"sudodemcfg.h" + +using namespace boost; +using namespace std; + +void sudodem_print_help(); +void sudodem_print_version(); + +int main( int argc, char **argv ) +{ + cout<<"Welcome to SudoDEM!"< 0) + { + std::string exeName = argv[0]; + if (exeName.size() > 0) + { + std::string origPathValue = ""; + const char *getenvVal = getenv("PATH"); + if (getenvVal != NULL) + { + origPathValue = getenvVal; + //cout<<"original PATH="<modulesArgs; + bool isGUI=true; + if(argc != 1){ + for(int i=1;i < argc; i++){ + if ( strcmp(argv[i], "-v") == 0 ){//version + sudodem_print_version(); + if(argc == 2){ + //just for enquiring version + exit(1); + } + }else if (strcmp(argv[i], "-h") == 0 ){//help + sudodem_print_help(); + if(argc == 2){ + //just for enquiring version + exit(1); + } + } + else if( strncmp(argv[i], "-j",2) == 0 ){//this first two characters are '-j' + int len = strlen(argv[i]); + if(len > 2){//i.e., the user may type '-j4' instead of a standard way '-j 4' + char cores[2]; + cores[0]='1';cores[1]=' '; + switch (len) { + case 3: + strncpy(cores,argv[i]+2,1);//the core number should not exceed 99 here by default. + break; + case 4: + strncpy(cores,argv[i]+2,2);//the core number should not exceed 99 here by default. + break; + default: + cout<<"Warning: wrong number of threads was assigned to this sim. Please check the command input. Only one thread will be used for continuing running."< prg_feats((std::istream_iterator(iss)), + std::istream_iterator()); + + /*for(int i=0;i0:\n" + "\t\targ0=sys.argv[0]\n" + "\t\tif qt4: sudodem.qt.Controller();\n" + //"\t\tif sum(bool(arg0.endswith(ext)) for ext in ('.xml','.xml.bz2','.xml.gz','.sudodem','.sudodem.gz','.sudodem.bz2','.bin','.bin.gz','.bin.bz2'))>0:\n" + // "\t\t\tif len(sys.argv)>1: raise RuntimeError('Extra arguments to saved simulation to run: '+' '.join(sys.argv[1:]))\n" + // "\t\t\tsys.stderr.write('Running simulation '+arg0)\n" + "\t\tif arg0.endswith('.py'):\n" + "\t\t\tdef runScript(script):\n" + "\t\t\t\tsys.stderr.write('Running script '+arg0)\n" + "\t\t\t\ttry: execfile(script,globals())\n" + "\t\t\t\texcept SystemExit: raise\n" + "\t\t\t\texcept: # all other exceptions\n" + "\t\t\t\t\timport traceback\n" + "\t\t\t\t\ttraceback.print_exc()\n" + "\t\t\t\t\tif sudodem.runtime.exitAfter: sys.exit(1)\n" + "\t\t\t\tif sudodem.runtime.exitAfter: sys.exit(0)\n" + "\t\t\trunScript(arg0)\n" + "\tif sudodem.runtime.exitAfter: sys.exit(0)\n" + //# common ipython configuration + //"\tbanner='[[ Ctrl+L clears screen, Ctrl+U kills line. '+', '.join((['F12 controller','F11 3d view (use h-key for showing help)','F10 both','F9 generator'] if (qt4) else [])+['F8 plot'])+'. ]]'\n" + //# ipython options, see e.g. http://www.cv.nrao.edu/~rreid/casa/tips/ipy_user_conf.py + //#execfile=[prefix+'/lib/sudodem'+suffix+'/py/sudodem/ipython.py'], + "\tipconfig=dict(prompt_in1='SudoDEM [\\#]: ',prompt_in2=' .\\D.: ',prompt_out=' -> [\\#]: ',\ + separate_in='',separate_out='',separate_out2='',\ + readline_parse_and_bind=['tab: complete',] +\ + (['\"\\e[24~\": \"\\C-Usudodem.qt.Controller();\\C-M\"',\ + '\"\\e[23~\": \"\\C-Usudodem.qt.View();\\C-M\"',\ + '\"\\e[21~\": \"\\C-Usudodem.qt.Controller(), sudodem.qt.View();\\C-M\"',\ + '\"\\e[20~\": \"\\C-Usudodem.qt.Generator();\\C-M\"'] if (qt4) else []) +\ + ['\"\\e[19~\": \"\\C-Uimport sudodem.plot; sudodem.plot.plot();\\C-M\"', \ + '\"\\e[A\": history-search-backward', '\"\\e[B\": history-search-forward'])\n" + //#F12,F11,F10,F9,F8 + //"\tipconfig=dict(prompt_in1='SudoDEM [\\#]: ',prompt_in2=' .\\D.: ',prompt_out=' -> [\\#]: ')\n" + //"\tprint ipconfig\n" + //# show python console IPYTHON3.0 embeded + "\tfrom IPython.terminal.embed import InteractiveShellEmbed\n" + "\tfrom IPython.config.loader import Config\n" + "\tcfg = Config()\n" + "\tprompt_config = cfg.PromptManager\n" + "\tprompt_config.in_template = ipconfig['prompt_in1']\n" + "\tprompt_config.in2_template = ipconfig['prompt_in2']\n" + "\tprompt_config.out_template = ipconfig['prompt_out']\n" + "\timport readline\n" + "\tfor k in ipconfig['readline_parse_and_bind']: readline.parse_and_bind(k)\n" + "\tInteractiveShellEmbed.config=cfg\n" + "\tInteractiveShellEmbed.banner1=''\n" + "\tipshell=InteractiveShellEmbed()\n" + "\tipshell()\n" +); +cout<<"Tips: Ctrl+L clears screen, Ctrl+U kills line. F12 controller, use h-key for 3d view help,F9 generator, F8 plot"<*v>*o2JA-6& zM)dxkNuK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ruA{}&f5 z_rK@B=^YoBPLE=!M1fuj%A-QRKsMJbG=H~#Ywd<&{aJ(UQnnIe& z_r5^;2z?8<@di8$2bkHNl#~{FLjrcB*>5~QyV-B8U2gzDw1#0Fpb7vIm9S98<{F_m z=@lukhk`=)(Sa?9AcYLo%HO~Mt=(N%hi&lTEzGXpLtMo}$TnlO7sM*SJbFo1Q6GHM zf)+p#-eF$jr>yhqvw~6D=e|A%{WwaqTJ4J{6ic_}=B2F2%ALv^ud7C0=4ZpSCK?Nk@mRg(Ep(i!ODDC}U$>z7dys!>Y~lQ7l&cqSlaS(bOI zi{tU5#rXa!d+$Gtk0!^bdX^yY{nm1iaSCT>FbDB| z-P=>Wz7EZOUHTE}sdk&^O?-cRe)4H;HX8mW+V9TvI-g_Nbi4y^ki;t4N6+-vQPhfM zz%pPNxS0XoHRSD^Q*DN2z%uZkF+lr+gG%T!<_7iFfsMWbAePXr1#S9Fq#B3OWy}p? z1VxxqL{lpGiXlun`W?=58FPcC90XrJ1dlBEh9dOn*uSIGLAVBOYZpF literal 0 HcmV?d00001 diff --git a/SudoDEM2D/gui/CMakeLists.txt b/SudoDEM2D/gui/CMakeLists.txt new file mode 100644 index 0000000..db8d231 --- /dev/null +++ b/SudoDEM2D/gui/CMakeLists.txt @@ -0,0 +1,34 @@ +IF(${ENABLE_GUI}) + INCLUDE(${QT_USE_FILE}) + INCLUDE_DIRECTORIES(${QGLVIEWER_INCLUDE_DIR}) + + SET(_GLViewer_MOC_HEADERS qt4/GLViewer.hpp;qt4/OpenGLManager.hpp) + SET(_GLViewer_SOURCE_FILES qt4/GLViewer.cpp;qt4/_GLViewer.cpp;qt4/OpenGLManager.cpp;qt4/GLViewerDisplay.cpp;qt4/GLViewerMouse.cpp) + + QT4_WRAP_CPP(_GLViewer_MOC_OUTFILES ${_GLViewer_MOC_HEADERS}) + + ADD_LIBRARY(_GLViewer SHARED ${_GLViewer_SOURCE_FILES} ${_GLViewer_MOC_OUTFILES}) + SET_TARGET_PROPERTIES(_GLViewer PROPERTIES PREFIX "" INSTALL_RPATH "$ORIGIN;$ORIGIN/../../../../3rdlibs;") + TARGET_LINK_LIBRARIES(_GLViewer ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) + IF(GL2PS_FOUND AND ENABLE_GL2PS) + TARGET_LINK_LIBRARIES(_GLViewer ${GL2PS_LIBRARIES}) + ENDIF(GL2PS_FOUND AND ENABLE_GL2PS) + INSTALL(TARGETS _GLViewer DESTINATION ${SUDODEM_PY_PATH}/sudodem/qt) + + FILE(GLOB filesPYQT "${CMAKE_CURRENT_SOURCE_DIR}/qt4/*.py") + INSTALL(FILES ${filesPYQT} DESTINATION ${SUDODEM_PY_PATH}/sudodem/qt) + + EXECUTE_PROCESS( + COMMAND "pyrcc4" "-o" "${CMAKE_BINARY_DIR}/img_rc.py" "img.qrc" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/qt4 + RESULT_VARIABLE rv + ) + + EXECUTE_PROCESS( + COMMAND "pyuic4" "-o" "${CMAKE_BINARY_DIR}/ui_controller.py" "controller.ui" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/qt4 + RESULT_VARIABLE rv + ) + INSTALL(FILES ${CMAKE_BINARY_DIR}/img_rc.py ${CMAKE_BINARY_DIR}/ui_controller.py DESTINATION ${SUDODEM_PY_PATH}/sudodem/qt) + +ENDIF(${ENABLE_GUI}) diff --git a/SudoDEM2D/gui/qt4/GLViewer.cpp b/SudoDEM2D/gui/qt4/GLViewer.cpp new file mode 100644 index 0000000..605fe60 --- /dev/null +++ b/SudoDEM2D/gui/qt4/GLViewer.cpp @@ -0,0 +1,500 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2005 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#include"GLViewer.hpp" +#include"OpenGLManager.hpp" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef SUDODEM_GL2PS + #include +#endif + +static unsigned initBlocked(State::DOF_NONE); + +CREATE_LOGGER(GLViewer); + +GLLock::GLLock(GLViewer* _glv): boost::try_mutex::scoped_lock(Omega::instance().renderMutex), glv(_glv){ + glv->makeCurrent(); +} +GLLock::~GLLock(){ glv->doneCurrent(); } + + +#define _W3 setw(3)<emitCloseView(viewId); + e->accept(); +} + +GLViewer::GLViewer(int _viewId, const shared_ptr& _renderer, QGLWidget* shareWidget): QGLViewer(/*parent*/(QWidget*)NULL,shareWidget), renderer(_renderer), viewId(_viewId) { + isMoving=false; + drawGrid=0; + drawScale=false; + timeDispMask=TIME_REAL|TIME_VIRT|TIME_ITER; + cut_plane = 0; + cut_plane_delta = -2; + gridSubdivide = false; + resize(550,550); + last=-1; + if(viewId==0) setWindowTitle("Primary view"); + else setWindowTitle(("Secondary view #"+boost::lexical_cast(viewId)).c_str()); + + show(); + + mouseMovesCamera(); + + camera()->setType(qglviewer::Camera::ORTHOGRAPHIC); + manipulatedClipPlane=-1; + + if(manipulatedFrame()==0) setManipulatedFrame(new qglviewer::ManipulatedFrame()); + + xyPlaneConstraint=shared_ptr(new qglviewer::LocalConstraint()); + // Forbid rotation + qglviewer::WorldConstraint *constraint = new qglviewer::WorldConstraint(); + constraint->setRotationConstraintType(qglviewer::AxisPlaneConstraint::FORBIDDEN); + //manipulatedFrame()->setConstraint(NULL); + manipulatedFrame()->setConstraint(constraint); + + setKeyDescription(Qt::Key_Return,"Run simulation."); + setKeyDescription(Qt::Key_A,"Toggle visibility of global axes."); + setKeyDescription(Qt::Key_C,"Set scene center so that all bodies are visible; if a body is selected, center around this body."); + setKeyDescription(Qt::Key_C & Qt::AltModifier,"Set scene center to median body position (same as space)"); + setKeyDescription(Qt::Key_D,"Toggle time display mask"); + setKeyDescription(Qt::Key_G,"Toggle grid visibility; g turns on and cycles"); + setKeyDescription(Qt::Key_G & Qt::ShiftModifier ,"Hide grid."); + setKeyDescription(Qt::Key_M, "Move selected object."); + //setKeyDescription(Qt::Key_X,"Show the xz [shift: xy] (up-right) plane (clip plane: align normal with +x)"); + //setKeyDescription(Qt::Key_Y,"Show the yx [shift: yz] (up-right) plane (clip plane: align normal with +y)"); + //setKeyDescription(Qt::Key_Z,"Show the zy [shift: zx] (up-right) plane (clip plane: align normal with +z)"); + setKeyDescription(Qt::Key_Period,"Toggle grid subdivision by 10"); + setKeyDescription(Qt::Key_S & Qt::AltModifier,"Save QGLViewer state to /tmp/qglviewerState.xml"); + setKeyDescription(Qt::Key_T,"Switch orthographic / perspective camera"); + setKeyDescription(Qt::Key_O,"Set narrower field of view"); + setKeyDescription(Qt::Key_P,"Set wider field of view"); + setKeyDescription(Qt::Key_R,"Revolve around scene center"); + setKeyDescription(Qt::Key_V,"Save PDF of the current view to /tmp/sudodem-snapshot-0001.pdf (whichever number is available first). (Must be compiled with the gl2ps feature.)"); + //setPathKey(-Qt::Key_F1); + //setPathKey(-Qt::Key_F2); + setKeyDescription(Qt::Key_Escape,"Manipulate scene (default)"); + //setKeyDescription(Qt::Key_F1,"Manipulate clipping plane #1"); + //setKeyDescription(Qt::Key_F2,"Manipulate clipping plane #2"); + //setKeyDescription(Qt::Key_F3,"Manipulate clipping plane #3"); + //setKeyDescription(Qt::Key_1,"Make the manipulated clipping plane parallel with plane #1"); + //setKeyDescription(Qt::Key_2,"Make the manipulated clipping plane parallel with plane #2"); + //setKeyDescription(Qt::Key_2,"Make the manipulated clipping plane parallel with plane #3"); + //setKeyDescription(Qt::Key_1 & Qt::AltModifier,"Add/remove plane #1 to/from the bound group"); + //setKeyDescription(Qt::Key_2 & Qt::AltModifier,"Add/remove plane #2 to/from the bound group"); + //setKeyDescription(Qt::Key_3 & Qt::AltModifier,"Add/remove plane #3 to/from the bound group"); + //setKeyDescription(Qt::Key_0,"Clear the bound group"); + //setKeyDescription(Qt::Key_7,"Load [Alt: save] view configuration #0"); + //setKeyDescription(Qt::Key_8,"Load [Alt: save] view configuration #1"); + //setKeyDescription(Qt::Key_9,"Load [Alt: save] view configuration #2"); + //setKeyDescription(Qt::Key_Space,"Center scene (same as Alt-C); clip plane: activate/deactivate"); + + centerScene(); +} + +bool GLViewer::isManipulating(){ + return isMoving || manipulatedClipPlane>=0; +} + +void GLViewer::resetManipulation(){ + mouseMovesCamera(); + setSelectedName(-1); + isMoving=false; + manipulatedClipPlane=-1; +} +/* +void GLViewer::startClipPlaneManipulation(int planeNo){ + assert(planeNonumClipPlanes); + resetManipulation(); + mouseMovesManipulatedFrame(xyPlaneConstraint.get()); + manipulatedClipPlane=planeNo; + const Se3r se3(renderer->clipPlaneSe3[planeNo]); + manipulatedFrame()->setPositionAndOrientation(qglviewer::Vec(se3.position[0],se3.position[1],se3.position[2]),qglviewer::Quaternion(se3.orientation.x(),se3.orientation.y(),se3.orientation.z(),se3.orientation.w())); + string grp=strBoundGroup(); + displayMessage("Manipulating clip plane #"+boost::lexical_cast(planeNo+1)+(grp.empty()?grp:" (bound planes:"+grp+")")); +}*/ + +string GLViewer::getState(){ + QString origStateFileName=stateFileName(); + string tmpFile=Omega::instance().tmpFilename(); + setStateFileName(QString(tmpFile.c_str())); saveStateToFile(); setStateFileName(origStateFileName); + LOG_DEBUG("State saved to temp file "<>ss; ret+=" "+ss;}; in.close(); + boost::filesystem::remove(boost::filesystem::path(tmpFile)); + return ret; +} + +void GLViewer::setState(string state){ + string tmpFile=Omega::instance().tmpFilename(); + std::ofstream out(tmpFile.c_str()); + if(!out.good()){ LOG_ERROR("Error opening temp file `"<key()==Qt::Key_A){ toggleAxisIsDrawn(); return; } + else if(e->key()==Qt::Key_Escape){ + if(!isManipulating()){ return; } + else { resetManipulation(); displayMessage("Manipulating scene."); } + } + else if(e->key()==Qt::Key_Space){ + if(manipulatedClipPlane>=0) {displayMessage("Clip plane #"+boost::lexical_cast(manipulatedClipPlane+1)+(renderer->clipPlaneActive[manipulatedClipPlane]?" de":" ")+"activated"); renderer->clipPlaneActive[manipulatedClipPlane]=!renderer->clipPlaneActive[manipulatedClipPlane]; } + else{ centerMedianQuartile(); } + } + // function keys + else if(e->key()==Qt::Key_F1 || e->key()==Qt::Key_F2 || e->key()==Qt::Key_F3 ){ + int n=0; if(e->key()==Qt::Key_F1) n=1; else if(e->key()==Qt::Key_F2) n=2; else if(e->key()==Qt::Key_F3) n=3; assert(n>0); int planeId=n-1; + if(planeId>=renderer->numClipPlanes) return; + //if(planeId!=manipulatedClipPlane) startClipPlaneManipulation(planeId); + } + // numbers + else if(e->key()==Qt::Key_0 && (e->modifiers() & Qt::AltModifier)) { boundClipPlanes.clear(); displayMessage("Cleared bound planes group.");} + else if(e->key()==Qt::Key_1 || e->key()==Qt::Key_2 || e->key()==Qt::Key_3 ){ + int n=0; if(e->key()==Qt::Key_1) n=1; else if(e->key()==Qt::Key_2) n=2; else if(e->key()==Qt::Key_3) n=3; assert(n>0); int planeId=n-1; + if(planeId>=renderer->numClipPlanes) return; // no such clipping plane + if(e->modifiers() & Qt::AltModifier){ + if(boundClipPlanes.count(planeId)==0) {boundClipPlanes.insert(planeId); displayMessage("Added plane #"+boost::lexical_cast(planeId+1)+" to the bound group: "+strBoundGroup());} + else {boundClipPlanes.erase(planeId); displayMessage("Removed plane #"+boost::lexical_cast(planeId+1)+" from the bound group: "+strBoundGroup());} + } + else if(manipulatedClipPlane>=0 && manipulatedClipPlane!=planeId) { + const Quaternionr& o=renderer->clipPlaneSe3[planeId].orientation; + manipulatedFrame()->setOrientation(qglviewer::Quaternion(o.x(),o.y(),o.z(),o.w())); + displayMessage("Copied orientation from plane #1"); + } + } + else if(e->key()==Qt::Key_7 || e->key()==Qt::Key_8 || e->key()==Qt::Key_9){ + int nn=-1; if(e->key()==Qt::Key_7)nn=0; else if(e->key()==Qt::Key_8)nn=1; else if(e->key()==Qt::Key_9)nn=2; assert(nn>=0); size_t n=(size_t)nn; + if(e->modifiers() & Qt::AltModifier) saveDisplayParameters(n); + else useDisplayParameters(n); + } + // letters alphabetically + else if(e->key()==Qt::Key_C && (e->modifiers() & Qt::AltModifier)){ displayMessage("Median centering"); centerMedianQuartile(); } + else if(e->key()==Qt::Key_C){ + // center around selected body + if(selectedName() >= 0 && (*(Omega::instance().getScene()->bodies)).exists(selectedName())) setSceneCenter(manipulatedFrame()->position()); + // make all bodies visible + else centerScene(); + } + else if(e->key()==Qt::Key_D &&(e->modifiers() & Qt::AltModifier)){ Body::id_t id; if((id=Omega::instance().getScene()->selectedBody)>=0){ const shared_ptr& b=Body::byId(id); b->setDynamic(!b->isDynamic()); LOG_INFO("Body #"<isDynamic()?"":"NOT")<<" dynamic"); } } + else if(e->key()==Qt::Key_D) {timeDispMask+=1; if(timeDispMask>(TIME_REAL|TIME_VIRT|TIME_ITER))timeDispMask=0; } + else if(e->key()==Qt::Key_G) { if(e->modifiers() & Qt::ShiftModifier){ drawGrid=0; return; } else drawGrid++; if(drawGrid>=8) drawGrid=0; } + else if (e->key()==Qt::Key_M && selectedName() >= 0){ + if(!(isMoving=!isMoving)){ + displayMessage("Moving done."); + if (last>=0) {Body::byId(Body::id_t(last))->state->blockedDOFs=initBlocked; last=-1;} mouseMovesCamera();} + else{ displayMessage("Moving selected object"); + + long selection = Omega::instance().getScene()->selectedBody; + initBlocked=Body::byId(Body::id_t(selection))->state->blockedDOFs; last=selection; + Body::byId(Body::id_t(selection))->state->blockedDOFs=State::DOF_ALL; + + Rotationr& r = Body::byId(selection)->state->ori; + Quaternionr q = Quaternionr(AngleAxisr(r.angle(),Vector3r::UnitZ())); + Vector2r& v = Body::byId(selection)->state->pos; + manipulatedFrame()->setPositionAndOrientation(qglviewer::Vec(v[0],v[1],0.0),qglviewer::Quaternion(q.x(),q.y(),q.z(),q.w())); + mouseMovesManipulatedFrame();} + } + else if (e->key() == Qt::Key_T) camera()->setType(camera()->type()==qglviewer::Camera::ORTHOGRAPHIC ? qglviewer::Camera::PERSPECTIVE : qglviewer::Camera::ORTHOGRAPHIC); + else if(e->key()==Qt::Key_O) camera()->setFieldOfView(camera()->fieldOfView()*0.9); + else if(e->key()==Qt::Key_P) camera()->setFieldOfView(camera()->fieldOfView()*1.1); + else if(e->key()==Qt::Key_R){ // reverse the clipping plane; revolve around scene center if no clipping plane selected + if(manipulatedClipPlane>=0 && manipulatedClipPlanenumClipPlanes){ + // here, we must update both manipulatedFrame orientation and renderer->clipPlaneSe3 orientation in the same way + Quaternionr& ori=renderer->clipPlaneSe3[manipulatedClipPlane].orientation; + ori=Quaternionr(AngleAxisr(Mathr::PI,Vector3r(0,1,0)))*ori; + manipulatedFrame()->setOrientation(qglviewer::Quaternion(qglviewer::Vec(0,1,0),Mathr::PI)*manipulatedFrame()->orientation()); + displayMessage("Plane #"+boost::lexical_cast(manipulatedClipPlane+1)+" reversed."); + } + else { + camera()->setRevolveAroundPoint(sceneCenter()); + } + } + else if(e->key()==Qt::Key_S){ + LOG_INFO("Saving QGLViewer state to /tmp/qglviewerState.xml"); + setStateFileName("/tmp/qglviewerState.xml"); saveStateToFile(); setStateFileName(QString::null); + } + else if(e->key()==Qt::Key_X || e->key()==Qt::Key_Y || e->key()==Qt::Key_Z){ + int axisIdx=(e->key()==Qt::Key_X?0:(e->key()==Qt::Key_Y?1:2)); + if(manipulatedClipPlane<0){ + qglviewer::Vec up(0,0,0), vDir(0,0,0); + bool alt=(e->modifiers() && Qt::ShiftModifier); + up[axisIdx]=1; vDir[(axisIdx+(alt?2:1))%3]=alt?1:-1; + camera()->setViewDirection(vDir); + camera()->setUpVector(up); + centerMedianQuartile(); + } + else{ // align clipping normal plane with world axis + // x: (0,1,0),pi/2; y: (0,0,1),pi/2; z: (1,0,0),0 + qglviewer::Vec axis(0,0,0); axis[(axisIdx+1)%3]=1; Real angle=axisIdx==2?0:Mathr::PI/2; + manipulatedFrame()->setOrientation(qglviewer::Quaternion(axis,angle)); + } + } + else if(e->key()==Qt::Key_Period) gridSubdivide = !gridSubdivide; + else if(e->key()==Qt::Key_Return){ + if (Omega::instance().isRunning()) Omega::instance().pause(); + else Omega::instance().run(); + LOG_INFO("Running..."); + } +#ifdef SUDODEM_GL2PS + else if(e->key()==Qt::Key_V){ + for(int i=0; ;i++){ + std::ostringstream fss; fss<<"/tmp/sudodem-snapshot-"<key()==Qt::Key_Plus ){ + cut_plane = std::min(1.0, cut_plane + std::pow(10.0,(double)cut_plane_delta)); + static_cast(camera())->setCuttingDistance(cut_plane); + displayMessage("Cut plane: "+boost::lexical_cast(cut_plane)); + }else if( e->key()==Qt::Key_Minus ){ + cut_plane = std::max(0.0, cut_plane - std::pow(10.0,(double)cut_plane_delta)); + static_cast(camera())->setCuttingDistance(cut_plane); + displayMessage("Cut plane: "+boost::lexical_cast(cut_plane)); + }else if( e->key()==Qt::Key_Slash ){ + cut_plane_delta -= 1; + displayMessage("Cut plane increment: 1e"+(cut_plane_delta>0?std::string("+"):std::string(""))+boost::lexical_cast(cut_plane_delta)); + }else if( e->key()==Qt::Key_Asterisk ){ + cut_plane_delta = std::min(1+cut_plane_delta,-1); + displayMessage("Cut plane increment: 1e"+(cut_plane_delta>0?std::string("+"):std::string(""))+boost::lexical_cast(cut_plane_delta)); + } +#endif + + else if(e->key()!=Qt::Key_Escape && e->key()!=Qt::Key_Space) QGLViewer::keyPressEvent(e); +*/ + updateGL(); +} + +/* Center the scene such that periodic cell is contained in the view */ +void GLViewer::centerPeriodic(){ + Scene* scene=Omega::instance().getScene().get(); + assert(scene->isPeriodic); + Vector2r center=.5*scene->cell->getSize(); + Vector2r halfSize=.5*scene->cell->getSize(); + float radius=std::max(halfSize[0],halfSize[1]); + LOG_DEBUG("Periodic scene center="<isPeriodic){ centerPeriodic(); return; } + long nBodies=scene->bodies->size(); + // nBodies +=scene->nodes->size();//including nodes from fem + if(nBodies<4) { + LOG_DEBUG("Less than 4 bodies, median makes no sense; calling centerScene() instead."); + return centerScene(); + } + std::vector coords[2]; + for(int i=0;i<2;i++)coords[i].reserve(nBodies); + FOREACH(shared_ptr b, *scene->bodies){ + if(!b) continue; + for(int i=0; i<2; i++) coords[i].push_back(b->state->pos[i]); + } + /*FOREACH(shared_ptr b, *scene->nodes){ + if(!b) continue; + for(int i=0; i<3; i++) coords[i].push_back(b->pos[i]); + }*/ + Vector2r median,interQuart; + for(int i=0;i<2;i++){ + sort(coords[i].begin(),coords[i].end()); + median[i]=*(coords[i].begin()+nBodies/2); + interQuart[i]=*(coords[i].begin()+2*nBodies/4)-*(coords[i].begin()+nBodies/4);//debug for 2d + } + LOG_DEBUG("Median position is"<isPeriodic){ centerPeriodic(); return; } + LOG_INFO("Select with shift, press 'm' to move."); + Vector2r min,max; + if(not(rb->bound)){ rb->updateBound();} + + min=rb->bound->min; max=rb->bound->max; + bool hasNan=(isnan(min[0])||isnan(min[1])||isnan(max[0])||isnan(max[1])); + Real minDim=std::min(max[0]-min[0],max[1]-min[1]); + if(minDim<=0 || hasNan){ + // Aabb is not yet calculated... + LOG_DEBUG("scene's bound not yet calculated or has zero or nan dimension(s), attempt get that from bodies' positions."); + Real inf=std::numeric_limits::infinity(); + min=Vector2r(inf,inf); max=Vector2r(-inf,-inf); + FOREACH(const shared_ptr& b, *rb->bodies){ + if(!b) continue; + max=max.cwiseMax(b->state->pos); + min=min.cwiseMin(b->state->pos); + } + /* FOREACH(const shared_ptr& n, *rb->nodes){ + if(!n) continue; + max=max.cwiseMax(n->pos); + min=min.cwiseMin(n->pos); + }*/ + if(isinf(min[0])||isinf(min[1])||isinf(max[0])||isinf(max[1])){ LOG_DEBUG("No min/max computed from bodies either, setting cube (-1,-1)×(1,1)"); min=-Vector2r::Ones(); max=Vector2r::Ones(); } + } else {LOG_DEBUG("Using scene's Aabb");} + + LOG_DEBUG("Got scene box min="<=0) { + Body::byId(Body::id_t(last))->state->blockedDOFs=initBlocked; last=-1; Omega::instance().getScene()->selectedBody = -1;} + if(isMoving){ + displayMessage("Moving finished"); mouseMovesCamera(); isMoving=false; + Omega::instance().getScene()->selectedBody = -1; + } + return; + } + if(selection>=0 && (*(Omega::instance().getScene()->bodies)).exists(selection)){ + resetManipulation(); + if (last>=0) {Body::byId(Body::id_t(last))->state->blockedDOFs=initBlocked; last=-1;} + if(Body::byId(Body::id_t(selection))->isClumpMember()){ // select clump (invisible) instead of its member + LOG_DEBUG("Clump member #"<clumpId; + } + + setSelectedName(selection); + LOG_DEBUG("New selection "<(selection)+(Body::byId(selection)->isClump()?" (clump)":"")); + Omega::instance().getScene()->selectedBody = selection; + PyGILState_STATE gstate; + gstate = PyGILState_Ensure(); + boost::python::object main=boost::python::import("__main__"); + boost::python::object global=main.attr("__dict__"); + // the try/catch block must be properly nested inside PyGILState_Ensure and PyGILState_Release + try{ + boost::python::eval(string("onBodySelect("+boost::lexical_cast(selection)+")").c_str(),global,global); + } catch (boost::python::error_already_set const &) { + LOG_DEBUG("unable to call onBodySelect. Not defined?"); + } + PyGILState_Release(gstate); + // see https://svn.boost.org/trac/boost/ticket/2781 for exception handling + } +} + +// maybe new object will be selected. +// if so, then set isDynamic of previous selection, to old value +void GLViewer::endSelection(const QPoint &point){ + manipulatedClipPlane=-1; + QGLViewer::endSelection(point); +} + +string GLViewer::getRealTimeString(){ + ostringstream oss; + boost::posix_time::time_duration t=Omega::instance().getRealTime_duration(); + unsigned d=t.hours()/24,h=t.hours()%24,m=t.minutes(),s=t.seconds(); + oss<<"clock "; + if(d>0) oss<0) oss<<_W2< +#include +#include +#include +#endif + +#include +#include +#include + +#include + +using std::setw; +using std::setfill; +using std::setprecision; + +/*! Class handling user interaction with the openGL rendering of simulation. + * + * Clipping planes: + * ================ + * + * Clipping plane is manipulated after hitting F1, F2, .... To end the manipulation, press Escape. + * + * Keystrokes during clipping plane manipulation: + * * space activates/deactives the clipping plane + * * x,y,z aligns the plane with yz, xz, xy planes + * * left-double-click aligns the plane with world coordinates system (canonical planes + 45˚ interpositions) + * * 1,2,... will align the current plane with #1, #2, ... (same orientation) + * * r reverses the plane (normal*=-1)a + * + * Keystrokes that work regardless of whether a clipping plane is being manipulated: + * * Alt-1,Alt-2,... adds/removes the respective plane to bound group: + * mutual positions+orientations of planes in the group are maintained when one of those planes is manipulated + * + * Clip plane number is 3; change SUDODEM_RENDERER_NUM_CLIP_PLANE, complete switches "|| ..." in keyPressEvent + * and recompile to have more. + */ +class GLViewer : public QGLViewer +{ + Q_OBJECT + + friend class QGLThread; + protected: + shared_ptr renderer; + + private : + + bool isMoving; + bool wasDynamic; + float cut_plane; + int cut_plane_delta; + bool gridSubdivide; + long last; + int manipulatedClipPlane; + set boundClipPlanes; + shared_ptr xyPlaneConstraint; + string strBoundGroup(){string ret;FOREACH(int i, boundClipPlanes) ret+=" "+boost::lexical_cast(i+1);return ret;} + boost::posix_time::ptime last_user_event; + + public: + //virtual void updateGL(void); + + const int viewId; + + void centerMedianQuartile(); + int drawGrid; + bool drawScale; + int timeDispMask; + enum{TIME_REAL=1,TIME_VIRT=2,TIME_ITER=4}; + + GLViewer(int viewId, const shared_ptr& renderer, QGLWidget* shareWidget=0); + virtual ~GLViewer(); + #if 0 + virtual void paintGL(); + #endif + virtual void draw(); + virtual void drawWithNames(); + void displayMessage(const std::string& s){ QGLViewer::displayMessage(QString(s.c_str()));} + void centerScene(); + void centerPeriodic(); + void mouseMovesCamera(); + void mouseMovesManipulatedFrame(qglviewer::Constraint* c=NULL); + void resetManipulation(); + bool isManipulating(); + void startClipPlaneManipulation(int planeNo); + //! get QGLViewer state as string (XML); QGLViewer normally only supports saving state to file. + string getState(); + //! set QGLViewer state from string (XML); QGLVIewer normally only supports loading state from file. + void setState(string); + //! Load display parameters (QGLViewer and OpenGLRenderer) from Scene::dispParams[n] and use them + void useDisplayParameters(size_t n); + //! Save display parameters (QGOViewer and OpenGLRenderer) to Scene::dispParams[n] + void saveDisplayParameters(size_t n); + //! Get radius of the part of scene that fits the current view + float displayedSceneRadius(); + //! Get center of the part of scene that fits the current view + qglviewer::Vec displayedSceneCenter(); + + //! Adds our attributes to the QGLViewer state that can be saved + QDomElement domElement(const QString& name, QDomDocument& document) const; + //! Adds our attributes to the QGLViewer state that can be restored + void initFromDOMElement(const QDomElement& element); + + // if defined, snapshot will be saved to this file right after being drawn and the string will be reset. + // this way the caller will be notified of the frame being saved successfully. + string nextFrameSnapshotFilename; + #ifdef SUDODEM_GL2PS + // output stream for gl2ps; initialized as needed + FILE* gl2psStream; + #endif + + boost::posix_time::ptime getLastUserEvent(); + + + DECLARE_LOGGER; + protected : + virtual void keyPressEvent(QKeyEvent *e); + virtual void postDraw(); + // overridden in the player that doesn't get time from system clock but from the db + virtual string getRealTimeString(); + virtual void closeEvent(QCloseEvent *e); + virtual void postSelection(const QPoint& point); + virtual void endSelection(const QPoint &point); + virtual void mouseDoubleClickEvent(QMouseEvent *e); + virtual void wheelEvent(QWheelEvent* e); + virtual void mouseMoveEvent(QMouseEvent *e); + virtual void mousePressEvent(QMouseEvent *e); +}; + +/*! Get unconditional lock on a GL view. + +Use if you need to manipulate GL context in some way. +The ctor doesn't return until the lock has been acquired +and the lock is released when the GLLock object is desctructed; +*/ +class GLLock: public boost::try_mutex::scoped_lock{ + GLViewer* glv; + public: + GLLock(GLViewer* _glv); + ~GLLock(); +}; + + +class SudoDEMCamera : public qglviewer::Camera +{ + Q_OBJECT + private: + float cuttingDistance; + public : + SudoDEMCamera():cuttingDistance(0){}; + float zNear() const; + virtual void setCuttingDistance(float s){cuttingDistance=s;}; +}; + + + diff --git a/SudoDEM2D/gui/qt4/GLViewerDisplay.cpp b/SudoDEM2D/gui/qt4/GLViewerDisplay.cpp new file mode 100644 index 0000000..4248773 --- /dev/null +++ b/SudoDEM2D/gui/qt4/GLViewerDisplay.cpp @@ -0,0 +1,281 @@ +/************************************************************************* +* Copyright (C) 2004 by Olivier Galizzi * +* olivier.galizzi@imag.fr * +* Copyright (C) 2005 by Janek Kozicki * +* cosurgi@berlios.de * +* * +* This program is free software; it is licensed under the terms of the * +* GNU General Public License v2 or later. See file LICENSE for details. * +*************************************************************************/ + +#include"GLViewer.hpp" +#include"OpenGLManager.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +#ifdef SUDODEM_GL2PS + #include +#endif + +static int last(-1); + +void GLViewer::useDisplayParameters(size_t n){ + LOG_DEBUG("Loading display parameters from #"< >& dispParams=Omega::instance().getScene()->dispParams; + if(dispParams.size()<=(size_t)n){ throw std::invalid_argument(("Display parameters #"+boost::lexical_cast(n)+" don't exist (number of entries "+boost::lexical_cast(dispParams.size())+")").c_str());; return;} + const shared_ptr& dp=dispParams[n]; + string val; + if(dp->getValue("OpenGLRenderer",val)){ istringstream oglre(val); + sudodem::ObjectIO::load(oglre,"renderer",renderer); + } + else { LOG_WARN("OpenGLRenderer configuration not found in display parameters, skipped.");} + if(dp->getValue("GLViewer",val)){ GLViewer::setState(val); displayMessage("Loaded view configuration #"+boost::lexical_cast(n)); } + else { LOG_WARN("GLViewer configuration not found in display parameters, skipped."); } +} + +void GLViewer::saveDisplayParameters(size_t n){ + LOG_DEBUG("Saving display parameters to #"< >& dispParams=Omega::instance().getScene()->dispParams; + if(dispParams.size()<=n){while(dispParams.size()<=n) dispParams.push_back(shared_ptr(new DisplayParameters));} assert(n& dp=dispParams[n]; + ostringstream oglre; + sudodem::ObjectIO::save(oglre,"renderer",renderer); + dp->setValue("OpenGLRenderer",oglre.str()); + dp->setValue("GLViewer",GLViewer::getState()); + displayMessage("Saved view configuration ot #"+boost::lexical_cast(n)); +} + +void GLViewer::draw() +{ +#ifdef SUDODEM_GL2PS + if(!nextFrameSnapshotFilename.empty() && boost::algorithm::ends_with(nextFrameSnapshotFilename,".pdf")){ + gl2psStream=fopen(nextFrameSnapshotFilename.c_str(),"wb"); + if(!gl2psStream){ int err=errno; throw runtime_error(string("Error opening file ")+nextFrameSnapshotFilename+": "+strerror(err)); } + LOG_DEBUG("Start saving snapshot to "<bodies->size(); + int sortAlgo=(nBodies<100 ? GL2PS_BSP_SORT : GL2PS_SIMPLE_SORT); + gl2psBeginPage(/*const char *title*/"Some title", /*const char *producer*/ "SudoDEM", + /*GLint viewport[4]*/ NULL, + /*GLint format*/ GL2PS_PDF, /*GLint sort*/ sortAlgo, /*GLint options*/GL2PS_SIMPLE_LINE_OFFSET|GL2PS_USE_CURRENT_VIEWPORT|GL2PS_TIGHT_BOUNDING_BOX|GL2PS_COMPRESS|GL2PS_OCCLUSION_CULL|GL2PS_NO_BLENDING, + /*GLint colormode*/ GL_RGBA, /*GLint colorsize*/0, + /*GL2PSrgba *colortable*/NULL, + /*GLint nr*/0, /*GLint ng*/0, /*GLint nb*/0, + /*GLint buffersize*/4096*4096 /* 16MB */, /*FILE *stream*/ gl2psStream, + /*const char *filename*/NULL); + } +#endif + + qglviewer::Vec vd=camera()->viewDirection(); renderer->viewDirection=Vector2r(vd[0],vd[1]); + if(Omega::instance().getScene()){ + const shared_ptr& scene=Omega::instance().getScene(); + int selection = selectedName(); + if(selection!=-1 && (*(Omega::instance().getScene()->bodies)).exists(selection) && isMoving){ + static Real lastTimeMoved(0); + qreal v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);//zhswee + if(last == selection) // delay by one redraw, so the body will not jump into 0,0,0 coords + { + Rotationr& r = (*(Omega::instance().getScene()->bodies))[selection]->state->ori; + Vector2r& v = (*(Omega::instance().getScene()->bodies))[selection]->state->pos; + Vector2r& vel = (*(Omega::instance().getScene()->bodies))[selection]->state->vel; + Real& angVel = (*(Omega::instance().getScene()->bodies))[selection]->state->angVel; + angVel=0.0; + Real dt=(scene->time-lastTimeMoved); lastTimeMoved=scene->time; + if (dt!=0) { vel[0]=-(v[0]-v0)/dt; vel[1]=-(v[1]-v1)/dt;} + else vel[0]=vel[1]=0; + //FIXME: should update spin like velocity above, when the body is rotated: + Quaternionr q = Quaternionr(AngleAxisr(r.angle(),Vector3r::UnitZ())); + double q0,q1,q2,q3; manipulatedFrame()->getOrientation(q0,q1,q2,q3); q.x()=q0;q.y()=q1;q.z()=q2;q.w()=q3; + } + (*(Omega::instance().getScene()->bodies))[selection]->userForcedDisplacementRedrawHook(); + } + /*if(manipulatedClipPlane>=0){ + assert(manipulatedClipPlanenumClipPlanes); + qreal v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);//zhswee + double q0,q1,q2,q3; manipulatedFrame()->getOrientation(q0,q1,q2,q3); + AngleAxisr aa = Quaternionr(q0,q1,q2,q3); + Se2r newSe2(Vector2r(v0,v1),Rotationr(aa.angle())); newSe2.rotation.normalize(); + const Se3r& oldSe3=renderer->clipPlaneSe3[manipulatedClipPlane]; + FOREACH(int planeId, boundClipPlanes){ + if(planeId>=renderer->numClipPlanes || !renderer->clipPlaneActive[planeId] || planeId==manipulatedClipPlane) continue; + Se3r& boundSe3=renderer->clipPlaneSe3[planeId]; + Quaternionr relOrient=oldSe3.orientation.conjugate()*boundSe3.orientation; relOrient.normalize(); + Vector3r relPos=oldSe3.orientation.conjugate()*(boundSe3.position-oldSe3.position); + boundSe3.position=newSe3.position+newSe3.orientation*relPos; + boundSe3.orientation=newSe3.orientation*relOrient; + boundSe3.orientation.normalize(); + } + renderer->clipPlaneSe3[manipulatedClipPlane]=newSe3; + }*/ + scene->renderer=renderer; + renderer->render(scene, selectedName()); + } +} + +void GLViewer::drawWithNames(){ + qglviewer::Vec vd=camera()->viewDirection(); renderer->viewDirection=Vector2r(vd[0],vd[1]); + const shared_ptr scene(Omega::instance().getScene()); + scene->renderer=renderer; + renderer->scene=scene; + renderer->renderShape(); +} + + +qglviewer::Vec GLViewer::displayedSceneCenter(){ + return camera()->unprojectedCoordinatesOf(qglviewer::Vec(width()/2 /* pixels */ ,height()/2 /* pixels */, /*middle between near plane and far plane*/ .5)); +} + +float GLViewer::displayedSceneRadius(){ + return (camera()->unprojectedCoordinatesOf(qglviewer::Vec(width()/2,height()/2,.5))-camera()->unprojectedCoordinatesOf(qglviewer::Vec(0,0,.5))).norm(); +} + +void GLViewer::postDraw(){ + Real wholeDiameter=QGLViewer::camera()->sceneRadius()*2; + + renderer->viewInfo.sceneRadius=QGLViewer::camera()->sceneRadius(); + qglviewer::Vec c=QGLViewer::camera()->sceneCenter(); + renderer->viewInfo.sceneCenter=Vector3r(c[0],c[1],c[2]); + + Real dispDiameter=min(wholeDiameter,max((Real)displayedSceneRadius()*2,wholeDiameter/1e3)); // limit to avoid drawing 1e5 lines with big zoom level + //qglviewer::Vec center=QGLViewer::camera()->sceneCenter(); + Real gridStep=pow(10,(floor(log10(dispDiameter)-.7))); + Real scaleStep=pow(10,(floor(log10(displayedSceneRadius()*2)-.7))); // unconstrained + int nSegments=((int)(wholeDiameter/gridStep))+1; + Real realSize=nSegments*gridStep; + //LOG_TRACE("nSegments="<projectedCoordinatesOf(center+delta)-camera()->projectedCoordinatesOf(center); + for(int xy=0;xy<2;xy++)extremalDxDy[xy]=(axis>0 ? min(extremalDxDy[xy],(int)screenDxDy[axis][xy]) : screenDxDy[axis][xy]); + } + //LOG_DEBUG("Screen offsets for axes: "<<" x("<=0){ + for(int planeId=0; planeIdnumClipPlanes; planeId++){ + if(!renderer->clipPlaneActive[planeId] && planeId!=manipulatedClipPlane) continue; + glPushMatrix(); + const Se3r& se3=renderer->clipPlaneSe3[planeId]; + AngleAxisr aa(se3.orientation); + glTranslatef(se3.position[0],se3.position[1],se3.position[2]); + glRotated(aa.angle()*Mathr::RAD_TO_DEG,aa.axis()[0],aa.axis()[1],aa.axis()[2]); + Real cff=1; + if(!renderer->clipPlaneActive[planeId]) cff=.4; + glColor3f(max((Real)0.,cff*cos(planeId)),max((Real)0.,cff*sin(planeId)),planeId==manipulatedClipPlane); // variable colors + QGLViewer::drawGrid(realSize,2*nSegments); + drawArrow(wholeDiameter/6); + glPopMatrix(); + } + }*/ + + Scene* rb=Omega::instance().getScene().get(); + #define _W3 setw(3)<time; + unsigned min=((unsigned)t/60),sec=(((unsigned)t)%60),msec=((unsigned)(1e3*t))%1000,usec=((unsigned long)(1e6*t))%1000,nsec=((unsigned long)(1e9*t))%1000; + if(min>0) oss<<_W2<0) oss<<_W2<0) oss<<_W3<0) oss<<_W3<iter; + if(rb->stopAtIter>rb->iter) oss<<" ("<iter)/rb->stopAtIter<<"%)"; + QGLViewer::drawText(x,y,oss.str().c_str()); + y-=lineHt; + } + if(drawGrid){ + glColor3v(Vector3r(1,1,0)); + ostringstream oss; + oss<<"grid: "< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef SUDODEM_GL2PS + #include +#endif + +void GLViewer::mouseMovesCamera(){ + setWheelBinding(Qt::ShiftModifier , FRAME, ZOOM); + setWheelBinding(Qt::NoModifier, CAMERA, ZOOM); + //cout<<"mouse moves camera"<=0x020500 + setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, SELECT); + + setMouseBinding(Qt::ShiftModifier, Qt::LeftButton, FRAME, ZOOM); + setMouseBinding(Qt::ShiftModifier, Qt::RightButton, FRAME, ZOOM); + setMouseBinding(Qt::ShiftModifier, Qt::MidButton, FRAME, TRANSLATE); + setMouseBinding(Qt::ShiftModifier, Qt::RightButton, FRAME, NO_MOUSE_ACTION);//ROTATE + + setMouseBinding(Qt::NoModifier, Qt::RightButton, CAMERA, ZOOM); + setMouseBinding(Qt::NoModifier, Qt::MidButton, CAMERA, ZOOM); + setMouseBinding(Qt::NoModifier, Qt::LeftButton, CAMERA, TRANSLATE);//ROTATE + setMouseBinding(Qt::NoModifier, Qt::RightButton, CAMERA, TRANSLATE); +#else + setMouseBinding(Qt::SHIFT + Qt::LeftButton, SELECT); + setMouseBinding(Qt::SHIFT + Qt::LeftButton + Qt::RightButton, FRAME, ZOOM); + setMouseBinding(Qt::SHIFT + Qt::MidButton, FRAME, TRANSLATE); + setMouseBinding(Qt::SHIFT + Qt::RightButton, FRAME, ROTATE); + cout<<"QGLViewer < 2.5"<frame()->setWheelSensitivity(-1.0f); +#endif +}; + +void GLViewer::mouseMovesManipulatedFrame(qglviewer::Constraint* c){ + setMouseBinding(Qt::LeftButton + Qt::RightButton, FRAME, ZOOM); + setMouseBinding(Qt::MidButton, FRAME, ZOOM); + setMouseBinding(Qt::LeftButton, FRAME, TRANSLATE); + setMouseBinding(Qt::RightButton, FRAME, TRANSLATE); + setWheelBinding(Qt::NoModifier , FRAME, ZOOM); + manipulatedFrame()->setConstraint(c); +} + + +void GLViewer::mouseMoveEvent(QMouseEvent *e){ + last_user_event = boost::posix_time::second_clock::local_time(); + QGLViewer::mouseMoveEvent(e); +} + +void GLViewer::mousePressEvent(QMouseEvent *e){ + last_user_event = boost::posix_time::second_clock::local_time(); + QGLViewer::mousePressEvent(e); +} + +/* Handle double-click event; if clipping plane is manipulated, align it with the global coordinate system. + * Otherwise pass the event to QGLViewer to handle it normally. + * + * mostly copied over from ManipulatedFrame::mouseDoubleClickEvent + */ +void GLViewer::mouseDoubleClickEvent(QMouseEvent *event){ + last_user_event = boost::posix_time::second_clock::local_time(); + + if(manipulatedClipPlane<0) { /* LOG_DEBUG("Double click not on clipping plane"); */ QGLViewer::mouseDoubleClickEvent(event); return; } +#if QT_VERSION >= 0x040000 + if (event->modifiers() == Qt::NoModifier) +#else + if (event->state() == Qt::NoButton) +#endif + switch (event->button()){ + case Qt::LeftButton: manipulatedFrame()->alignWithFrame(NULL,true); LOG_DEBUG("Aligning cutting plane"); break; + default: break; // avoid warning + } +} + +void GLViewer::wheelEvent(QWheelEvent* event){ + last_user_event = boost::posix_time::second_clock::local_time(); + + if(manipulatedClipPlane<0){ QGLViewer::wheelEvent(event); return; } + /*assert(manipulatedClipPlanenumClipPlanes); + float distStep=1e-3*sceneRadius(); + float dist=event->delta()*manipulatedFrame()->wheelSensitivity()*distStep; + Vector3r normal=renderer->clipPlaneSe3[manipulatedClipPlane].orientation*Vector3r(0,0,1); + qglviewer::Vec newPos=manipulatedFrame()->position()+qglviewer::Vec(normal[0],normal[1],normal[2])*dist; + manipulatedFrame()->setPosition(newPos); + renderer->clipPlaneSe3[manipulatedClipPlane].position=Vector3r(newPos[0],newPos[1],newPos[2]); + */ + updateGL(); + /* in draw, bound cutting planes will be moved as well */ +} diff --git a/SudoDEM2D/gui/qt4/Inspector.py b/SudoDEM2D/gui/qt4/Inspector.py new file mode 100644 index 0000000..ebc9649 --- /dev/null +++ b/SudoDEM2D/gui/qt4/Inspector.py @@ -0,0 +1,285 @@ +# encoding: utf-8 + +from PyQt4.QtCore import * +from PyQt4.QtGui import * +from sudodem import * +from sudodem.qt.SerializableEditor import * +import sudodem.qt + + +class EngineInspector(QWidget): + def __init__(self,parent=None): + QWidget.__init__(self,parent) + grid=QGridLayout(self); grid.setSpacing(0); grid.setMargin(0) + self.serEd=SeqSerializable(parent=None,getter=lambda:O.engines,setter=lambda x:setattr(O,'engines',x),serType=Engine,path='O.engines') + grid.addWidget(self.serEd) + self.setLayout(grid) +#class MaterialsInspector(QWidget): +# def __init__(self,parent=None): +# QWidget.__init__(self,parent) +# grid=QGridLayout(self); grid.setSpacing(0); grid.setMargin(0) +# self.serEd=SeqSerializable(parent=None,getter=lambda:O.materials,setter=lambda x:setattr(O,'materials',x),serType=Engine) +# grid.addWidget(self.serEd) +# self.setLayout(grid) + +class CellInspector(QWidget): + def __init__(self,parent=None): + QWidget.__init__(self,parent) + self.layout=QVBoxLayout(self) #; self.layout.setSpacing(0); self.layout.setMargin(0) + self.periCheckBox=QCheckBox('periodic boundary',self) + self.periCheckBox.clicked.connect(self.update) + self.layout.addWidget(self.periCheckBox) + self.scroll=QScrollArea(self); self.scroll.setWidgetResizable(True) + self.layout.addWidget(self.scroll) + self.setLayout(self.layout) + self.refresh() + self.refreshTimer=QTimer(self) + self.refreshTimer.timeout.connect(self.refresh) + self.refreshTimer.start(1000) + def refresh(self): + self.periCheckBox.setChecked(O.periodic) + editor=self.scroll.widget() + if not O.periodic and editor: self.scroll.takeWidget() + if (O.periodic and not editor) or (editor and editor.ser!=O.cell): + self.scroll.setWidget(SerializableEditor(O.cell,parent=self,showType=True,path='O.cell')) + def update(self): + self.scroll.takeWidget() # do this before changing periodicity, otherwise the SerializableEditor will raise exception about None object + O.periodic=self.periCheckBox.isChecked() + self.refresh() + + + +def makeBodyLabel(b): + ret=unicode(b.id)+u' ' + if not b.shape: ret+=u'⬚' + else: + typeMap={'Disk':u'⚫','Facet':u'△','Wall':u'┃','Box':u'⎕','Cylinder':u'⌭','ChainedCylinder':u'☡','Clump':u'☍'} + ret+=typeMap.get(b.shape.__class__.__name__,u'﹖') + if not b.dynamic: ret+=u'⚓' + elif b.state.blockedDOFs: ret+=u'⎈' + return ret + +def getBodyIdFromLabel(label): + try: + return int(unicode(label).split()[0]) + except ValueError: + print 'Error with label:',unicode(label) + return -1 + +class BodyInspector(QWidget): + def __init__(self,bodyId=-1,parent=None,bodyLinkCallback=None,intrLinkCallback=None): + QWidget.__init__(self,parent) + v=sudodem.qt.views() + self.bodyId=bodyId + if bodyId<0 and len(v)>0 and v[0].selection>0: self.bodyId=v[0].selection + self.idGlSync=self.bodyId + self.bodyLinkCallback,self.intrLinkCallback=bodyLinkCallback,intrLinkCallback + self.bodyIdBox=QSpinBox(self) + self.bodyIdBox.setMinimum(0) + self.bodyIdBox.setMaximum(100000000) + self.bodyIdBox.setValue(self.bodyId) + self.intrWithCombo=QComboBox(self); + self.gotoBodyButton=QPushButton(u'→ #',self) + self.gotoIntrButton=QPushButton(u'→ #+#',self) + # id selector + topBoxWidget=QWidget(self); topBox=QHBoxLayout(topBoxWidget); topBox.setMargin(0); #topBox.setSpacing(0); + hashLabel=QLabel('#',self); hashLabel.setFixedWidth(8) + topBox.addWidget(hashLabel) + topBox.addWidget(self.bodyIdBox) + self.plusLabel=QLabel('+',self); topBox.addWidget(self.plusLabel) + hashLabel2=QLabel('#',self); hashLabel2.setFixedWidth(8); topBox.addWidget(hashLabel2) + topBox.addWidget(self.intrWithCombo) + topBox.addStretch() + topBox.addWidget(self.gotoBodyButton) + topBox.addWidget(self.gotoIntrButton) + topBoxWidget.setLayout(topBox) + # forces display + forcesWidget=QFrame(self); forcesWidget.setFrameShape(QFrame.Box); self.forceGrid=QGridLayout(forcesWidget); + self.forceGrid.setVerticalSpacing(0); self.forceGrid.setHorizontalSpacing(9); self.forceGrid.setMargin(4); + for i,j in itertools.product((0,1,2,3),(-1,0,1,2)): + lab=QLabel(''+('force','torque','move','rot')[i]+'' if j==-1 else ''); self.forceGrid.addWidget(lab,i,j+1); + if j>=0: lab.setAlignment(Qt.AlignRight) + if i>1: lab.hide() # do not show forced moves and rotations by default (they will appear if non-zero) + self.showMovRot=False + # + self.grid=QGridLayout(self); self.grid.setSpacing(0); self.grid.setMargin(0) + self.grid.addWidget(topBoxWidget) + self.grid.addWidget(forcesWidget) + self.scroll=QScrollArea(self) + self.scroll.setWidgetResizable(True) + self.grid.addWidget(self.scroll) + self.tryShowBody() + self.bodyIdBox.valueChanged.connect(self.bodyIdSlot) + self.gotoBodyButton.clicked.connect(self.gotoBodySlot) + self.gotoIntrButton.clicked.connect(self.gotoIntrSlot) + self.refreshTimer=QTimer(self) + self.refreshTimer.timeout.connect(self.refreshEvent) + self.refreshTimer.start(1000) + self.intrWithCombo.addItems(['0']); self.intrWithCombo.setCurrentIndex(0); + self.intrWithCombo.setMinimumWidth(80) + self.setWindowTitle('Body #%d'%self.bodyId) + self.gotoBodySlot() + def displayForces(self): + if self.bodyId<0: return + try: + val=[O.forces.f(self.bodyId),O.forces.t(self.bodyId),O.forces.move(self.bodyId),O.forces.rot(self.bodyId)] + hasMovRot=(val[2]!=Vector3.Zero or val[3]!=Vector3.Zero) + if hasMovRot!=self.showMovRot: + for i,j in itertools.product((2,3),(-1,0,1,2)): + if hasMovRot: self.forceGrid.itemAtPosition(i,j+1).widget().show() + else: self.forceGrid.itemAtPosition(i,j+1).widget().hide() + self.showMovRot=hasMovRot + rows=((0,1,2,3) if hasMovRot else (0,1)) + for i,j in itertools.product(rows,(0,1,2)): + self.forceGrid.itemAtPosition(i,j+1).widget().setText(''+str(val[i][j])+'') + except IndexError:pass + def tryShowBody(self): + try: + b=O.bodies[self.bodyId] + self.serEd=SerializableEditor(b,showType=True,parent=self,path='O.bodies[%d]'%self.bodyId) + except IndexError: + self.serEd=QFrame(self) + self.bodyId=-1 + self.scroll.setWidget(self.serEd) + def changeIdSlot(self,newId): + self.bodyIdBox.setValue(newId); + self.bodyIdSlot() + def bodyIdSlot(self): + self.bodyId=self.bodyIdBox.value() + self.tryShowBody() + self.setWindowTitle('Body #%d'%self.bodyId) + self.refreshEvent() + def gotoBodySlot(self): + try: + id=int(getBodyIdFromLabel(self.intrWithCombo.currentText())) + except ValueError: return # empty id + if not self.bodyLinkCallback: + self.bodyIdBox.setValue(id); self.bodyId=id + else: self.bodyLinkCallback(id) + def gotoIntrSlot(self): + ids=self.bodyIdBox.value(),getBodyIdFromLabel(self.intrWithCombo.currentText()) + if not self.intrLinkCallback: + self.ii=InteractionInspector(ids) + self.ii.show() + else: self.intrLinkCallback(ids) + def refreshEvent(self): + try: O.bodies[self.bodyId] + except: self.bodyId=-1 # invalidate deleted body + # no body shown yet, try to get the first one... + if self.bodyId<0 and len(O.bodies)>0: + try: + print 'SET ZERO' + b=O.bodies[0]; self.bodyIdBox.setValue(0) + except IndexError: pass + v=sudodem.qt.views() + if len(v)>0 and v[0].selection!=self.bodyId: + if self.idGlSync==self.bodyId: # changed in the viewer, reset ourselves + self.bodyId=self.idGlSync=v[0].selection; self.changeIdSlot(self.bodyId) + return + else: v[0].selection=self.idGlSync=self.bodyId # changed here, set in the viewer + meId=self.bodyIdBox.value(); pos=self.intrWithCombo.currentIndex() + try: + meLabel=makeBodyLabel(O.bodies[meId]) + except IndexError: meLabel=u'…' + self.plusLabel.setText(' '.join(meLabel.split()[1:])+' +') # do not repeat the id + self.bodyIdBox.setMaximum(len(O.bodies)-1) + others=[(i.id1 if i.id1!=meId else i.id2) for i in O.interactions.withBody(self.bodyIdBox.value()) if i.isReal] + others.sort() + self.intrWithCombo.clear() + self.intrWithCombo.addItems([makeBodyLabel(O.bodies[i]) for i in others]) + if pos>self.intrWithCombo.count() or pos<0: pos=0 + self.intrWithCombo.setCurrentIndex(pos); + other=self.intrWithCombo.itemText(pos) + if other=='': + self.gotoBodyButton.setEnabled(False); self.gotoIntrButton.setEnabled(False) + other=u'∅' + else: + self.gotoBodyButton.setEnabled(True); self.gotoIntrButton.setEnabled(True) + self.gotoBodyButton.setText(u'→ %s'%other) + self.gotoIntrButton.setText(u'→ %s + %s'%(meLabel,other)) + self.displayForces() + +class InteractionInspector(QWidget): + def __init__(self,ids=None,parent=None,bodyLinkCallback=None): + QWidget.__init__(self,parent) + self.bodyLinkCallback=bodyLinkCallback + self.ids=ids + self.gotoId1Button=QPushButton(u'#…',self) + self.gotoId2Button=QPushButton(u'#…',self) + self.gotoId1Button.clicked.connect(self.gotoId1Slot) + self.gotoId2Button.clicked.connect(self.gotoId2Slot) + topBoxWidget=QWidget(self) + topBox=QHBoxLayout(topBoxWidget) + topBox.addWidget(self.gotoId1Button) + labelPlus=QLabel('+',self); labelPlus.setAlignment(Qt.AlignHCenter) + topBox.addWidget(labelPlus) + topBox.addWidget(self.gotoId2Button) + topBoxWidget.setLayout(topBox) + self.setWindowTitle(u'No interaction') + self.grid=QGridLayout(self); self.grid.setSpacing(0); self.grid.setMargin(0) + self.grid.addWidget(topBoxWidget,0,0) + self.scroll=QScrollArea(self) + self.scroll.setWidgetResizable(True) + self.grid.addWidget(self.scroll) + self.refreshTimer=QTimer(self) + self.refreshTimer.timeout.connect(self.refreshEvent) + self.refreshTimer.start(1000) + if self.ids: self.setupInteraction() + def setupInteraction(self): + try: + intr=O.interactions[self.ids[0],self.ids[1]] + self.serEd=SerializableEditor(intr,showType=True,parent=self.scroll,path='O.interactions[%d,%d]'%(self.ids[0],self.ids[1])) + self.scroll.setWidget(self.serEd) + self.gotoId1Button.setText('#'+makeBodyLabel(O.bodies[self.ids[0]])) + self.gotoId2Button.setText('#'+makeBodyLabel(O.bodies[self.ids[1]])) + self.setWindowTitle('Interaction #%d + #%d'%(self.ids[0],self.ids[1])) + except IndexError: + if self.ids: # reset view (there was an interaction) + self.ids=None + self.serEd=QFrame(self.scroll); self.scroll.setWidget(self.serEd) + self.setWindowTitle('No interaction') + self.gotoId1Button.setText(u'#…'); self.gotoId2Button.setText(u'#…'); + def gotoId(self,bodyId): + if self.bodyLinkCallback: self.bodyLinkCallback(bodyId) + else: self.bi=BodyInspector(bodyId); self.bi.show() + def gotoId1Slot(self): self.gotoId(self.ids[0]) + def gotoId2Slot(self): self.gotoId(self.ids[1]) + def refreshEvent(self): + # no ids yet -- try getting the first interaction, if it exists + if not self.ids: + try: + i=O.interactions.nth(0) + self.ids=i.id1,i.id2 + self.setupInteraction() + return + except IndexError: return # no interaction exists at all + try: # try to fetch an existing interaction + O.interactions[self.ids[0],self.ids[1]] + except IndexError: + self.ids=None + +class SimulationInspector(QWidget): + def __init__(self,parent=None): + QWidget.__init__(self,parent) + self.setWindowTitle("Simulation Inspection") + self.tabWidget=QTabWidget(self) + + self.engineInspector=EngineInspector(parent=None) + self.bodyInspector=BodyInspector(parent=None,intrLinkCallback=self.changeIntrIds) + self.intrInspector=InteractionInspector(parent=None,bodyLinkCallback=self.changeBodyId) + self.cellInspector=CellInspector(parent=None) + + for i,name,widget in [(0,'Engines',self.engineInspector),(1,'Bodies',self.bodyInspector),(2,'Interactions',self.intrInspector),(3,'Cell',self.cellInspector)]: + self.tabWidget.addTab(widget,name) + grid=QGridLayout(self); grid.setSpacing(0); grid.setMargin(0) + grid.addWidget(self.tabWidget) + self.setLayout(grid) + def changeIntrIds(self,ids): + self.tabWidget.removeTab(2); self.intrInspector.close() + self.intrInspector=InteractionInspector(ids=ids,parent=None,bodyLinkCallback=self.changeBodyId) + self.tabWidget.insertTab(2,self.intrInspector,'Interactions') + self.tabWidget.setCurrentIndex(2) + def changeBodyId(self,id): + self.bodyInspector.changeIdSlot(id) + self.tabWidget.setCurrentIndex(1) + diff --git a/SudoDEM2D/gui/qt4/OpenGLManager.cpp b/SudoDEM2D/gui/qt4/OpenGLManager.cpp new file mode 100644 index 0000000..29f8881 --- /dev/null +++ b/SudoDEM2D/gui/qt4/OpenGLManager.cpp @@ -0,0 +1,76 @@ +#include"OpenGLManager.hpp" + +CREATE_LOGGER(OpenGLManager); + +OpenGLManager* OpenGLManager::self=NULL; + +OpenGLManager::OpenGLManager(QObject* parent): QObject(parent){ + if(self) throw runtime_error("OpenGLManager instance already exists, uses OpenGLManager::self to retrieve it."); + self=this; + renderer=shared_ptr(new OpenGLRenderer); + renderer->init(); + connect(this,SIGNAL(createView()),this,SLOT(createViewSlot())); + connect(this,SIGNAL(resizeView(int,int,int)),this,SLOT(resizeViewSlot(int,int,int))); + connect(this,SIGNAL(closeView(int)),this,SLOT(closeViewSlot(int))); + connect(this,SIGNAL(startTimerSignal()),this,SLOT(startTimerSlot()),Qt::QueuedConnection); +} + +void OpenGLManager::timerEvent(QTimerEvent* event){ + //cerr<<"."; + boost::mutex::scoped_lock lock(viewsMutex); + // when sharing the 0th view widget, it should be enough to update the primary view only + //if(views.size()>0) views[0]->updateGL(); + #if 1 + FOREACH(const shared_ptr& view, views){ if(view) view->updateGL(); } + #endif +} + +void OpenGLManager::createViewSlot(){ + boost::mutex::scoped_lock lock(viewsMutex); + if(views.size()==0){ + views.push_back(shared_ptr(new GLViewer(0,renderer,/*shareWidget*/(QGLWidget*)0))); + } else { + throw runtime_error("Secondary views not supported"); + //views.push_back(shared_ptr(new GLViewer(views.size(),renderer,views[0].get()))); + } +} + +void OpenGLManager::resizeViewSlot(int id, int wd, int ht){ + views[id]->resize(wd,ht); +} + +void OpenGLManager::closeViewSlot(int id){ + boost::mutex::scoped_lock lock(viewsMutex); + for(size_t i=views.size()-1; (!views[i]); i--){ views.resize(i); } // delete empty views from the end + if(id<0){ // close the last one existing + assert(*views.rbegin()); // this should have been sanitized by the loop above + views.resize(views.size()-1); // releases the pointer as well + } + if(id==0){ + LOG_DEBUG("Closing primary view."); + if(views.size()==1) views.clear(); + else{ LOG_INFO("Cannot close primary view, secondary views still exist."); } + } +} +void OpenGLManager::centerAllViews(){ + boost::mutex::scoped_lock lock(viewsMutex); + FOREACH(const shared_ptr& g, views){ if(!g) continue; g->centerScene(); } +} +void OpenGLManager::startTimerSlot(){ + startTimer(50); +} + +int OpenGLManager::waitForNewView(float timeout,bool center){ + size_t origViewCount=views.size(); + emitCreateView(); + float t=0; + while(views.size()!=origViewCount+1){ + usleep(50000); t+=.05; + // wait at most 5 secs + if(t>=timeout) { + LOG_ERROR("Timeout waiting for the new view to open, giving up."); return -1; + } + } + if(center)(*views.rbegin())->centerScene(); + return (*views.rbegin())->viewId; +} diff --git a/SudoDEM2D/gui/qt4/OpenGLManager.hpp b/SudoDEM2D/gui/qt4/OpenGLManager.hpp new file mode 100644 index 0000000..595f6ee --- /dev/null +++ b/SudoDEM2D/gui/qt4/OpenGLManager.hpp @@ -0,0 +1,47 @@ +#pragma once +//#include + +#ifndef Q_MOC_RUN +#include"GLViewer.hpp" +#endif + +#include +#include + +/* +Singleton class managing OpenGL views, +a renderer instance and timer to refresh the display. +*/ +class OpenGLManager: public QObject{ + Q_OBJECT + DECLARE_LOGGER; + public: + static OpenGLManager* self; + OpenGLManager(QObject *parent=0); + // manipulation must lock viewsMutex! + std::vector > views; + shared_ptr renderer; + // signals are protected, emitting them is therefore wrapped with such funcs + void emitResizeView(int id, int wd, int ht){ emit resizeView(id,wd,ht); } + void emitCreateView(){ emit createView(); } + void emitStartTimer(){ emit startTimerSignal(); } + void emitCloseView(int id){ emit closeView(id); } + // create a new view and wait for it to become available; return the view number + // if timout (in seconds) elapses without the view to come up, reports error and returns -1 + int waitForNewView(float timeout=5., bool center=true); + signals: + void createView(); + void resizeView(int id, int wd, int ht); + void closeView(int id); + // this is used to start timer from the main thread via postEvent (ugly) + void startTimerSignal(); + public slots: + virtual void createViewSlot(); + virtual void resizeViewSlot(int id, int wd, int ht); + virtual void closeViewSlot(int id=-1); + virtual void timerEvent(QTimerEvent* event); + virtual void startTimerSlot(); + void centerAllViews(); + private: + boost::mutex viewsMutex; +}; diff --git a/SudoDEM2D/gui/qt4/SerializableEditor.py b/SudoDEM2D/gui/qt4/SerializableEditor.py new file mode 100644 index 0000000..0f41598 --- /dev/null +++ b/SudoDEM2D/gui/qt4/SerializableEditor.py @@ -0,0 +1,759 @@ +# encoding: utf-8 +from PyQt4.QtCore import * +from PyQt4.QtGui import * +from PyQt4 import QtGui + +import re,itertools +import logging +logging.trace=logging.debug +logging.basicConfig(level=logging.INFO) + +from sudodem import * +import sudodem.qt + +try: + from minieigen import * +except ImportError: + from miniEigen import * + +seqSerializableShowType=True # show type headings in serializable sequences (takes vertical space, but makes the type hyperlinked) + +# BUG: cursor is moved to the beginnign of the input field even if it has focus +# +# checking for focus seems to return True always and cursor is never moved +# +# the 'True or' part effectively disables the condition (so that the cursor is moved always), but it might be fixed in the future somehow +# +# if True or w.hasFocus(): w.home(False) +# +# + +def makeWrapperHref(text,className,attr=None,static=False): + """Create clickable HTML hyperlink to a SudoDEM class or its attribute. + + :param className: name of the class to link to. + :param attr: attribute to link to. If given, must exist directly in given *className*; if not given or empty, link to the class itself is created and *attr* is ignored. + :return: HTML with the hyperref. + """ + if not static: return '%s'%(sudodem.qt.sphinxDocWrapperPage,className,(('.'+attr) if attr else ''),text) + else: return '%s'%(sudodem.qt.sphinxDocWrapperPage,className,attr,text) + +def serializableHref(ser,attr=None,text=None): + """Return HTML href to a *ser* optionally to the attribute *attr*. + The class hierarchy is crawled upwards to find out in which parent class is *attr* defined, + so that the href target is a valid link. In that case, only single inheritace is assumed and + the first class from the top defining *attr* is used. + + :param ser: object of class deriving from :yref:`Serializable`, or string; if string, *attr* must be empty. + :param attr: name of the attribute to link to; if empty, linke to the class itself is created. + :param text: visible text of the hyperlink; if not given, either class name or attribute name without class name (when *attr* is not given) is used. + + :returns: HTML with the hyperref. + """ + # klass is a class name given as string + if isinstance(ser,str): + if attr: raise InvalidArgument("When *ser* is a string, *attr* must be empty (only class link can be created)") + return makeWrapperHref(text if text else ser,ser) + # klass is a type object + if attr: + klass=ser.__class__ + while attr in dir(klass.__bases__[0]): klass=klass.__bases__[0] + if not text: text=attr + else: + klass=ser.__class__ + if not text: text=klass.__name__ + return makeWrapperHref(text,klass.__name__,attr,static=(attr and getattr(klass,attr)==getattr(ser,attr))) + +class AttrEditor(): + """Abstract base class handing some aspects common to all attribute editors. + Holds exacly one attribute which is updated whenever it changes.""" + def __init__(self,getter=None,setter=None): + self.getter,self.setter=getter,setter + self.hot,self.focused=False,False + self.widget=None + def refresh(self): pass + def update(self): pass + def isHot(self,hot=True): + "Called when the widget gets focus; mark it hot, change colors etc." + if hot==self.hot: return + self.hot=hot + if hot: self.setStyleSheet('QWidget { background: red }') + else: self.setStyleSheet('QWidget { background: none }') + def sizeHint(self): return QSize(150,12) + def trySetter(self,val): + try: self.setter(val) + except AttributeError: self.setEnabled(False) + self.isHot(False) + +class AttrEditor_Bool(AttrEditor,QFrame): + def __init__(self,parent,getter,setter): + AttrEditor.__init__(self,getter,setter) + QFrame.__init__(self,parent) + self.checkBox=QCheckBox(self) + lay=QVBoxLayout(self); lay.setSpacing(0); lay.setMargin(0); lay.addStretch(1); lay.addWidget(self.checkBox); lay.addStretch(1) + self.checkBox.clicked.connect(self.update) + def refresh(self): self.checkBox.setChecked(self.getter()) + def update(self): self.trySetter(self.checkBox.isChecked()) + +class AttrEditor_Int(AttrEditor,QSpinBox): + def __init__(self,parent,getter,setter): + AttrEditor.__init__(self,getter,setter) + QSpinBox.__init__(self,parent) + self.setRange(int(-1e9),int(1e9)); self.setSingleStep(1); + self.valueChanged.connect(self.update) + def refresh(self): self.setValue(self.getter()) + def update(self): self.trySetter(self.value()) + +class AttrEditor_Str(AttrEditor,QLineEdit): + def __init__(self,parent,getter,setter): + AttrEditor.__init__(self,getter,setter) + QLineEdit.__init__(self,parent) + self.textEdited.connect(self.isHot) + self.selectionChanged.connect(self.isHot) + self.editingFinished.connect(self.update) + def refresh(self): self.setText(self.getter()) + def update(self): self.trySetter(str(self.text())) + +class AttrEditor_Float(AttrEditor,QLineEdit): + def __init__(self,parent,getter,setter): + AttrEditor.__init__(self,getter,setter) + QLineEdit.__init__(self,parent) + self.textEdited.connect(self.isHot) + self.selectionChanged.connect(self.isHot) + self.editingFinished.connect(self.update) + def refresh(self): + self.setText(str(self.getter())); + if True or not self.hasFocus(): self.home(False) + def update(self): + try: self.trySetter(float(self.text())) + except ValueError: self.refresh() + +class AttrEditor_Quaternion(AttrEditor,QFrame): + def __init__(self,parent,getter,setter): + AttrEditor.__init__(self,getter,setter) + QFrame.__init__(self,parent) + self.grid=QHBoxLayout(self); self.grid.setSpacing(0); self.grid.setMargin(0) + for i in range(4): + if i==3: + f=QFrame(self); f.setFrameShape(QFrame.VLine); f.setFrameShadow(QFrame.Sunken); f.setFixedWidth(4) # add vertical divider (axis | angle) + self.grid.addWidget(f) + w=QLineEdit('') + self.grid.addWidget(w); + w.textEdited.connect(self.isHot) + w.selectionChanged.connect(self.isHot) + w.editingFinished.connect(self.update) + def refresh(self): + val=self.getter(); axis,angle=val.toAxisAngle() + for i in (0,1,2,4): + w=self.grid.itemAt(i).widget(); w.setText(str(axis[i] if i<3 else angle)); + if True or not w.hasFocus(): w.home(False) + def update(self): + try: + x=[float((self.grid.itemAt(i).widget().text())) for i in (0,1,2,4)] + except ValueError: self.refresh() + q=Quaternion(Vector3(x[0],x[1],x[2]),x[3]); q.normalize() # from axis-angle + self.trySetter(q) + def setFocus(self): self.grid.itemAt(0).widget().setFocus() + +class AttrEditor_Se3(AttrEditor,QFrame): + def __init__(self,parent,getter,setter): + AttrEditor.__init__(self,getter,setter) + QFrame.__init__(self,parent) + self.grid=QGridLayout(self); self.grid.setSpacing(0); self.grid.setMargin(0) + for row,col in itertools.product(range(2),range(5)): # one additional column for vertical line in quaternion + if (row,col)==(0,3): continue + if (row,col)==(0,4): self.grid.addWidget(QLabel(u'←posori',self),row,col); continue + if (row,col)==(1,3): + f=QFrame(self); f.setFrameShape(QFrame.VLine); f.setFrameShadow(QFrame.Sunken); f.setFixedWidth(4); self.grid.addWidget(f,row,col); continue + w=QLineEdit('') + self.grid.addWidget(w,row,col); + w.textEdited.connect(self.isHot) + w.selectionChanged.connect(self.isHot) + w.editingFinished.connect(self.update) + def refresh(self): + pos,ori=self.getter(); axis,angle=ori.toAxisAngle() + for i in (0,1,2,4): + w=self.grid.itemAtPosition(1,i).widget(); w.setText(str(axis[i] if i<3 else angle)); + if True or not w.hasFocus(): w.home(False) + for i in (0,1,2): + w=self.grid.itemAtPosition(0,i).widget(); w.setText(str(pos[i])); + if True or not w.hasFocus(): w.home(False) + def update(self): + try: + q=[float((self.grid.itemAtPosition(1,i).widget().text())) for i in (0,1,2,4)] + v=[float((self.grid.itemAtPosition(0,i).widget().text())) for i in (0,1,2)] + except ValueError: self.refresh() + qq=Quaternion(Vector3(q[0],q[1],q[2]),q[3]); qq.normalize() # from axis-angle + self.trySetter((v,qq)) + def setFocus(self): self.grid.itemAtPosition(0,0).widget().setFocus() + +class AttrEditor_MatrixX(AttrEditor,QFrame): + def __init__(self,parent,getter,setter,rows,cols,idxConverter): + 'idxConverter converts row,col tuple to either (row,col), (col) etc depending on what access is used for []' + AttrEditor.__init__(self,getter,setter) + QFrame.__init__(self,parent) + self.rows,self.cols=rows,cols + self.idxConverter=idxConverter + self.setContentsMargins(0,0,0,0) + val=self.getter() + self.grid=QGridLayout(self); self.grid.setSpacing(0); self.grid.setMargin(0) + for row,col in itertools.product(range(self.rows),range(self.cols)): + w=QLineEdit('') + self.grid.addWidget(w,row,col); + w.textEdited.connect(self.isHot) + w.selectionChanged.connect(self.isHot) + w.editingFinished.connect(self.update) + def refresh(self): + val=self.getter() + for row,col in itertools.product(range(self.rows),range(self.cols)): + w=self.grid.itemAtPosition(row,col).widget() + w.setText(str(val[self.idxConverter(row,col)])) + if True or not w.hasFocus: w.home(False) # make the left-most part visible, if the text is wider than the widget + def update(self): + try: + val=self.getter() + for row,col in itertools.product(range(self.rows),range(self.cols)): + w=self.grid.itemAtPosition(row,col).widget() + if w.isModified(): val[self.idxConverter(row,col)]=float(w.text()) + logging.debug('setting'+str(val)) + self.trySetter(val) + except ValueError: self.refresh() + def setFocus(self): self.grid.itemAtPosition(0,0).widget().setFocus() + +class AttrEditor_MatrixXi(AttrEditor,QFrame): + def __init__(self,parent,getter,setter,rows,cols,idxConverter): + 'idxConverter converts row,col tuple to either (row,col), (col) etc depending on what access is used for []' + AttrEditor.__init__(self,getter,setter) + QFrame.__init__(self,parent) + self.rows,self.cols=rows,cols + self.idxConverter=idxConverter + self.setContentsMargins(0,0,0,0) + self.grid=QGridLayout(self); self.grid.setSpacing(0); self.grid.setMargin(0) + for row,col in itertools.product(range(self.rows),range(self.cols)): + w=QSpinBox() + w.setRange(int(-1e9),int(1e9)); w.setSingleStep(1); + self.grid.addWidget(w,row,col); + self.refresh() # refresh before connecting signals! + for row,col in itertools.product(range(self.rows),range(self.cols)): + self.grid.itemAtPosition(row,col).widget().valueChanged.connect(self.update) + def refresh(self): + val=self.getter() + for row,col in itertools.product(range(self.rows),range(self.cols)): + w=self.grid.itemAtPosition(row,col).widget().setValue(val[self.idxConverter(row,col)]) + def update(self): + val=self.getter(); modified=False + for row,col in itertools.product(range(self.rows),range(self.cols)): + w=self.grid.itemAtPosition(row,col).widget() + if w.value()!=val[self.idxConverter(row,col)]: + modified=True; val[self.idxConverter(row,col)]=w.value() + if not modified: return + logging.debug('setting'+str(val)) + self.trySetter(val) + def setFocus(self): self.grid.itemAtPosition(0,0).widget().setFocus() + +class AttrEditor_Vector6i(AttrEditor_MatrixXi): + def __init__(self,parent,getter,setter): + AttrEditor_MatrixXi.__init__(self,parent,getter,setter,1,6,lambda r,c:c) +class AttrEditor_Vector3i(AttrEditor_MatrixXi): + def __init__(self,parent,getter,setter): + AttrEditor_MatrixXi.__init__(self,parent,getter,setter,1,3,lambda r,c:c) +class AttrEditor_Vector2i(AttrEditor_MatrixXi): + def __init__(self,parent,getter,setter): + AttrEditor_MatrixXi.__init__(self,parent,getter,setter,1,2,lambda r,c:c) + +class AttrEditor_Vector6(AttrEditor_MatrixX): + def __init__(self,parent,getter,setter): + AttrEditor_MatrixX.__init__(self,parent,getter,setter,1,6,lambda r,c:c) +class AttrEditor_Vector3(AttrEditor_MatrixX): + def __init__(self,parent,getter,setter): + AttrEditor_MatrixX.__init__(self,parent,getter,setter,1,3,lambda r,c:c) +class AttrEditor_Vector2(AttrEditor_MatrixX): + def __init__(self,parent,getter,setter): + AttrEditor_MatrixX.__init__(self,parent,getter,setter,1,2,lambda r,c:c) +class AttrEditor_Matrix3(AttrEditor_MatrixX): + def __init__(self,parent,getter,setter): + AttrEditor_MatrixX.__init__(self,parent,getter,setter,3,3,lambda r,c:(r,c)) + +class Se3FakeType: pass + +_fundamentalEditorMap={bool:AttrEditor_Bool,str:AttrEditor_Str,int:AttrEditor_Int,float:AttrEditor_Float,Quaternion:AttrEditor_Quaternion,Vector2:AttrEditor_Vector2,Vector3:AttrEditor_Vector3,Vector6:AttrEditor_Vector6,Matrix3:AttrEditor_Matrix3,Vector6i:AttrEditor_Vector6i,Vector3i:AttrEditor_Vector3i,Vector2i:AttrEditor_Vector2i,Se3FakeType:AttrEditor_Se3} +_fundamentalInitValues={bool:True,str:'',int:0,float:0.0,Quaternion:Quaternion((0,1,0),0.0),Vector3:Vector3.Zero,Matrix3:Matrix3.Zero,Vector6:Vector6.Zero,Vector6i:Vector6i.Zero,Vector3i:Vector3i.Zero,Vector2i:Vector2i.Zero,Vector2:Vector2.Zero,Se3FakeType:(Vector3.Zero,Quaternion((0,1,0),0.0))} + +class SerQLabel(QLabel): + def __init__(self,parent,label,tooltip,path): + QLabel.__init__(self,parent) + self.path=path + self.setText(label) + if tooltip or path: self.setToolTip((''+path+'
' if self.path else '')+(tooltip if tooltip else '')) + self.linkActivated.connect(sudodem.qt.openUrl) + def mousePressEvent(self,event): + if event.button()!=Qt.MidButton: + event.ignore(); return + # middle button clicked, paste pasteText to clipboard + cb=QApplication.clipboard() + cb.setText(self.path,mode=QClipboard.Clipboard) + cb.setText(self.path,mode=QClipboard.Selection) # X11 global selection buffer + event.accept() + +class SerializableEditor(QFrame): + "Class displaying and modifying serializable attributes of a sudodem object." + import collections + import logging + # each attribute has one entry associated with itself + class EntryData: + def __init__(self,name,T,flags=0): + self.name,self.T,self.flags=name,T,flags + self.lineNo,self.widget=None,None + def __init__(self,ser,parent=None,ignoredAttrs=set(),showType=False,path=None): + "Construct window, *ser* is the object we want to show." + QtGui.QFrame.__init__(self,parent) + self.ser=ser + self.path=(ser.label if (hasattr(ser,'label') and ser.label) else path) + self.showType=showType + self.hot=False + self.entries=[] + self.ignoredAttrs=ignoredAttrs + logging.debug('New Serializable of type %s'%ser.__class__.__name__) + self.setWindowTitle(str(ser)) + self.mkWidgets() + self.refreshTimer=QTimer(self) + self.refreshTimer.timeout.connect(self.refreshEvent) + self.refreshTimer.start(500) + def getListTypeFromDocstring(self,attr): + "Guess type of array by scanning docstring for :yattrtype: and parsing its argument; ugly, but works." + doc=getattr(self.ser.__class__,attr).__doc__ + if doc==None: + logging.error("Attribute %s has no docstring."%attr) + return None + m=re.search(r':yattrtype:`([^`]*)`',doc) + if not m: + logging.error("Attribute %s does not contain :yattrtype:`....` (docstring is '%s'"%(attr,doc)) + return None + cxxT=m.group(1) + logging.debug('Got type "%s" from :yattrtype:'%cxxT) + def vecTest(T,cxxT): + #regexp=r'^\s*(std\s*::)?\s*vector\s*<\s*(std\s*::)?\s*('+T+r')\s*>\s*$' + regexp=r'^\s*(std\s*::)?\s*vector\s*<\s*(shared_ptr\s*<\s*)?\s*(std\s*::)?\s*('+T+r')(\s*>)?\s*>\s*$' + m=re.match(regexp,cxxT) + return m + vecMap={ + 'bool':bool,'int':int,'long':int,'Body::id_t':long,'size_t':long, + 'Real':float,'float':float,'double':float, + 'Vector6r':Vector6,'Vector6i':Vector6i,'Vector3i':Vector3i,'Vector2r':Vector2,'Vector2i':Vector2i, + 'Vector3r':Vector3,'Matrix3r':Matrix3,'Se3r':Se3FakeType, + 'string':str, + #'BodyCallback':BodyCallback, + #'IntrCallback':IntrCallback,'BoundFunctor':BoundFunctor,'IGeomFunctor':IGeomFunctor,'IPhysFunctor':IPhysFunctor,'LawFunctor':LawFunctor,'KinematicEngine':KinematicEngine, + 'IntrCallback':IntrCallback,'BoundFunctor':BoundFunctor,'IGeomFunctor':IGeomFunctor,'IPhysFunctor':IPhysFunctor,'LawFunctor':LawFunctor, + 'GlShapeFunctor':GlShapeFunctor,'GlStateFunctor':GlStateFunctor,'GlIGeomFunctor':GlIGeomFunctor,'GlIPhysFunctor':GlIPhysFunctor,'GlBoundFunctor':GlBoundFunctor,'GlExtraDrawer':GlExtraDrawer + } + for T,ret in vecMap.items(): + if vecTest(T,cxxT): + logging.debug("Got type %s from cxx type %s"%(repr(ret),cxxT)) + return (ret,) + logging.error("Unable to guess python type from cxx type '%s'"%cxxT) + return None + def mkAttrEntries(self): + if self.ser==None: return + try: + d=self.ser.dict() + except TypeError: + logging.error('TypeError when getting attributes of '+str(self.ser)+',skipping. ') + import traceback + traceback.print_exc() + attrs=self.ser.dict().keys(); attrs.sort() + for attr in attrs: + val=getattr(self.ser,attr) # get the value using serattr, as it might be different from what the dictionary provides (e.g. Body.blockedDOFs) + t=None + doc=getattr(self.ser.__class__,attr).__doc__; + if '|yhidden|' in doc: continue + if attr in self.ignoredAttrs: continue + if isinstance(val,list): + t=self.getListTypeFromDocstring(attr) + if not t and len(val)==0: t=(val[0].__class__,) # 1-tuple is list of the contained type + #if not t: raise RuntimeError('Unable to guess type of '+str(self.ser)+'.'+attr) + # hack for Se3, which is returned as (Vector3,Quaternion) in python + elif isinstance(val,tuple) and len(val)==2 and val[0].__class__==Vector3 and val[1].__class__==Quaternion: t=Se3FakeType + else: t=val.__class__ + match=re.search(':yattrflags:`\s*([0-9]+)\s*`',doc) # non-empty attribute + flags=int(match.group(1)) if match else 0 + #logging.debug('Attr %s is of type %s'%(attr,((t[0].__name__,) if isinstance(t,tuple) else t.__name__))) + self.entries.append(self.EntryData(name=attr,T=t)) + def getDocstring(self,attr=None): + "If attr is *None*, return docstring of the Serializable itself" + doc=(getattr(self.ser.__class__,attr).__doc__ if attr else self.ser.__class__.__doc__) + if not doc: return '' + doc=re.sub(':y(attrtype|default|attrflags):`[^`]*`','',doc) + statAttr=re.compile('^.. ystaticattr::.*$',re.MULTILINE|re.DOTALL) + doc=re.sub(statAttr,'',doc) # static classes have their proper docs at the beginning, discard static memeber docs + # static: attribute of the type is the same object as attribute of the instance + # in that case, get docstring from the class documentation by parsing it + if attr and getattr(self.ser.__class__,attr)==getattr(self.ser,attr): doc=self.getStaticAttrDocstring(attr) + doc=re.sub(':yref:`([^`]*)`','\\1',doc) + import textwrap + wrapper=textwrap.TextWrapper(replace_whitespace=False) + return wrapper.fill(textwrap.dedent(doc)) + def getStaticAttrDocstring(self,attr): + ret=''; c=self.ser.__class__ + while hasattr(c,attr) and hasattr(c.__base__,attr): c=c.__base__ + start='.. ystaticattr:: %s.%s('%(c.__name__,attr) + if start in c.__doc__: + ll=c.__doc__.split('\n') + for i in range(len(ll)): + if ll[i].startswith(start): break + for i in range(i+1,len(ll)): + if len(ll[i])>0 and ll[i][0] not in ' \t': break + ret+=ll[i] + return ret + else: return '[no documentation found]' + def mkWidget(self,entry): + if not entry.T: return None + # single fundamental object + Klass=_fundamentalEditorMap.get(entry.T,None) + getter,setter=lambda: getattr(self.ser,entry.name), lambda x: setattr(self.ser,entry.name,x) + if Klass: + widget=Klass(self,getter=getter,setter=setter) + widget.setFocusPolicy(Qt.StrongFocus) + if (entry.flags & AttrFlags.readonly): widget.setEnabled(False) + return widget + # sequences + if entry.T.__class__==tuple: + assert(len(entry.T)==1) # we don't handle tuples of other lenghts + # sequence of serializables + T=entry.T[0] + if (issubclass(T,Serializable) or T==Serializable): + widget=SeqSerializable(self,getter,setter,T,path=(self.path+'.'+entry.name if self.path else None),shrink=True) + return widget + if (T in _fundamentalEditorMap): + widget=SeqFundamentalEditor(self,getter,setter,T) + return widget + return None + # a serializable + if issubclass(entry.T,Serializable) or entry.T==Serializable: + obj=getattr(self.ser,entry.name) + if hasattr(obj,'label') and obj.label: path=obj.label + elif self.path: path=self.path+'.'+entry.name + else: path=None + widget=SerializableEditor(getattr(self.ser,entry.name),parent=self,showType=self.showType,path=(self.path+'.'+entry.name if self.path else None)) + widget.setFrameShape(QFrame.Box); widget.setFrameShadow(QFrame.Raised); widget.setLineWidth(1) + return widget + return None + def mkWidgets(self): + self.mkAttrEntries() + grid=QFormLayout() + grid.setContentsMargins(2,2,2,2) + grid.setVerticalSpacing(0) + grid.setLabelAlignment(Qt.AlignRight) + if self.showType: + lab=SerQLabel(self,makeSerializableLabel(self.ser,addr=True,href=True),tooltip=self.getDocstring(),path=self.path) + lab.setFrameShape(QFrame.Box); lab.setFrameShadow(QFrame.Sunken); lab.setLineWidth(2); lab.setAlignment(Qt.AlignHCenter); lab.linkActivated.connect(sudodem.qt.openUrl) + grid.setWidget(0,QFormLayout.SpanningRole,lab) + for entry in self.entries: + entry.widget=self.mkWidget(entry) + objPath=(self.path+'.'+entry.name) if self.path else None + label=SerQLabel(self,serializableHref(self.ser,entry.name),tooltip=self.getDocstring(entry.name),path=objPath) + grid.addRow(label,entry.widget if entry.widget else QLabel('unhandled type')) + self.setLayout(grid) + self.refreshEvent() + def refreshEvent(self): + for e in self.entries: + if e.widget and not e.widget.hot: e.widget.refresh() + def refresh(self): pass + +def makeSerializableLabel(ser,href=False,addr=True,boldHref=True,num=-1,count=-1): + ret=u'' + if num>=0: + if count>=0: ret+=u'%d/%d. '%(num,count) + else: ret+=u'%d. '%num + if href: ret+=(u' ' if boldHref else u' ')+serializableHref(ser)+(u' ' if boldHref else u' ') + else: ret+=ser.__class__.__name__+' ' + if hasattr(ser,'label') and ser.label: ret+=u' “'+unicode(ser.label)+u'”' + # do not show address if there is a label already + elif addr: + import re + ss=unicode(ser); m=re.match(u'<(.*) instance at (0x.*)>',ss) + if m: ret+=m.group(2) + else: logging.warning(u"Serializable converted to str ('%s') does not contain 'instance at 0x…'"%ss) + return ret + +class SeqSerializableComboBox(QFrame): + def __init__(self,parent,getter,setter,serType,path=None,shrink=False): + QFrame.__init__(self,parent) + self.getter,self.setter,self.serType,self.path,self.shrink=getter,setter,serType,path,shrink + self.layout=QVBoxLayout(self) + topLineFrame=QFrame(self) + topLineLayout=QHBoxLayout(topLineFrame); + for l in self.layout, topLineLayout: l.setSpacing(0); l.setContentsMargins(0,0,0,0) + topLineFrame.setLayout(topLineLayout) + buttons=(self.newButton,self.killButton,self.upButton,self.downButton)=[QPushButton(label,self) for label in (u'☘',u'☠',u'↑',u'↓')] + buttonSlots=(self.newSlot,self.killSlot,self.upSlot,self.downSlot) # same order as buttons + for b in buttons: b.setStyleSheet('QPushButton { font-size: 15pt; }'); b.setFixedWidth(30); b.setFixedHeight(30) + self.combo=QComboBox(self) + self.combo.setSizeAdjustPolicy(QComboBox.AdjustToContents) + for w in buttons[0:2]+[self.combo,]+buttons[2:4]: topLineLayout.addWidget(w) + self.layout.addWidget(topLineFrame) # nested layout + self.scroll=QScrollArea(self); self.scroll.setWidgetResizable(True) + self.layout.addWidget(self.scroll) + self.seqEdit=None # currently edited serializable + self.setLayout(self.layout) + self.hot=None # API compat with SerializableEditor + self.setFrameShape(QFrame.Box); self.setFrameShadow(QFrame.Raised); self.setLineWidth(1) + # signals + for b,slot in zip(buttons,buttonSlots): b.clicked.connect(slot) + self.combo.currentIndexChanged.connect(self.comboIndexSlot) + self.refreshEvent() + # periodic refresh + self.refreshTimer=QTimer(self) + self.refreshTimer.timeout.connect(self.refreshEvent) + self.refreshTimer.start(1000) # 1s should be enough + #print 'SeqSerializable path is',self.path + def comboIndexSlot(self,ix): # different seq item selected + currSeq=self.getter(); + if len(currSeq)==0: ix=-1 + logging.debug('%s comboIndexSlot len=%d, ix=%d'%(self.serType.__name__,len(currSeq),ix)) + self.downButton.setEnabled(ix0) + self.combo.setEnabled(ix>=0) + if ix>=0: + ser=currSeq[ix] + self.seqEdit=SerializableEditor(ser,parent=self,showType=seqSerializableShowType,path=(self.path+'['+str(ix)+']') if self.path else None) + self.scroll.setWidget(self.seqEdit) + if self.shrink: + self.sizeHint=lambda: QSize(100,1000) + self.scroll.sizeHint=lambda: QSize(100,1000) + self.sizePolicy().setVerticalPolicy(QSizePolicy.Expanding) + self.scroll.sizePolicy().setVerticalPolicy(QSizePolicy.Expanding) + self.setMinimumHeight(min(300,self.seqEdit.height()+self.combo.height()+10)) + self.setMaximumHeight(100000) + self.scroll.setMaximumHeight(100000) + else: + self.scroll.setWidget(QFrame()) + if self.shrink: + self.setMaximumHeight(self.combo.height()+10); + self.scroll.setMaximumHeight(0) + def serLabel(self,ser,i=-1): + return ('' if i<0 else str(i)+'. ')+str(ser)[1:-1].replace('instance at ','') + def refreshEvent(self,forceIx=-1): + currSeq=self.getter() + comboEnabled=self.combo.isEnabled() + if comboEnabled and len(currSeq)==0: self.comboIndexSlot(-1) # force refresh, otherwise would not happen from the initially empty state + ix,cnt=self.combo.currentIndex(),self.combo.count() + # serializable currently being edited (which can be absent) or the one of which index is forced + ser=(self.seqEdit.ser if self.seqEdit else None) if forceIx<0 else currSeq[forceIx] + if comboEnabled and len(currSeq)==cnt and (ix<0 or ser==currSeq[ix]): return + if not comboEnabled and len(currSeq)==0: return + logging.debug(self.serType.__name__+' rebuilding list from scratch') + self.combo.clear() + if len(currSeq)>0: + prevIx=-1 + for i,s in enumerate(currSeq): + self.combo.addItem(makeSerializableLabel(s,num=i,count=len(currSeq),addr=False)) + if s==ser: prevIx=i + if forceIx>=0: newIx=forceIx # force the index (used from newSlot to make the new element active) + elif prevIx>=0: newIx=prevIx # if found what was active before, use it + elif ix>=0: newIx=ix # otherwise use the previous index (e.g. after deletion) + else: newIx=0 # fallback to 0 + logging.debug('%s setting index %d'%(self.serType.__name__,newIx)) + self.combo.setCurrentIndex(newIx) + else: + logging.debug('%s EMPTY, setting index 0'%(self.serType.__name__)) + self.combo.setCurrentIndex(-1) + self.killButton.setEnabled(len(currSeq)>0) + def newSlot(self): + dialog=NewSerializableDialog(self,self.serType.__name__) + if not dialog.exec_(): return # cancelled + ser=dialog.result() + ix=self.combo.currentIndex() + currSeq=self.getter(); currSeq.insert(ix,ser); self.setter(currSeq) + logging.debug('%s new item created at index %d'%(self.serType.__name__,ix)) + self.refreshEvent(forceIx=ix) + def killSlot(self): + ix=self.combo.currentIndex() + currSeq=self.getter(); del currSeq[ix]; self.setter(currSeq) + self.refreshEvent() + def upSlot(self): + i=self.combo.currentIndex() + assert(i>0) + currSeq=self.getter(); + prev,curr=currSeq[i-1:i+1]; currSeq[i-1],currSeq[i]=curr,prev; self.setter(currSeq) + self.refreshEvent(forceIx=i-1) + def downSlot(self): + i=self.combo.currentIndex() + currSeq=self.getter(); assert(i=0 else None + menu=QMenu(self) + actNew,actKill,actUp,actDown=[menu.addAction(name) for name in (u'☘ New',u'☠ Remove',u'↑ Up',u'↓ Down')] + if index<0: [a.setEnabled(False) for a in actKill,actUp,actDown] + if index==len(seq)-1: actDown.setEnabled(False) + if index==0: actUp.setEnabled(False) + if field: field.setStyleSheet('QWidget { background: green }') + act=menu.exec_(self.mapToGlobal(event.pos())) + if field: field.setStyleSheet('QWidget { background: none }') + if not act: return + if act==actNew: self.newSlot(index) + elif act==actKill: self.killSlot(index) + elif act==actUp: self.upSlot(index) + elif act==actDown: self.downSlot(index) + def localPositionToIndex(self,pos): + gp=self.mapToGlobal(pos) + for row in range(self.form.count()/2): + w,i=self.form.itemAt(row,QFormLayout.FieldRole),self.form.itemAt(row,QFormLayout.LabelRole) + for wi in w.widget(),i.widget(): + x0,y0,x1,y1=wi.geometry().getCoords(); globG=QRect(self.mapToGlobal(QPoint(x0,y0)),self.mapToGlobal(QPoint(x1,y1))) + if globG.contains(gp): + return row + return -1 + def newSlot(self,i): + seq=self.getter(); + seq.insert(i,_fundamentalInitValues.get(self.itemType,self.itemType())) + self.setter(seq) + self.rebuild() + def killSlot(self,i): + seq=self.getter(); assert(iError',errMsg) + return + class ItemGetter(): + def __init__(self,getter,index): self.getter,self.index=getter,index + def __call__(self): return self.getter()[self.index] + class ItemSetter(): + def __init__(self,getter,setter,index): self.getter,self.setter,self.index=getter,setter,index + def __call__(self,val): seq=self.getter(); seq[self.index]=val; self.setter(seq) + for i,item in enumerate(currSeq): + widget=Klass(self,ItemGetter(self.getter,i),ItemSetter(self.getter,self.setter,i)) #proxy,'value') + self.form.insertRow(i,'%d. '%i,widget) + logging.debug('added item %d %s'%(i,str(widget))) + if len(currSeq)==0: self.form.insertRow(0,'empty',QLabel('(right-click for menu)')) + logging.debug('rebuilt, will refresh now') + self.refreshEvent(dontRebuild=True) # avoid infinite recursion it the length would change meanwhile + def refreshEvent(self,dontRebuild=False,forceIx=-1): + currSeq=self.getter() + if len(currSeq)!=self.form.count()/2: #rowCount(): + if dontRebuild: return # length changed behind our back, just pretend nothing happened and update next time instead + self.rebuild() + currSeq=self.getter() + for i in range(len(currSeq)): + item=self.form.itemAt(i,QFormLayout.FieldRole) + logging.trace('got item #%d %s'%(i,str(item.widget()))) + widget=item.widget() + if not widget.hot: + widget.refresh() + if forceIx>=0 and forceIx==i: widget.setFocus() + def refresh(self): pass # SerializableEditor API diff --git a/SudoDEM2D/gui/qt4/_GLViewer.cpp b/SudoDEM2D/gui/qt4/_GLViewer.cpp new file mode 100644 index 0000000..22abc3a --- /dev/null +++ b/SudoDEM2D/gui/qt4/_GLViewer.cpp @@ -0,0 +1,102 @@ +#include"GLViewer.hpp" +#include"OpenGLManager.hpp" +#include +#include + +#include +#include + +namespace py=boost::python; + +qglviewer::Vec tuple2vec(py::tuple t){ qglviewer::Vec ret; for(int i=0;i<3;i++){py::extract e(t[i]); if(!e.check()) throw invalid_argument("Element #"+boost::lexical_cast(i)+" is not a number"); ret[i]=e();} return ret;}; +py::tuple vec2tuple(qglviewer::Vec v){return py::make_tuple(v[0],v[1],v[2]);}; + +class pyGLViewer{ + const size_t viewNo; + public: + #define GLV if((OpenGLManager::self->views.size()<=viewNo) || !(OpenGLManager::self->views[viewNo])) throw runtime_error("No view #"+boost::lexical_cast(viewNo)); GLViewer* glv=OpenGLManager::self->views[viewNo].get(); + pyGLViewer(size_t _viewNo=0): viewNo(_viewNo){} + void close(){ GLV; QCloseEvent* e(new QCloseEvent); QApplication::postEvent(glv,e); } + py::tuple get_grid(){GLV; return py::make_tuple(bool(glv->drawGrid & 1),bool(glv->drawGrid & 2),bool(glv->drawGrid & 4));} + void set_grid(py::tuple t){GLV; glv->drawGrid=0; for(int i=0;i<3;i++) if(py::extract(t[i])()) glv->drawGrid+=1<camera()->upVector,glv->camera()->setUpVector); + VEC_GET_SET(lookAt,glv->camera()->position()+glv->camera()->viewDirection,glv->camera()->lookAt); + VEC_GET_SET(viewDir,glv->camera()->viewDirection,glv->camera()->setViewDirection); + VEC_GET_SET(eyePosition,glv->camera()->position,glv->camera()->setPosition); + #define BOOL_GET_SET(property,getter,setter)void set_##property(bool b){GLV; setter(b);} bool get_##property(){GLV; return getter();} + BOOL_GET_SET(axes,glv->axisIsDrawn,glv->setAxisIsDrawn); + BOOL_GET_SET(fps,glv->FPSIsDisplayed,glv->setFPSIsDisplayed); + bool get_scale(){GLV; return glv->drawScale;} void set_scale(bool b){GLV; glv->drawScale=b;} + bool get_orthographic(){GLV; return glv->camera()->type()==qglviewer::Camera::ORTHOGRAPHIC;} + void set_orthographic(bool b){GLV; return glv->camera()->setType(b ? qglviewer::Camera::ORTHOGRAPHIC : qglviewer::Camera::PERSPECTIVE);} + int get_selection(void){ GLV; return glv->selectedName(); } void set_selection(int s){ GLV; glv->setSelectedName(s); } + #define FLOAT_GET_SET(property,getter,setter)void set_##property(Real r){GLV; setter(r);} Real get_##property(){GLV; return getter();} + FLOAT_GET_SET(sceneRadius,glv->sceneRadius,glv->setSceneRadius); + void fitAABB(const Vector3r& min, const Vector3r& max){GLV; glv->camera()->fitBoundingBox(qglviewer::Vec(min[0],min[1],min[2]),qglviewer::Vec(max[0],max[1],max[2]));} + void fitSphere(const Vector3r& center,Real radius){GLV; glv->camera()->fitSphere(qglviewer::Vec(center[0],center[1],center[2]),radius);} + void showEntireScene(){GLV; glv->camera()->showEntireScene();} + void center(bool median){GLV; if(median)glv->centerMedianQuartile(); else glv->centerScene();} + Vector2i get_screenSize(){GLV; return Vector2i(glv->width(),glv->height());} + void set_screenSize(Vector2i t){ /*GLV;*/ OpenGLManager::self->emitResizeView(viewNo,t[0],t[1]);} + string pyStr(){return string("(viewNo)+">";} + void saveDisplayParameters(size_t n){GLV; glv->saveDisplayParameters(n);} + void useDisplayParameters(size_t n){GLV; glv->useDisplayParameters(n);} + string get_timeDisp(){GLV; const int& m(glv->timeDispMask); string ret; if(m&GLViewer::TIME_REAL) ret+='r'; if(m&GLViewer::TIME_VIRT) ret+="v"; if(m&GLViewer::TIME_ITER) ret+="i"; return ret;} + void set_timeDisp(string s){GLV; int& m(glv->timeDispMask); m=0; FOREACH(char c, s){switch(c){case 'r': m|=GLViewer::TIME_REAL; break; case 'v': m|=GLViewer::TIME_VIRT; break; case 'i': m|=GLViewer::TIME_ITER; break; default: throw invalid_argument(string("Invalid flag for timeDisp: `")+c+"'");}}} + void set_bgColor(const Vector3r& c){ QColor cc(255*c[0],255*c[1],255*c[2]); GLV; glv->setBackgroundColor(cc);} Vector3r get_bgColor(){ GLV; QColor c(glv->backgroundColor()); return Vector3r(c.red()/255.,c.green()/255.,c.blue()/255.);} + #undef GLV + #undef VEC_GET_SET + #undef BOOL_GET_SET + #undef FLOAT_GET_SET +}; + +// ask to create a new view and wait till it exists +pyGLViewer createView(){ + int id=OpenGLManager::self->waitForNewView(); + if(id<0) throw std::runtime_error("Unable to open new 3d view."); + return pyGLViewer((*OpenGLManager::self->views.rbegin())->viewId); +} + +py::list getAllViews(){ py::list ret; FOREACH(const shared_ptr& v, OpenGLManager::self->views){ if(v) ret.append(pyGLViewer(v->viewId)); } return ret; }; +void centerViews(void){ OpenGLManager::self->centerAllViews(); } + +shared_ptr getRenderer(){ return OpenGLManager::self->renderer; } + +BOOST_PYTHON_MODULE(_GLViewer){ + SUDODEM_SET_DOCSTRING_OPTS; + + OpenGLManager* glm=new OpenGLManager(); // keep this singleton object forever + glm->emitStartTimer(); + + py::def("View",createView,"Create a new 3d view."); + py::def("center",centerViews,"Center all views."); + py::def("views",getAllViews,"Return list of all open :yref:`sudodem.qt.GLViewer` objects"); + + py::def("Renderer",&getRenderer,"Return the active :yref:`OpenGLRenderer` object."); + + py::class_("GLViewer",py::no_init) + .add_property("upVector",&pyGLViewer::get_upVector,&pyGLViewer::set_upVector,"Vector that will be shown oriented up on the screen.") + .add_property("lookAt",&pyGLViewer::get_lookAt,&pyGLViewer::set_lookAt,"Point at which camera is directed.") + .add_property("viewDir",&pyGLViewer::get_viewDir,&pyGLViewer::set_viewDir,"Camera orientation (as vector).") + .add_property("eyePosition",&pyGLViewer::get_eyePosition,&pyGLViewer::set_eyePosition,"Camera position.") + .add_property("grid",&pyGLViewer::get_grid,&pyGLViewer::set_grid,"Display square grid in zero planes, as 3-tuple of bools for yz, xz, xy planes.") + .add_property("fps",&pyGLViewer::get_fps,&pyGLViewer::set_fps,"Show frames per second indicator.") + .add_property("axes",&pyGLViewer::get_axes,&pyGLViewer::set_axes,"Show arrows for axes.") + .add_property("scale",&pyGLViewer::get_scale,&pyGLViewer::set_scale,"Scale of the view (?)") + .add_property("sceneRadius",&pyGLViewer::get_sceneRadius,&pyGLViewer::set_sceneRadius,"Visible scene radius.") + .add_property("ortho",&pyGLViewer::get_orthographic,&pyGLViewer::set_orthographic,"Whether orthographic projection is used; if false, use perspective projection.") + .add_property("screenSize",&pyGLViewer::get_screenSize,&pyGLViewer::set_screenSize,"Size of the viewer's window, in scree pixels") + .add_property("timeDisp",&pyGLViewer::get_timeDisp,&pyGLViewer::set_timeDisp,"Time displayed on in the vindow; is a string composed of characters *r*, *v*, *i* standing respectively for real time, virtual time, iteration number.") + // .add_property("bgColor",&pyGLViewer::get_bgColor,&pyGLViewer::set_bgColor) // useless: OpenGLRenderer::Background_color is used via openGL directly, bypassing QGLViewer background property + .def("fitAABB",&pyGLViewer::fitAABB,(py::arg("mn"),py::arg("mx")),"Adjust scene bounds so that Axis-aligned bounding box given by its lower and upper corners *mn*, *mx* fits in.") + .def("fitSphere",&pyGLViewer::fitSphere,(py::arg("center"),py::arg("radius")),"Adjust scene bounds so that disk given by *center* and *radius* fits in.") + .def("showEntireScene",&pyGLViewer::showEntireScene) + .def("center",&pyGLViewer::center,(py::arg("median")=true),"Center view. View is centered either so that all bodies fit inside (*median* = False), or so that 75\% of bodies fit inside (*median* = True).") + .def("saveState",&pyGLViewer::saveDisplayParameters,(py::arg("slot")),"Save display parameters into numbered memory slot. Saves state for both :yref:`GLViewer` and associated :yref:`OpenGLRenderer`.") + .def("loadState",&pyGLViewer::useDisplayParameters,(py::arg("slot")),"Load display parameters from slot saved previously into, identified by its number.") + .def("__repr__",&pyGLViewer::pyStr).def("__str__",&pyGLViewer::pyStr) + .def("close",&pyGLViewer::close) + .add_property("selection",&pyGLViewer::get_selection,&pyGLViewer::set_selection) + ; +} diff --git a/SudoDEM2D/gui/qt4/__init__.py b/SudoDEM2D/gui/qt4/__init__.py new file mode 100644 index 0000000..dff0f09 --- /dev/null +++ b/SudoDEM2D/gui/qt4/__init__.py @@ -0,0 +1,296 @@ +# encoding: utf-8 +import sudodem.runtime +if not sudodem.runtime.hasDisplay: + msg = "Connecting to DISPLAY at SudoDEM startup failed, unable to activate the qt4 interface." + import os + if 'SUDODEM_BATCH' in os.environ: + msg += "\nDo not import qt when running in batch mode." + raise ImportError(msg) + +from PyQt4.QtGui import * +from PyQt4 import QtCore + +from sudodem.qt.ui_controller import Ui_Controller + +from sudodem.qt.Inspector import * +from sudodem import * +import sudodem.system + +from sudodem.qt._GLViewer import * + +maxWebWindows=1 +"Number of webkit windows that will be cycled to show help on clickable objects" +webWindows=[] +"holds instances of QtWebKit windows; clicking an url will open it in the window that was the least recently updated" +sphinxOnlineDocPath='https://www.sudodem.org/doc/' +"Base URL for the documentation. Packaged versions should change to the local installation directory." + + +import os.path +# find if we have docs installed locally from package +sphinxLocalDocPath=os.environ['SUDODEM_PREFIX']+'/share/doc/sudodem-doc/html/' +#sphinxBuildDocPath=sudodem.config.sourceRoot+'/doc/sphinx/_build/html/' +# we prefer the packaged documentation for this version, if installed +if os.path.exists(sphinxLocalDocPath+'/index.html'): sphinxPrefix='file://'+sphinxLocalDocPath +# otherwise look for documentation generated in the source tree +#elif os.path.exists(sphinxBuildDocPath+'/index.html'): sphinxPrefix='file://'+sphinxBuildDocPath +# fallback to online docs +else: sphinxPrefix=sphinxOnlineDocPath + +sphinxDocWrapperPage=sphinxPrefix+'/sudodem.wrapper.html' + + + + +def openUrl(url): + from PyQt4 import QtWebKit + global maxWebWindows,webWindows + reuseLast=False + # use the last window if the class is the same and only the attribute differs + try: + reuseLast=(len(webWindows)>0 and str(webWindows[-1].url()).split('#')[-1].split('.')[2]==url.split('#')[-1].split('.')[2]) + #print str(webWindows[-1].url()).split('#')[-1].split('.')[2],url.split('#')[-1].split('.')[2] + except: pass + if not reuseLast: + if len(webWindows)0: self.displayCombo.insertSeparator(10000); afterSep=0 + for c in sudodem.system.childClasses(bc) | set([bc]): + inst=eval(c+'()'); + if len(set(inst.dict().keys())-set(['label']))>0: + self.displayCombo.addItem(c); afterSep+=1 + def inspectSlot(self): + self.inspector=SimulationInspector(parent=None) + self.inspector.show() + def setTabActive(self,what): + if what=='simulation': ix=0 + elif what=='display': ix=1 + elif what=='generator': ix=2 + elif what=='python': ix=3 + else: raise ValueErorr("No such tab: "+what) + self.controllerTabs.setCurrentIndex(ix) + def generatorComboSlot(self,genStr): + "update generator parameters when a new one is selected" + gen=eval(str(genStr)+'()') + self.generator=gen + se=SerializableEditor(gen,parent=self.generatorArea,showType=True) + self.generatorArea.setWidget(se) + def pythonComboSlot(self,cmd): + try: + code=compile(str(cmd),'','exec') + exec code in globals() + except: + import traceback + traceback.print_exc() + def generateSlot(self): + filename=str(self.generatorFilenameEdit.text()) + if self.generatorMemoryCheck.isChecked(): + filename=':memory:'+filename + print 'BUG: Saving to memory slots freezes SudoDEM (cause unknown). Cross fingers.' + #print 'Will save to ',filename + self.generator.generate(filename) + if self.generatorAutoCheck: + O.load(filename) + self.setTabActive('simulation') + if len(views())==0: + v=View(); v.center() + def displayComboSlot(self,dispStr): + ser=(self.renderer if dispStr=='OpenGLRenderer' else eval(str(dispStr)+'()')) + path='sudodem.qt.Renderer()' if dispStr=='OpenGLRenderer' else dispStr + se=SerializableEditor(ser,parent=self.displayArea,ignoredAttrs=set(['label']),showType=True,path=path) + self.displayArea.setWidget(se) + def loadSlot(self): + f=QFileDialog.getOpenFileName(self,'Load simulation','','SudoDEM simulations (*.xml *.xml.bz2 *.xml.gz *.sudodem *.sudodem.gz *.sudodem.bz2);; *.*') + f=str(f) + if not f: return # cancelled + self.deactivateControls() + O.load(f) + def saveSlot(self): + f=QFileDialog.getSaveFileName(self,'Save simulation','','SudoDEM simulations (*.xml *.xml.bz2 *.xml.gz *.sudodem *.sudodem.gz *.sudodem.bz2);; *.*') + f=str(f) + if not f: return # cancelled + O.save(f) + def reloadSlot(self): + self.deactivateControls() + from sudodem import plot + plot.splitData() + O.reload() + def dtFixedSlot(self): + O.dt=O.dt + O.dynDt=False + def dtDynSlot(self): + O.dt=-O.dt + def dtEditNoupdateSlot(self): + self.dtEditUpdate=False + def dtEditedSlot(self): + try: + t=float(self.dtEdit.text()) + O.dt=t + except ValueError: pass + self.dtEdit.setText(str(O.dt)) + self.dtEditUpdate=True + def playSlot(self): O.run() + def pauseSlot(self): O.pause() + def stepSlot(self): O.step() + def subStepSlot(self,value): O.subStepping=bool(value) + def show3dSlot(self, show): + vv=views() + assert(len(vv) in (0,1)) + if show: + if len(vv)==0: View() + else: + if len(vv)>0: vv[0].close() + def setReferenceSlot(self): + # sets reference periodic cell as well + utils.setRefPos() + def centerSlot(self): + for v in views(): v.center() + def setViewAxes(self,dir,up): + try: + v=views()[0] + v.viewDir=dir + v.upVector=up + v.center() + except IndexError: pass + #def xyzSlot(self): self.setViewAxes((0,0,-1),(0,1,0)) + #def yzxSlot(self): self.setViewAxes((-1,0,0),(0,0,1)) + #def zxySlot(self): self.setViewAxes((0,-1,0),(1,0,0)) + def refreshEvent(self): + self.refreshValues() + self.activateControls() + def deactivateControls(self): + self.realTimeLabel.setText('') + self.virtTimeLabel.setText('') + self.iterLabel.setText('') + self.fileLabel.setText('[loading]') + self.playButton.setEnabled(False) + self.pauseButton.setEnabled(False) + self.stepButton.setEnabled(False) + self.subStepCheckbox.setEnabled(False) + self.reloadButton.setEnabled(False) + self.dtFixedRadio.setEnabled(False) + self.dtDynRadio.setEnabled(False) + self.dtEdit.setEnabled(False) + self.dtEdit.setText('') + self.dtEditUpdate=True + def activateControls(self): + hasSim=len(O.engines)>0 + running=O.running + if hasSim: + self.playButton.setEnabled(not running) + self.pauseButton.setEnabled(running) + self.reloadButton.setEnabled(O.filename is not None) + self.stepButton.setEnabled(not running) + self.subStepCheckbox.setEnabled(not running) + else: + self.playButton.setEnabled(False) + self.pauseButton.setEnabled(False) + self.reloadButton.setEnabled(False) + self.stepButton.setEnabled(False) + self.subStepCheckbox.setEnabled(False) + self.dtFixedRadio.setEnabled(True) + self.dtDynRadio.setEnabled(O.dynDtAvailable) + dynDt=O.dynDt + self.dtFixedRadio.setChecked(not dynDt) + self.dtDynRadio.setChecked(dynDt) + if dynDt or self.dtEditUpdate: + self.dtEdit.setText(str(O.dt)) + if dynDt: self.dtEditUpdate=True + self.dtEdit.setEnabled(not dynDt) + fn=O.filename + self.fileLabel.setText(fn if fn else '[no file]') + + def refreshValues(self): + rt=int(O.realtime); t=O.time; iter=O.iter; + assert(len(self.iterTimes)==len(self.iterValues)) + if len(self.iterTimes)==0: self.iterTimes.append(rt); self.iterValues.append(iter); self.iterPerSec=0 # update always for the first time + elif rt-self.iterTimes[-1]>self.iterPerSecTimeout: # update after a timeout + if len(self.iterTimes)==1: self.iterTimes.append(self.iterTimes[0]); self.iterValues.append(self.iterValues[0]) # 2 values, first one is bogus + self.iterTimes[0]=self.iterTimes[1]; self.iterValues[0]=self.iterValues[1] + self.iterTimes[1]=rt; self.iterValues[1]=iter; + self.iterPerSec=(self.iterValues[-1]-self.iterValues[-2])/(self.iterTimes[-1]-self.iterTimes[-2]) + if not O.running: self.iterPerSec=0 + stopAtIter=O.stopAtIter + subStepInfo='' + if O.subStepping: + subStep=O.subStep + if subStep==-1: subStepInfo=u'→ prologue' + elif subStep>=0 and subStepepilogue' + else: raise RuntimeError("Invalid O.subStep value %d, should be ∈{-1,…,len(o.engines)}"%subStep) + subStepInfo="
sub %d/%d [%s]"%(subStep,len(O.engines),subStepInfo) + self.subStepCheckbox.setChecked(O.subStepping) # might have been changed async + if stopAtIter<=iter: + self.realTimeLabel.setText('%02d:%02d:%02d'%(rt//3600,(rt%3600)//60,rt%60)) + self.iterLabel.setText('#%ld, %.1f/s %s'%(iter,self.iterPerSec,subStepInfo)) + else: + e=int((stopAtIter-iter)*self.iterPerSec) + self.realTimeLabel.setText('%02d:%02d:%02d (ETA %02d:%02d:%02d)'%(rt//3600,rt//60,rt%60,e//3600,e//60,e%60)) + self.iterLabel.setText('#%ld / %ld, %.1f/s %s'%(O.iter,stopAtIter,self.iterPerSec,subStepInfo)) + if t!=float('inf'): + s=int(t); ms=int(t*1000)%1000; us=int(t*1000000)%1000; ns=int(t*1000000000)%1000 + self.virtTimeLabel.setText(u'%03ds%03dm%03dμ%03dn'%(s,ms,us,ns)) + else: self.virtTimeLabel.setText(u'[ ∞ ] ?!') + self.show3dButton.setChecked(len(views())>0) + +def Generator(): + global controller + if not controller: controller=ControllerClass(); + controller.show(); controller.raise_() + controller.setTabActive('generator') +def Controller(): + global controller + if not controller: controller=ControllerClass(); + controller.show(); controller.raise_() + controller.setTabActive('simulation') +def Inspector(): + global controller + if not controller: controller=ControllerClass(); + controller.inspectSlot() + +#if __name__=='__main__': +# from PyQt4 import QtGui +# import sys +# qapp=QtGui.QApplication(sys.argv) +# c=Controller().show() +# qapp.exec_() diff --git a/SudoDEM2D/gui/qt4/build b/SudoDEM2D/gui/qt4/build new file mode 100755 index 0000000..e6d3bcc --- /dev/null +++ b/SudoDEM2D/gui/qt4/build @@ -0,0 +1,4 @@ +#!/bin/sh +pyrcc4 -o img_rc.py img.qrc +pyuic4 controller.ui > ui_controller.py +pyuic4 SeqSerializable.ui > ui_SeqSerializable.py diff --git a/SudoDEM2D/gui/qt4/controller.ui b/SudoDEM2D/gui/qt4/controller.ui new file mode 100644 index 0000000..e66c074 --- /dev/null +++ b/SudoDEM2D/gui/qt4/controller.ui @@ -0,0 +1,1015 @@ + + + Controller + + + + 0 + 0 + 290 + 495 + + + + + 0 + 0 + + + + SudoDEM2D + + + + :/img/sudodem-favicon.xpm:/img/sudodem-favicon.xpm + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + 0 + + + + Simulation + + + + 0 + + + 0 + + + + + 6 + + + + + QLayout::SetMinAndMaxSize + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Load + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Save + + + + + + + Inspect + + + + + + + + + QLayout::SetMinimumSize + + + QFormLayout::AllNonFixedFieldsGrow + + + 6 + + + 6 + + + 6 + + + + + real + + + + + + + 00:00:00 + + + + + + + virt + + + + + + + 00:000.000m000μ000n + + + + + + + iter + + + + + + + #0, 0.0/s + + + true + + + + + + + Δt + + + + + + + + + + + fixed + + + true + + + + + + + false + + + time stepper + + + + + + + + + false + + + Qt::ClickFocus + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + [no file] + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 6 + + + 6 + + + + + 0 + + + + + false + + + + 5 + 0 + + + + + 18 + + + + + + + + 32 + 32 + + + + true + + + false + + + + + + + false + + + + 4 + 0 + + + + + 18 + + + + ▮▮ + + + + 32 + 32 + + + + + + + + + + 0 + + + + + 0 + + + 0 + + + + + false + + + + 2 + 0 + + + + + 12 + + + + ▶▮ + + + + 32 + 32 + + + + + + + + + 7 + + + + sub-step + + + + + + + + + false + + + + 5 + 0 + + + + + 22 + + + + + + + + 32 + 32 + + + + + + + + + + + + + + Show + + + true + + + + + + + Reference + + + + + + + Center + + + + + + + + + + + + Display + + + + 0 + + + 0 + + + + + + + + true + + + + + 0 + 0 + 284 + 433 + + + + + + + + + + Generate + + + + 0 + + + + + 0 + + + + + + + + + 200 + 200 + + + + + 0 + 0 + + + + true + + + + + 0 + 0 + 500 + 500 + + + + + 0 + 0 + + + + + 500 + 500 + + + + + 398 + 336 + + + + + + + + + + + false + + + memory slot + + + false + + + false + + + + + + + /tmp/scene.sudodem.gz + + + + + + + open automatically + + + true + + + + + + + Generate + + + + + + + + + + + + Python + + + + + + + + + Monospace + + + + IBeamCursor + + + Qt::StrongFocus + + + false + + + true + + + QComboBox::InsertAtTop + + + 1 + + + false + + + + + + + <i>(Output appears in the terminal)</i> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + loadButton + clicked() + Controller + loadSlot() + + + 93 + 64 + + + 284 + 0 + + + + + saveButton + clicked() + Controller + saveSlot() + + + 184 + 64 + + + 284 + 0 + + + + + dtFixedRadio + clicked() + Controller + dtFixedSlot() + + + 143 + 170 + + + 284 + 0 + + + + + dtDynRadio + clicked() + Controller + dtDynSlot() + + + 268 + 176 + + + 284 + 4 + + + + + dtEdit + editingFinished() + Controller + dtEditedSlot() + + + 147 + 204 + + + 284 + 43 + + + + + playButton + clicked() + Controller + playSlot() + + + 116 + 304 + + + 3 + 309 + + + + + pauseButton + clicked() + Controller + pauseSlot() + + + 268 + 304 + + + 284 + 311 + + + + + referenceButton + clicked() + Controller + setReferenceSlot() + + + 184 + 429 + + + 5 + 469 + + + + + centerButton + clicked() + Controller + centerSlot() + + + 275 + 429 + + + 284 + 469 + + + + + generateButton + clicked() + Controller + generateSlot() + + + 101 + 60 + + + 284 + 469 + + + + + dtEdit + textEdited(QString) + Controller + dtEditNoupdateSlot() + + + 147 + 204 + + + 284 + 205 + + + + + dtEdit + cursorPositionChanged(int,int) + Controller + dtEditNoupdateSlot() + + + 147 + 204 + + + 284 + 181 + + + + + generatorCombo + currentIndexChanged(QString) + Controller + generatorComboSlot() + + + 101 + 60 + + + 284 + 130 + + + + + displayCombo + currentIndexChanged(QString) + Controller + displayComboSlot() + + + 101 + 45 + + + 284 + 108 + + + + + pythonCombo + activated(QString) + Controller + pythonComboSlot() + + + 107 + 66 + + + 284 + 68 + + + + + inspectButton + clicked() + Controller + inspectSlot() + + + 247 + 54 + + + 0 + 58 + + + + + reloadButton + clicked() + Controller + reloadSlot() + + + 194 + 363 + + + 284 + 437 + + + + + stepButton + clicked() + Controller + stepSlot() + + + 79 + 363 + + + 6 + 450 + + + + + subStepCheckbox + stateChanged(int) + Controller + subStepSlot() + + + 42 + 376 + + + -2 + 381 + + + + + show3dButton + toggled(bool) + Controller + show3dSlot(bool) + + + 42 + 418 + + + -2 + 422 + + + + + + loadSlot() + saveSlot() + reloadSlot() + playSlot() + pauseSlot() + stepSlot() + setReferenceSlot() + centerSlot() + dtFixedSlot() + dtDynSlot() + dtEditedSlot() + generateSlot() + dtEditNoupdateSlot() + generatorComboSlot() + displayComboSlot() + pythonComboSlot() + pythonEditSlot() + inspectSlot() + subStepSlot() + show3dSlot(bool) + + diff --git a/SudoDEM2D/gui/qt4/img.qrc b/SudoDEM2D/gui/qt4/img.qrc new file mode 100644 index 0000000..16ad0f1 --- /dev/null +++ b/SudoDEM2D/gui/qt4/img.qrc @@ -0,0 +1,5 @@ + + + sudodem-favicon.xpm + + diff --git a/SudoDEM2D/gui/qt4/img_rc.py b/SudoDEM2D/gui/qt4/img_rc.py new file mode 100644 index 0000000..3ecd3d0 --- /dev/null +++ b/SudoDEM2D/gui/qt4/img_rc.py @@ -0,0 +1,1017 @@ +# -*- coding: utf-8 -*- + +# Resource object code +# +# Created by: The Resource Compiler for PyQt4 (Qt v4.8.7) +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore + +qt_resource_data = "\ +\x00\x00\x3d\x0a\ +\x00\ +\x02\x5c\x12\x78\x9c\xed\x9d\x67\x57\xdb\xcc\xf3\xf7\x1f\xdf\xff\ +\x57\x21\x7e\x72\xc1\x96\xad\xc8\xea\xc2\xc8\x47\xcd\x0e\x04\x48\ +\x01\xd2\x0f\x10\x6a\x42\x02\xa1\x26\x21\x05\x5e\xfb\xbd\xda\xef\ +\xac\x8d\xa9\xc6\xd8\x40\x72\x69\x74\xf2\x60\x90\xb4\x3b\x3b\xf3\ +\xd9\xd9\x22\xc9\x79\x54\x96\xde\x3c\x9f\x91\xca\x8f\xfe\xef\xe0\ +\x70\xf9\x70\x73\x55\x5a\xfd\xb4\xbc\x2f\x95\xa5\x83\x6f\x6b\x3b\ +\x6b\xeb\xdb\x4b\x1b\xcb\xdf\x37\x57\x77\xbe\x2e\x1d\xed\x6e\xbf\ +\x5f\x90\x7c\xe9\xf7\xff\xfd\x4f\xb7\x6c\x29\xfd\x57\x33\x35\x4b\ +\xd2\xff\x57\xf9\xbf\xff\x49\xd2\xff\x5b\x95\x9e\xee\x7c\x5d\x4f\ +\x15\x35\x55\x64\x8d\x4b\xaa\x2b\x5c\x77\x9a\x89\x99\x24\xa9\x1e\ +\x70\xdd\x74\x6a\x66\xcd\x49\x75\x19\xe7\xe3\xc4\xc0\xf9\x1c\xd7\ +\x5d\x2d\xb1\x92\x66\xaa\xe7\xb9\xee\x35\x93\x56\xd3\x4c\xf5\x02\ +\xce\xeb\xe2\x7c\x19\xba\x91\xd8\x49\x2b\xd5\x7d\xae\xdb\x66\x1c\ +\xc7\xfc\x7c\x15\xba\x11\x47\x71\x9c\xea\x75\xe8\x35\xa6\x47\xa9\ +\xde\x40\xfd\x76\x52\x4b\xc2\x54\xaf\xa0\x3c\x4b\x94\x57\xc4\xf5\ +\x96\x28\xaf\xd4\x29\x8f\xdb\x3b\x02\x5d\x17\xe5\x9f\x88\xf2\x43\ +\x94\xff\x1b\xe5\xbb\x89\x8e\xf2\x17\x50\xbe\x93\x38\x4d\xee\x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x19\x96\x69\x71\xfb\xa7\xa9\xbf\xb2\xe1\ +\x93\xf3\x31\x23\xfa\x17\xd5\xff\x14\xd7\x6b\x42\x7f\x86\xfa\x34\ +\xe1\xbf\xe7\xa8\xcf\x15\xf3\xa3\x17\xa8\xcf\xf6\x34\x97\xc7\x73\ +\x56\xf8\xcb\x42\x7f\x9e\xa3\xf2\x0c\x17\xf6\xcd\xa3\x7e\x8b\xd9\ +\x83\xf9\x37\xca\xb7\x44\xbe\x7a\x85\xf3\xb1\xe0\xff\x35\xe2\xc3\ +\x00\xc5\x78\xfd\x46\xd4\xef\x81\xb7\xb7\x38\x9f\x38\x8e\xc3\xfd\ +\xf5\x4e\xf8\x97\xf6\xdb\x3e\x50\x7e\xb6\x62\x8c\x67\x92\x0c\x5d\ +\xac\x67\x54\xae\xb3\xc9\x10\xad\x0f\x15\x99\xfc\x61\x62\x7c\x0f\ +\x70\x7d\x24\xee\x97\x71\x7d\x4b\x5c\x9f\xc3\xf5\xe9\x7e\x02\xef\ +\x5f\x79\x5c\xdf\xb4\x3c\x8b\xeb\x05\x9c\x0f\x85\x3f\xcb\xb8\xdf\ +\x14\xf7\xfb\x72\xbb\x7d\xc8\xdf\x5c\x4f\xf7\x57\x91\x5f\xeb\xa2\ +\x7c\x0b\xf1\x6f\xc8\x18\x7f\xac\xc8\xe2\xbc\x56\xe8\x7a\x31\x3f\ +\x2b\x72\x3d\x09\xc5\xf8\x59\x92\xdb\xbc\xf2\xf6\x8c\xc8\x34\xde\ +\x47\xa8\xef\x44\x26\x7f\xd2\xfc\xe4\x37\x74\x47\xac\x27\x16\x50\ +\xbe\x9d\xc4\x18\x8f\x16\x51\xbf\x67\x35\x6d\x6e\xdf\x23\x99\xc6\ +\x1f\xda\x8f\x1a\x85\xee\xb2\x09\x21\xf7\xd7\x12\xea\x4f\xd8\xf4\ +\x86\xdb\x3f\x26\xec\xa1\xfd\x8e\x71\xd4\x17\x33\x7e\x79\xfc\xdf\ +\x73\xdd\x88\x58\x7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\x63\xff\x47\ +\x81\x5e\x63\xc3\x23\xf2\x37\xd7\xf5\x96\x41\xcf\xcf\x65\xe8\xb1\ +\x61\x61\x7f\x30\x07\x3d\x34\x74\x87\xdf\x9f\x2f\x60\xbc\x17\xf6\ +\x16\xb8\x1e\x69\x91\x03\x7f\x96\x71\x3e\x9d\x6f\xf3\xfa\x7d\xba\ +\x5e\xcc\x0f\xab\x05\x8c\xc7\xa6\x61\xf3\xeb\xeb\x5c\x67\xcb\x1b\ +\x2b\xe4\xbc\x36\xa0\x87\x4d\x7a\xff\xaa\x02\xdd\x4b\x5a\x78\xff\ +\xb1\x08\xdd\x61\x2b\x06\xcc\xbf\x0b\x18\xff\xc4\xf3\xda\x11\x94\ +\x6f\xbb\x0e\xd6\x37\x27\x5c\x8f\x63\xb1\x9e\xfc\x0d\x3d\x12\xd7\ +\x2f\xe0\x7e\x36\x5d\xc4\xfc\x6b\xb1\x40\x7c\x8a\xf7\x07\x0b\xc4\ +\xa7\x07\x1e\x47\xe1\x0f\x97\x4d\xd8\xb9\x3f\x96\xa0\x47\x86\x89\ +\xf5\xc1\x18\xf4\xc4\x70\x5c\xec\x7f\x77\xfc\x85\xf7\x4f\x60\x5f\ +\x1c\xd2\xfb\x22\xc7\xb8\xde\x63\xe5\xf1\xf2\xff\x88\x78\x44\x2e\ +\xbf\xbe\x86\x78\x85\x26\xed\x6f\xe8\x28\xcf\xb5\xcd\x08\xfb\x27\ +\xd0\x13\x96\x7f\x91\xbf\x0b\x34\x1e\xd2\x7c\xd4\x82\xfd\x2d\xab\ +\xe9\x71\x7b\xed\x02\x8d\x67\x06\xe6\x4b\x4e\xc7\xff\xbc\xfd\xae\ +\xf0\xbf\xae\x71\x7b\x3c\xf2\x7f\xb3\xa6\x71\x7f\x68\x1d\x9d\xf7\ +\xa7\x65\xe8\x11\x5b\x21\xf3\xf3\x2b\xa8\xaf\xa6\x87\x58\xff\xac\ +\xc2\x1e\x4f\x0b\x35\xae\xaf\x15\x90\x0f\xec\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1\x5e\x5a\xdf\x7e\x11\xf1\xf1\xf0\xfe\xe6\x16\ +\xec\x67\x09\x07\xfb\x15\xdb\x9d\xfe\x80\xf7\x07\x89\xaf\x88\xc6\ +\xe7\x1d\xd1\xbe\x10\xf9\x72\x57\xb4\xc7\x85\x7d\x7b\xc2\x5e\x0b\ +\xfa\x3e\xfc\x97\x4e\xbf\xf8\xf5\x07\x5c\x77\x6b\x6c\xc2\xc2\xfd\ +\x73\x88\xeb\x13\x71\xff\x37\xf2\x87\x55\x43\x7b\xbe\xc3\x9e\x74\ +\x7d\x81\xef\xe7\xeb\x34\xbe\x68\xc8\x97\x47\xd4\x7f\x44\x3e\xf8\ +\x29\xfa\x87\x86\xf7\xe5\x7e\x09\x5e\x69\x3f\x2e\x14\xed\xa7\xf7\ +\x83\x23\xe8\x6c\xf6\x8f\xf7\xd9\x62\xd8\x1b\x1b\x94\xcf\x13\xd4\ +\xef\x6a\xe4\xdf\xa6\xe0\x93\xc6\x8f\x16\xb5\x37\x76\xc0\xe7\x63\ +\xe8\x96\x18\x6f\x27\x10\x9f\xb8\x96\xa0\xfd\x93\x28\x9f\x2d\xf7\ +\xe8\xfb\x79\xaa\xdf\x0b\x71\xfd\x14\x78\xf6\x1c\x07\xe3\xf7\x34\ +\xf5\x97\x9a\x86\xf6\xcf\x88\xf8\xd2\x78\xf2\x94\xda\xd7\x7e\xff\ +\x5b\xb4\x97\xc6\x93\xe7\x22\xfe\x94\x7f\x5e\x50\x7f\x16\xef\x1f\ +\xce\x0a\xde\x5b\xd8\xcf\x99\x43\xfd\x4e\x18\x59\xdc\xbe\x79\xd4\ +\x9f\xee\xb7\x73\xff\xbe\x84\xce\x5a\x0b\x7f\xbc\x22\xfb\x9b\x2d\ +\x3c\xff\x78\x2d\x78\xf7\xb0\xff\xf0\x46\xf0\x51\x43\xfb\xde\x52\ +\xbe\x10\xfa\x3b\xc1\xaf\x47\xdf\x5f\xa2\x7c\x43\x94\x2f\x35\xf8\ +\xf5\x4d\x36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c\ +\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\x32\ +\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\xc9\ +\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\ +\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\ +\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\ +\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\ +\xc9\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\ +\x24\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\ +\x93\x8c\x81\x4c\x32\x06\x32\x19\x06\x03\x6a\xfb\x18\x54\x59\x99\ +\x0c\x53\x06\xc3\x80\xda\xd3\xd1\x7f\xb9\x99\x0c\x53\x6e\xc7\x40\ +\x6f\xb1\xef\x9f\x85\x8c\x81\xbb\x90\x7e\x19\xe8\x2f\xfa\x37\x23\ +\x61\x90\x63\x4a\x26\x97\x4b\x3f\x0c\xdc\x3e\xfe\xbd\x45\x37\x63\ +\xe0\x6e\xe4\xe6\x0c\x0c\x92\x80\xab\x22\xdc\xdf\xe8\x91\xc9\xcd\ +\xe5\x66\x0c\x0c\x3e\xfe\x97\x47\x39\x63\xe0\xae\xa4\x77\x06\x86\ +\x17\xff\xb3\xd1\xee\x35\x53\x64\x32\x18\xe9\x95\x81\xfe\xfa\xf2\ +\x4d\xee\xee\xaf\xe4\x4c\x6e\x2f\xbd\x31\x30\xa8\x28\x65\x0c\x3c\ +\x44\xe9\x85\x81\xc1\xc6\x27\x63\xe0\xa1\xc9\xf5\x0c\x0c\x27\x3a\ +\x19\x03\x0f\x47\xae\x63\x60\x98\x91\xc9\x18\x78\x18\x72\x35\x03\ +\xc3\x8e\x4b\xc6\xc0\x43\x90\xab\x18\xb8\x9b\xa8\x64\x0c\xdc\xb7\ +\x5c\xce\xc0\xdd\xc5\x24\x63\xe0\x7e\xa5\x1f\x06\x06\x2f\x19\x03\ +\xf7\x29\x97\x31\x70\xd7\xf1\xc8\x18\xb8\x3f\x79\x28\x0c\xdc\xe5\ +\xd8\x93\x49\xb7\x5c\xcc\xc0\xfd\x44\x23\x63\xe0\x7e\xe4\x21\x31\ +\x70\x79\xbd\x99\x0c\x53\x2e\x62\xe0\x3e\xfb\x63\xc6\xc0\xdd\x4b\ +\xc6\x40\x26\xe7\x19\xb8\xef\xb9\x59\xc6\xc0\x5d\xcb\xc3\x63\x20\ +\x7b\x87\xe4\xae\x25\x63\x20\x93\xb3\x0c\xdc\x3f\x01\x17\x59\x91\ +\xc9\x30\x25\x63\x20\x93\x8c\x81\x4c\x6e\xc2\xc0\xfd\x51\x90\xc9\ +\x30\x25\x63\x20\x93\x87\xca\x40\xf6\x8d\xc9\xdd\x49\xc6\x40\x26\ +\x37\x63\xe0\xbe\x46\x83\x4c\x86\x29\x0f\x97\x81\xec\xbb\xe3\xbb\ +\x92\x9b\x32\x70\x3f\x99\x20\x93\x61\xca\xcd\x19\xb8\xbb\x88\x64\ +\x0c\xdc\x8d\x64\x0c\x64\xd2\x0f\x03\x77\xff\xec\x28\x93\x61\x4a\ +\x7f\x0c\xdc\x35\x05\x99\x0c\x53\x6e\xf6\xec\xf8\xae\x29\xc8\x18\ +\xb8\x0b\xe9\x9f\x81\xbb\x88\x4d\xc6\xc0\x5d\xc8\xed\x18\xb8\xab\ +\xf7\x8c\x33\x19\xa6\xdc\x96\x81\xbb\xf9\xe2\x20\x93\x61\xca\xcd\ +\xde\x2b\xbe\x9c\x83\x9b\xdf\x73\xff\xc7\xfd\xc8\x7d\xb7\xfa\xfc\ +\x31\x18\x06\xfe\xd6\xe3\x3e\xe4\xbe\xdb\x7c\xfe\xb8\xe9\x77\x46\ +\xff\xd6\x71\x1f\x72\xdf\x6d\x3e\x7f\xfc\x97\x19\xb8\x1f\xb9\xef\ +\x56\x9f\x3f\x6e\xfe\xdd\x71\xbf\x9e\xbd\xeb\x96\xfd\xbd\x72\xd7\ +\xde\x18\x3c\x03\xd7\x79\x3f\x8b\x7d\xaf\x72\x57\xde\xe8\xef\xb7\ +\x68\x1e\x2a\x07\xff\xa2\x0c\xdf\x1b\xfd\xfe\x26\xd5\xed\x2d\xc8\ +\xe2\xdf\xbb\x0c\xd7\x1b\xc3\x63\xe0\x7a\x4b\x32\x02\xae\x12\xa5\ +\x4b\x1b\xa6\x37\xfa\xff\x7d\xc2\x41\xd8\xf3\x50\xe2\x1f\x74\x1d\ +\xf7\x2b\x32\x1d\x39\x29\xdf\xf5\xf7\xe1\x79\xe3\x36\xbf\x53\x3a\ +\x88\x28\xdd\x57\xfc\x83\x9e\x8e\xbb\x15\xb9\xeb\x28\xf4\xc5\x40\ +\x3f\x72\xdb\xdf\x2b\xbe\x6d\xb4\xee\x32\xfe\xbd\xc5\xfd\xee\x49\ +\x90\x2f\x3c\xca\x8c\x81\x9b\x53\xd0\x8f\xdc\xfe\x77\xcb\x6f\x1b\ +\xb5\xe1\xc6\xbf\xdf\xb8\x0f\x9f\x03\x5f\xaa\x4a\x75\xa9\x71\x09\ +\x01\xb2\x54\xe1\x0c\x9c\xa6\x60\x38\x04\x0c\xee\xff\x2f\xe8\x3f\ +\x7a\x83\x26\x60\x50\x51\x1f\x16\x07\x45\xa9\x24\x8d\xf0\xe3\x44\ +\xfa\x7d\x29\x01\xb2\xb4\x20\x2d\xde\x38\x13\xf4\x27\x83\xfc\x7f\ +\x4c\xfa\x8b\xe0\x20\x08\x18\x5e\xdc\x07\x47\xc1\x23\x16\xfb\x2a\ +\x45\x1f\xc7\x55\x04\xa4\x0c\x8c\xde\x30\x13\xf4\x2b\xf7\xf5\xff\ +\x19\xf5\x5f\xb2\x90\xbb\x8a\xfb\x6d\x39\x58\x62\x3d\x7f\xe4\xdc\ +\x51\x92\xc6\xae\x88\xff\xb8\xf4\x5e\x3a\x96\xfe\x48\xb5\x07\xc6\ +\xc0\xf5\x36\xf4\xcb\xc1\x4d\xee\xd1\x25\xe3\xde\xa2\xdf\x0f\x05\ +\xe7\xa3\x9f\x1e\xe6\x95\x04\x58\x92\x2d\x39\x92\x2b\x79\x0f\x92\ +\x81\xe1\xec\xee\xdd\xec\x7a\x4d\x5a\xbe\xc3\x78\xaf\x48\xab\xd2\ +\x1a\x3b\x56\xf9\xbf\x95\x1b\x73\x70\x11\x01\x17\xcd\x03\xd6\xa5\ +\x0d\xe9\xa3\xf4\x49\xda\x94\x3e\x4b\x5f\xa4\x2d\x69\x5b\xfa\x2a\ +\xed\x48\xbb\x0f\x92\x81\xeb\x2d\xb9\x39\x05\x37\xbb\x7a\x4f\xda\ +\x97\x0e\xa4\xc3\xa1\x45\x3d\x8d\xf6\x37\xe9\xbb\xf4\x43\x3a\x92\ +\x7e\x4a\xbf\xa4\x50\x8a\xa4\x98\x1d\x91\x94\x48\x4d\xa9\x25\x3d\ +\x96\x26\x18\x0b\x93\x3d\xfa\xea\x22\x06\x9e\x48\xa7\xb3\xfe\x94\ +\x34\x2d\xcd\x48\x4f\xa5\x67\xd2\x73\xe9\x85\x34\x2b\xcd\x49\xf3\ +\xed\xe3\x25\x9f\x13\xf4\xea\xf9\x7e\xa5\xbf\xff\xef\x78\xb0\x14\ +\xdc\x94\x81\x3d\xe9\x95\xf4\x7a\xa0\x14\xac\xf0\x3e\xfe\x46\x7a\ +\x2b\xbd\x93\x3e\xb0\xe6\xa9\xaa\xa2\x06\xaa\x7c\xe9\x91\x53\xf3\ +\x6a\x41\x2d\xf7\xe0\xf6\xf3\xf3\x00\x10\x30\x25\xf9\x6a\x55\xad\ +\xab\x0d\xb5\xa2\x16\xd5\x59\xd6\xeb\xe7\x2f\x38\x4a\xea\x88\x5a\ +\xeb\xd9\xef\xfd\x4a\xff\xff\xef\xf9\x7d\x32\xb0\x27\x9d\xa8\xbf\ +\xd5\x41\x44\x7f\x41\x5d\x50\x17\xd5\x47\x6a\x2c\x29\xea\xe8\x15\ +\x51\x3f\x7d\x2c\xa9\x63\xea\x38\x3b\xde\xab\xc7\xd7\x3a\xfe\x2c\ +\x01\x7f\x54\x59\xaa\xa9\xba\x6a\xa8\xa6\x6a\xa9\x17\xc5\xbd\xfb\ +\xb0\x55\xe7\x54\x1d\x0f\x8d\x81\xfb\xa1\x40\x30\xe0\xaa\x9e\xaa\ +\xa9\xcb\x7d\x70\xb0\xac\xae\xa8\xab\xea\x9a\xba\xae\x6e\xa8\x1f\ +\xd5\x4f\xea\x26\x8b\x7d\xaf\xd1\x4f\x8f\xcf\xea\x17\x4e\x40\x7a\ +\x6c\xa9\xdb\xea\xd7\x2b\x9d\x7f\x9a\x80\x1d\x75\x9c\xe7\x80\x5d\ +\x75\x4f\xdd\xef\x21\xfe\xe9\x31\x27\x1d\x3c\x68\x06\xae\xb7\x6a\ +\x78\x0c\xec\x49\x87\xea\x37\xf5\xbb\xfa\xa3\x27\x0a\x0e\xa5\x23\ +\xf5\xa7\xfa\x4b\x0d\xd5\x48\x8d\xd5\x44\x6d\xaa\x2d\x96\xeb\x6f\ +\x12\xf9\xce\xf1\x98\xb2\x40\x87\x83\x89\x2b\xdc\xdf\x59\x09\x4c\ +\xaa\x62\x0e\xf0\x44\x9d\x52\xa7\xd5\x99\x1e\x29\x98\xef\xd9\xdb\ +\xfd\xca\x6d\x19\xb8\x6b\x0a\x3a\x0c\xec\x49\x4f\xd5\x67\xea\xf3\ +\x4b\x29\x38\x94\x5e\xa8\xb3\xea\x9c\x3a\xaf\xbe\x54\x5f\xa9\xaf\ +\xd5\x37\xea\x5b\xf5\x9d\xfa\x41\x95\x94\x7e\x22\xdf\x39\x54\x65\ +\x5c\x3d\x7f\x5c\xe6\x1d\x10\xa0\x28\xa7\x57\x02\x81\x22\x2b\x39\ +\x25\xaf\x14\x94\x5e\x63\xdf\x9b\xaf\xfb\x95\xdb\x33\x70\xbd\x6d\ +\x83\x65\xe0\x34\x05\xae\x5a\x56\x7c\xa5\xaa\x74\x47\xbf\xae\x34\ +\x94\x8a\x52\x54\x4a\xca\x88\x72\xa2\xfc\x56\x16\x94\xc5\x5b\xc6\ +\xbd\x73\x3c\x52\xb6\x2e\x20\xe0\x32\x0a\x46\x95\xaa\xb4\xa4\x8c\ +\x29\x67\x76\x80\x94\xf7\xca\x31\x3b\xfe\x28\xb5\x73\x14\xdc\xc6\ +\xcf\xfd\xca\x60\x18\xb8\xde\xbe\xe1\x30\x90\x52\xa0\x2b\x86\x62\ +\x2a\x3f\x54\x4b\xb1\x14\x5b\x71\x14\x57\xf1\x14\x4d\x59\x56\x56\ +\x94\x55\x45\x52\xd6\x06\x16\xfd\xf4\x58\x57\x36\x2e\xcc\x02\x97\ +\x51\xf0\x87\x66\x00\xdd\xc7\x47\x62\xe0\x58\xf9\xa4\x6c\x2a\xdd\ +\x91\xb7\xf8\x15\x9f\x95\xf3\x65\x5d\xef\xe3\x7e\x65\x70\x0c\xdc\ +\x0d\x05\xa9\xec\x75\x1d\x5f\x94\x2d\x65\x5b\xf9\xaa\xec\x28\xbb\ +\xca\x9e\xb2\xaf\x1c\x28\x87\xca\x37\xe5\xfb\x40\x63\xdf\x1e\x07\ +\xd4\xcb\xb2\xc0\xc5\x14\x5c\xbc\x0f\xf8\x43\x39\x62\xf1\xff\xa9\ +\xfc\x52\x42\xe5\xe2\xeb\xa2\xbf\x96\x81\x54\xee\x9e\x81\x3d\x29\ +\x56\x12\xa5\xa9\xb4\x58\xe4\x87\x11\xf7\xce\xb1\xa9\x3e\xbe\x22\ +\x0b\x5c\x44\xc1\xc5\x0c\x4c\x28\x93\xca\x13\x65\x4a\x99\x56\x66\ +\x94\xa7\xca\xf9\xf3\xe3\xd2\x33\x25\x7f\x81\x6f\xff\x16\x06\x52\ +\xb9\x6b\x06\x9e\x2b\x2f\x18\x03\xc3\x8d\x7f\x7a\xac\x2b\xb3\xd7\ +\x32\xd0\x4d\xc1\xc5\x0c\xcc\x29\xf3\xca\xcb\x0b\x62\xdf\x61\xe0\ +\x95\x72\xf6\xa9\x71\x2f\x9e\xed\x57\x86\xc1\x40\x2a\x77\xc9\xc0\ +\xbe\xf4\x5a\x79\x73\x07\x0c\x2c\x9d\x59\x15\xf6\xcb\xc0\xf5\xc7\ +\x5b\xe5\xec\xd3\xa2\x5e\xbc\xda\xaf\x0c\x8b\x81\x61\x51\x90\xca\ +\xf9\xb1\xe0\x9d\xf2\x61\xe8\x0c\x6c\xaa\x52\x70\x3d\x01\xdd\x14\ +\xf4\xcb\x80\x1a\xd4\xce\xbd\x3b\x70\xbd\x4f\xfb\x95\xe1\x31\x90\ +\xca\xdd\x30\xa0\x04\x41\x20\x07\xc3\x67\xe0\xea\xf9\xe0\x20\x19\ +\xc8\x05\xf9\xe0\x5f\x61\x20\x95\xe1\x33\x50\x08\xca\x81\x3f\x74\ +\x06\xaa\xc1\xdd\x30\x50\x0f\x1a\x41\xe5\x1f\x63\x20\x95\xe1\x32\ +\xf0\x54\x2d\x06\xa5\xa1\x33\xf0\xa5\x47\x02\x4e\x53\xd0\x6b\xdc\ +\xc7\xa5\x74\x1f\x61\x24\x38\x09\x7e\x07\x0b\xc1\x62\xf0\x28\x18\ +\xfd\xe7\x18\x48\x65\x78\x0c\x2c\x05\x63\xc1\xf8\x90\x19\x78\xdf\ +\xe3\x5c\xe0\x66\x0c\x4c\x49\xc7\xc1\x9f\xa0\x16\xe8\x81\x11\x98\ +\x81\x15\x14\xd5\x6d\x29\x7d\x9a\x38\x27\xd9\x81\x13\xfc\x7b\x0c\ +\x0c\xee\xab\xa5\xf3\x79\xc0\x0d\xbc\xa1\x32\xb0\xa9\x6a\x03\x64\ +\x60\x39\x58\x09\x56\x83\xb5\x60\x3d\xd8\x08\x6c\x75\x56\xfa\x18\ +\x9c\x7f\x8a\xfc\x55\xfa\x14\x6c\x06\xff\x1e\x03\xa9\x0c\x87\x81\ +\xcf\xc1\x97\x81\x31\xb0\xc9\x8f\xee\xbf\x05\x3d\xcf\x07\xbb\x29\ +\xb8\x98\x81\xad\x60\x3b\xb8\xf8\x9d\x91\xd3\x87\xa5\x7e\x0d\x76\ +\x82\x9b\x78\xaf\x5f\xb9\x6b\x06\x52\xb9\x2d\x03\x67\x29\x78\xaa\ +\xee\x06\x7b\xb7\x66\x60\x3f\xd8\x0f\xd2\xb2\x0f\x82\xc3\xe0\x5b\ +\x20\x77\x71\xf0\xfd\x46\x59\xe0\x3a\x06\x7e\x04\x47\xc1\xcf\xa0\ +\x97\xa7\xc6\xbf\x82\x9b\x78\xae\x5f\xb9\x0f\x06\x6e\xff\x4d\xfd\ +\x59\x06\xc2\x20\xea\x83\x81\x40\x8d\x83\x8b\xac\x4b\x82\x66\x90\ +\x04\xad\xe0\x71\x00\x0e\x3e\xab\x13\x03\x66\xe0\x58\x99\x0c\x9e\ +\x04\xe7\x9f\x1a\x5e\xf7\x14\xf1\x5f\x62\x20\x95\xc1\x31\xb0\x27\ +\x4d\x05\xd3\x7d\x30\x70\x99\x65\x33\x01\x8e\xa7\xc1\xb3\x60\x5d\ +\x49\x9f\x17\xbf\xbf\x21\x01\x60\xe0\xb2\x99\x60\xca\xc0\xb1\xf2\ +\x3c\x78\x11\xcc\x5e\x98\x0d\xfa\xf5\x59\xbf\x72\x7f\x0c\xdc\x86\ +\x82\xb3\x0c\xcc\x05\xf3\x43\x60\x60\x86\xe5\x83\x97\x2c\x17\xbc\ +\xba\x71\x16\xb8\x9a\x81\xd7\x01\x9e\x1c\xbf\x09\xde\x06\x9b\x4a\ +\x2f\xef\x0d\xf4\xe6\xb1\x7e\xe5\x3e\x19\x48\x65\x30\x0c\xbc\x0b\ +\x3e\x0c\x85\x81\xf4\x90\xd8\xa5\x37\x67\x20\xa5\xe0\x3a\x06\xd2\ +\x63\x90\xde\xea\x57\xee\x9b\x81\xfe\x7e\x1b\xf7\xdc\x6e\xb1\x1c\ +\xc8\xc3\x62\xa0\xc9\x8a\xce\x18\x18\xb6\xdc\x9c\x82\xb3\x0c\xe4\ +\xe4\x7c\x1f\x0c\xc4\xc1\xc5\xf6\x74\x33\x30\x13\x14\xe4\x72\x1f\ +\x14\x5c\xce\x80\x2f\x5f\xc7\x40\x67\xff\xb0\x2a\xf7\xee\xa9\x7e\ +\xe5\xdf\x60\xa0\x2e\x37\xe4\x9b\xbf\x35\x56\x91\x2f\xb6\xe7\x2c\ +\x03\x49\x50\x1c\x20\x03\x25\x79\x84\x31\x70\x22\xbf\x09\x7e\xcb\ +\x3f\xdb\x0c\x5c\x7c\xed\xb8\xb4\x20\xdf\xc7\x77\x46\xb7\x2d\xf1\ +\xe6\x72\x7b\x06\x0e\xd5\x45\xf9\x66\xef\x0b\x3f\x92\x47\xe5\xa5\ +\x1e\x19\x48\x33\xc1\xe0\x18\x18\x93\x27\x95\x71\xf9\xbd\xfc\x43\ +\x39\x96\xc7\xe4\xcb\x72\x05\x8e\x3f\x72\x4d\x3e\xbd\x63\x9c\x31\ +\xd0\xb1\xec\x5d\xd0\xcd\x80\x2e\x1b\xb2\x29\xef\xf3\x95\xdc\x75\ +\x87\x25\xdb\xb2\x23\xbb\xb2\xc7\x0e\xad\xeb\x10\xf6\x9c\x67\x20\ +\x09\x96\x6f\x4c\xc1\x55\x4f\x0b\x56\xe4\x39\x65\xee\x8a\x37\x89\ +\x3a\x79\x20\xea\x7a\x9b\x24\x63\xa0\x73\xac\xca\xdd\x0c\xb8\xea\ +\x9a\xbc\x2e\x8f\xa9\x52\xb0\x21\x7f\xbe\x92\x80\x8f\xf2\x27\x79\ +\xf3\x4c\xec\xcf\x92\xf0\x59\x3e\x4f\xc1\x17\xb9\x7b\xb7\xb8\x2c\ +\x6f\xb1\xbf\x6c\xcb\x5f\xe5\x1d\x79\x57\xde\x93\xf7\xe5\x03\xf9\ +\x90\x55\xd0\x99\x39\xf4\xff\xf6\xc0\xe9\xe3\x9b\xfc\x4c\xe9\x3c\ +\x41\xcc\x18\xe8\x1c\xdf\xcf\x30\xf0\x43\x3e\x92\x7f\x72\xef\x8f\ +\xa9\xbf\xe4\x0d\x39\x38\xb7\xe3\x2f\x72\x40\x28\x47\x57\x12\xa0\ +\xc9\xb1\x9c\xc8\x4d\xb9\x75\x8e\x83\xc7\x72\x27\xfe\x13\x2c\xe6\ +\x93\xf2\x13\x79\x8a\x1d\xd3\x74\x4c\xc9\x33\xec\xdf\x53\xf9\x99\ +\xfc\x9c\x93\x30\x18\x06\x5e\xc8\xa7\xdf\x24\xc8\x18\xe8\x1c\xb3\ +\xf2\xd9\x19\xc1\x9c\x3c\x7f\x2a\x5b\x6f\xa9\x8f\x2f\x18\x15\x5e\ +\xca\xaf\xe4\xd7\xd7\x10\x80\xe3\x8d\xfc\x56\x4e\xce\x30\xf0\x8e\ +\xfa\xf8\x84\xfc\xa1\x1d\xf7\x8b\x8f\x29\x59\xca\x4d\xc8\x83\x61\ +\xe0\x24\x50\x73\xf7\xc7\xc0\xdd\x51\x70\x73\x06\x94\xdc\x59\x06\ +\x82\xdc\x7c\xd7\x88\xbd\xa5\xaa\xb2\x14\xc8\xb9\xd3\xf9\x20\x97\ +\x3b\x3b\x03\x48\x8f\x7c\xae\x90\x2b\xe7\xfc\x5c\x35\x57\xcf\x75\ +\xfe\xda\xc8\x55\x72\xc5\x5c\xf7\x68\x90\xee\x15\x95\x72\x57\xc7\ +\x5f\x50\x30\x92\x1b\x10\x03\xb9\x8c\x81\xcb\x5a\x7b\x96\x81\xdf\ +\xb9\x85\xdc\xf9\x79\xd9\x7b\x3e\x43\x58\xe4\x24\x3c\xca\x8d\xe6\ +\xce\x13\xb0\x94\x1b\xcb\x8d\xe7\xde\xe7\x8e\x73\x7f\x72\xb5\x9c\ +\x7e\xea\x0a\xe3\x0c\x05\xcd\xc0\xcc\x59\x3d\x11\x90\x1e\x93\xb7\ +\xce\x03\xe3\x92\x9d\x73\x72\x27\x39\x37\x63\xa0\x47\x06\xbc\xdc\ +\xcf\x4b\x66\xee\x63\xea\xb6\xfa\x58\xd5\x72\xcb\xb9\x95\x0b\x18\ +\x58\xcd\xad\xe5\xd6\xe9\xd8\xc8\x7d\xcc\x7d\xca\x6d\xb6\xaf\xfa\ +\x9c\xfb\x92\x3b\x3d\x2f\xd8\xea\x99\x80\x69\xbe\xc6\xb8\x69\xcc\ +\xb7\x73\xe9\x3b\x65\x5f\x73\x3b\xb9\x91\x60\x37\xb7\x97\xdb\xcf\ +\x1d\xe4\x0e\x73\xdf\x72\xb5\x8c\x81\x9e\x18\xf8\x9e\xfb\x71\x41\ +\x1e\xe8\x1c\x47\xb9\x9f\xb9\x5f\xe7\x18\x08\x73\x51\x9b\x80\xf4\ +\x88\x73\x49\xae\x79\xea\xaa\x58\x6e\x9d\xa2\xe0\xf1\x50\x18\xb0\ +\xe8\xa8\xca\x13\xb9\xc9\xdc\x93\xdc\x54\x6e\x3a\x97\xfe\x1a\xd1\ +\x57\xfa\x55\x9a\x99\xdc\xd3\xdc\xfd\x31\x70\x57\x14\x0c\x82\x81\ +\x67\xb9\xe7\x57\x32\xf0\x22\x37\x7b\x41\x16\x98\xcb\xcd\x77\x31\ +\x90\x52\xf0\x32\xf7\xea\xd4\x95\xaf\x73\x6f\xda\xe3\xc1\xdb\x01\ +\x30\x30\xce\x8f\x77\xb9\x0f\x39\x29\xaf\xe6\x15\x36\xe9\x67\x13\ +\x92\x7c\x3e\x3f\x93\xdb\x91\x2c\xd5\x52\xe7\xba\x7e\x8f\x08\xc7\ +\x8e\x54\xc8\xd7\x7a\xf0\x54\xbf\xf2\xaf\x30\x50\xce\x5f\xc5\x80\ +\x9f\x9f\xcf\x55\xf3\x67\x09\xa8\xe7\x1b\xf9\xf5\xdc\xd9\xa3\x92\ +\x2f\x76\x5d\x99\xc8\xa5\x3c\x18\x18\xc9\xf7\x4a\xc0\x09\xef\xb6\ +\x88\xfa\xbb\xdc\x94\xf4\x3b\xbf\x90\xaf\x48\x8b\xf9\x47\xf9\xd1\ +\xfc\x52\x7e\x2c\x3f\x9e\x7f\x9f\x2f\xaa\xe9\x1b\xa4\xdb\x17\xc4\ +\xfc\xfc\xf1\x55\x3a\xce\x5f\xef\xa9\x7e\xe5\x5f\x61\xe0\x4f\xfe\ +\xf2\x27\xbc\xb5\xbc\x9e\x37\xf2\xe6\x39\x06\xc4\xce\x60\x37\x03\ +\x56\xde\xce\x3b\xa7\xae\x75\xf3\x1e\x31\xa0\xf5\xcc\x80\x95\x4b\ +\xcb\x5d\xce\xaf\xe4\x57\xf3\x6b\xf9\xf5\xfc\x46\xfe\x23\x8b\xf9\ +\xc7\x00\x6f\x0d\xf7\x73\xcc\xf6\xe0\xa9\x7e\xe5\xba\xff\xe7\xf4\ +\x2e\x64\x10\x0c\x7c\xca\x6f\xe6\x2f\x63\xe0\x73\xfe\x4b\x7e\x2b\ +\xbf\x7d\x29\x03\xa9\x9c\xa6\xe0\x6b\xbe\x70\x6a\x34\xd8\xc9\xef\ +\xde\x98\x81\x13\xda\xdc\xed\x2f\xde\x97\xbf\x53\x92\x31\x70\x15\ +\x03\x7b\xf9\xfd\x4b\x19\x38\x60\x19\xff\x30\xff\xed\x4a\x06\x4e\ +\x53\xf0\x3d\xff\xa3\xeb\xda\xa3\xfc\x4f\x4e\xc1\xaf\x9e\x19\x08\ +\x4f\x3d\xec\xeb\x35\xe6\xd1\xc5\x9f\x9b\xdf\xc0\x53\xfd\xca\xdf\ +\xc8\x40\x2a\x67\x19\x88\xf3\xc9\x25\x0c\xd4\xf2\x4d\xc6\x40\x2b\ +\xff\x98\xc7\x75\x22\x3f\x99\x7f\x92\x9f\x62\xc7\x34\x3b\xba\xed\ +\x10\x0c\xcc\xe4\x9f\x76\x31\xf0\x2c\xff\x3c\x7f\xb3\xf9\xc0\x8b\ +\x33\x25\x5f\xdf\xcf\x67\xf3\x73\xf9\xf9\x6b\x29\xb8\x1f\x06\xee\ +\x82\x82\x41\x30\xf0\x5d\x9e\xb8\x64\x3e\xf0\x32\xff\x8a\x31\xf0\ +\x3a\xff\x26\xff\x36\xff\x2e\xff\x21\x2f\x15\xd4\x82\x52\x08\x0a\ +\x72\x21\x57\xe8\xb6\x43\x30\x90\x2f\x14\x0a\xe5\x82\x26\x4f\xe6\ +\x27\x38\x0b\x7e\xa1\x5a\xb8\xd9\xba\xe0\x66\xed\xaf\x17\x1a\x85\ +\x4a\xa1\x58\x28\x15\x46\x0a\x57\x5f\x99\x31\x70\x35\x03\x27\x85\ +\x8b\x19\xf8\x5d\x58\x28\xac\xe7\x16\x0b\x8f\x0a\xa3\x85\xa5\xae\ +\x63\xec\x12\x06\xc6\x0b\xef\x19\x1f\xc7\x85\x3f\x85\x5a\x41\x2f\ +\x18\x05\xb3\x60\x71\x06\xec\xc2\xe0\x19\x70\x0a\x6e\xc1\x2b\x68\ +\xec\x58\x2e\xac\x14\x56\x0b\x6b\x57\x52\x70\x5f\x0c\x0c\x9f\x82\ +\x41\x30\xf0\x2e\x58\xbf\x84\x81\x8d\xc2\xc7\x42\x1a\xd9\x4f\x85\ +\xcd\x33\x0c\x7c\x3e\xe7\x6f\xc1\xc0\x97\x53\x57\xc9\x8c\x95\xad\ +\x42\xfa\x04\x69\xbb\x47\x06\xc2\x1e\x46\xf6\x54\xbe\x16\x76\x0a\ +\xbb\x3c\xfe\xe9\xb1\x57\xd8\x2f\x1c\x14\x0e\x0b\xdf\xae\xa0\x20\ +\x63\xa0\xdb\x9a\xb3\x0c\x7c\xbf\x84\x81\x1f\x85\x23\xce\xc0\xcf\ +\xc2\xaf\x33\x0c\x2c\x9d\xf1\x76\x58\x88\xf8\x95\x71\x21\x39\x73\ +\x5d\x93\x33\xd0\xea\x91\x81\xc7\xd7\x64\xf4\x54\x26\x0a\x93\x85\ +\x27\xed\xf8\xa7\xc7\x54\x61\xba\x30\xc3\x18\x78\x5a\x78\x76\xe9\ +\xfd\xf7\xc7\xc0\xb0\x29\x18\x0c\x03\xcf\x2f\x61\xe0\x45\x61\x96\ +\x47\x76\xb6\x30\x77\x8e\x81\x3f\x5d\xde\x9e\x2f\xbc\xe4\x57\xbe\ +\x2a\xbc\x3e\x73\xdd\x9b\x42\x4b\x7e\x5b\x38\xe9\x71\x4e\x78\x7d\ +\x8b\xdf\x15\x3e\x74\xc5\x3f\x3d\xbc\x82\x54\x56\xcb\x87\x85\xf4\ +\x50\xca\xfd\x78\xaa\x5f\xf9\xdb\x18\xe8\xc8\xb9\xa7\xc7\xe5\x8b\ +\x19\x90\xcb\xb9\x32\x9f\xe9\x95\x0b\xe5\x72\xf9\xf2\x4c\x30\x13\ +\xf8\xe5\x2a\xbf\xb2\x5e\x6e\x9c\xb9\xae\x52\x6e\xc9\xc5\xf2\xa0\ +\x66\x03\x67\xa3\x8f\x63\xb7\x50\x2a\x8f\x10\x03\xe9\x71\x73\x4f\ +\xf5\x2b\xbd\x31\x30\x5c\x0a\x06\xc3\xc0\xc9\x25\x0c\xfc\x2e\x2f\ +\x94\x31\xce\x2f\x96\x1f\x95\xcf\xce\x0b\x47\xa9\xc7\xa5\x73\xbe\ +\xa5\x32\xf2\xc0\x58\x79\xfc\x0c\x03\xef\xcb\x49\x70\xdc\x23\x03\ +\x27\xd7\xce\x06\x2e\x66\x40\x2b\xfc\x29\xd7\x1e\x34\x03\xc3\xa4\ +\xa0\x1f\x02\xce\x33\xa0\x5f\xc2\x80\x51\x36\x05\x03\x05\xab\x6c\ +\x97\x9d\xf2\xf9\x4c\x80\x7d\x40\xb7\xec\xb1\x2b\xbf\xe4\xb5\xf2\ +\xf2\x99\x6b\x56\x18\x03\xbd\xce\x06\x56\x2f\xc9\xe3\x1d\xb9\x8c\ +\x81\xb5\xf2\x7a\x79\xa3\xfc\x90\x19\x18\x1e\x05\x83\x61\xe0\xe3\ +\x25\x0c\x8c\xab\x9f\xca\x62\xd5\xb7\x58\xd8\x2c\x7f\x3e\x13\xdf\ +\x2f\xe5\xad\xf2\x76\xf9\x6b\x79\x26\xd8\x29\xef\x96\xf7\xca\xfb\ +\xe5\x83\x73\x23\xc6\x21\x63\x60\x70\xb3\x81\xcb\x18\xf0\x0a\xdf\ +\xca\xdf\x1f\x38\x03\xc3\xa2\x60\x30\x0c\xfc\xb8\x94\x01\xa3\x7c\ +\xd4\xa6\xe0\x67\xf9\xd7\xb9\x4c\x10\x96\xa3\x72\x5c\x4e\xca\xcd\ +\x72\xab\xfc\xb8\x3c\x71\x8e\x80\xc9\xf2\x93\xf2\xd4\xd0\x47\x82\ +\xf4\x98\x2e\xcf\x5c\x39\x1a\x3c\x04\x06\x86\x43\x41\x3f\x04\x5c\ +\xf0\x6b\x24\xe5\xcb\xbe\x08\x33\xca\xcf\xca\xcf\xdb\x14\xbc\x28\ +\xcf\x96\xe7\xce\xc5\xf9\xaa\x63\xbe\xfc\xb2\xdc\xeb\x5b\x64\xaf\ +\xfa\x1e\x09\xd2\xe3\x75\xf9\xcd\x5f\xc0\xc0\x30\x28\x18\x0c\x03\ +\x6f\x2f\x65\x20\xa5\xe0\x5d\x9b\x81\x0f\x65\xc9\x57\x7d\xc5\x0f\ +\xfc\x5e\x19\x90\xfd\x9c\xdf\x1b\x01\x79\xff\xfa\xd6\x5e\xc5\x40\ +\xc1\x2f\xfb\x7f\x03\x03\x83\xa7\x60\x30\x0c\x68\xd2\x55\x5f\x86\ +\xfa\x7e\xd5\x17\x14\xd4\xfd\x86\x5f\xf1\x8b\x7e\xc9\x1f\xe9\x81\ +\x83\x13\xff\xb7\xbf\xd0\x23\x03\x8b\xc4\xc0\x23\x7f\xd4\x5f\xba\ +\x84\x87\xab\x18\x18\xf3\xc7\xff\x12\x06\x06\x4d\xc1\x60\x18\x78\ +\xef\x5f\xc5\xc0\xb1\xff\xc7\xef\x8c\x07\xeb\xb9\x9a\xaf\xfb\x86\ +\x6f\xfa\x96\x3f\x5a\x38\xbf\x6b\x20\x0e\xdb\x77\x7c\xd7\xf7\x7c\ +\xad\x47\x06\x52\xbb\x96\xfd\x15\x7f\xd5\x5f\xf3\xd7\xfd\x0d\xff\ +\xa2\x38\x5e\xc5\xc0\x93\xc2\x47\xff\x93\xff\x77\x30\x30\x58\x0e\ +\x06\xc3\xc0\xa6\x7f\xf5\x6f\x45\x7c\xf6\xbf\xf8\x1d\x06\x70\x6c\ +\xf9\xdb\xfe\x57\x7f\x87\xe5\x83\xf3\x1c\x94\xcb\xb6\xbf\xeb\xef\ +\xf9\xfb\xfe\x41\x8f\x04\x2c\xf8\x87\xfe\x37\xff\xbb\x8f\x39\xfe\ +\x0f\xff\xc8\xff\xe9\x9f\x8f\xe5\x55\x0c\x68\x85\x5f\x7e\x78\x45\ +\x26\x78\x68\x0c\x0c\x8e\x83\x7e\x6b\x3b\x4b\xc1\x75\xbf\x17\x62\ +\x94\xa3\x53\x23\x02\xe6\x06\xb1\x9f\xf8\x4d\xbf\xe5\x3f\xf6\x27\ +\xfc\x49\xff\x89\x3f\xe5\x4f\xfb\x33\xfe\x53\xff\x99\xff\xdc\x7f\ +\xe1\xcf\xfa\x6f\x0b\x73\x7e\x6f\xab\xc2\x79\xff\xa5\xff\xca\xdf\ +\x6d\x3f\x05\xfa\x50\x78\xed\xbf\x39\xd7\xa7\xaf\x26\xe0\xad\xff\ +\xce\xff\xf0\x97\x31\x30\x08\x0a\xfa\xaf\xeb\xec\xd3\xe3\xeb\x7f\ +\x33\x46\xaa\xaa\x55\xa5\x7a\x36\x1b\x2c\x16\x82\xaa\x95\x97\xab\ +\xb9\x6a\xbe\x5a\xa8\x96\xab\x7e\xb5\x5a\xad\x57\x1b\xd5\x4a\xb5\ +\x58\x9d\x09\x4a\xd5\xde\xb2\xc0\x48\xf5\xa4\xba\xdb\x15\xd1\xdf\ +\xd5\x85\xea\xd3\x33\xf1\xbc\x2c\xf6\x8b\xd5\x47\xd5\xd1\xea\x52\ +\x75\xac\x3a\x5e\xed\x8f\x81\xfe\xe5\xb6\x0c\xdc\xae\xfe\xdb\xd5\ +\x72\x96\x81\xab\xe6\x03\x65\x79\x4c\x7d\x5f\x3d\xae\xfe\xa9\xd6\ +\xaa\x3a\xa3\xc0\x38\x47\xc2\xe9\xc3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x06\x82\x46\x3f\x0c\x7c\x91\xe5\xc6\xb3\x7a\xae\x71\xb3\xd8\x77\ +\x13\x20\x49\xf9\xc6\xe5\x0c\x68\x85\x42\xa3\xcc\xa2\xea\x37\xaa\ +\x8d\xd5\x76\xbf\xaf\x37\x1a\x8d\x4a\xa3\x78\x01\x03\xa5\xc6\xc8\ +\x5f\xc9\x40\x2f\x56\x5e\x6e\xf5\x60\x18\x38\xe9\x83\x81\xdf\x8d\ +\x9b\xe4\xfd\xcb\x08\x90\xa4\x85\x2b\x19\xf8\x50\x58\x6c\x3c\x6a\ +\x8c\x36\x96\x4e\x45\x7c\xac\x31\xde\x78\xdf\x38\xbe\x80\x81\x8d\ +\xfa\x9f\x07\xc1\xc0\x60\xe5\xba\xf2\xfa\xe1\xe6\xf6\x0c\xdc\xee\ +\xe8\x6e\x41\xad\x8b\x01\xbd\x61\x34\xba\x29\x30\x1b\x56\xc3\x3e\ +\x15\x6f\xa7\xe1\x36\x3c\x36\x3e\x78\x0d\xad\xb1\xdc\x58\x69\xac\ +\x36\xd6\x1a\xeb\xec\xd8\x68\x7c\x6c\x7c\x6a\x6c\xf2\x73\xe7\x29\ +\x18\x06\x01\x0f\xe3\xf7\x8a\xfb\x7f\x4e\xd5\xcd\xc0\xe7\x3b\x63\ +\xe0\xfc\x1b\x63\x5f\xba\x62\xbe\xd5\xd8\x6e\x7c\x3d\xf5\x97\x9d\ +\xc6\x6e\x63\xaf\xb1\xdf\x66\xe0\xa0\x71\xd8\xf8\xc6\xe3\xfc\xbd\ +\xf1\xa3\x71\xc4\x8e\x9f\xa7\x8e\xa3\xc6\xaf\x46\x78\x41\x26\x18\ +\x4e\x16\xf8\xb7\x18\xb8\xab\x3c\x80\x5f\x98\xe8\x96\xa8\x11\x77\ +\x51\x90\x34\x9a\x8d\x16\xfd\xe5\x71\x23\x57\xc7\xaa\x0f\xf1\x9f\ +\x68\x4c\x36\x9e\x34\xa6\x78\x94\xa7\x1b\x33\x8d\xa7\xe7\x8e\x67\ +\x8d\xe7\x19\x03\x3d\xb6\xf7\x3e\x18\x78\xd1\xb8\xa8\x05\xb3\x8d\ +\xb9\x2e\x06\xe6\x59\x2f\x9f\xe7\x7f\x79\x79\x66\xc4\x7f\xd5\x78\ +\xcd\xa2\xfc\x86\x7a\xfa\xdb\xc6\xbb\x0b\x18\xf8\xd0\x90\x2a\xff\ +\x35\x06\x06\xf3\xbd\x99\x5a\x19\x76\xfc\x95\xca\xe5\x2d\x78\xd7\ +\x35\xfe\x07\x15\xb9\x92\xab\xe4\x2b\x85\xca\xe9\xf8\x97\x2b\x7e\ +\x05\x51\xae\x56\xea\x3c\xca\x21\x5b\x1c\x9c\x67\xa0\x52\x29\x9e\ +\x62\x40\x50\x90\x31\x70\x51\x9b\xbb\x19\x28\x0d\x95\x81\x91\x2b\ +\xe2\x9f\xca\x49\xe5\x34\x03\xbf\x2b\x0b\x95\x97\xf5\xc5\xca\x9b\ +\xf6\x5a\xf0\x51\x65\xb4\xf2\xba\x1d\xe5\xa5\xca\x38\xcf\x03\x63\ +\x95\xf1\x0b\x18\x78\xdd\x78\x7f\x23\x06\x6e\x27\x19\x03\xbd\x1c\ +\x27\xf9\xad\xea\x75\x2d\xe8\x66\xe0\xb8\xf2\x87\x45\xb1\x56\xd1\ +\x29\x0f\xac\xd6\x8d\x53\x04\xbc\x6e\x98\x15\xf1\x0c\xc1\xaa\xd8\ +\x17\x50\xe0\x54\xce\xee\x13\x0d\x2b\x0b\xfc\xbd\x0c\x5c\x4c\x81\ +\x3b\x14\x0a\xbc\x6b\x32\x00\x44\x3b\xc5\xc0\x72\x7d\xb9\xb2\x52\ +\x49\x33\xfd\x2a\x67\x60\xad\xb2\xde\x15\xe7\x8d\xca\xc7\x76\x3f\ +\xff\x74\xe6\x1c\x8e\xcd\xca\xe7\xca\x7f\x8d\x81\x7e\x29\xe8\x66\ +\xe0\xcb\x80\x19\xe8\xf5\xd7\x24\x52\xd9\xaa\x1c\xd7\x8f\xeb\x5a\ +\x61\xbb\xf2\xb5\xb2\x53\x29\x35\x76\x2b\x5e\xdd\xab\xef\x31\x06\ +\xf6\xcf\x45\xf9\xa0\x72\xd8\x8e\xf0\xb7\xca\xf7\x0b\x18\xf8\x51\ +\x39\xca\x18\xe8\x8b\x82\x9f\x03\x63\xe0\x26\xd1\x87\xfc\xaa\x84\ +\x2c\xf6\x6f\xea\xd8\x0d\xd6\x2b\x51\x25\x7d\xfa\x17\x57\x92\x0b\ +\xfa\x79\xb3\xd2\x6a\x47\x78\xa1\xf2\xf8\xc2\x59\xe1\xc4\x29\x06\ +\x26\x2b\xc3\x23\xe0\x6f\x67\x20\x6d\x7f\xa9\xd2\x61\xe0\xc9\xad\ +\x19\x50\x2a\xd7\x7f\x31\x78\xb1\x4c\x55\xa6\x4f\xad\x01\xf6\xea\ +\x33\x9c\x81\xf1\xc6\xd3\xca\xb3\x73\x31\x7e\x5e\xe9\xac\xff\xbd\ +\xfa\x8b\x53\x33\x05\x1c\xb3\x95\xb9\xca\xfc\x29\x06\x5e\x66\x0c\ +\x5c\x43\x41\x87\x81\x57\xb7\x62\x60\xb1\x87\x2f\xc5\x2e\x97\xd7\ +\x95\xb0\x6b\xcf\xff\x4d\x05\x4f\x80\xbd\xfa\xdb\x73\x0c\xbc\xab\ +\x7c\x38\x9d\xe9\x8b\x9d\x7d\x22\xb5\xa8\x14\x83\xa2\x5c\xcc\x15\ +\xf3\xc5\x42\xb1\x5c\x14\x0c\xf8\xc5\xff\x02\x03\x83\xa0\xa0\xd7\ +\x6f\xc2\xba\x8f\x93\xfc\xf5\x5f\x8a\x5e\x2f\xd5\x62\xd8\xb5\x17\ +\x54\x2f\xbe\xa7\xbe\xde\x28\x6e\x74\x51\x60\xb3\xe5\xff\x69\x06\ +\x8a\xc5\x4a\x05\x7f\x2f\x15\x47\x8a\x27\x2c\xfa\x9d\xe3\x77\x71\ +\x81\x71\xb0\x50\x5c\xbc\x94\x81\xdb\xcb\xbf\xc0\x40\xe7\xff\x37\ +\x7a\x54\xbc\x59\xf4\x07\x11\x7b\x21\xa3\x5d\x0c\x1c\x34\x96\x8a\ +\x7f\x28\xce\x6f\x1b\x63\x45\x11\xfd\xf1\xe2\xfb\xe2\x71\xf1\x4f\ +\xb1\x56\xd4\x8b\x06\xf5\x72\xb3\x68\x15\xed\xa2\x53\x74\x8b\x5e\ +\x51\xeb\x22\x20\x3d\x96\x8b\x2b\xc5\xd5\xe2\xda\x7f\x84\x81\xdb\ +\x64\x82\xf5\x62\xca\xc0\x46\x8f\x0c\x9c\xe4\x3f\x16\x07\x6d\xfb\ +\xa7\x53\x0c\x6c\x54\x37\x8b\x76\xe5\x73\x51\x8c\xf8\x5f\x98\x36\ +\x5b\xd9\x2a\x6e\x17\xbf\x16\x77\x28\xb6\x85\xe2\x6e\x71\x8f\x73\ +\x30\x56\xd9\x2f\x1e\x14\x0f\xcf\x45\xbf\x43\xc1\x72\x71\x56\x1d\ +\x16\x01\xff\x0a\x03\xaa\xf4\xad\x98\xe6\x82\xef\xd7\x32\x70\x92\ +\xbf\xf9\x8c\xbf\x57\xf9\x51\x44\x06\x58\x69\x1c\x15\xd3\x3e\xff\ +\xb3\x28\xb2\xfd\xaf\x62\x58\x8c\xda\xd1\x3f\x1d\xdd\xb8\x98\xb0\ +\xab\x56\x19\x91\x97\xc5\xbf\x59\x6c\x15\x1f\x0f\x31\x0b\x3c\x34\ +\x06\x6e\x43\xc1\x04\xcb\x04\x93\x57\x32\xd0\xcb\xef\x06\xde\x46\ +\x52\x06\x0e\x1a\x4f\x8a\x62\xdc\x9f\x2a\x76\xc6\xfc\xc3\xc2\x74\ +\x71\xe6\xd2\x9e\xfe\x94\xb2\xd2\xd9\xbf\x3f\x2b\x3e\x2f\xbe\x18\ +\xe2\x6c\x10\xf2\xd0\x18\xe8\x9f\x82\xd9\xe2\x5c\x71\xfe\x42\x06\ +\xc2\x7c\x6f\x3b\x7d\xb7\x95\x97\xc5\x8f\x8d\x57\xc5\x53\x3b\xc2\ +\x5d\x0c\x5c\xd6\xdb\xcf\x96\x72\xfa\xef\x57\xb7\x78\x50\xf2\xef\ +\x30\xa0\x4a\x6f\x8a\xef\x82\xee\xe8\x5b\xb9\xb3\xbf\x20\x3e\x4c\ +\x79\x5b\x3c\xea\x5e\x01\x16\x4f\xbf\x0d\xd4\x79\xf6\x73\x79\xfc\ +\xbb\xe5\xba\xf6\x0e\x4a\x1e\x1e\x03\xfd\x53\xf0\xa1\x38\x2b\x4b\ +\x25\x8c\xfa\x27\xf9\x27\xd7\x3e\xe5\x19\xb8\xdd\xa5\xee\x5d\x00\ +\xa5\x74\xfa\xb9\xcf\xf9\xaf\x05\xae\x29\xed\x8e\x08\x78\x98\x0c\ +\xf4\x4f\x41\x50\xf2\xeb\x93\x77\x1e\x7b\x21\xf2\x19\x06\x72\xa5\ +\x7c\xa9\x3f\x06\xae\x6f\xe9\x20\xe5\x61\x32\xd0\x3f\x05\x85\xd2\ +\xdd\xfc\xbf\x1b\x17\x49\xf9\x0c\x03\x7e\xe9\xa8\xd2\x0f\x03\x77\ +\x4b\xc0\xc3\x65\xe0\xb6\xdf\xae\xdc\x87\x54\x4b\xe2\xed\x80\xd9\ +\x4a\xbd\xd4\x28\x55\x4a\xbb\xc5\x62\x69\xba\xbd\x17\xd4\x0b\x03\ +\xf7\xd1\xb6\x87\xcb\xc0\xdf\x47\x41\xa9\x94\xee\xf7\x8f\x94\x4e\ +\x4a\xbf\x4b\x0b\x25\xb1\xe3\x57\x28\xc6\xc5\x45\x46\x42\x2f\x14\ +\xdc\x4f\xbb\x1e\x32\x03\xc3\xff\x2d\x84\xc1\xca\xa3\xd2\x68\x69\ +\xa9\x74\xd9\x1e\x40\xbe\x38\x56\x5a\xb8\x74\x25\x70\x9f\x2d\x7a\ +\xd8\x0c\xa4\xf2\x37\x51\x20\x49\xe7\xf7\xfb\xaf\x5f\x09\xde\x77\ +\x5b\x1e\x3e\x03\x7f\x5b\x36\x48\xa5\xd7\xe8\xdf\xe6\x17\xb9\x06\ +\x27\x7f\x03\x03\x83\xf8\xb6\xf9\xee\x65\x50\xbd\x7f\xf8\xd6\xff\ +\x1d\x0c\xa4\x72\x7b\x0e\xee\x6f\xd5\xd8\x2d\x0f\xcd\xea\xbf\x87\ +\x81\x54\x06\xc1\xc1\x7d\x92\xf0\x30\x6d\xfd\xbb\x18\x18\xe4\x2f\ +\x5e\x3c\x7c\xab\xef\x4a\xfe\x36\x06\x52\x19\x1c\x07\xc3\xf5\xf4\ +\xc3\xb4\xea\xbc\xfc\x8d\x0c\xa4\x32\x58\x0e\x06\xe5\xf9\x87\x61\ +\xc5\x4d\xe5\x6f\x65\x00\x32\x1c\x12\xee\xf3\xb8\x0f\xf9\xbb\x19\ +\x48\xe5\xbe\xa3\xf6\x37\x47\x1f\xf2\xf7\x33\x00\xb9\xef\x08\xfe\ +\xad\xf1\x4f\xe5\x5f\x61\x00\x72\xdf\xb1\xfc\xbb\x62\x2f\xe4\xdf\ +\x62\x40\xc8\x7d\xc7\xf6\xef\x88\xbd\x90\x7f\x93\x81\x8e\xdc\x77\ +\xb4\x1f\x72\xec\x85\xfc\xeb\x0c\x74\x24\x8b\xfc\x65\xf2\xdf\x61\ +\xe0\xbc\xfc\x37\x23\x7e\x5e\xfe\xcb\x0c\x64\x02\xc9\x18\xc8\x24\ +\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\ +\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\ +\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\ +\xc9\x18\xc8\x24\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\ +\x24\x63\x20\x93\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\ +\x93\x8c\x81\x4c\x32\x06\x32\xc9\x18\xc8\x24\x63\x20\x93\xff\x1d\ +\xd7\xff\xef\xff\x03\x88\xfa\xba\xd2\ +" + +qt_resource_name = "\ +\x00\x03\ +\x00\x00\x70\x37\ +\x00\x69\ +\x00\x6d\x00\x67\ +\x00\x13\ +\x04\xf5\x2f\xad\ +\x00\x73\ +\x00\x75\x00\x64\x00\x6f\x00\x64\x00\x65\x00\x6d\x00\x2d\x00\x66\x00\x61\x00\x76\x00\x69\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x78\ +\x00\x70\x00\x6d\ +" + +qt_resource_struct = "\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ +\x00\x00\x00\x0c\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ +" + +def qInitResources(): + QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + +def qCleanupResources(): + QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + +qInitResources() diff --git a/SudoDEM2D/gui/qt4/sudodem-favicon.png b/SudoDEM2D/gui/qt4/sudodem-favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..38ed6c6d6b58e19d506ac29d58e92a62c583637a GIT binary patch literal 64984 zcmeEt_d8rs*Y+?Ni8@KNAcBO5ZbUDMnjm`bqIZcdY7moXi3moG=tS>*v>*o2JA-6& zM)dxkNuKw6|AX(RC)ed-=A5(kz1O<;z1Cj)zBH8uZ*Fhi<*|Vo|njjE34EIA! z1blO%dL<70B5;>^rcDg|^Cz}~1D~(CJvDF#fs7S!KX|v|WuE|F(s{`1duX}Zcz9d9 zvIcp3d-K@4IJ#R}xLNbKzOqf(mbeW9-32|9d!p@=x;f{YYT_AiwL7sg5JyFPFXXYl z%;Z=@u#rgt=eTaMkx8I)^m|9D;_B&#Izze}rq#N|U1S9$4mzE7U5vBpEH?<5d(t1@ zCFqgrTRG~k4`IId0a1SxxYN9H;4d*?`9i>bfIgMeAIkyKztwgz95$?4EKPx7PSoSwn7e)Oy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{wCnz5rgtPnhN zz9msX`$tPGjB)HwHDj6sUlf0NYRHPwmDZ@F;G$M6|8jnFB z#YXN{SQm+gNH;2yEp;IU#}lwptXfuXubzRELrMykjT%CgmxJbN)d1R<0BVSA)l^D_ ztetG(%!KD|Vbg{nkX?&Ft6(c<>l~&77z`W0l7^o~k&TEAQCo9Y<{}2e+Xk;va$T9w zmNpdil)!FWbw5!yjVwT`rf%R#s?O{R{%!_`YpSr6!GusswXAE1Eld=2K^p+=0(xF| z@IVt}pHPYT+VINI(0CbvH)B|6MhNiIT&tG9kXZ$ZEQrl(Xt}O?!wR8yspc)gR&8em6!_;gA@WJ- zqM*MQktLf79L7ZE`k52A`mW5dVunGK5pnW`!p9(-4OpIMGb>x{x>DLZ_c9z5D05TC zLyk?d5QB)iHA`3$%#NZ+epz)DRsbw$fj|`ba7y#oC6?XsTwB;ou88Blr`3*=-pP`& z>)e!?XRPZ_*);Vq^ZUb%ExMCalFnmSs0dW_Y8adFT^Ec<1P zz;sxa5Q$vSLAvxy63Fi^y3LmAh29jbHO#m#;S}q*UNZ3F3iatNq4C~9v4Hu;sk&_* zL(!3off)9?wVIAjuPH?3x@N9ukk2%2yUq&=ZW`L4iBbDP%f9Ys-5snCNP4#oE6y%N zO_`uj@&!qzjEJt>G-wPR_#Ul0Q$IjPUzT9eyF)(dR8OkUBtdE3xk7=(y9ruA{}&f5 z_rK@B=^YoB c #76D1DA", +", c #85D6DF", +"' c #65CCCE", +") c #63CBCD", +"! c #62CBCC", +"~ c #61CACB", +"{ c #78D2DA", +"] c #87D7E0", +"^ c #9FE0E4", +"/ c #64CBCC", +"( c #A8E2E7", +"_ c #67CCD0", +": c #79D2DA", +"< c #7BD3DD", +"[ c #7AD2DC", +"} c #8DD9E2", +"| c #B3E6EA", +"1 c #9DDFE4", +"2 c #320607", +"3 c #591519", +"4 c #61CBCC", +"5 c #7DD3DD", +"6 c #A9E3E9", +"7 c #CAEDEF", +"8 c #93DBD7", +"9 c #D7F2F1", +"0 c #E81C24", +"a c #4D171A", +"b c #461417", +"c c #451417", +"d c #441417", +"e c #7AD2DD", +"f c #79D2DD", +"g c #8AD8E2", +"h c #B1E5EB", +"i c #9CDDDD", +"j c #69CCC7", +"k c #5CC8C1", +"l c #4EC3BB", +"m c #44C0B8", +"n c #45C0B8", +"o c #4CC3BB", +"p c #ACE4E7", +"q c #ED1C24", +"r c #EE262E", +"s c #5A2528", +"t c #461215", +"u c #431417", +"v c #541518", +"w c #591619", +"x c #69161B", +"y c #6C161B", +"z c #71171B", +"A c #7A171C", +"B c #7E181C", +"C c #7D181C", +"D c #7C171C", +"E c #75171B", +"F c #6C161A", +"G c #68161A", +"H c #581619", +"I c #421416", +"J c #79D2DB", +"K c #7DD3DE", +"L c #92DAE4", +"M c #8AD8DC", +"N c #7DD4D3", +"O c #73D0CC", +"P c #60C9C2", +"Q c #41BFB6", +"R c #42BFB7", +"S c #46C1B9", +"T c #47C1B9", +"U c #83D5D0", +"V c #F9464C", +"W c #613033", +"X c #4E1418", +"Y c #531518", +"Z c #591518", +"` c #73171C", +" . c #82181C", +".. c #90191E", +"+. c #8C181D", +"@. c #8B181D", +"#. c #89181D", +"$. c #B81D24", +"%. c #A21B22", +"&. c #67161A", +"*. c #571519", +"=. c #7FD4DE", +"-. c #7DD3DC", +";. c #7CD3D9", +">. c #7DD4D4", +",. c #6CCDC7", +"'. c #43C0B7", +"). c #41BFB7", +"!. c #95DBDB", +"~. c #FA5F65", +"{. c #60373A", +"]. c #481417", +"^. c #4C1418", +"/. c #6B161A", +"(. c #8A181D", +"_. c #9D1A20", +":. c #C71E25", +"<. c #C51E25", +"[. c #C81E25", +"}. c #A01B21", +"|. c #7BD3DC", +"1. c #7BD2DC", +"2. c #75D0D6", +"3. c #64CAC8", +"4. c #4BC2BA", +"5. c #46C1B8", +"6. c #4DC3BB", +"7. c #AAE3E7", +"8. c #ED1921", +"9. c #F15F65", +"0. c #674043", +"a. c #461316", +"b. c #441315", +"c. c #431316", +"d. c #441416", +"e. c #60161A", +"f. c #70171B", +"g. c #81171C", +"h. c #85181D", +"i. c #88181D", +"j. c #86181D", +"k. c #BE1D24", +"l. c #C61E25", +"m. c #C21E25", +"n. c #B91D24", +"o. c #66CCCF", +"p. c #569AA0", +"q. c #328984", +"r. c #47C3BB", +"s. c #5BC8C2", +"t. c #ED171F", +"u. c #F87B80", +"v. c #744D50", +"w. c #430F12", +"x. c #410D11", +"y. c #400D10", +"z. c #49191C", +"A. c #6D3E40", +"B. c #763538", +"C. c #7B2B2F", +"D. c #822126", +"E. c #871B20", +"F. c #8E181D", +"G. c #A01A20", +"H. c #BF1E24", +"I. c #70D0D5", +"J. c #55989F", +"K. c #143132", +"L. c #2E7976", +"M. c #49C6BD", +"N. c #ED1B23", +"O. c #FFADB1", +"P. c #7B5A5C", +"Q. c #441013", +"R. c #420E11", +"S. c #4C1B1E", +"T. c #603538", +"U. c #6C3E41", +"V. c #794649", +"W. c #9B6467", +"X. c #AC6063", +"Y. c #A7484C", +"Z. c #891318", +"`. c #88151A", +" + c #88161B", +".+ c #C11E24", +"++ c #68CDD0", +"@+ c #55979D", +"#+ c #163738", +"$+ c #183839", +"%+ c #286A67", +"&+ c #48C2BA", +"*+ c #FFB8BC", +"=+ c #876568", +"-+ c #471316", +";+ c #491619", +">+ c #4C1A1D", +",+ c #4D1C1F", +"'+ c #73494B", +")+ c #AC8F91", +"!+ c #DEC2C4", +"~+ c #CA9194", +"{+ c #9A383D", +"]+ c #871318", +"^+ c #87151A", +"/+ c #93191E", +"(+ c #64CCCD", +"_+ c #69CDD1", +":+ c #7AD3DC", +"<+ c #53949B", +"[+ c #173738", +"}+ c #193B3C", +"|+ c #1F504F", +"1+ c #47C2BA", +"2+ c #FAB4B7", +"3+ c #9A7B7E", +"4+ c #451215", +"5+ c #400B0E", +"6+ c #71494C", +"7+ c #AA9294", +"8+ c #E3DCDD", +"9+ c #E2CDCF", +"0+ c #BF8589", +"a+ c #9F4045", +"b+ c #942C31", +"c+ c #8D2025", +"d+ c #88171C", +"e+ c #87181D", +"f+ c #BD1E24", +"g+ c #519297", +"h+ c #1C4546", +"i+ c #47C0B8", +"j+ c #98DDE2", +"k+ c #ED1D26", +"l+ c #FDCFD2", +"m+ c #C2AFB1", +"n+ c #DCD4D5", +"o+ c #DEC7C9", +"p+ c #D8ABAD", +"q+ c #BA7477", +"r+ c #A44A4E", +"s+ c #8E2025", +"t+ c #840E13", +"u+ c #861318", +"v+ c #89171C", +"w+ c #508F95", +"x+ c #173838", +"y+ c #193A3B", +"z+ c #163637", +"A+ c #143334", +"B+ c #9BDEE4", +"C+ c #EE232B", +"D+ c #EBD2D4", +"E+ c #851116", +"F+ c #830C11", +"G+ c #A41B21", +"H+ c #4F8D93", +"I+ c #234A4C", +"J+ c #2F5D60", +"K+ c #3F7579", +"L+ c #5BA0A7", +"M+ c #74C7D0", +"N+ c #80D9E3", +"O+ c #9CDEE4", +"P+ c #EE2930", +"Q+ c #EDD5D7", +"R+ c #C51F25", +"S+ c #7DD5DF", +"T+ c #7ED6E0", +"U+ c #7DD4DE", +"V+ c #9EDEE4", +"W+ c #F6E4E6", +"X+ c #851015", +"Y+ c #A2E0E5", +"Z+ c #FFF4F6", +"`+ c #840F14", +" @ c #B41C23", +".@ c #A8E2E8", +"+@ c #ED2028", +"@@ c #FFFAFB", +"#@ c #861217", +"$@ c #ADE3E9", +"%@ c #9CDEE3", +"&@ c #ED1E26", +"*@ c #FFF6F7", +"=@ c #89191D", +"-@ c #A71B21", +";@ c #7ED4DE", +">@ c #81D5DE", +",@ c #B1E5E9", +"'@ c #FFF4F5", +")@ c #8D1F24", +"!@ c #8ED9E2", +"~@ c #A2E0E6", +"{@ c #90D9D9", +"]@ c #71CFCB", +"^@ c #4EC3BC", +"/@ c #50C4BC", +"(@ c #AFE5E8", +"_@ c #ED1A23", +":@ c #FFDFE1", +"<@ c #90272B", +"[@ c #8B191E", +"}@ c #85D6E1", +"|@ c #8BD8E0", +"1@ c #7ED4D6", +"2@ c #6CCECC", +"3@ c #5FC9C5", +"4@ c #5AC7C1", +"5@ c #4EC4BB", +"6@ c #5FC9C3", +"7@ c #ABE4E8", +"8@ c #FEC4C6", +"9@ c #942E33", +"0@ c #AD1C22", +"a@ c #7FD6E1", +"b@ c #7BD2DB", +"c@ c #74D1D6", +"d@ c #6ECED1", +"e@ c #69CDCD", +"f@ c #5EC8C4", +"g@ c #44C0B7", +"h@ c #65CBC5", +"i@ c #A1E0E5", +"j@ c #FBA8AB", +"k@ c #97363A", +"l@ c #35817F", +"m@ c #45C0B7", +"n@ c #75D0CC", +"o@ c #9FDFE4", +"p@ c #F98C90", +"q@ c #9B3E42", +"r@ c #8F191E", +"s@ c #E01E23", +"t@ c #D51D22", +"u@ c #B61B20", +"v@ c #97191F", +"w@ c #254D4F", +"x@ c #1D4848", +"y@ c #48C3BB", +"z@ c #7CD3D2", +"A@ c #F57075", +"B@ c #9E4549", +"C@ c #92191E", +"D@ c #EE1F24", +"E@ c #EF1F24", +"F@ c #D71E23", +"G@ c #94191E", +"H@ c #BA1D24", +"I@ c #1A4040", +"J@ c #3FABA5", +"K@ c #F3545B", +"L@ c #A24D51", +"M@ c #ED1F24", +"N@ c #F01F24", +"O@ c #B01B20", +"P@ c #183738", +"Q@ c #36908C", +"R@ c #48C5BC", +"S@ c #F03840", +"T@ c #A55458", +"U@ c #B51B21", +"V@ c #AC1C22", +"W@ c #244C4E", +"X@ c #18393A", +"Y@ c #2D7773", +"Z@ c #EE1C24", +"`@ c #A85C60", +" # c #A81A20", +".# c #C31E25", +"+# c #ED141C", +"@# c #AB5C60", +"## c #CF1E25", +"$# c #EC141D", +"%# c #AE595D", +"&# c #EA1F24", +"*# c #C41E25", +"=# c #244C4D", +"-# c #93DBE2", +";# c #EC151E", +"># c #B45B5F", +",# c #93181D", +"'# c #DA1F25", +")# c #7CD3DC", +"!# c #234B4D", +"~# c #183A3B", +"{# c #173839", +"]# c #96DCE3", +"^# c #B95E62", +"/# c #89181C", +"(# c #881920", +"_# c #7D334E", +":# c #7CD2DC", +"<# c #1C4041", +"[# c #3B7074", +"}# c #72C4CE", +"|# c #7AD3DD", +"1# c #9ADDE4", +"2# c #ED1820", +"3# c #DC656A", +"4# c #B4191F", +"5# c #8A171B", +"6# c #84212B", +"7# c #5C5C97", +"8# c #5368AE", +"9# c #4E6FBC", +"0# c #4F6EBA", +"a# c #D91F25", +"b# c #7ED6E1", +"c# c #F01C24", +"d# c #E1686E", +"e# c #C41920", +"f# c #991A1F", +"g# c #8C1315", +"h# c #6A4873", +"i# c #4C73C2", +"j# c #F21C1F", +"k# c #EC1F24", +"l# c #C31E24", +"m# c #D02128", +"n# c #D52129", +"o# c #D8222A", +"p# c #DB232B", +"q# c #D9222B", +"r# c #D6222A", +"s# c #D22129", +"t# c #CA1F27", +"u# c #9CDEE5", +"v# c #EF1C24", +"w# c #ED1A22", +"x# c #E46C71", +"y# c #C3181F", +"z# c #BF1D25", +"A# c #5D5D95", +"B# c #4E6FBD", +"C# c #4D6FBC", +"D# c #954B78", +"E# c #E1252F", +"F# c #EE1F23", +"G# c #CB1E25", +"H# c #C81F26", +"I# c #E7262F", +"J# c #F12832", +"K# c #EF2731", +"L# c #EE2731", +"M# c #F02732", +"N# c #DF242D", +"O# c #CD2027", +"P# c #C71F26", +"Q# c #9FDFE5", +"R# c #E61B23", +"S# c #E76E73", +"T# c #C3171E", +"U# c #8A161A", +"V# c #635B8A", +"W# c #4F6EBB", +"X# c #526DB8", +"Y# c #D42C3C", +"Z# c #DC1F25", +"`# c #E4252E", +" $ c #E2242D", +".$ c #9BDEE3", +"+$ c #DC1A21", +"@$ c #E86B70", +"#$ c #8C191D", +"$$ c #7D3043", +"%$ c #4E6DBA", +"&$ c #4868B7", +"*$ c #4967B6", +"=$ c #4A67B7", +"-$ c #4767B7", +";$ c #4D6CB9", +">$ c #4E6FBB", +",$ c #8F4E7E", +"'$ c #F51B1D", +")$ c #E2252D", +"!$ c #E9262F", +"~$ c #A3E0E7", +"{$ c #E9646A", +"]$ c #C3171F", +"^$ c #86181C", +"/$ c #882025", +"($ c #517CBF", +"_$ c #4768B7", +":$ c #9FB3DB", +"<$ c #89C1E7", +"[$ c #80C7EC", +"}$ c #86CCEF", +"|$ c #89C6EA", +"1$ c #91B5DE", +"2$ c #657DC1", +"3$ c #4A70BE", +"4$ c #D82229", +"5$ c #EC2730", +"6$ c #79D2DC", +"7$ c #78D2DC", +"8$ c #9ADEE3", +"9$ c #EB5B61", +"0$ c #90161A", +"a$ c #657398", +"b$ c #4F6AB7", +"c$ c #ADBEE1", +"d$ c #58B5E6", +"e$ c #51B1E4", +"f$ c #49AEE3", +"g$ c #88C8EC", +"h$ c #6C85C5", +"i$ c #4D6DB9", +"j$ c #4971BF", +"k$ c #974A76", +"l$ c #EC252D", +"m$ c #7BD2DD", +"n$ c #81D5DF", +"o$ c #8BD8E1", +"p$ c #8AD8DF", +"q$ c #8DD8DF", +"r$ c #9BDDE1", +"s$ c #A6E1E2", +"t$ c #A8E2DF", +"u$ c #B1E5E8", +"v$ c #EF545A", +"w$ c #C21920", +"x$ c #BF2630", +"y$ c #4B99DA", +"z$ c #4F6DBA", +"A$ c #5372BC", +"B$ c #56AFE3", +"C$ c #50B1E4", +"D$ c #78C3EA", +"E$ c #6881C3", +"F$ c #D12D3F", +"G$ c #ED242C", +"H$ c #ACE3E8", +"I$ c #A5E0E2", +"J$ c #99DDD9", +"K$ c #81D5CF", +"L$ c #54C6BD", +"M$ c #51C4BD", +"N$ c #B5E7E9", +"O$ c #F04D53", +"P$ c #C21A21", +"Q$ c #6B92BB", +"R$ c #5085C9", +"S$ c #557AC0", +"T$ c #52B2E4", +"U$ c #ACCEEB", +"V$ c #4767B6", +"W$ c #526CB7", +"X$ c #E6232B", +"Y$ c #EB222A", +"Z$ c #7CD3DE", +"`$ c #82D5E0", +" % c #9CDDE7", +".% c #98DDE3", +"+% c #8AD7D8", +"@% c #83D6D4", +"#% c #61CAC5", +"$% c #55C6BF", +"%% c #53C5BE", +"&% c #A3E1E1", +"*% c #F0454C", +"=% c #C0242D", +"-% c #4F7CC3", +";% c #4F6CB9", +">% c #5097D4", +",% c #5DB8E7", +"'% c #8C9DD0", +")% c #F21D20", +"!% c #EB2128", +"~% c #ED2731", +"{% c #7ED3DE", +"]% c #88D7E2", +"^% c #7BD3D8", +"/% c #78D1D5", +"(% c #6DCECE", +"_% c #67CCC9", +":% c #61CAC6", +"<% c #5DC8C2", +"[% c #55C6BE", +"}% c #81D5D3", +"|% c #F03940", +"1% c #C71C22", +"2% c #827494", +"3% c #50B5E7", +"4% c #5078C1", +"5% c #4CAFE3", +"6% c #93BBE2", +"7% c #4C6BB9", +"8% c #4573C3", +"9% c #E5232B", +"0% c #EC2228", +"a% c #74D0D7", +"b% c #71CFD4", +"c% c #6FCED2", +"d% c #67CCCC", +"e% c #5EC9C6", +"f% c #58C6C0", +"g% c #43C0B6", +"h% c #F0222A", +"i% c #C62C33", +"j% c #C32129", +"k% c #50B3E6", +"l% c #50B4E6", +"m% c #5778BF", +"n% c #8AC7EA", +"o% c #4E6EBB", +"p% c #A2456C", +"q% c #EF1A22", +"r% c #C72E34", +"s% c #B23644", +"t% c #4FB3E5", +"u% c #6381C3", +"v% c #72C1EA", +"w% c #7188C6", +"x% c #6065A9", +"y% c #F51B1C", +"z% c #EB2228", +"A% c #EB2630", +"B% c #BCDDCC", +"C% c #EF1B23", +"D% c #C7262D", +"E% c #935E78", +"F% c #4EB1E5", +"G% c #6A8BC9", +"H% c #506FBB", +"I% c #5070BC", +"J% c #5070BD", +"K% c #5171BD", +"L% c #5172BE", +"M% c #5AB6E6", +"N% c #A4B1D9", +"O% c #4772C2", +"P% c #E2242E", +"Q% c #E92630", +"R% c #FFF5A1", +"S% c #F8F2CD", +"T% c #D3C3C4", +"U% c #CA181E", +"V% c #6E8CB4", +"W% c #4DB0E4", +"X% c #6D92CB", +"Y% c #4760AC", +"Z% c #445CA7", +"`% c #3E529D", +" & c #384893", +".& c #34428C", +"+& c #313E88", +"@& c #2F3984", +"#& c #2C357F", +"$& c #2A327C", +"%& c #4BB0E4", +"&& c #B0B7D9", +"*& c #4A67B3", +"=& c #4B70BE", +"-& c #A54369", +";& c #FDF5AA", +">& c #FAE62E", +",& c #F9DF00", +"'& c #F7E86D", +")& c #52161B", +"!& c #A6878A", +"~& c #CC1D25", +"{& c #CB161B", +"]& c #56ABDD", +"^& c #4EB0E4", +"/& c #6A89BB", +"(& c #28317C", +"_& c #2B347E", +":& c #2D3781", +"<& c #4BB0E5", +"[& c #ACAAC8", +"}& c #29317B", +"|& c #2F3B85", +"1& c #3A4C97", +"2& c #4864B0", +"3& c #4D6BB7", +"4& c #4F6DB9", +"5& c #6F5E9C", +"6& c #ED232C", +"7& c #FDF5AD", +"8& c #FAE20B", +"9& c #F9E104", +"0& c #F9E106", +"a& c #FBE724", +"b& c #612A2F", +"c& c #490A0F", +"d& c #936C6F", +"e& c #D01D24", +"f& c #CC161A", +"g& c #49BBF1", +"h& c #89B8DC", +"i& c #222B78", +"j& c #2C3680", +"k& c #ABA9C7", +"l& c #4D3F80", +"m& c #EB242D", +"n& c #FBEF7B", +"o& c #F9E212", +"p& c #F9E105", +"q& c #FAE416", +"r& c #9B7876", +"s& c #4E1015", +"t& c #501318", +"u& c #703E42", +"v& c #D21D24", +"w& c #CA181D", +"x& c #49BBF2", +"y& c #88CDEF", +"z& c #414689", +"A& c #C1495B", +"B& c #4DB5E9", +"C& c #4DADE2", +"D& c #ACAAC7", +"E& c #3E3477", +"F& c #ED262F", +"G& c #E8262F", +"H& c #FAE83E", +"I& c #FAE421", +"J& c #F9E001", +"K& c #FAE209", +"L& c #D6C7C0", +"M& c #4B0D12", +"N& c #4F1217", +"O& c #612A2E", +"P& c #D51D24", +"Q& c #CC151A", +"R& c #51B2E5", +"S& c #B1B2CD", +"T& c #DF2C35", +"U& c #4BB7EC", +"V& c #58B0E2", +"W& c #9293B9", +"X& c #3B3479", +"Y& c #ED1E23", +"Z& c #F9E20D", +"`& c #F9E103", +" * c #FFFFC6", +".* c #4E1017", +"+* c #581E23", +"@* c #D81D24", +"#* c #CA171C", +"$* c #6499C5", +"%* c #4DAFE4", +"&* c #A0CCE8", +"** c #2A337D", +"=* c #E7252C", +"-* c #4AB8ED", +";* c #73C2EB", +">* c #4E5291", +",* c #35367D", +"'* c #EA2127", +")* c #FFF164", +"!* c #622B34", +"~* c #DC1D24", +"{* c #C91A1F", +"]* c #7C7B9F", +"^* c #67BBE8", +"/* c #B4B6D0", +"(* c #313E89", +"_* c #E02B34", +":* c #7DBDE4", +"<* c #232C79", +"[* c #3C3377", +"}* c #E9242C", +"|* c #FAE308", +"1* c #754650", +"2* c #DE1D24", +"3* c #C61D24", +"4* c #A24B5F", +"5* c #B6DDF2", +"6* c #4A5190", +"7* c #2A337E", +"8* c #D9323D", +"9* c #4CB6EB", +"0* c #577DB5", +"a* c #29337D", +"b* c #3F3477", +"c* c #E5252E", +"d* c #F9E000", +"e* c #906858", +"f* c #4F1116", +"g* c #E01D24", +"h* c #B7303D", +"i* c #ECF2F9", +"j* c #353E84", +"k* c #2B3580", +"l* c #83305D", +"m* c #F71E1F", +"n* c #F01E22", +"o* c #D03A48", +"p* c #4DB6EA", +"q* c #52B5E7", +"r* c #4892CB", +"s* c #292E7A", +"t* c #473374", +"u* c #C0A475", +"v* c #4B0C11", +"w* c #E21D24", +"x* c #55ACDE", +"y* c #61B6E5", +"z* c #DCDCE9", +"A* c #28347F", +"B* c #333981", +"C* c #9F2D51", +"D* c #D12332", +"E* c #AC4863", +"F* c #4893CD", +"G* c #385EA0", +"H* c #2A317B", +"I* c #2A347E", +"J* c #61346D", +"K* c #E92228", +"L* c #EDDE83", +"M* c #46060E", +"N* c #E41D24", +"O* c #A74557", +"P* c #4FB3E7", +"Q* c #70BEE8", +"R* c #EEE9F1", +"S* c #252E7B", +"T* c #243481", +"U* c #B82C45", +"V* c #EA2630", +"W* c #FFF85B", +"X* c #531724", +"Y* c #E61C24", +"Z* c #5CA3D2", +"`* c #4FB0E4", +" = c #70BFE8", +".= c #F9F3F7", +"+= c #6268A0", +"@= c #242D7A", +"#= c #443678", +"$= c #F61E20", +"%= c #ED2730", +"&= c #FFEA0B", +"*= c #7B4E5E", +"== c #AD3D4D", +"-= c #4EB5E9", +";= c #50B0E4", +">= c #5BB4E5", +",= c #E1F5FE", +"'= c #AFB0CC", +")= c #343D84", +"!= c #27307B", +"~= c #223582", +"{= c #B72942", +"]= c #EA232B", +"^= c #EB2731", +"/= c #FFFEF5", +"(= c #FFFEE0", +"_= c #83564B", +":= c #FBE200", +"<= c #A38061", +"[= c #E91C24", +"}= c #C61D23", +"|= c #8A6986", +"1= c #4AAEE3", +"2= c #A3D4EF", +"3= c #FCFFFF", +"4= c #9497BD", +"5= c #3B4388", +"6= c #29327D", +"7= c #353D84", +"8= c #8D3A62", +"9= c #F11E21", +"0= c #EF2832", +"a= c #FEFCE5", +"b= c #FFFBDF", +"c= c #FAE631", +"d= c #F9E213", +"e= c #FFFFFC", +"f= c #531719", +"g= c #C1A24E", +"h= c #4E1116", +"i= c #EB1C24", +"j= c #C71B22", +"k= c #8A6A86", +"l= c #92CBEC", +"m= c #FDFDFE", +"n= c #DADCE8", +"o= c #6B71A5", +"p= c #7B81B0", +"q= c #8E96B9", +"r= c #EE1D22", +"s= c #EC242B", +"t= c #FFFFF0", +"u= c #FFFEF3", +"v= c #FAE52A", +"w= c #FCF084", +"x= c #8D645D", +"y= c #4F1117", +"z= c #DCC237", +"A= c #4B0C13", +"B= c #8A6987", +"C= c #55B2E4", +"D= c #6DBDE8", +"E= c #A3D6F1", +"F= c #E5EEF6", +"G= c #EFE9F0", +"H= c #DFDCE8", +"I= c #C1C0D7", +"J= c #9C9EC1", +"K= c #989ABF", +"L= c #9496BC", +"M= c #9597BC", +"N= c #B9B8D1", +"O= c #D9D5E2", +"P= c #B8CAE2", +"Q= c #81C2E8", +"R= c #7C98BE", +"S= c #EB2024", +"T= c #EE262F", +"U= c #F8BEB1", +"V= c #FBEA4B", +"W= c #FFFFE3", +"X= c #4F1211", +"Y= c #F9E206", +"Z= c #FBEB2F", +"`= c #460612", +" - c #C71B21", +".- c #995268", +"+- c #54ADDE", +"@- c #48ADE3", +"#- c #64B6E4", +"$- c #7FC6EB", +"%- c #87CCEE", +"&- c #89CDEF", +"*- c #8ACDEF", +"=- c #83C9ED", +"-- c #63B1E1", +";- c #49ACE2", +">- c #42B5EC", +",- c #8A7B9D", +"'- c #F3191C", +")- c #EC252E", +"!- c #EE332E", +"~- c #F8E100", +"{- c #FCED5A", +"]- c #A88A8A", +"^- c #F9E506", +"/- c #F9DB07", +"(- c #F8C40A", +"_- c #F8B40C", +":- c #FEAB1A", +"<- c #6A393B", +"[- c #CB1F27", +"}- c #D7222A", +"|- c #EB2631", +"1- c #E82D39", +"2- c #6F96C2", +"3- c #50B2E5", +"4- c #50B2E6", +"5- c #59AADB", +"6- c #B75368", +"7- c #F3191D", +"8- c #EA2128", +"9- c #F5C60C", +"0- c #FBF3B2", +"a- c #4C0E11", +"b- c #F9DD07", +"c- c #F9CA09", +"d- c #F7A20E", +"e- c #F79011", +"f- c #F79310", +"g- c #F79410", +"h- c #FB950C", +"i- c #9D694D", +"j- c #CC1F27", +"k- c #D9232B", +"l- c #EA2730", +"m- c #E82C37", +"n- c #7394BD", +"o- c #4EB4E7", +"p- c #8E7898", +"q- c #EC2025", +"r- c #EC1F25", +"s- c #EE2631", +"t- c #EC4629", +"u- c #FCE934", +"v- c #C2ABA4", +"w- c #FAE306", +"x- c #EFD507", +"y- c #F9E006", +"z- c #F8B30D", +"A- c #F7930D", +"B- c #DC983F", +"C- c #D12027", +"D- c #CF2028", +"E- c #D12129", +"F- c #D62229", +"G- c #DA232B", +"H- c #DE232D", +"I- c #E3252E", +"J- c #E7252F", +"K- c #F1242E", +"L- c #E2323F", +"M- c #C94557", +"N- c #887EA0", +"O- c #54AFE1", +"P- c #47BAF0", +"Q- c #4CB6EA", +"R- c #4BB6EB", +"S- c #49B8ED", +"T- c #4AB7ED", +"U- c #7D88AE", +"V- c #C1485A", +"W- c #E32830", +"X- c #F01D21", +"Y- c #EC1F23", +"Z- c #EC262F", +"`- c #EE2F40", +" ; c #F8DF04", +".; c #F9EB81", +"+; c #4C0E14", +"@; c #E3C908", +"#; c #D68D10", +"$; c #F79710", +"%; c #E98E1A", +"&; c #521519", +"*; c #ED242D", +"=; c #F02731", +"-; c #ED252D", +";; c #F21A1E", +">; c #F61719", +",; c #EA2227", +"'; c #D43743", +"); c #C84151", +"!; c #C84252", +"~; c #CD3E4C", +"{; c #DD2E38", +"]; c #F31A1D", +"^; c #EE1E23", +"/; c #EB252D", +"(; c #F2888E", +"_; c #FBE414", +":; c #C6B09D", +"<; c #4D0E14", +"[; c #BB960D", +"}; c #F9E406", +"|; c #F9C909", +"1; c #B46A12", +"2; c #C36D12", +"3; c #F09114", +"4; c #531619", +"5; c #EC222B", +"6; c #FAE423", +"7; c #FCEE66", +"8; c #60292B", +"9; c #4F1218", +"0; c #B8920D", +"a; c #F9DE06", +"b; c #F8B00D", +"c; c #F79210", +"d; c #934F14", +"e; c #AD6013", +"f; c #F89410", +"g; c #F99712", +"h; c #571A19", +"i; c #E9212A", +"j; c #EC2630", +"k; c #FBE941", +"l; c #BDA275", +"m; c #4C0E18", +"n; c #D4B40A", +"o; c #F9DA07", +"p; c #F79810", +"q; c #F89510", +"r; c #612117", +"s; c #813B16", +"t; c #FD9810", +"u; c #935119", +"v; c #4E1118", +"w; c #E82029", +"x; c #ED1F23", +"y; c #EA2026", +"z; c #EB242C", +"A; c #FBEC60", +"B; c #FFF03C", +"C; c #6C383F", +"D; c #480A19", +"E; c #F9E306", +"F; c #F8C709", +"G; c #F59310", +"H; c #5C1D17", +"I; c #632716", +"J; c #FF9A10", +"K; c #C97711", +"L; c #4D1018", +"M; c #E92028", +"N; c #EB1F24", +"O; c #EB2229", +"P; c #EC242D", +"Q; c #EE2732", +"R; c #FCEF7E", +"S; c #C7AB56", +"T; c #4B0D13", +"U; c #470919", +"V; c #FFEF05", +"W; c #F8B90B", +"X; c #F79110", +"Y; c #F29110", +"Z; c #571918", +"`; c #430919", +" > c #FE9E0F", +".> c #FB9C0F", +"+> c #4C1018", +"@> c #EC1E26", +"#> c #EC2026", +"$> c #EB252E", +"%> c #FDF39B", +"&> c #FFF229", +"*> c #652F2F", +"=> c #713915", +"-> c #FEB50C", +";> c #F08F10", +">> c #511518", +",> c #490D18", +"'> c #D27B11", +")> c #F99610", +"!> c #5F2117", +"~> c #ED1D25", +"{> c #EB232B", +"]> c #FDF5A9", +"^> c #DCC33A", +"/> c #501218", +"(> c #A15414", +"_> c #FB9610", +":> c #E7910F", +"<> c #4E1218", +"[> c #4C0F18", +"}> c #B26512", +"|> c #712E16", +"1> c #FDF5B1", +"2> c #FCE506", +"3> c #BD980C", +"4> c #FBE10D", +"5> c #672E26", +"6> c #D68210", +"7> c #FA9610", +"8> c #A85B13", +"9> c #874015", +"0> c #F8970F", +"a> c #F8980F", +"b> c #F58D11", +"c> c #F28413", +"d> c #F07F14", +"e> c #ED7916", +"f> c #EF7B15", +"g> c #F08014", +"h> c #F58D12", +"i> c #884314", +"j> c #EC1D25", +"k> c #FDF8C5", +"l> c #FBE306", +"m> c #BF9A0C", +"n> c #F2D807", +"o> c #F9D807", +"p> c #F79A0E", +"q> c #EA9420", +"r> c #E58811", +"s> c #F79510", +"t> c #FB9910", +"u> c #8C4914", +"v> c #732718", +"w> c #E3561C", +"x> c #DF4F1E", +"y> c #DF501D", +"z> c #B5451B", +"A> c #4B1018", +"B> c #FEF9CF", +"C> c #F9E108", +"D> c #D8B80A", +"E> c #7D4913", +"F> c #FCE406", +"G> c #F9D607", +"H> c #F58F11", +"I> c #ED7616", +"J> c #E7591C", +"K> c #541817", +"L> c #642018", +"M> c #E3531D", +"N> c #E0521D", +"O> c #ED631B", +"P> c #450D18", +"Q> c #E6252F", +"R> c #FDF4A7", +"S> c #F9E20A", +"T> c #E3C608", +"U> c #F9D407", +"V> c #ED7716", +"W> c #E0511D", +"X> c #E5591C", +"Y> c #4C1218", +"Z> c #E8571D", +"`> c #E7541D", +" , c #632317", +"., c #ED1D24", +"+, c #EC2731", +"@, c #EACF08", +"#, c #511418", +"$, c #8D5E12", +"%, c #FFEA05", +"&, c #F8C10B", +"*, c #F38912", +"=, c #E2561D", +"-, c #CF4C1C", +";, c #4D1218", +">, c #D75C1A", +",, c #E4531D", +"', c #7B2A19", +"), c #EC1C24", +"!, c #EC2631", +"~, c #F9E20F", +"{, c #EDD307", +"], c #521518", +"^, c #E49F0D", +"/, c #F89610", +"(, c #EA6E18", +"_, c #C84C1B", +":, c #4D1118", +"<, c #A24019", +"[, c #A03B1A", +"}, c #F6DE06", +"|, c #521618", +"1, c #944B14", +"2, c #F99510", +"3, c #E6631A", +"4, c #B7461A", +"5, c #712918", +"6, c #E1521D", +"7, c #C04B1A", +"8, c #EE2730", +"9, c #E8252F", +"0, c #F9E20E", +"a, c #FAB70B", +"b, c #531618", +"c, c #FA9A10", +"d, c #F68F11", +"e, c #E0531D", +"f, c #E2521D", +"g, c #A24218", +"h, c #5B1918", +"i, c #D4511B", +"j, c #491018", +"k, c #EE2630", +"l, c #F9E30D", +"m, c #F8C909", +"n, c #F7A10F", +"o, c #F79610", +"p, c #682916", +"q, c #823E15", +"r, c #F48C12", +"s, c #E5531D", +"t, c #803118", +"u, c #561618", +"v, c #DB511D", +"w, c #E9581D", +"x, c #470F18", +"y, c #EB262F", +"z, c #F89820", +"A, c #F7940F", +"B, c #975413", +"C, c #541718", +"D, c #F48613", +"E, c #E9551D", +"F, c #581C17", +"G, c #D84F1D", +"H, c #863518", +"I, c #56141A", +"J, c #E9252E", +"K, c #F9A83B", +"L, c #F7930F", +"M, c #A85A13", +"N, c #923918", +"O, c #E2531D", +"P, c #EC611B", +"Q, c #D35A1A", +"R, c #E4541D", +"S, c #DB531C", +"T, c #953219", +"U, c #541419", +"V, c #E8232D", +"W, c #F9B559", +"X, c #D98611", +"Y, c #D7511C", +"Z, c #C3481B", +"`, c #4A1018", +" ' c #92341A", +".' c #E1531D", +"+' c #DE511D", +"@' c #D7551B", +"#' c #922B19", +"$' c #74121A", +"%' c #79161A", +"&' c #7B161A", +"*' c #591418", +"=' c #090203", +"-' c #FABD68", +";' c #F79D0F", +">' c #A04119", +",' c #BB4D19", +"'' c #7A3317", +")' c #E45C1B", +"!' c #A0321A", +"~' c #7C181A", +"{' c #74161A", +"]' c #521318", +"^' c #1A0608", +"/' c #ED212A", +"(' c #FABE63", +"_' c #EB6B19", +":' c #DA551C", +"<' c #E7571D", +"[' c #C2461B", +"}' c #93281A", +"|' c #7C191A", +"1' c #71161A", +"2' c #591319", +"3' c #4E1318", +"4' c #470E18", +"5' c #EA5A1C", +"6' c #E5581D", +"7' c #B8431A", +"8' c #8D241A", +"9' c #78161A", +"0' c #78151A", +"a' c #7A161A", +"b' c #671418", +"c' c #4F1318", +"d' c #2C0A0D", +"e' c #F21D25", +"f' c #EA2028", +"g' c #EB2730", +"h' c #FBC56D", +"i' c #E76719", +"j' c #5F1D18", +"k' c #973919", +"l' c #D34F1C", +"m' c #AF3A1B", +"n' c #832119", +"o' c #75131A", +"p' c #70151A", +"q' c #5B1419", +"r' c #8F3219", +"s' c #781719", +"t' c #76141A", +"u' c #911116", +"v' c #E81F27", +"w' c #F7930E", +"x' c #E2561C", +"y' c #601B18", +"z' c #521717", +"A' c #D2521B", +"B' c #912C19", +"C' c #76161A", +"D' c #571318", +"E' c #731519", +"F' c #5F1115", +"G' c #1A0506", +"H' c #CF181F", +"I' c #E81E26", +"J' c #EB7316", +"K' c #6D2318", +"L' c #551318", +"M' c #73161A", +"N' c #5E1418", +"O' c #6F1418", +"P' c #180405", +"Q' c #020000", +"R' c #320608", +"S' c #F61D25", +"T' c #EB1C25", +"U' c #F99911", +"V' c #E35A1B", +"W' c #722519", +"X' c #931216", +"Y' c #E45E1E", +"Z' c #7E2B19", +"`' c #080101", +" ) c #EA2731", +".) c #E1551D", +"+) c #AD4918", +"@) c #4A090B", +"#) c #E25A20", +"$) c #B0421A", +"%) c #4B1118", +"&) c #0E0203", +"*) c #E15820", +"=) c #DA5B1A", +"-) c #E1541D", +";) c #DE571B", +">) c #B43C1B", +",) c #8E271A", +"') c #621419", +")) c #E2591D", +"!) c #DD521D", +"~) c #D14F1B", +"{) c #982E19", +"]) c #72111A", +"^) c #601419", +"/) c #E25A1D", +"() c #DF561C", +"_) c #A5371A", +":) c #661419", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ @ @ @ @ @ # # # # $ % . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # # # # # # # & % . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # # # # # # # # # # # * % % . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ = - ; > # # # # # # # # # # # # , % % % . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ' ) ! ! ! ~ { # # # # # # # # # # # # # ] ^ % % . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ / ) - ! ! ! ! ! ! { # # # # # # # # # # # # # # ] ( % % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ _ ' ! ! ! ! ! ! ! ! ! ) : # # # # # # # # # # # # # < [ } | 1 % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3 @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ! ! ! ! ! ! ! ! ! ! ! 4 : # # # # # # # # # # # # # 5 6 7 8 9 1 % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0 a @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ b c d d c d c b @ @ @ @ ! ! ! ! ! ! ! ! ! ! ~ { # # # # # # # # e f g h i j k l m n o p % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q r s t @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ c d u v w x y z A B C C B D E F G H b I ! ! ! ! ! ! ! ! ! ! J # # # # # < K L M N O P Q R S T T T T T U ( % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q V W t @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ b c b X Y Z ` ...+.@.#.#.#.#.#.#.#.#.#.#.#.#.#.$.%.&.*. ! ! ! ! ! ! ! ! ) J # # K =.-.;.>.,.'.R n T T T T T T T T T T ).!.1 . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q ~.{.@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ].].^./.C +.(.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#._.:.<.<.[.}. ! ! ! ! ! ! ! ) |.# 1.2.3.4.5.T T T T T T T T T T T T T T T T T 6.7. . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q 8.9.0.a.@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ a.b.c.d.e.f.g.h.i.(.(.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.j.k.<.<.<.<.l.m.n. ! ! ! ! ! ! o.< # # p.q.r.T T T T T T T T T T T T T T T T T T T S s. . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q t.u.v.w.@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ t x.y.z.A.B.C.D.E.F.@.(.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.G.:.<.<.<.<.<.<.l.H. ! ! ! ! 4 I.# # # # J.K.L.M.T T T T T T T T T T T T T T T T T T T T . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q N.O.P.w.@ @ @ @ @ @ @ @ @ @ @ t Q.R.S.T.U.V.W.X.Y.Z.`. +#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#..+<.<.<.<.<.<.<.<.<.<. ! ! ! ++{ # # # # # @+#+$+%+&+T T T T T T T T T T T T T T T . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q 8.*+=+-+@ @ @ @ @ @ @ ;+>+,+'+)+!+~+{+]+^+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#./+l.<.<.<.<.<.<.<.<.<.<.<. (+- _+:+# # # # # # # <+[+}+}+|+1+T T T T T T T T . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q 8.2+3+4+w.5+5+6+7+8+9+0+a+b+c+ +d+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.e+f+<.<.<.<.<.<.<.<.<.<.<.<.<. |.< # # # # # # # # # g+[+}+}+}+h+i+T T 5 # # j+ . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q k+l+m+n+o+p+q+r+s+t+u+v+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#...l.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # w+x+}+y+z+A+ # # # # # # # # B+ . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q C+D+E+F+u+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.i.G+<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # H+I+J+K+L+M+N+# # # # # # # # # < O+% . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q P+Q+E+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.e+R+<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # S+T+U+# # # # # # # # # # # # # < V+% % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q r W+X+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#._.:.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # # # # # # # # # # # # # # # # # Y+1 % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q C+Z+`+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.i. @<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # # # # # # # # # # # # # # # # # .@1 % % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q +@@@#@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.i.l.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # # # # # # # # # # # # # # # # # $@%@% % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q &@*@=@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.-@l.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # # # # # # # # # # # # # # # ;@>@,@%@% % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q N.'@)@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.k.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # # # # # # # # # < < # !@~@{@]@^@/@(@% % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q _@:@<@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.[@<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # # # # # K }@|@1@2@3@4@5@'.m 5.T S 6@7@% % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q N.8@9@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.i.0@<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # a@b@c@d@e@f@6.R g@5.T T T T T T T T n h@i@% . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q N.j@k@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.i.i.i.#.#.#.#.#.#.#.@.l.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # l@m@n T T T T T T T T T T T T T T T T 5.n@o@ . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q N.p@q@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.r@r@ s@t@u@#.i.#.#.#.#.#.v@<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # w@x@y@T T T T T T T T T T T T T T T T T T z@ . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q N.A@B@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.@.C@ D@E@D@F@G@i.#.#.j.H@<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # w@}+I@J@1+T T T T T T T T T T T T T T T T . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q K@L@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. M@M@M@M@N@O@e+#./+[.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # w@}+}+P@Q@R@T T T T T T T T T T . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q S@T@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. M@M@M@M@M@E@U@i.V@<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # W@}+}+}+X@Y@i+T T T . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q Z@`@#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. M@M@M@M@M@M@M@ #.#<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # W@}+}+}+}+}+ . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q +#@##.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#. M@M@M@M@M@M@M@E@##<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # W@}+}+}+}+}+ . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q $#%##.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.C@ M@M@M@M@M@M@M@M@&#*#<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # =#}+}+}+}+}+ # # # # < -# . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q ;#>#d+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.,# M@M@M@M@M@M@M@M@D@'#<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # )#!#}+~#X@{#y+ # # # # # # # # # # # < ]#% . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q t.^# +#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#./#(#_# M@M@M@M@M@M@M@M@M@&#<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # :#I+<#[#w+}#:## # # # # # # # # # # # # # # |#1#% % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . Z@q q q q q q q 2#3#4#r@e+#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.#.5#6#7#8#9#9#0#0#0#0#0#0#0# M@M@M@M@M@M@M@M@M@D@a#<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. # # # # # # # # # # # # # b#S+S+# # # # # # # # # # # # # # # # # < B+1 % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c#q q q q q q q 8.d#e#:. @f#j.#.#.#.#.#.#.#.#.#.#.#.#.#.#.g#h#i#0#0#0#0#0#0#0#0#0#0#0#0#0#0# j#M@M@M@M@M@M@M@M@M@k#l.<.<.<.<.<.<.*#l#l.m#n#o#p#q#r#s#t#.#*#<.<.<.<. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # u#O+% % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v#q q q q q q q w#x#y#<.<.:.z#f#@.i.#.#.#.#.#.#.#.#.#.#.5#A#B#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#C#D#E#F#M@M@M@M@M@M@M@M@G#<.<.<.<.*#H#r#I#J#K#K#L#L#L#L#K#M#K#N#O#P#*#<. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Q#%@% % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . R#q q q q q q q q S#T#<.<.<.<.<.l.G+#.#.#.#.#.#.#.#.#.U#V#W#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#X#Y#D@M@M@M@M@M@M@M@Z#*#<.<.H#`#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#K# $H# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ~@.$% % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +$q q q q q q q q @$T#<.<.<.<.<.<.l..# @#$i.#.#.#.#.#.$$9#0#0#0#0#0#0#0#0#0#%$&$*$=$-$;$0#0#0#0#0#>$,$'$M@M@M@M@M@M@k#.#<.)$L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#K#!$ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ~$.$% % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q {$]$<.<.<.<.<.<.<.<.<.[. @f#^$i.#./$($0#0#0#0#0#0#0#0#0#_$:$<$[$}$|$1$2$0#0#0#0#0#3$,$'$M@M@M@M@M@E@4$5$L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#I# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # < 6$7$~$8$% % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q 9$y#<.<.<.<.<.<.<.<.<.<.<.:.m.G.0$a$b$0#0#0#0#0#0#0#0#0#c$d$e$e$e$e$f$g$h$i$0#0#0#0#j$k$F#M@M@M@M@M@l$L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# # # # # # # # # # # # # # # # # # # # # # # # < m$< < n$o$!@p$q$r$s$t$u$1 % % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q v$w$<.<.<.<.<.<.<.<.<.<.<.<.<.<.x$y$z$0#0#0#0#0#0#0#0#A$B$e$e$e$e$e$e$C$D$E$0#0#0#0#0#C#F$F#M@M@M@M@G$L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# # # # # # # # # # # # # # # # # # # # 5 5 5 5 -#H$I$J$K$L$m n n S T T M$N$% % . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q O$P$<.<.<.<.<.<.<.<.<.<.<.<.<.<.Q$R$0#0#0#0#0#0#0#0#0#S$T$e$e$e$e$e$e$e$C$U$V$0#0#0#0#0#W$X$M@M@M@M@Y$L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# # # # # # # # # # # < < < Z$`$ %.%+%@%#%$%%%M$o 5.5.S S T T T T T T T T o &%1 . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q *%P$<.<.<.<.<.<.<.<.<.<.<.<.<.=%T$-%0#0#0#0#0#0#0#0#;%>%e$e$e$e$e$e$e$e$e$,%'%0#0#0#0#0#0#D#)%M@M@M@!%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~% # # # Z$K {%]%, ^%/%(%_%:%<%[%'.'.m m S T T T T T T T T T T T T T T T T T n }% . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q |%.#<.<.<.<.<.<.<.<.<.<.<.<.1%2%3%4%0#0#0#0#0#0#0#0#0# e$e$e$e$e$e$e$5%6%7%0#0#0#0#0#8%9%M@M@M@0%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#5$ a%b%c%d%e%f%g%'.g@m 5.T T T T T T T T T T T T T T T T T T T T T T T T T T T R . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q h%i%<.<.<.<.<.<.<.<.<.<.<.<.j%k%l%m%0#0#0#0#0#0#0#0#0# e$e$e$e$e$e$n%&$0#0#0#0#0#o%p%M@M@M@0%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~% T T T T T T T T T T T T T T T T T T T T T T T T T T T T T . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q q%r%<.<.<.<.<.<.<.<.<.<.<.<.s%e$t%u%0#0#0#0#0#0#0#0#0# e$e$e$e$e$v%w%0#0#0#0#0#0#x%y%M@M@z%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#A% T T T T T T T T T T T T T T T T T T T B% . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q C%D%<.<.<.<.<.<.<.<.<.<.<.1%E%e$F%G%0#0#H%I%J%K%K%L%L% e$e$e$e$M%N%0#0#0#0#0#0#O%P%M@M@!%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#Q% T T T T T T T T T R%S%T% . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q v#H#<.<.<.<.<.<.<.<.<.<.<.U%V%e$W%X%Y%Z%`% &.&+&@&#&$& e$e$e$e$%&&&*&0#I%H%0#0#=&-&M@M@Y$L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# ;&>&,&'&)&!& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q v#~&<.<.<.<.<.<.<.<.<.<.<.{&]&e$^&/&(&_&_&_&_&_&_&_&:& e$e$e$e$<&[&$&}&|&1&2&3&4&5&M@M@6&L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# 7&8&9&0&0&a&b&c&d& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q Z@e&<.<.<.<.<.<.<.<.<.<.<.f&g&e$e$h&i&_&_&_&_&_&_&_&j& e$e$e$<&k&_&_&_&_&_&#&:&l&D@M@m&L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#A% n&o&p&0&0&0&0&q&r&s&t&u& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q Z@v&<.<.<.<.<.<.<.<.<.<.<.w&x&e$e$y&z&_&_&_&_&_&_&_&_& A&B&e$e$C&D&_&_&_&_&_&_&_&E&D@M@F&L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#G& H&I&J&0&0&0&0&0&0&K&L&M&t&N&O& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q Z@P&<.<.<.<.<.<.<.<.<.<.<.Q&R&e$e$R&S&_&_&_&_&_&_&_&_&|& T&U&e$e$V&W&_&_&_&_&_&_&_&X&F#Y&~%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# Z&`&0&0&0&0&0&0&0&0&9& *.*t&t&t&+* . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q @*<.<.<.<.<.<.<.<.<.<.<.#*$*e$e$%*&***_&_&_&_&_&_&_&_& M@=*-*e$e$;*>*_&_&_&_&_&_&_&,*F#'*L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# 0&0&0&0&0&0&0&0&0&0&0&p&)*!*t&t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q ~*<.<.<.<.<.<.<.<.<.<.<.{*]*e$e$e$^*/*(&_&_&_&_&_&_&_&(* M@M@_*U&e$e$:*<*_&_&_&_&_&_&_&[*D@}*L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~% 0&0&0&0&0&0&0&0&0&0&0&0&|*1*t&t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q 2*<.<.<.<.<.<.<.<.<.<.<.3*4*e$e$e$^&5*6*7*_&_&_&_&_&_&_& M@M@M@8*9*e$k%0*a*_&_&_&_&_&_&_&b*D@F&L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#c* 0&0&0&0&0&0&0&0&0&0&0&0&d*e*f*t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q g*<.<.<.<.<.<.<.<.<.<.<.<.h*e$e$e$e$^&i*j*_&_&_&_&_&_&_&k*l*m*n*M@o*p*q*r*s*_&_&_&_&_&_&_&_&t*D@~%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# 0&0&0&0&0&0&0&0&0&0&0&0&9&u*v*t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q w*<.<.<.<.<.<.<.<.<.<.<.<.3*x*e$e$e$e$y*z*7*_&_&_&_&_&_&_&A*B*C*D*E*F*G*H*_&_&_&_&_&_&_&_&I*J*K*L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~% 0&0&0&0&0&0&0&0&0&0&0&0&0&0&L*M*t&t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q N**#<.<.<.<.<.<.<.<.<.<.<.3*O*P*e$e$e$e$Q*R*S*_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&T*U*5$L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#V* 0&0&0&0&0&0&0&0&0&0&0&0&0&0&W*X*t&t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q Y**#<.<.<.<.<.<.<.<.<.<.<.<.3*Z*e$e$e$e$`* =.=+=@=_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&#=$=L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#%= 0&0&0&0&0&0&0&0&0&0&0&0&0&0&&=*=t&t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q 0 *#<.<.<.<.<.<.<.<.<.<.<.<.<.==-=e$e$e$e$;=>=,='=)=!=_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&_&~={=]=L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#^= /=(=_= 0&0&0&0&0&0&0&0&0&0&0&0&0&0&:=<=t&t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q [=*#<.<.<.<.<.<.<.<.<.<.<.<.<.}=|=P*e$e$e$e$e$1=2=3=4=5=(&**_&_&_&_&_&_&_&_&_&_&_&_&6=7=8=9=0=L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# a=b=c=d=e=f=t& 0&0&0&0&0&0&0&0&0&0&0&0&0&0&J&g=h=t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q i=.#<.<.<.<.<.<.<.<.<.<.<.<.<.<.j=k=e$e$e$e$e$e$e$e$l=m=n=o=!=**_&_&_&_&_&_&_&_&**6=p=q=r=s=L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#]=t=u=v=0&0&9&w=x=y=t&t& 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&z=A=t&t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q .#<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.3*B=-=e$e$e$e$e$e$`*C=D=E=F=G=H=I=J=K=L=M=N=O=P=Q=R=Y&S=~%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#T=U=V=p&p&0&0&0&`&W=X=t&t&t&t& 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&Y=Z=`=t&t&t&t&t& . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q v#.#<.<.<.<.<.<.<.<.<.<.<.<.<.<.<.<. -.-+-e$e$e$e$e$e$e$e$^&@-5%#-$-%-&-*-=---;->-,-'-M@)-L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#!-~-p&0&0&0&0&0&0&{-]-N&t&t&t&t& 0&0&0&0&0&0&0&0&0&0&0&Y=^-/-(-_-:-<-t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q v#*#<.<.<.<.<.<.<.<.<.<.<.<.<.*#:.[-}-|-1-2-e$3-e$e$e$e$e$e$e$e$e$e$e$e$e$e$4-5-6-7-M@8-L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#9-Y=0&0&0&0&0&0&0&d*0-a-t&t&t&t&t& 0&0&0&0&0&0&0&0&0&Y=b-c-d-e-f-g-h-i-t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q v#l.<.<.<.<.<.<.<.<.<.<.<.j-k-l-L#L#L#L#L#L#m-n-4-e$e$e$e$e$e$e$e$e$e$e$e$o-p-q-M@M@r-L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#s-t-0&0&0&0&0&0&0&0&0&0&u-v-t&t&t&t&t& 0&0&0&0&0&0&w-x-y-z-g-g-g-g-g-g-A-B-t&t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q Z@C-D-E-s#F-G-H-I-J-!$A%L#K#L#L#L#L#L#L#L#L#L#K-L-M-N-O-P-U&Q-Q-R-S-T-U-V-W-X-M@M@Y-Z-L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#`- ;0&0&0&0&0&0&0&0&0&0&d*.;+;t&t&t&t&t& 0&0&0&0&0&0&@;#;$;f-g-g-g-g-g-g-g-%;&;t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q *;=;K#K#K#K#K#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#-;;;>;,;';);!;~;{;;;];^;M@M@M@k#/;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#K#(;`&0&0&0&0&0&0&0&0&0&0&0&_;:;<;t&t&t&t&[;0&0&0&0&};|;1;2;g-g-g-g-g-g-g-g-g-3;4;t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q 5;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#)-M@M@M@M@M@M@M@M@M@M@M@M@M@M@/;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#G& 6;0&0&0&0&0&0&0&0&0&0&0&`&7;8;t&t&t&9;0;0&0&0&a;b;c;d;e;f;g-g-g-g-g-g-g-g-g;h;t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q i;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#)-M@M@M@M@M@M@M@M@M@M@M@M@r-j;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~% k;0&0&0&0&0&0&0&0&0&0&0&0&0&l;A=t&t&m;n;0&0&o;p;g-q;r;s;t;g-g-g-g-g-g-g-g-q;u;v;t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q w;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#)-M@M@M@M@M@M@M@M@M@x;y;z;~%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# A;0&0&0&0&0&0&0&0&0&0&0&0&0&B;C;t&t&D;x-E;F;g-g-g-G;H;I;J;g-g-g-g-g-g-g-g-f;K;L;t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q M;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#)-M@M@M@M@M@x;N;O;P;j;Q;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# R;p&0&0&0&0&0&0&0&0&0&0&0&0&d*S;T;t&U;V;W;X;g-g-g-Y;Z;`; >g-g-g-g-g-g-g-g-g-.>+>t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q @>L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#)-M@M@k##>O;$>Q;L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# %>p&0&0&0&0&0&0&0&0&0&0&0&0&0&&>*>t&=>->c;g-g-g-g-;>>>,>'>g-g-g-g-g-g-g-g-g-)>!>t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q ~>L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#)-M@{>~%L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# ]>p&0&0&0&0&0&0&0&0&0&0&0&0&0&`&^>/>(>_>g-g-g-g-g-:><>[>}>g-g-g-g-g-g-g-g-g-f;|>t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q q ~>L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L# 1>p&0&0&0&0&0&2>3>0&0&0&0&0&0&0&4>5>6>g-g-g-g-g-7>8>9;t&9>0>a>b>c>d>e>e>f>g>h>i>9;t&t&t&t&t& . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . q q q q q q q j>L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~% k>0&0&0&0&0&0&l>m>n>0&0&0&0&0&o>p>q>r>g-g-g-g-s>t>u>9;t&v>w>x>x>y>y>y>y>y>y>x>z>A>t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . q q q q q q q ~>L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#5$ B>C>0&0&0&0&0&0&D>E>F>0&0&0&G>$;g-g-q;g-g-s>H>I>J>K>t&t&L>M>N>N>N>N>N>N>N>N>N>O>P>t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q ~>L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#Q> R>S>0&0&0&0&0&0&T>9;T>0&0&U>g-g-g-g-g-g-g-V>W>N>X>A>t&t&Y>Z>N>N>N>N>N>N>N>N>N>`> ,t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q .,L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#+, Z&0&0&0&0&0&0&@,#,$,%,&,g-g-g-g-g-g-*,=,N>N>N>-,;,t&t&A>>,N>N>N>N>N>N>N>N>N>,,',t&t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q ),L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#!, ~,0&0&0&0&0&0&{,],U;^,X;g-g-g-g-/,(,W>N>N>N>N>_,<>t&t&:,<,N>N>N>N>N>N>N>N>N>W>[,t&t&t&t&t&t& . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q ),L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~%l- ~,0&0&0&0&0&0&},|,t&1,2,g-g-g-c;3,W>N>N>N>N>W>4,t&t&t&9;5,6,N>N>N>N>N>N>N>N>N>7,+>t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q 8,L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#9, 0,0&0&0&0&0&a;a,b,t&A>c,g-g-d,e,N>N>N>N>N>N>f,g,t&t&t&t&h,e,N>N>N>N>N>N>N>N>N>i,j,t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q q k,L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#A% l,};};0&m,n,o,)>p,9;9;q,g-r,e,N>N>N>N>N>N>N>s,t,t&t&t&t&u,v,N>N>N>N>N>N>N>N>N>w,x,t&t&t&t&t& . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q q y,L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#A% z,A,o,X;c;g-g-2,B,v;t&C,D,e,N>N>N>N>N>N>N>N>E,F,t&t&t&t&],G,N>N>N>N>N>N>N>N>N>,,H,t&t&t&t&t&I,. . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . ),q q q q q J,L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#+,~% K,L,g-g-g-g-g-q;M,v;t&<>N,O,N>N>N>N>N>N>N>N>P,P>t&t&t&t&9;Q,W>N>N>N>N>N>N>N>R,S,T,t&t&t&t&t&U,. . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q q V,L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#^= W,A-g-g-g-g-g-f;X,L;t&t&9;Y,N>N>N>N>N>N>N>N>Z,`,t&t&t&t&t& 'M>N>N>N>N>.'+'@'#'$'%'&'*'t&t&t&U,='. . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . q q q q ]=L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~%V* -'A-g-g-g-g-g-g-;'[>t&t&t&>'f,N>N>N>N>N>N>6,,'`,t&t&t&t&t&'',,N>N>6,)'!'~'%'%'%'%'%'%'{']'t&]'^'. . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v#q q q /'L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#V* ('A-g-g-g-g-g-s>_'|,t&t&t&Y>:'N>N>N>6,<'['}'|'1'2'3't&t&t&4'5'6'7'8'9'0'%'%'%'%'%'%'%'%'a'b'c'd'. . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . e'q q f'L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~%g' h'A-g-g-g-g-f-i'6,j't&t&t&9;k'6,R,l'm'n'o'%'%'%'&'p'q'3't&:,r's't'%'%'%'%'%'%'%'%'%'%'%'%'a'a'R.. . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . u'v#q v'L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#L#~%A% w'g-g-s>b>x'N>6,y't&t&t&t&z'A'B'o'%'%'%'%'%'%'%'%'a'C'D't&c' %'%'%'%'%'%'%'%'%'%'%'a'E'F'G'. . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H'q I'L#L#L#L#L#L#L#L#L#L#L#L#L#L#G& w'g-s>J'N>N>N>N>K't&t&t&t&t&t&L'M'%'%'%'%'%'%'%'%'%'%'%'%'N' %'%'%'%'%'%'%'%'O'P'Q'. . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . R'S'T'L#L#L#L#L#L#L#L#L#L#A%9, U'g>V'W>N>N>N>N>W't&t&t&t&t&t&t&c' %'%'%'%'%'%'%'%'%' %'%'%'%' . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X'Z@L#L#L#L#L#L#L#5$Q% Y'x>N>N>N>N>N>N>Z'9;t&t&t&t&t&t&t& %'%'%'%'%' . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . `'R# )L#L#~%~%J- .)N>N>N>N>N>N>N>+)+>t&t&t&t&t&t&t& . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . @)=;I- #)N>N>N>N>N>N>N>$)%)t&t&t&t&t&t&t& . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . &). *)N>N>N>N>N>N>N>=)x,t&t&t&t&t&t&t& . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -)N>N>N>W>R,;)>),)p'')L'3't&t&t&t& . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ))N>.'!)~){)])0'%'%'%'&'C'^)L't&t&t& . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . /)()_)%'%'%'%'%'%'%'%'%'%'%'%'%':)]' . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0'%'%'%'%'%'%'%'%'%'%'%'%'%' . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . %'%'%'%'%'%'%'%' . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . %'%'%'%' . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/SudoDEM2D/gui/qt4/ui_controller.py b/SudoDEM2D/gui/qt4/ui_controller.py new file mode 100644 index 0000000..eb06c4e --- /dev/null +++ b/SudoDEM2D/gui/qt4/ui_controller.py @@ -0,0 +1,393 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'controller-b.ui' +# +# Created by: PyQt4 UI code generator 4.12.1 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + def _fromUtf8(s): + return s + +try: + _encoding = QtGui.QApplication.UnicodeUTF8 + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig, _encoding) +except AttributeError: + def _translate(context, text, disambig): + return QtGui.QApplication.translate(context, text, disambig) + +class Ui_Controller(object): + def setupUi(self, Controller): + Controller.setObjectName(_fromUtf8("Controller")) + Controller.resize(290, 495) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(Controller.sizePolicy().hasHeightForWidth()) + Controller.setSizePolicy(sizePolicy) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/img/sudodem-favicon.xpm")), QtGui.QIcon.Normal, QtGui.QIcon.Off) + Controller.setWindowIcon(icon) + self.gridLayout_3 = QtGui.QGridLayout(Controller) + self.gridLayout_3.setMargin(0) + self.gridLayout_3.setSpacing(0) + self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) + self.controllerTabs = QtGui.QTabWidget(Controller) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.controllerTabs.sizePolicy().hasHeightForWidth()) + self.controllerTabs.setSizePolicy(sizePolicy) + self.controllerTabs.setObjectName(_fromUtf8("controllerTabs")) + self.tab = QtGui.QWidget() + self.tab.setObjectName(_fromUtf8("tab")) + self.gridLayout = QtGui.QGridLayout(self.tab) + self.gridLayout.setMargin(0) + self.gridLayout.setSpacing(0) + self.gridLayout.setObjectName(_fromUtf8("gridLayout")) + self.verticalLayout_3 = QtGui.QVBoxLayout() + self.verticalLayout_3.setMargin(6) + self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setSizeConstraint(QtGui.QLayout.SetMinAndMaxSize) + self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) + self.loadButton = QtGui.QPushButton(self.tab) + self.loadButton.setEnabled(True) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.loadButton.sizePolicy().hasHeightForWidth()) + self.loadButton.setSizePolicy(sizePolicy) + self.loadButton.setMinimumSize(QtCore.QSize(0, 0)) + self.loadButton.setObjectName(_fromUtf8("loadButton")) + self.horizontalLayout_2.addWidget(self.loadButton) + self.saveButton = QtGui.QPushButton(self.tab) + self.saveButton.setEnabled(True) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.saveButton.sizePolicy().hasHeightForWidth()) + self.saveButton.setSizePolicy(sizePolicy) + self.saveButton.setMinimumSize(QtCore.QSize(0, 0)) + self.saveButton.setObjectName(_fromUtf8("saveButton")) + self.horizontalLayout_2.addWidget(self.saveButton) + self.inspectButton = QtGui.QPushButton(self.tab) + self.inspectButton.setObjectName(_fromUtf8("inspectButton")) + self.horizontalLayout_2.addWidget(self.inspectButton) + self.verticalLayout_3.addLayout(self.horizontalLayout_2) + self.formLayout = QtGui.QFormLayout() + self.formLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize) + self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) + self.formLayout.setMargin(6) + self.formLayout.setSpacing(6) + self.formLayout.setObjectName(_fromUtf8("formLayout")) + self.label_6 = QtGui.QLabel(self.tab) + self.label_6.setObjectName(_fromUtf8("label_6")) + self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_6) + self.realTimeLabel = QtGui.QLabel(self.tab) + self.realTimeLabel.setObjectName(_fromUtf8("realTimeLabel")) + self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.realTimeLabel) + self.label_7 = QtGui.QLabel(self.tab) + self.label_7.setObjectName(_fromUtf8("label_7")) + self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_7) + self.virtTimeLabel = QtGui.QLabel(self.tab) + self.virtTimeLabel.setObjectName(_fromUtf8("virtTimeLabel")) + self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.virtTimeLabel) + self.label_8 = QtGui.QLabel(self.tab) + self.label_8.setObjectName(_fromUtf8("label_8")) + self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label_8) + self.iterLabel = QtGui.QLabel(self.tab) + self.iterLabel.setWordWrap(True) + self.iterLabel.setObjectName(_fromUtf8("iterLabel")) + self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.iterLabel) + self.label_9 = QtGui.QLabel(self.tab) + self.label_9.setObjectName(_fromUtf8("label_9")) + self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.label_9) + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + self.dtFixedRadio = QtGui.QRadioButton(self.tab) + self.dtFixedRadio.setChecked(True) + self.dtFixedRadio.setObjectName(_fromUtf8("dtFixedRadio")) + self.horizontalLayout.addWidget(self.dtFixedRadio) + self.dtDynRadio = QtGui.QRadioButton(self.tab) + self.dtDynRadio.setEnabled(False) + self.dtDynRadio.setObjectName(_fromUtf8("dtDynRadio")) + self.horizontalLayout.addWidget(self.dtDynRadio) + self.verticalLayout.addLayout(self.horizontalLayout) + self.dtEdit = QtGui.QLineEdit(self.tab) + self.dtEdit.setEnabled(False) + self.dtEdit.setFocusPolicy(QtCore.Qt.ClickFocus) + self.dtEdit.setObjectName(_fromUtf8("dtEdit")) + self.verticalLayout.addWidget(self.dtEdit) + self.formLayout.setLayout(4, QtGui.QFormLayout.FieldRole, self.verticalLayout) + self.verticalLayout_3.addLayout(self.formLayout) + self.horizontalLayout_5 = QtGui.QHBoxLayout() + self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_5.addItem(spacerItem) + self.fileLabel = QtGui.QLabel(self.tab) + self.fileLabel.setObjectName(_fromUtf8("fileLabel")) + self.horizontalLayout_5.addWidget(self.fileLabel) + spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout_5.addItem(spacerItem1) + self.verticalLayout_3.addLayout(self.horizontalLayout_5) + self.verticalLayout_2 = QtGui.QVBoxLayout() + self.verticalLayout_2.setMargin(6) + self.verticalLayout_2.setSpacing(6) + self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) + self.horizontalLayout_3 = QtGui.QHBoxLayout() + self.horizontalLayout_3.setSpacing(0) + self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) + self.playButton = QtGui.QPushButton(self.tab) + self.playButton.setEnabled(False) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(5) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.playButton.sizePolicy().hasHeightForWidth()) + self.playButton.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(18) + self.playButton.setFont(font) + self.playButton.setIconSize(QtCore.QSize(32, 32)) + self.playButton.setDefault(True) + self.playButton.setFlat(False) + self.playButton.setObjectName(_fromUtf8("playButton")) + self.horizontalLayout_3.addWidget(self.playButton) + self.pauseButton = QtGui.QPushButton(self.tab) + self.pauseButton.setEnabled(False) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(4) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.pauseButton.sizePolicy().hasHeightForWidth()) + self.pauseButton.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(18) + self.pauseButton.setFont(font) + self.pauseButton.setIconSize(QtCore.QSize(32, 32)) + self.pauseButton.setObjectName(_fromUtf8("pauseButton")) + self.horizontalLayout_3.addWidget(self.pauseButton) + self.verticalLayout_2.addLayout(self.horizontalLayout_3) + self.horizontalLayout_4 = QtGui.QHBoxLayout() + self.horizontalLayout_4.setSpacing(0) + self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) + self.gridLayout_9 = QtGui.QGridLayout() + self.gridLayout_9.setMargin(0) + self.gridLayout_9.setSpacing(0) + self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) + self.stepButton = QtGui.QPushButton(self.tab) + self.stepButton.setEnabled(False) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(2) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.stepButton.sizePolicy().hasHeightForWidth()) + self.stepButton.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(12) + self.stepButton.setFont(font) + self.stepButton.setIconSize(QtCore.QSize(32, 32)) + self.stepButton.setObjectName(_fromUtf8("stepButton")) + self.gridLayout_9.addWidget(self.stepButton, 0, 0, 1, 1) + self.subStepCheckbox = QtGui.QCheckBox(self.tab) + font = QtGui.QFont() + font.setPointSize(7) + self.subStepCheckbox.setFont(font) + self.subStepCheckbox.setObjectName(_fromUtf8("subStepCheckbox")) + self.gridLayout_9.addWidget(self.subStepCheckbox, 1, 0, 1, 1) + self.horizontalLayout_4.addLayout(self.gridLayout_9) + self.reloadButton = QtGui.QPushButton(self.tab) + self.reloadButton.setEnabled(False) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(5) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.reloadButton.sizePolicy().hasHeightForWidth()) + self.reloadButton.setSizePolicy(sizePolicy) + font = QtGui.QFont() + font.setPointSize(22) + self.reloadButton.setFont(font) + self.reloadButton.setIconSize(QtCore.QSize(32, 32)) + self.reloadButton.setObjectName(_fromUtf8("reloadButton")) + self.horizontalLayout_4.addWidget(self.reloadButton) + self.verticalLayout_2.addLayout(self.horizontalLayout_4) + self.verticalLayout_3.addLayout(self.verticalLayout_2) + self.gridLayout_2 = QtGui.QGridLayout() + self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) + self.show3dButton = QtGui.QPushButton(self.tab) + self.show3dButton.setCheckable(True) + self.show3dButton.setObjectName(_fromUtf8("show3dButton")) + self.gridLayout_2.addWidget(self.show3dButton, 0, 0, 1, 1) + self.referenceButton = QtGui.QPushButton(self.tab) + self.referenceButton.setObjectName(_fromUtf8("referenceButton")) + self.gridLayout_2.addWidget(self.referenceButton, 0, 1, 1, 1) + self.centerButton = QtGui.QPushButton(self.tab) + self.centerButton.setObjectName(_fromUtf8("centerButton")) + self.gridLayout_2.addWidget(self.centerButton, 0, 2, 1, 1) + self.verticalLayout_3.addLayout(self.gridLayout_2) + self.gridLayout.addLayout(self.verticalLayout_3, 0, 0, 1, 1) + self.controllerTabs.addTab(self.tab, _fromUtf8("")) + self.tab_2 = QtGui.QWidget() + self.tab_2.setObjectName(_fromUtf8("tab_2")) + self.gridLayout_7 = QtGui.QGridLayout(self.tab_2) + self.gridLayout_7.setMargin(0) + self.gridLayout_7.setSpacing(0) + self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) + self.displayCombo = QtGui.QComboBox(self.tab_2) + self.displayCombo.setObjectName(_fromUtf8("displayCombo")) + self.gridLayout_7.addWidget(self.displayCombo, 0, 0, 1, 1) + self.displayArea = QtGui.QScrollArea(self.tab_2) + self.displayArea.setWidgetResizable(True) + self.displayArea.setObjectName(_fromUtf8("displayArea")) + self.displayAreaWidget = QtGui.QWidget() + self.displayAreaWidget.setGeometry(QtCore.QRect(0, 0, 284, 437)) + self.displayAreaWidget.setObjectName(_fromUtf8("displayAreaWidget")) + self.displayArea.setWidget(self.displayAreaWidget) + self.gridLayout_7.addWidget(self.displayArea, 1, 0, 1, 1) + self.controllerTabs.addTab(self.tab_2, _fromUtf8("")) + self.tab_4 = QtGui.QWidget() + self.tab_4.setObjectName(_fromUtf8("tab_4")) + self.gridLayout_6 = QtGui.QGridLayout(self.tab_4) + self.gridLayout_6.setMargin(0) + self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) + self.gridLayout_5 = QtGui.QGridLayout() + self.gridLayout_5.setSpacing(0) + self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) + self.generatorCombo = QtGui.QComboBox(self.tab_4) + self.generatorCombo.setObjectName(_fromUtf8("generatorCombo")) + self.gridLayout_5.addWidget(self.generatorCombo, 0, 0, 1, 1) + self.generatorArea = QtGui.QScrollArea(self.tab_4) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(200) + sizePolicy.setVerticalStretch(200) + sizePolicy.setHeightForWidth(self.generatorArea.sizePolicy().hasHeightForWidth()) + self.generatorArea.setSizePolicy(sizePolicy) + self.generatorArea.setMinimumSize(QtCore.QSize(0, 0)) + self.generatorArea.setWidgetResizable(True) + self.generatorArea.setObjectName(_fromUtf8("generatorArea")) + self.generatorAreaWidget = QtGui.QWidget() + self.generatorAreaWidget.setGeometry(QtCore.QRect(0, 0, 500, 500)) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.generatorAreaWidget.sizePolicy().hasHeightForWidth()) + self.generatorAreaWidget.setSizePolicy(sizePolicy) + self.generatorAreaWidget.setMinimumSize(QtCore.QSize(500, 500)) + self.generatorAreaWidget.setMaximumSize(QtCore.QSize(398, 336)) + self.generatorAreaWidget.setObjectName(_fromUtf8("generatorAreaWidget")) + self.generatorArea.setWidget(self.generatorAreaWidget) + self.gridLayout_5.addWidget(self.generatorArea, 1, 0, 1, 1) + self.gridLayout_4 = QtGui.QGridLayout() + self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) + self.generatorMemoryCheck = QtGui.QCheckBox(self.tab_4) + self.generatorMemoryCheck.setEnabled(False) + self.generatorMemoryCheck.setCheckable(False) + self.generatorMemoryCheck.setChecked(False) + self.generatorMemoryCheck.setObjectName(_fromUtf8("generatorMemoryCheck")) + self.gridLayout_4.addWidget(self.generatorMemoryCheck, 0, 0, 1, 1) + self.generatorFilenameEdit = QtGui.QLineEdit(self.tab_4) + self.generatorFilenameEdit.setObjectName(_fromUtf8("generatorFilenameEdit")) + self.gridLayout_4.addWidget(self.generatorFilenameEdit, 0, 1, 1, 2) + self.generatorAutoCheck = QtGui.QCheckBox(self.tab_4) + self.generatorAutoCheck.setChecked(True) + self.generatorAutoCheck.setObjectName(_fromUtf8("generatorAutoCheck")) + self.gridLayout_4.addWidget(self.generatorAutoCheck, 1, 0, 1, 2) + self.generateButton = QtGui.QPushButton(self.tab_4) + self.generateButton.setObjectName(_fromUtf8("generateButton")) + self.gridLayout_4.addWidget(self.generateButton, 1, 2, 1, 1) + self.gridLayout_5.addLayout(self.gridLayout_4, 2, 0, 1, 1) + self.gridLayout_6.addLayout(self.gridLayout_5, 0, 0, 1, 1) + self.controllerTabs.addTab(self.tab_4, _fromUtf8("")) + self.tab_3 = QtGui.QWidget() + self.tab_3.setObjectName(_fromUtf8("tab_3")) + self.gridLayout_8 = QtGui.QGridLayout(self.tab_3) + self.gridLayout_8.setMargin(0) + self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) + self.verticalLayout_4 = QtGui.QVBoxLayout() + self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) + self.pythonCombo = QtGui.QComboBox(self.tab_3) + font = QtGui.QFont() + font.setFamily(_fromUtf8("Monospace")) + self.pythonCombo.setFont(font) + self.pythonCombo.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor)) + self.pythonCombo.setFocusPolicy(QtCore.Qt.StrongFocus) + self.pythonCombo.setAutoFillBackground(False) + self.pythonCombo.setEditable(True) + self.pythonCombo.setInsertPolicy(QtGui.QComboBox.InsertAtTop) + self.pythonCombo.setMinimumContentsLength(1) + self.pythonCombo.setDuplicatesEnabled(False) + self.pythonCombo.setObjectName(_fromUtf8("pythonCombo")) + self.verticalLayout_4.addWidget(self.pythonCombo) + self.label = QtGui.QLabel(self.tab_3) + self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.label.setObjectName(_fromUtf8("label")) + self.verticalLayout_4.addWidget(self.label) + spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_4.addItem(spacerItem2) + self.gridLayout_8.addLayout(self.verticalLayout_4, 0, 0, 1, 1) + self.controllerTabs.addTab(self.tab_3, _fromUtf8("")) + self.gridLayout_3.addWidget(self.controllerTabs, 0, 0, 1, 1) + + self.retranslateUi(Controller) + self.controllerTabs.setCurrentIndex(0) + QtCore.QObject.connect(self.loadButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.loadSlot) + QtCore.QObject.connect(self.saveButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.saveSlot) + QtCore.QObject.connect(self.dtFixedRadio, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.dtFixedSlot) + QtCore.QObject.connect(self.dtDynRadio, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.dtDynSlot) + QtCore.QObject.connect(self.dtEdit, QtCore.SIGNAL(_fromUtf8("editingFinished()")), Controller.dtEditedSlot) + QtCore.QObject.connect(self.playButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.playSlot) + QtCore.QObject.connect(self.pauseButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.pauseSlot) + QtCore.QObject.connect(self.referenceButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.setReferenceSlot) + QtCore.QObject.connect(self.centerButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.centerSlot) + QtCore.QObject.connect(self.generateButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.generateSlot) + QtCore.QObject.connect(self.dtEdit, QtCore.SIGNAL(_fromUtf8("textEdited(QString)")), Controller.dtEditNoupdateSlot) + QtCore.QObject.connect(self.dtEdit, QtCore.SIGNAL(_fromUtf8("cursorPositionChanged(int,int)")), Controller.dtEditNoupdateSlot) + QtCore.QObject.connect(self.generatorCombo, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(QString)")), Controller.generatorComboSlot) + QtCore.QObject.connect(self.displayCombo, QtCore.SIGNAL(_fromUtf8("currentIndexChanged(QString)")), Controller.displayComboSlot) + QtCore.QObject.connect(self.pythonCombo, QtCore.SIGNAL(_fromUtf8("activated(QString)")), Controller.pythonComboSlot) + QtCore.QObject.connect(self.inspectButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.inspectSlot) + QtCore.QObject.connect(self.reloadButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.reloadSlot) + QtCore.QObject.connect(self.stepButton, QtCore.SIGNAL(_fromUtf8("clicked()")), Controller.stepSlot) + QtCore.QObject.connect(self.subStepCheckbox, QtCore.SIGNAL(_fromUtf8("stateChanged(int)")), Controller.subStepSlot) + QtCore.QObject.connect(self.show3dButton, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), Controller.show3dSlot) + QtCore.QMetaObject.connectSlotsByName(Controller) + + def retranslateUi(self, Controller): + Controller.setWindowTitle(_translate("Controller", "SudoDEM2D", None)) + self.loadButton.setText(_translate("Controller", "Load", None)) + self.saveButton.setText(_translate("Controller", "Save", None)) + self.inspectButton.setText(_translate("Controller", "Inspect", None)) + self.label_6.setText(_translate("Controller", "real", None)) + self.realTimeLabel.setText(_translate("Controller", "00:00:00", None)) + self.label_7.setText(_translate("Controller", "virt", None)) + self.virtTimeLabel.setText(_translate("Controller", "00:000.000m000μ000n", None)) + self.label_8.setText(_translate("Controller", "iter", None)) + self.iterLabel.setText(_translate("Controller", "#0, 0.0/s", None)) + self.label_9.setText(_translate("Controller", "Δt", None)) + self.dtFixedRadio.setText(_translate("Controller", "fixed", None)) + self.dtDynRadio.setText(_translate("Controller", "time stepper", None)) + self.fileLabel.setText(_translate("Controller", "[no file]", None)) + self.playButton.setText(_translate("Controller", "▶", None)) + self.pauseButton.setText(_translate("Controller", "▮▮", None)) + self.stepButton.setText(_translate("Controller", "▶▮", None)) + self.subStepCheckbox.setText(_translate("Controller", "sub-step", None)) + self.reloadButton.setText(_translate("Controller", "↻", None)) + self.show3dButton.setText(_translate("Controller", "Show", None)) + self.referenceButton.setText(_translate("Controller", "Reference", None)) + self.centerButton.setText(_translate("Controller", "Center", None)) + self.controllerTabs.setTabText(self.controllerTabs.indexOf(self.tab), _translate("Controller", "Simulation", None)) + self.controllerTabs.setTabText(self.controllerTabs.indexOf(self.tab_2), _translate("Controller", "Display", None)) + self.generatorMemoryCheck.setText(_translate("Controller", "memory slot", None)) + self.generatorFilenameEdit.setText(_translate("Controller", "/tmp/scene.sudodem.gz", None)) + self.generatorAutoCheck.setText(_translate("Controller", "open automatically", None)) + self.generateButton.setText(_translate("Controller", "Generate", None)) + self.controllerTabs.setTabText(self.controllerTabs.indexOf(self.tab_4), _translate("Controller", "Generate", None)) + self.label.setText(_translate("Controller", "(Output appears in the terminal)", None)) + self.controllerTabs.setTabText(self.controllerTabs.indexOf(self.tab_3), _translate("Controller", "Python", None)) + +import img_rc diff --git a/SudoDEM2D/lib/.DS_Store b/SudoDEM2D/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5c9074294c1f1c9f766bf4085201ce6fef580875 GIT binary patch literal 10244 zcmeHM&2Aev5FYwRUOP7GLjfOp*-H@v_Q7fmD?m^{wVi_l6bK+UJ+y@_S*opMrBx-_ zg6+D{rKh|=`UpjUJcDxx5FnRc(mqHZp!tT}3LJW=TLVKO0diL4H{{HGT>h+xNNu0i zi$pOIMaV3d7g6LSZs&X>O=UGZkP7;=m!wCvB(351@(pyT2oVSo2oVSo2oVSoxD64& zp3Nz`V`L~p1VRKt1V$0y^&v)PS8L<-Djvq zRq9d0xxe2>+v>kMX~hw)Ht2P-d;XhRCu#Qj8ykPCsp*;7!dw(BL<>s`KUPlCL8V{q zpZ2z^-S7F=qiX-8mObyMX)=1Q)*d$-gM;NychYvh+H5zvTDe(o0P@3k&2~KuuUuXhOY8Agv2?W_UzSQ6>+$B7TUS@}(aPt=ul5dG=NFg1T>bjo zxURD0gFZ38N9FH$8u^zT7b{0;t7BSU{$;nd(%s$6cV2R?zkT-VYuR2O+uk{``~H)M z7>#>Y>9&)!eT+J`bCw=Zla8rDZHJjZ&}uVdA%*RGFYd{HJl0$Ktu)tu3n4tHTw?&5 zqn|K?j;K#5b?IDMt5$%pt##1CVtUA@Q3v6%`UWc3at9@>ry&NT0;1faj<&t;*!~;Z zZQBKQLf-@7qh#kZW=FJpxN$JK%m|F+CB`sv9OvCw1Y@U^V8$_b4agJlSEruC-#_Tb z=Fh7)p!RPYr#S89duVISc7H1w5zoqdB20j`3KqO5N9p)flvg<*^#M>&6%jF$>J8WenPx z74w)CEzE&b?~+YkE9FY5c$c(iLypFT&Vn3ICHr4IMQn0V9@cY_xoqbkCCg + * \endcode + */ + +#include "src/Cholesky/LLT.h" +#include "src/Cholesky/LDLT.h" +#ifdef EIGEN_USE_LAPACKE +#ifdef EIGEN_USE_MKL +#include "mkl_lapacke.h" +#else +#include "src/misc/lapacke.h" +#endif +#include "src/Cholesky/LLT_LAPACKE.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/SudoDEM2D/lib/Eigen/CholmodSupport b/SudoDEM2D/lib/Eigen/CholmodSupport new file mode 100644 index 0000000..bed8924 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/CholmodSupport @@ -0,0 +1,48 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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/CholmodSupport/CholmodSupport.h" + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_CHOLMODSUPPORT_MODULE_H + diff --git a/SudoDEM2D/lib/Eigen/Core b/SudoDEM2D/lib/Eigen/Core new file mode 100644 index 0000000..4d4901e --- /dev/null +++ b/SudoDEM2D/lib/Eigen/Core @@ -0,0 +1,537 @@ +// 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" + +#if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA) + #define EIGEN_CUDACC __CUDACC__ +#endif + +#if defined(__CUDA_ARCH__) && !defined(EIGEN_NO_CUDA) + #define EIGEN_CUDA_ARCH __CUDA_ARCH__ +#endif + +#if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9) +#define EIGEN_CUDACC_VER ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100)) +#elif defined(__CUDACC_VER__) +#define EIGEN_CUDACC_VER __CUDACC_VER__ +#else +#define EIGEN_CUDACC_VER 0 +#endif + +// Handle NVCC/CUDA/SYCL +#if defined(__CUDACC__) || defined(__SYCL_DEVICE_ONLY__) + // Do not try asserts on CUDA and SYCL! + #ifndef EIGEN_NO_DEBUG + #define EIGEN_NO_DEBUG + #endif + + #ifdef EIGEN_INTERNAL_DEBUGGING + #undef EIGEN_INTERNAL_DEBUGGING + #endif + + #ifdef EIGEN_EXCEPTIONS + #undef EIGEN_EXCEPTIONS + #endif + + // All functions callable from CUDA code must be qualified with __device__ + #ifdef __CUDACC__ + // Do not try to vectorize on CUDA and SYCL! + #ifndef EIGEN_DONT_VECTORIZE + #define EIGEN_DONT_VECTORIZE + #endif + + #define EIGEN_DEVICE_FUNC __host__ __device__ + // We need math_functions.hpp to ensure that that EIGEN_USING_STD_MATH macro + // works properly on the device side + #include + #else + #define EIGEN_DEVICE_FUNC + #endif + +#else + #define EIGEN_DEVICE_FUNC + +#endif + +// When compiling CUDA device code with NVCC, pull in math functions from the +// global namespace. In host mode, and when device doee with clang, use the +// std versions. +#if defined(__CUDA_ARCH__) && defined(__NVCC__) + #define EIGEN_USING_STD_MATH(FUNC) using ::FUNC; +#else + #define EIGEN_USING_STD_MATH(FUNC) using std::FUNC; +#endif + +#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(EIGEN_EXCEPTIONS) && !defined(EIGEN_USE_SYCL) + #define EIGEN_EXCEPTIONS +#endif + +#ifdef EIGEN_EXCEPTIONS + #include +#endif + +// 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 EIGEN_COMP_MINGW && 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_MAX_ALIGN_BYTES is the proper check, it takes into +// account both the user's will (EIGEN_MAX_ALIGN_BYTES,EIGEN_DONT_ALIGN) and our own platform checks +#if EIGEN_MAX_ALIGN_BYTES==0 + #ifndef EIGEN_DONT_VECTORIZE + #define EIGEN_DONT_VECTORIZE + #endif +#endif + +#if EIGEN_COMP_MSVC + #include // for _aligned_malloc -- need it regardless of whether vectorization is enabled + #if (EIGEN_COMP_MSVC >= 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)) || EIGEN_ARCH_x86_64 + #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__) && ( (!EIGEN_COMP_GNUC) || EIGEN_COMP_ICC || 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 + #ifdef __AVX__ + #define EIGEN_VECTORIZE_AVX + #define EIGEN_VECTORIZE_SSE3 + #define EIGEN_VECTORIZE_SSSE3 + #define EIGEN_VECTORIZE_SSE4_1 + #define EIGEN_VECTORIZE_SSE4_2 + #endif + #ifdef __AVX2__ + #define EIGEN_VECTORIZE_AVX2 + #endif + #ifdef __FMA__ + #define EIGEN_VECTORIZE_FMA + #endif + #if defined(__AVX512F__) && defined(EIGEN_ENABLE_AVX512) + #define EIGEN_VECTORIZE_AVX512 + #define EIGEN_VECTORIZE_AVX2 + #define EIGEN_VECTORIZE_AVX + #define EIGEN_VECTORIZE_FMA + #ifdef __AVX512DQ__ + #define EIGEN_VECTORIZE_AVX512DQ + #endif + #ifdef __AVX512ER__ + #define EIGEN_VECTORIZE_AVX512ER + #endif + #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 EIGEN_COMP_ICC >= 1110 + #include + #else + #include + #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 + #if defined(EIGEN_VECTORIZE_AVX) || defined(EIGEN_VECTORIZE_AVX512) + #include + #endif + #endif + } // end extern "C" + #elif defined __VSX__ + #define EIGEN_VECTORIZE + #define EIGEN_VECTORIZE_VSX + #include + // We need to #undef all these ugly tokens defined in + // => use __vector instead of vector + #undef bool + #undef vector + #undef pixel + #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) || (defined __ARM_NEON__) + #define EIGEN_VECTORIZE + #define EIGEN_VECTORIZE_NEON + #include + #elif (defined __s390x__ && defined __VEC__) + #define EIGEN_VECTORIZE + #define EIGEN_VECTORIZE_ZVECTOR + #include + #endif +#endif + +#if defined(__F16C__) && !defined(EIGEN_COMP_CLANG) + // We can use the optimized fp16 to float and float to fp16 conversion routines + #define EIGEN_HAS_FP16_C +#endif + +#if defined __CUDACC__ + #define EIGEN_VECTORIZE_CUDA + #include + #if EIGEN_CUDACC_VER >= 70500 + #define EIGEN_HAS_CUDA_FP16 + #endif +#endif + +#if defined EIGEN_HAS_CUDA_FP16 + #include + #include +#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 !(EIGEN_COMP_MSVC && EIGEN_OS_WINCE) && !EIGEN_COMP_ARM +#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 std::is_nothrow_move_assignable +#ifdef EIGEN_INCLUDE_TYPE_TRAITS +#include +#endif + +// for outputting debug info +#ifdef EIGEN_DEBUG_ASSIGN +#include +#endif + +// required for __cpuid, needs to be included after cmath +#if EIGEN_COMP_MSVC && EIGEN_ARCH_i386_OR_x86_64 && !EIGEN_OS_WINCE + #include +#endif + +/** \brief Namespace containing all symbols from the %Eigen library. */ +namespace Eigen { + +inline static const char *SimdInstructionSetsInUse(void) { +#if defined(EIGEN_VECTORIZE_AVX512) + return "AVX512, FMA, AVX2, AVX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2"; +#elif defined(EIGEN_VECTORIZE_AVX) + return "AVX SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2"; +#elif 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_VSX) + return "VSX"; +#elif defined(EIGEN_VECTORIZE_NEON) + return "ARM NEON"; +#elif defined(EIGEN_VECTORIZE_ZVECTOR) + return "S390X ZVECTOR"; +#else + return "None"; +#endif +} + +} // end namespace Eigen + +#if defined EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS || defined EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API || defined EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS || defined EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API || defined EIGEN2_SUPPORT +// This will generate an error message: +#error Eigen2-support is only available up to version 3.2. Please go to "http://eigen.tuxfamily.org/index.php?title=Eigen2" for further information +#endif + +namespace Eigen { + +// 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/Meta.h" +#include "src/Core/util/ForwardDeclarations.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" +#include "src/Core/MathFunctionsImpl.h" +#include "src/Core/arch/Default/ConjHelper.h" + +#if defined EIGEN_VECTORIZE_AVX512 + #include "src/Core/arch/SSE/PacketMath.h" + #include "src/Core/arch/AVX/PacketMath.h" + #include "src/Core/arch/AVX512/PacketMath.h" + #include "src/Core/arch/AVX512/MathFunctions.h" +#elif defined EIGEN_VECTORIZE_AVX + // Use AVX for floats and doubles, SSE for integers + #include "src/Core/arch/SSE/PacketMath.h" + #include "src/Core/arch/SSE/Complex.h" + #include "src/Core/arch/SSE/MathFunctions.h" + #include "src/Core/arch/AVX/PacketMath.h" + #include "src/Core/arch/AVX/MathFunctions.h" + #include "src/Core/arch/AVX/Complex.h" + #include "src/Core/arch/AVX/TypeCasting.h" + #include "src/Core/arch/SSE/TypeCasting.h" +#elif 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" + #include "src/Core/arch/SSE/TypeCasting.h" +#elif defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX) + #include "src/Core/arch/AltiVec/PacketMath.h" + #include "src/Core/arch/AltiVec/MathFunctions.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/MathFunctions.h" + #include "src/Core/arch/NEON/Complex.h" +#elif defined EIGEN_VECTORIZE_ZVECTOR + #include "src/Core/arch/ZVector/PacketMath.h" + #include "src/Core/arch/ZVector/MathFunctions.h" + #include "src/Core/arch/ZVector/Complex.h" +#endif + +// Half float support +#include "src/Core/arch/CUDA/Half.h" +#include "src/Core/arch/CUDA/PacketMathHalf.h" +#include "src/Core/arch/CUDA/TypeCasting.h" + +#if defined EIGEN_VECTORIZE_CUDA + #include "src/Core/arch/CUDA/PacketMath.h" + #include "src/Core/arch/CUDA/MathFunctions.h" +#endif + +#include "src/Core/arch/Default/Settings.h" + +#include "src/Core/functors/TernaryFunctors.h" +#include "src/Core/functors/BinaryFunctors.h" +#include "src/Core/functors/UnaryFunctors.h" +#include "src/Core/functors/NullaryFunctors.h" +#include "src/Core/functors/StlFunctors.h" +#include "src/Core/functors/AssignmentFunctors.h" + +// Specialized functors to enable the processing of complex numbers +// on CUDA devices +#include "src/Core/arch/CUDA/Complex.h" + +#include "src/Core/IO.h" +#include "src/Core/DenseCoeffsBase.h" +#include "src/Core/DenseBase.h" +#include "src/Core/MatrixBase.h" +#include "src/Core/EigenBase.h" + +#include "src/Core/Product.h" +#include "src/Core/CoreEvaluators.h" +#include "src/Core/AssignEvaluator.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/ArrayBase.h" +#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/CwiseTernaryOp.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/Stride.h" +#include "src/Core/MapBase.h" +#include "src/Core/Map.h" +#include "src/Core/Ref.h" +#include "src/Core/Block.h" +#include "src/Core/VectorBlock.h" +#include "src/Core/Transpose.h" +#include "src/Core/DiagonalMatrix.h" +#include "src/Core/Diagonal.h" +#include "src/Core/DiagonalProduct.h" +#include "src/Core/Redux.h" +#include "src/Core/Visitor.h" +#include "src/Core/Fuzzy.h" +#include "src/Core/Swap.h" +#include "src/Core/CommaInitializer.h" +#include "src/Core/GeneralProduct.h" +#include "src/Core/Solve.h" +#include "src/Core/Inverse.h" +#include "src/Core/SolverBase.h" +#include "src/Core/PermutationMatrix.h" +#include "src/Core/Transpositions.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/ProductEvaluators.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/ConditionEstimator.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/ArrayWrapper.h" + +#ifdef EIGEN_USE_BLAS +#include "src/Core/products/GeneralMatrixMatrix_BLAS.h" +#include "src/Core/products/GeneralMatrixVector_BLAS.h" +#include "src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h" +#include "src/Core/products/SelfadjointMatrixMatrix_BLAS.h" +#include "src/Core/products/SelfadjointMatrixVector_BLAS.h" +#include "src/Core/products/TriangularMatrixMatrix_BLAS.h" +#include "src/Core/products/TriangularMatrixVector_BLAS.h" +#include "src/Core/products/TriangularSolverMatrix_BLAS.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" + +#endif // EIGEN_CORE_H diff --git a/SudoDEM2D/lib/Eigen/Dense b/SudoDEM2D/lib/Eigen/Dense new file mode 100644 index 0000000..5768910 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/Dense @@ -0,0 +1,7 @@ +#include "Core" +#include "LU" +#include "Cholesky" +#include "QR" +#include "SVD" +#include "Geometry" +#include "Eigenvalues" diff --git a/SudoDEM2D/lib/Eigen/Eigen b/SudoDEM2D/lib/Eigen/Eigen new file mode 100644 index 0000000..654c8dc --- /dev/null +++ b/SudoDEM2D/lib/Eigen/Eigen @@ -0,0 +1,2 @@ +#include "Dense" +#include "Sparse" diff --git a/SudoDEM2D/lib/Eigen/Eigenvalues b/SudoDEM2D/lib/Eigen/Eigenvalues new file mode 100644 index 0000000..f3f661b --- /dev/null +++ b/SudoDEM2D/lib/Eigen/Eigenvalues @@ -0,0 +1,61 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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/misc/RealSvd2x2.h" +#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 +#ifdef EIGEN_USE_MKL +#include "mkl_lapacke.h" +#else +#include "src/misc/lapacke.h" +#endif +#include "src/Eigenvalues/RealSchur_LAPACKE.h" +#include "src/Eigenvalues/ComplexSchur_LAPACKE.h" +#include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.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/SudoDEM2D/lib/Eigen/Geometry b/SudoDEM2D/lib/Eigen/Geometry new file mode 100644 index 0000000..716d529 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/Geometry @@ -0,0 +1,62 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_GEOMETRY_MODULE_H +#define EIGEN_GEOMETRY_MODULE_H + +#include "Core" + +#include "src/Core/util/DisableStupidWarnings.h" + +#include "SVD" +#include "LU" +#include + +/** \defgroup Geometry_Module Geometry module + * + * This module provides support for: + * - fixed-size homogeneous transformations + * - translation, scaling, 2D and 3D rotations + * - \link Quaternion quaternions \endlink + * - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3) + * - orthognal vector generation (\ref MatrixBase::unitOrthogonal) + * - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink + * - \link AlignedBox axis aligned bounding boxes \endlink + * - \link umeyama least-square transformation fitting \endlink + * + * \code + * #include + * \endcode + */ + +#include "src/Geometry/OrthoMethods.h" +#include "src/Geometry/EulerAngles.h" + +#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" + +// Use the SSE optimized version whenever possible. At the moment the +// SSE version doesn't compile when AVX is enabled +#if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX +#include "src/Geometry/arch/Geometry_SSE.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/SudoDEM2D/lib/Eigen/Householder b/SudoDEM2D/lib/Eigen/Householder new file mode 100644 index 0000000..89cd81b --- /dev/null +++ b/SudoDEM2D/lib/Eigen/Householder @@ -0,0 +1,30 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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/SudoDEM2D/lib/Eigen/IterativeLinearSolvers b/SudoDEM2D/lib/Eigen/IterativeLinearSolvers new file mode 100644 index 0000000..957d575 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/IterativeLinearSolvers @@ -0,0 +1,48 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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, + * - LeastSquaresConjugateGradient for rectangular least-square problems, + * - 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. + * - IncompleteLUT - 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/IterativeLinearSolvers/SolveWithGuess.h" +#include "src/IterativeLinearSolvers/IterativeSolverBase.h" +#include "src/IterativeLinearSolvers/BasicPreconditioners.h" +#include "src/IterativeLinearSolvers/ConjugateGradient.h" +#include "src/IterativeLinearSolvers/LeastSquareConjugateGradient.h" +#include "src/IterativeLinearSolvers/BiCGSTAB.h" +#include "src/IterativeLinearSolvers/IncompleteLUT.h" +#include "src/IterativeLinearSolvers/IncompleteCholesky.h" + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H diff --git a/SudoDEM2D/lib/Eigen/Jacobi b/SudoDEM2D/lib/Eigen/Jacobi new file mode 100644 index 0000000..17c1d78 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/Jacobi @@ -0,0 +1,33 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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/SudoDEM2D/lib/Eigen/LU b/SudoDEM2D/lib/Eigen/LU new file mode 100644 index 0000000..6418a86 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/LU @@ -0,0 +1,50 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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/Kernel.h" +#include "src/misc/Image.h" +#include "src/LU/FullPivLU.h" +#include "src/LU/PartialPivLU.h" +#ifdef EIGEN_USE_LAPACKE +#ifdef EIGEN_USE_MKL +#include "mkl_lapacke.h" +#else +#include "src/misc/lapacke.h" +#endif +#include "src/LU/PartialPivLU_LAPACKE.h" +#endif +#include "src/LU/Determinant.h" +#include "src/LU/InverseImpl.h" + +// Use the SSE optimized version whenever possible. At the moment the +// SSE version doesn't compile when AVX is enabled +#if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX + #include "src/LU/arch/Inverse_SSE.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/SudoDEM2D/lib/Eigen/MetisSupport b/SudoDEM2D/lib/Eigen/MetisSupport new file mode 100644 index 0000000..85c41bf --- /dev/null +++ b/SudoDEM2D/lib/Eigen/MetisSupport @@ -0,0 +1,35 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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/SudoDEM2D/lib/Eigen/OrderingMethods b/SudoDEM2D/lib/Eigen/OrderingMethods new file mode 100644 index 0000000..d8ea361 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/OrderingMethods @@ -0,0 +1,73 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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/SudoDEM2D/lib/Eigen/PaStiXSupport b/SudoDEM2D/lib/Eigen/PaStiXSupport new file mode 100644 index 0000000..de3a63b --- /dev/null +++ b/SudoDEM2D/lib/Eigen/PaStiXSupport @@ -0,0 +1,48 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_PASTIXSUPPORT_MODULE_H +#define EIGEN_PASTIXSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +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/PaStiXSupport/PaStiXSupport.h" + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_PASTIXSUPPORT_MODULE_H diff --git a/SudoDEM2D/lib/Eigen/PardisoSupport b/SudoDEM2D/lib/Eigen/PardisoSupport new file mode 100755 index 0000000..340edf5 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/PardisoSupport @@ -0,0 +1,35 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_PARDISOSUPPORT_MODULE_H +#define EIGEN_PARDISOSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +#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/SudoDEM2D/lib/Eigen/QR b/SudoDEM2D/lib/Eigen/QR new file mode 100644 index 0000000..c7e9144 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/QR @@ -0,0 +1,51 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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::householderQr() + * - MatrixBase::colPivHouseholderQr() + * - MatrixBase::fullPivHouseholderQr() + * + * \code + * #include + * \endcode + */ + +#include "src/QR/HouseholderQR.h" +#include "src/QR/FullPivHouseholderQR.h" +#include "src/QR/ColPivHouseholderQR.h" +#include "src/QR/CompleteOrthogonalDecomposition.h" +#ifdef EIGEN_USE_LAPACKE +#ifdef EIGEN_USE_MKL +#include "mkl_lapacke.h" +#else +#include "src/misc/lapacke.h" +#endif +#include "src/QR/HouseholderQR_LAPACKE.h" +#include "src/QR/ColPivHouseholderQR_LAPACKE.h" +#endif + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_QR_MODULE_H +/* vim: set filetype=cpp et sw=2 ts=2 ai: */ diff --git a/SudoDEM2D/lib/Eigen/QtAlignedMalloc b/SudoDEM2D/lib/Eigen/QtAlignedMalloc new file mode 100644 index 0000000..4f07df0 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/QtAlignedMalloc @@ -0,0 +1,40 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_QTMALLOC_MODULE_H +#define EIGEN_QTMALLOC_MODULE_H + +#include "Core" + +#if (!EIGEN_MALLOC_ALREADY_ALIGNED) + +#include "src/Core/util/DisableStupidWarnings.h" + +void *qMalloc(std::size_t size) +{ + return Eigen::internal::aligned_malloc(size); +} + +void qFree(void *ptr) +{ + Eigen::internal::aligned_free(ptr); +} + +void *qRealloc(void *ptr, std::size_t size) +{ + void* newPtr = Eigen::internal::aligned_malloc(size); + std::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/SudoDEM2D/lib/Eigen/SPQRSupport b/SudoDEM2D/lib/Eigen/SPQRSupport new file mode 100644 index 0000000..f70390c --- /dev/null +++ b/SudoDEM2D/lib/Eigen/SPQRSupport @@ -0,0 +1,34 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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/CholmodSupport/CholmodSupport.h" +#include "src/SPQRSupport/SuiteSparseQRSupport.h" + +#endif diff --git a/SudoDEM2D/lib/Eigen/SVD b/SudoDEM2D/lib/Eigen/SVD new file mode 100644 index 0000000..5d0e75f --- /dev/null +++ b/SudoDEM2D/lib/Eigen/SVD @@ -0,0 +1,51 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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). + * Two decomposition algorithms are provided: + * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. + * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. + * These decompositions are accessible via the respective classes and following MatrixBase methods: + * - MatrixBase::jacobiSvd() + * - MatrixBase::bdcSvd() + * + * \code + * #include + * \endcode + */ + +#include "src/misc/RealSvd2x2.h" +#include "src/SVD/UpperBidiagonalization.h" +#include "src/SVD/SVDBase.h" +#include "src/SVD/JacobiSVD.h" +#include "src/SVD/BDCSVD.h" +#if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) +#ifdef EIGEN_USE_MKL +#include "mkl_lapacke.h" +#else +#include "src/misc/lapacke.h" +#endif +#include "src/SVD/JacobiSVD_LAPACKE.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/SudoDEM2D/lib/Eigen/Sparse b/SudoDEM2D/lib/Eigen/Sparse new file mode 100644 index 0000000..136e681 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/Sparse @@ -0,0 +1,36 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_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" +#ifndef EIGEN_MPL2_ONLY +#include "SparseCholesky" +#endif +#include "SparseLU" +#include "SparseQR" +#include "IterativeLinearSolvers" + +#endif // EIGEN_SPARSE_MODULE_H + diff --git a/SudoDEM2D/lib/Eigen/SparseCholesky b/SudoDEM2D/lib/Eigen/SparseCholesky new file mode 100644 index 0000000..b6a320c --- /dev/null +++ b/SudoDEM2D/lib/Eigen/SparseCholesky @@ -0,0 +1,45 @@ +// 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/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/SudoDEM2D/lib/Eigen/SparseCore b/SudoDEM2D/lib/Eigen/SparseCore new file mode 100644 index 0000000..76966c4 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/SparseCore @@ -0,0 +1,69 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_SPARSECORE_MODULE_H +#define EIGEN_SPARSECORE_MODULE_H + +#include "Core" + +#include "src/Core/util/DisableStupidWarnings.h" + +#include +#include +#include +#include +#include + +/** + * \defgroup SparseCore_Module SparseCore module + * + * This module provides a sparse matrix representation, and basic associated matrix manipulations + * and operations. + * + * See the \ref TutorialSparse "Sparse tutorial" + * + * \code + * #include + * \endcode + * + * This module depends on: Core. + */ + +#include "src/SparseCore/SparseUtil.h" +#include "src/SparseCore/SparseMatrixBase.h" +#include "src/SparseCore/SparseAssign.h" +#include "src/SparseCore/CompressedStorage.h" +#include "src/SparseCore/AmbiVector.h" +#include "src/SparseCore/SparseCompressedBase.h" +#include "src/SparseCore/SparseMatrix.h" +#include "src/SparseCore/SparseMap.h" +#include "src/SparseCore/MappedSparseMatrix.h" +#include "src/SparseCore/SparseVector.h" +#include "src/SparseCore/SparseRef.h" +#include "src/SparseCore/SparseCwiseUnaryOp.h" +#include "src/SparseCore/SparseCwiseBinaryOp.h" +#include "src/SparseCore/SparseTranspose.h" +#include "src/SparseCore/SparseBlock.h" +#include "src/SparseCore/SparseDot.h" +#include "src/SparseCore/SparseRedux.h" +#include "src/SparseCore/SparseView.h" +#include "src/SparseCore/SparseDiagonalProduct.h" +#include "src/SparseCore/ConservativeSparseSparseProduct.h" +#include "src/SparseCore/SparseSparseProductWithPruning.h" +#include "src/SparseCore/SparseProduct.h" +#include "src/SparseCore/SparseDenseProduct.h" +#include "src/SparseCore/SparseSelfAdjointView.h" +#include "src/SparseCore/SparseTriangularView.h" +#include "src/SparseCore/TriangularSolver.h" +#include "src/SparseCore/SparsePermutation.h" +#include "src/SparseCore/SparseFuzzy.h" +#include "src/SparseCore/SparseSolverBase.h" + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_SPARSECORE_MODULE_H + diff --git a/SudoDEM2D/lib/Eigen/SparseLU b/SudoDEM2D/lib/Eigen/SparseLU new file mode 100644 index 0000000..38b38b5 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/SparseLU @@ -0,0 +1,46 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2012 Désiré Nuentsa-Wakam +// Copyright (C) 2012 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_SPARSELU_MODULE_H +#define EIGEN_SPARSELU_MODULE_H + +#include "SparseCore" + +/** + * \defgroup SparseLU_Module SparseLU module + * This module defines a supernodal factorization of general sparse matrices. + * The code is fully optimized for supernode-panel updates with specialized kernels. + * Please, see the documentation of the SparseLU class for more details. + */ + +// Ordering interface +#include "OrderingMethods" + +#include "src/SparseLU/SparseLU_gemm_kernel.h" + +#include "src/SparseLU/SparseLU_Structs.h" +#include "src/SparseLU/SparseLU_SupernodalMatrix.h" +#include "src/SparseLU/SparseLUImpl.h" +#include "src/SparseCore/SparseColEtree.h" +#include "src/SparseLU/SparseLU_Memory.h" +#include "src/SparseLU/SparseLU_heap_relax_snode.h" +#include "src/SparseLU/SparseLU_relax_snode.h" +#include "src/SparseLU/SparseLU_pivotL.h" +#include "src/SparseLU/SparseLU_panel_dfs.h" +#include "src/SparseLU/SparseLU_kernel_bmod.h" +#include "src/SparseLU/SparseLU_panel_bmod.h" +#include "src/SparseLU/SparseLU_column_dfs.h" +#include "src/SparseLU/SparseLU_column_bmod.h" +#include "src/SparseLU/SparseLU_copy_to_ucol.h" +#include "src/SparseLU/SparseLU_pruneL.h" +#include "src/SparseLU/SparseLU_Utils.h" +#include "src/SparseLU/SparseLU.h" + +#endif // EIGEN_SPARSELU_MODULE_H diff --git a/SudoDEM2D/lib/Eigen/SparseQR b/SudoDEM2D/lib/Eigen/SparseQR new file mode 100644 index 0000000..a6f3b7f --- /dev/null +++ b/SudoDEM2D/lib/Eigen/SparseQR @@ -0,0 +1,37 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_SPARSEQR_MODULE_H +#define EIGEN_SPARSEQR_MODULE_H + +#include "SparseCore" +#include "OrderingMethods" +#include "src/Core/util/DisableStupidWarnings.h" + +/** \defgroup SparseQR_Module SparseQR module + * \brief Provides QR decomposition for sparse matrices + * + * This module provides a simplicial version of the left-looking Sparse QR decomposition. + * The columns of the input matrix should be reordered to limit the fill-in during the + * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. + * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list + * of built-in and external ordering methods. + * + * \code + * #include + * \endcode + * + * + */ + +#include "OrderingMethods" +#include "src/SparseCore/SparseColEtree.h" +#include "src/SparseQR/SparseQR.h" + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif diff --git a/SudoDEM2D/lib/Eigen/StdDeque b/SudoDEM2D/lib/Eigen/StdDeque new file mode 100644 index 0000000..bc68397 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/StdDeque @@ -0,0 +1,27 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// Copyright (C) 2009 Hauke Heibel +// +// 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_STDDEQUE_MODULE_H +#define EIGEN_STDDEQUE_MODULE_H + +#include "Core" +#include + +#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ + +#define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) + +#else + +#include "src/StlSupport/StdDeque.h" + +#endif + +#endif // EIGEN_STDDEQUE_MODULE_H diff --git a/SudoDEM2D/lib/Eigen/StdList b/SudoDEM2D/lib/Eigen/StdList new file mode 100644 index 0000000..4c6262c --- /dev/null +++ b/SudoDEM2D/lib/Eigen/StdList @@ -0,0 +1,26 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Hauke Heibel +// +// 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_STDLIST_MODULE_H +#define EIGEN_STDLIST_MODULE_H + +#include "Core" +#include + +#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ + +#define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) + +#else + +#include "src/StlSupport/StdList.h" + +#endif + +#endif // EIGEN_STDLIST_MODULE_H diff --git a/SudoDEM2D/lib/Eigen/StdVector b/SudoDEM2D/lib/Eigen/StdVector new file mode 100644 index 0000000..0c4697a --- /dev/null +++ b/SudoDEM2D/lib/Eigen/StdVector @@ -0,0 +1,27 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// Copyright (C) 2009 Hauke Heibel +// +// 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_STDVECTOR_MODULE_H +#define EIGEN_STDVECTOR_MODULE_H + +#include "Core" +#include + +#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ + +#define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) + +#else + +#include "src/StlSupport/StdVector.h" + +#endif + +#endif // EIGEN_STDVECTOR_MODULE_H diff --git a/SudoDEM2D/lib/Eigen/SuperLUSupport b/SudoDEM2D/lib/Eigen/SuperLUSupport new file mode 100644 index 0000000..59312a8 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/SuperLUSupport @@ -0,0 +1,64 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_SUPERLUSUPPORT_MODULE_H +#define EIGEN_SUPERLUSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +#ifdef EMPTY +#define EIGEN_EMPTY_WAS_ALREADY_DEFINED +#endif + +typedef int int_t; +#include +#include +#include + +// slu_util.h defines a preprocessor token named EMPTY which is really polluting, +// so we remove it in favor of a SUPERLU_EMPTY token. +// If EMPTY was already defined then we don't undef it. + +#if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) +# undef EIGEN_EMPTY_WAS_ALREADY_DEFINED +#elif defined(EMPTY) +# undef EMPTY +#endif + +#define SUPERLU_EMPTY (-1) + +namespace Eigen { struct SluMatrix; } + +/** \ingroup Support_modules + * \defgroup SuperLUSupport_Module SuperLUSupport module + * + * This module provides an interface to the SuperLU library. + * It provides the following factorization class: + * - class SuperLU: a supernodal sequential LU factorization. + * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). + * + * \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported. + * + * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. + * + * \code + * #include + * \endcode + * + * In order to use this module, the superlu headers must be accessible from the include paths, and your binary must be linked to the superlu library and its dependencies. + * The dependencies depend on how superlu has been compiled. + * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task. + * + */ + +#include "src/SuperLUSupport/SuperLUSupport.h" + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_SUPERLUSUPPORT_MODULE_H diff --git a/SudoDEM2D/lib/Eigen/UmfPackSupport b/SudoDEM2D/lib/Eigen/UmfPackSupport new file mode 100644 index 0000000..00eec80 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/UmfPackSupport @@ -0,0 +1,40 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// 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_UMFPACKSUPPORT_MODULE_H +#define EIGEN_UMFPACKSUPPORT_MODULE_H + +#include "SparseCore" + +#include "src/Core/util/DisableStupidWarnings.h" + +extern "C" { +#include +} + +/** \ingroup Support_modules + * \defgroup UmfPackSupport_Module UmfPackSupport module + * + * This module provides an interface to the UmfPack library which is part of the suitesparse package. + * It provides the following factorization class: + * - class UmfPackLU: a multifrontal sequential LU factorization. + * + * \code + * #include + * \endcode + * + * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. + * The dependencies depend on how umfpack has been compiled. + * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. + * + */ + +#include "src/UmfPackSupport/UmfPackSupport.h" + +#include "src/Core/util/ReenableStupidWarnings.h" + +#endif // EIGEN_UMFPACKSUPPORT_MODULE_H diff --git a/SudoDEM2D/lib/Eigen/src/Cholesky/LDLT.h b/SudoDEM2D/lib/Eigen/src/Cholesky/LDLT.h new file mode 100644 index 0000000..0313a54 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Cholesky/LDLT.h @@ -0,0 +1,672 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2011 Gael Guennebaud +// Copyright (C) 2009 Keir Mierle +// Copyright (C) 2009 Benoit Jacob +// Copyright (C) 2011 Timothy E. Holy +// +// 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_LDLT_H +#define EIGEN_LDLT_H + +namespace Eigen { + +namespace internal { + template struct LDLT_Traits; + + // PositiveSemiDef means positive semi-definite and non-zero; same for NegativeSemiDef + enum SignMatrix { PositiveSemiDef, NegativeSemiDef, ZeroSign, Indefinite }; +} + +/** \ingroup Cholesky_Module + * + * \class LDLT + * + * \brief Robust Cholesky decomposition of a matrix with pivoting + * + * \tparam _MatrixType the type of the matrix of which to compute the LDL^T Cholesky decomposition + * \tparam _UpLo the triangular part that will be used for the decompositon: Lower (default) or Upper. + * The other triangular part won't be read. + * + * Perform a robust Cholesky decomposition of a positive semidefinite or negative semidefinite + * matrix \f$ A \f$ such that \f$ A = P^TLDL^*P \f$, where P is a permutation matrix, L + * is lower triangular with a unit diagonal and D is a diagonal matrix. + * + * The decomposition uses pivoting to ensure stability, so that L will have + * zeros in the bottom right rank(A) - n submatrix. Avoiding the square root + * on D also stabilizes the computation. + * + * Remember that Cholesky decompositions are not rank-revealing. Also, do not use a Cholesky + * decomposition to determine whether a system of equations has a solution. + * + * This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism. + * + * \sa MatrixBase::ldlt(), SelfAdjointView::ldlt(), class LLT + */ +template class LDLT +{ + public: + typedef _MatrixType MatrixType; + enum { + RowsAtCompileTime = MatrixType::RowsAtCompileTime, + ColsAtCompileTime = MatrixType::ColsAtCompileTime, + MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, + UpLo = _UpLo + }; + typedef typename MatrixType::Scalar Scalar; + typedef typename NumTraits::Real RealScalar; + typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3 + typedef typename MatrixType::StorageIndex StorageIndex; + typedef Matrix TmpMatrixType; + + typedef Transpositions TranspositionType; + typedef PermutationMatrix PermutationType; + + typedef internal::LDLT_Traits Traits; + + /** \brief Default Constructor. + * + * The default constructor is useful in cases in which the user intends to + * perform decompositions via LDLT::compute(const MatrixType&). + */ + LDLT() + : m_matrix(), + m_transpositions(), + m_sign(internal::ZeroSign), + m_isInitialized(false) + {} + + /** \brief Default Constructor with memory preallocation + * + * Like the default constructor but with preallocation of the internal data + * according to the specified problem \a size. + * \sa LDLT() + */ + explicit LDLT(Index size) + : m_matrix(size, size), + m_transpositions(size), + m_temporary(size), + m_sign(internal::ZeroSign), + m_isInitialized(false) + {} + + /** \brief Constructor with decomposition + * + * This calculates the decomposition for the input \a matrix. + * + * \sa LDLT(Index size) + */ + template + explicit LDLT(const EigenBase& matrix) + : m_matrix(matrix.rows(), matrix.cols()), + m_transpositions(matrix.rows()), + m_temporary(matrix.rows()), + m_sign(internal::ZeroSign), + m_isInitialized(false) + { + compute(matrix.derived()); + } + + /** \brief Constructs a LDLT factorization from a given matrix + * + * This overloaded constructor is provided for \link InplaceDecomposition inplace decomposition \endlink when \c MatrixType is a Eigen::Ref. + * + * \sa LDLT(const EigenBase&) + */ + template + explicit LDLT(EigenBase& matrix) + : m_matrix(matrix.derived()), + m_transpositions(matrix.rows()), + m_temporary(matrix.rows()), + m_sign(internal::ZeroSign), + m_isInitialized(false) + { + compute(matrix.derived()); + } + + /** Clear any existing decomposition + * \sa rankUpdate(w,sigma) + */ + void setZero() + { + m_isInitialized = false; + } + + /** \returns a view of the upper triangular matrix U */ + inline typename Traits::MatrixU matrixU() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return Traits::getU(m_matrix); + } + + /** \returns a view of the lower triangular matrix L */ + inline typename Traits::MatrixL matrixL() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return Traits::getL(m_matrix); + } + + /** \returns the permutation matrix P as a transposition sequence. + */ + inline const TranspositionType& transpositionsP() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_transpositions; + } + + /** \returns the coefficients of the diagonal matrix D */ + inline Diagonal vectorD() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_matrix.diagonal(); + } + + /** \returns true if the matrix is positive (semidefinite) */ + inline bool isPositive() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_sign == internal::PositiveSemiDef || m_sign == internal::ZeroSign; + } + + /** \returns true if the matrix is negative (semidefinite) */ + inline bool isNegative(void) const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_sign == internal::NegativeSemiDef || m_sign == internal::ZeroSign; + } + + /** \returns a solution x of \f$ A x = b \f$ using the current decomposition of A. + * + * This function also supports in-place solves using the syntax x = decompositionObject.solve(x) . + * + * \note_about_checking_solutions + * + * More precisely, this method solves \f$ A x = b \f$ using the decomposition \f$ A = P^T L D L^* P \f$ + * by solving the systems \f$ P^T y_1 = b \f$, \f$ L y_2 = y_1 \f$, \f$ D y_3 = y_2 \f$, + * \f$ L^* y_4 = y_3 \f$ and \f$ P x = y_4 \f$ in succession. If the matrix \f$ A \f$ is singular, then + * \f$ D \f$ will also be singular (all the other matrices are invertible). In that case, the + * least-square solution of \f$ D y_3 = y_2 \f$ is computed. This does not mean that this function + * computes the least-square solution of \f$ A x = b \f$ is \f$ A \f$ is singular. + * + * \sa MatrixBase::ldlt(), SelfAdjointView::ldlt() + */ + template + inline const Solve + solve(const MatrixBase& b) const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + eigen_assert(m_matrix.rows()==b.rows() + && "LDLT::solve(): invalid number of rows of the right hand side matrix b"); + return Solve(*this, b.derived()); + } + + template + bool solveInPlace(MatrixBase &bAndX) const; + + template + LDLT& compute(const EigenBase& matrix); + + /** \returns an estimate of the reciprocal condition number of the matrix of + * which \c *this is the LDLT decomposition. + */ + RealScalar rcond() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return internal::rcond_estimate_helper(m_l1_norm, *this); + } + + template + LDLT& rankUpdate(const MatrixBase& w, const RealScalar& alpha=1); + + /** \returns the internal LDLT decomposition matrix + * + * TODO: document the storage layout + */ + inline const MatrixType& matrixLDLT() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_matrix; + } + + MatrixType reconstructedMatrix() const; + + /** \returns the adjoint of \c *this, that is, a const reference to the decomposition itself as the underlying matrix is self-adjoint. + * + * This method is provided for compatibility with other matrix decompositions, thus enabling generic code such as: + * \code x = decomposition.adjoint().solve(b) \endcode + */ + const LDLT& adjoint() const { return *this; }; + + inline Index rows() const { return m_matrix.rows(); } + inline Index cols() const { return m_matrix.cols(); } + + /** \brief Reports whether previous computation was successful. + * + * \returns \c Success if computation was succesful, + * \c NumericalIssue if the factorization failed because of a zero pivot. + */ + ComputationInfo info() const + { + eigen_assert(m_isInitialized && "LDLT is not initialized."); + return m_info; + } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + EIGEN_DEVICE_FUNC + void _solve_impl(const RhsType &rhs, DstType &dst) const; + #endif + + protected: + + static void check_template_parameters() + { + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar); + } + + /** \internal + * Used to compute and store the Cholesky decomposition A = L D L^* = U^* D U. + * The strict upper part is used during the decomposition, the strict lower + * part correspond to the coefficients of L (its diagonal is equal to 1 and + * is not stored), and the diagonal entries correspond to D. + */ + MatrixType m_matrix; + RealScalar m_l1_norm; + TranspositionType m_transpositions; + TmpMatrixType m_temporary; + internal::SignMatrix m_sign; + bool m_isInitialized; + ComputationInfo m_info; +}; + +namespace internal { + +template struct ldlt_inplace; + +template<> struct ldlt_inplace +{ + template + static bool unblocked(MatrixType& mat, TranspositionType& transpositions, Workspace& temp, SignMatrix& sign) + { + using std::abs; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; + typedef typename TranspositionType::StorageIndex IndexType; + eigen_assert(mat.rows()==mat.cols()); + const Index size = mat.rows(); + bool found_zero_pivot = false; + bool ret = true; + + if (size <= 1) + { + transpositions.setIdentity(); + if (numext::real(mat.coeff(0,0)) > static_cast(0) ) sign = PositiveSemiDef; + else if (numext::real(mat.coeff(0,0)) < static_cast(0)) sign = NegativeSemiDef; + else sign = ZeroSign; + return true; + } + + for (Index k = 0; k < size; ++k) + { + // Find largest diagonal element + Index index_of_biggest_in_corner; + mat.diagonal().tail(size-k).cwiseAbs().maxCoeff(&index_of_biggest_in_corner); + index_of_biggest_in_corner += k; + + transpositions.coeffRef(k) = IndexType(index_of_biggest_in_corner); + if(k != index_of_biggest_in_corner) + { + // apply the transposition while taking care to consider only + // the lower triangular part + Index s = size-index_of_biggest_in_corner-1; // trailing size after the biggest element + mat.row(k).head(k).swap(mat.row(index_of_biggest_in_corner).head(k)); + mat.col(k).tail(s).swap(mat.col(index_of_biggest_in_corner).tail(s)); + std::swap(mat.coeffRef(k,k),mat.coeffRef(index_of_biggest_in_corner,index_of_biggest_in_corner)); + for(Index i=k+1;i::IsComplex) + mat.coeffRef(index_of_biggest_in_corner,k) = numext::conj(mat.coeff(index_of_biggest_in_corner,k)); + } + + // partition the matrix: + // A00 | - | - + // lu = A10 | A11 | - + // A20 | A21 | A22 + Index rs = size - k - 1; + Block A21(mat,k+1,k,rs,1); + Block A10(mat,k,0,1,k); + Block A20(mat,k+1,0,rs,k); + + if(k>0) + { + temp.head(k) = mat.diagonal().real().head(k).asDiagonal() * A10.adjoint(); + mat.coeffRef(k,k) -= (A10 * temp.head(k)).value(); + if(rs>0) + A21.noalias() -= A20 * temp.head(k); + } + + // In some previous versions of Eigen (e.g., 3.2.1), the scaling was omitted if the pivot + // was smaller than the cutoff value. However, since LDLT is not rank-revealing + // we should only make sure that we do not introduce INF or NaN values. + // Remark that LAPACK also uses 0 as the cutoff value. + RealScalar realAkk = numext::real(mat.coeffRef(k,k)); + bool pivot_is_valid = (abs(realAkk) > RealScalar(0)); + + if(k==0 && !pivot_is_valid) + { + // The entire diagonal is zero, there is nothing more to do + // except filling the transpositions, and checking whether the matrix is zero. + sign = ZeroSign; + for(Index j = 0; j0) && pivot_is_valid) + A21 /= realAkk; + else if(rs>0) + ret = ret && (A21.array()==Scalar(0)).all(); + + if(found_zero_pivot && pivot_is_valid) ret = false; // factorization failed + else if(!pivot_is_valid) found_zero_pivot = true; + + if (sign == PositiveSemiDef) { + if (realAkk < static_cast(0)) sign = Indefinite; + } else if (sign == NegativeSemiDef) { + if (realAkk > static_cast(0)) sign = Indefinite; + } else if (sign == ZeroSign) { + if (realAkk > static_cast(0)) sign = PositiveSemiDef; + else if (realAkk < static_cast(0)) sign = NegativeSemiDef; + } + } + + return ret; + } + + // Reference for the algorithm: Davis and Hager, "Multiple Rank + // Modifications of a Sparse Cholesky Factorization" (Algorithm 1) + // Trivial rearrangements of their computations (Timothy E. Holy) + // allow their algorithm to work for rank-1 updates even if the + // original matrix is not of full rank. + // Here only rank-1 updates are implemented, to reduce the + // requirement for intermediate storage and improve accuracy + template + static bool updateInPlace(MatrixType& mat, MatrixBase& w, const typename MatrixType::RealScalar& sigma=1) + { + using numext::isfinite; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; + + const Index size = mat.rows(); + eigen_assert(mat.cols() == size && w.size()==size); + + RealScalar alpha = 1; + + // Apply the update + for (Index j = 0; j < size; j++) + { + // Check for termination due to an original decomposition of low-rank + if (!(isfinite)(alpha)) + break; + + // Update the diagonal terms + RealScalar dj = numext::real(mat.coeff(j,j)); + Scalar wj = w.coeff(j); + RealScalar swj2 = sigma*numext::abs2(wj); + RealScalar gamma = dj*alpha + swj2; + + mat.coeffRef(j,j) += swj2/alpha; + alpha += swj2/dj; + + + // Update the terms of L + Index rs = size-j-1; + w.tail(rs) -= wj * mat.col(j).tail(rs); + if(gamma != 0) + mat.col(j).tail(rs) += (sigma*numext::conj(wj)/gamma)*w.tail(rs); + } + return true; + } + + template + static bool update(MatrixType& mat, const TranspositionType& transpositions, Workspace& tmp, const WType& w, const typename MatrixType::RealScalar& sigma=1) + { + // Apply the permutation to the input w + tmp = transpositions * w; + + return ldlt_inplace::updateInPlace(mat,tmp,sigma); + } +}; + +template<> struct ldlt_inplace +{ + template + static EIGEN_STRONG_INLINE bool unblocked(MatrixType& mat, TranspositionType& transpositions, Workspace& temp, SignMatrix& sign) + { + Transpose matt(mat); + return ldlt_inplace::unblocked(matt, transpositions, temp, sign); + } + + template + static EIGEN_STRONG_INLINE bool update(MatrixType& mat, TranspositionType& transpositions, Workspace& tmp, WType& w, const typename MatrixType::RealScalar& sigma=1) + { + Transpose matt(mat); + return ldlt_inplace::update(matt, transpositions, tmp, w.conjugate(), sigma); + } +}; + +template struct LDLT_Traits +{ + typedef const TriangularView MatrixL; + typedef const TriangularView MatrixU; + static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); } + static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); } +}; + +template struct LDLT_Traits +{ + typedef const TriangularView MatrixL; + typedef const TriangularView MatrixU; + static inline MatrixL getL(const MatrixType& m) { return MatrixL(m.adjoint()); } + static inline MatrixU getU(const MatrixType& m) { return MatrixU(m); } +}; + +} // end namespace internal + +/** Compute / recompute the LDLT decomposition A = L D L^* = U^* D U of \a matrix + */ +template +template +LDLT& LDLT::compute(const EigenBase& a) +{ + check_template_parameters(); + + eigen_assert(a.rows()==a.cols()); + const Index size = a.rows(); + + m_matrix = a.derived(); + + // Compute matrix L1 norm = max abs column sum. + m_l1_norm = RealScalar(0); + // TODO move this code to SelfAdjointView + for (Index col = 0; col < size; ++col) { + RealScalar abs_col_sum; + if (_UpLo == Lower) + abs_col_sum = m_matrix.col(col).tail(size - col).template lpNorm<1>() + m_matrix.row(col).head(col).template lpNorm<1>(); + else + abs_col_sum = m_matrix.col(col).head(col).template lpNorm<1>() + m_matrix.row(col).tail(size - col).template lpNorm<1>(); + if (abs_col_sum > m_l1_norm) + m_l1_norm = abs_col_sum; + } + + m_transpositions.resize(size); + m_isInitialized = false; + m_temporary.resize(size); + m_sign = internal::ZeroSign; + + m_info = internal::ldlt_inplace::unblocked(m_matrix, m_transpositions, m_temporary, m_sign) ? Success : NumericalIssue; + + m_isInitialized = true; + return *this; +} + +/** Update the LDLT decomposition: given A = L D L^T, efficiently compute the decomposition of A + sigma w w^T. + * \param w a vector to be incorporated into the decomposition. + * \param sigma a scalar, +1 for updates and -1 for "downdates," which correspond to removing previously-added column vectors. Optional; default value is +1. + * \sa setZero() + */ +template +template +LDLT& LDLT::rankUpdate(const MatrixBase& w, const typename LDLT::RealScalar& sigma) +{ + typedef typename TranspositionType::StorageIndex IndexType; + const Index size = w.rows(); + if (m_isInitialized) + { + eigen_assert(m_matrix.rows()==size); + } + else + { + m_matrix.resize(size,size); + m_matrix.setZero(); + m_transpositions.resize(size); + for (Index i = 0; i < size; i++) + m_transpositions.coeffRef(i) = IndexType(i); + m_temporary.resize(size); + m_sign = sigma>=0 ? internal::PositiveSemiDef : internal::NegativeSemiDef; + m_isInitialized = true; + } + + internal::ldlt_inplace::update(m_matrix, m_transpositions, m_temporary, w, sigma); + + return *this; +} + +#ifndef EIGEN_PARSED_BY_DOXYGEN +template +template +void LDLT<_MatrixType,_UpLo>::_solve_impl(const RhsType &rhs, DstType &dst) const +{ + eigen_assert(rhs.rows() == rows()); + // dst = P b + dst = m_transpositions * rhs; + + // dst = L^-1 (P b) + matrixL().solveInPlace(dst); + + // dst = D^-1 (L^-1 P b) + // more precisely, use pseudo-inverse of D (see bug 241) + using std::abs; + const typename Diagonal::RealReturnType vecD(vectorD()); + // In some previous versions, tolerance was set to the max of 1/highest (or rather numeric_limits::min()) + // and the maximal diagonal entry * epsilon as motivated by LAPACK's xGELSS: + // RealScalar tolerance = numext::maxi(vecD.array().abs().maxCoeff() * NumTraits::epsilon(),RealScalar(1) / NumTraits::highest()); + // However, LDLT is not rank revealing, and so adjusting the tolerance wrt to the highest + // diagonal element is not well justified and leads to numerical issues in some cases. + // Moreover, Lapack's xSYTRS routines use 0 for the tolerance. + // Using numeric_limits::min() gives us more robustness to denormals. + RealScalar tolerance = (std::numeric_limits::min)(); + + for (Index i = 0; i < vecD.size(); ++i) + { + if(abs(vecD(i)) > tolerance) + dst.row(i) /= vecD(i); + else + dst.row(i).setZero(); + } + + // dst = L^-T (D^-1 L^-1 P b) + matrixU().solveInPlace(dst); + + // dst = P^-1 (L^-T D^-1 L^-1 P b) = A^-1 b + dst = m_transpositions.transpose() * dst; +} +#endif + +/** \internal use x = ldlt_object.solve(x); + * + * This is the \em in-place version of solve(). + * + * \param bAndX represents both the right-hand side matrix b and result x. + * + * \returns true always! If you need to check for existence of solutions, use another decomposition like LU, QR, or SVD. + * + * This version avoids a copy when the right hand side matrix b is not + * needed anymore. + * + * \sa LDLT::solve(), MatrixBase::ldlt() + */ +template +template +bool LDLT::solveInPlace(MatrixBase &bAndX) const +{ + eigen_assert(m_isInitialized && "LDLT is not initialized."); + eigen_assert(m_matrix.rows() == bAndX.rows()); + + bAndX = this->solve(bAndX); + + return true; +} + +/** \returns the matrix represented by the decomposition, + * i.e., it returns the product: P^T L D L^* P. + * This function is provided for debug purpose. */ +template +MatrixType LDLT::reconstructedMatrix() const +{ + eigen_assert(m_isInitialized && "LDLT is not initialized."); + const Index size = m_matrix.rows(); + MatrixType res(size,size); + + // P + res.setIdentity(); + res = transpositionsP() * res; + // L^* P + res = matrixU() * res; + // D(L^*P) + res = vectorD().real().asDiagonal() * res; + // L(DL^*P) + res = matrixL() * res; + // P^T (LDL^*P) + res = transpositionsP().transpose() * res; + + return res; +} + +/** \cholesky_module + * \returns the Cholesky decomposition with full pivoting without square root of \c *this + * \sa MatrixBase::ldlt() + */ +template +inline const LDLT::PlainObject, UpLo> +SelfAdjointView::ldlt() const +{ + return LDLT(m_matrix); +} + +/** \cholesky_module + * \returns the Cholesky decomposition with full pivoting without square root of \c *this + * \sa SelfAdjointView::ldlt() + */ +template +inline const LDLT::PlainObject> +MatrixBase::ldlt() const +{ + return LDLT(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_LDLT_H diff --git a/SudoDEM2D/lib/Eigen/src/Cholesky/LLT.h b/SudoDEM2D/lib/Eigen/src/Cholesky/LLT.h new file mode 100644 index 0000000..e1624d2 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Cholesky/LLT.h @@ -0,0 +1,542 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 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_LLT_H +#define EIGEN_LLT_H + +namespace Eigen { + +namespace internal{ +template struct LLT_Traits; +} + +/** \ingroup Cholesky_Module + * + * \class LLT + * + * \brief Standard Cholesky decomposition (LL^T) of a matrix and associated features + * + * \tparam _MatrixType the type of the matrix of which we are computing the LL^T Cholesky decomposition + * \tparam _UpLo the triangular part that will be used for the decompositon: Lower (default) or Upper. + * The other triangular part won't be read. + * + * This class performs a LL^T Cholesky decomposition of a symmetric, positive definite + * matrix A such that A = LL^* = U^*U, where L is lower triangular. + * + * While the Cholesky decomposition is particularly useful to solve selfadjoint problems like D^*D x = b, + * for that purpose, we recommend the Cholesky decomposition without square root which is more stable + * and even faster. Nevertheless, this standard Cholesky decomposition remains useful in many other + * situations like generalised eigen problems with hermitian matrices. + * + * Remember that Cholesky decompositions are not rank-revealing. This LLT decomposition is only stable on positive definite matrices, + * use LDLT instead for the semidefinite case. Also, do not use a Cholesky decomposition to determine whether a system of equations + * has a solution. + * + * Example: \include LLT_example.cpp + * Output: \verbinclude LLT_example.out + * + * \b Performance: for best performance, it is recommended to use a column-major storage format + * with the Lower triangular part (the default), or, equivalently, a row-major storage format + * with the Upper triangular part. Otherwise, you might get a 20% slowdown for the full factorization + * step, and rank-updates can be up to 3 times slower. + * + * This class supports the \link InplaceDecomposition inplace decomposition \endlink mechanism. + * + * Note that during the decomposition, only the lower (or upper, as defined by _UpLo) triangular part of A is considered. + * Therefore, the strict lower part does not have to store correct values. + * + * \sa MatrixBase::llt(), SelfAdjointView::llt(), class LDLT + */ +template class LLT +{ + public: + typedef _MatrixType MatrixType; + enum { + RowsAtCompileTime = MatrixType::RowsAtCompileTime, + ColsAtCompileTime = MatrixType::ColsAtCompileTime, + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime + }; + typedef typename MatrixType::Scalar Scalar; + typedef typename NumTraits::Real RealScalar; + typedef Eigen::Index Index; ///< \deprecated since Eigen 3.3 + typedef typename MatrixType::StorageIndex StorageIndex; + + enum { + PacketSize = internal::packet_traits::size, + AlignmentMask = int(PacketSize)-1, + UpLo = _UpLo + }; + + typedef internal::LLT_Traits Traits; + + /** + * \brief Default Constructor. + * + * The default constructor is useful in cases in which the user intends to + * perform decompositions via LLT::compute(const MatrixType&). + */ + LLT() : m_matrix(), m_isInitialized(false) {} + + /** \brief Default Constructor with memory preallocation + * + * Like the default constructor but with preallocation of the internal data + * according to the specified problem \a size. + * \sa LLT() + */ + explicit LLT(Index size) : m_matrix(size, size), + m_isInitialized(false) {} + + template + explicit LLT(const EigenBase& matrix) + : m_matrix(matrix.rows(), matrix.cols()), + m_isInitialized(false) + { + compute(matrix.derived()); + } + + /** \brief Constructs a LDLT factorization from a given matrix + * + * This overloaded constructor is provided for \link InplaceDecomposition inplace decomposition \endlink when + * \c MatrixType is a Eigen::Ref. + * + * \sa LLT(const EigenBase&) + */ + template + explicit LLT(EigenBase& matrix) + : m_matrix(matrix.derived()), + m_isInitialized(false) + { + compute(matrix.derived()); + } + + /** \returns a view of the upper triangular matrix U */ + inline typename Traits::MatrixU matrixU() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + return Traits::getU(m_matrix); + } + + /** \returns a view of the lower triangular matrix L */ + inline typename Traits::MatrixL matrixL() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + return Traits::getL(m_matrix); + } + + /** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A. + * + * Since this LLT class assumes anyway that the matrix A is invertible, the solution + * theoretically exists and is unique regardless of b. + * + * Example: \include LLT_solve.cpp + * Output: \verbinclude LLT_solve.out + * + * \sa solveInPlace(), MatrixBase::llt(), SelfAdjointView::llt() + */ + template + inline const Solve + solve(const MatrixBase& b) const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + eigen_assert(m_matrix.rows()==b.rows() + && "LLT::solve(): invalid number of rows of the right hand side matrix b"); + return Solve(*this, b.derived()); + } + + template + void solveInPlace(const MatrixBase &bAndX) const; + + template + LLT& compute(const EigenBase& matrix); + + /** \returns an estimate of the reciprocal condition number of the matrix of + * which \c *this is the Cholesky decomposition. + */ + RealScalar rcond() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + eigen_assert(m_info == Success && "LLT failed because matrix appears to be negative"); + return internal::rcond_estimate_helper(m_l1_norm, *this); + } + + /** \returns the LLT decomposition matrix + * + * TODO: document the storage layout + */ + inline const MatrixType& matrixLLT() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + return m_matrix; + } + + MatrixType reconstructedMatrix() const; + + + /** \brief Reports whether previous computation was successful. + * + * \returns \c Success if computation was succesful, + * \c NumericalIssue if the matrix.appears not to be positive definite. + */ + ComputationInfo info() const + { + eigen_assert(m_isInitialized && "LLT is not initialized."); + return m_info; + } + + /** \returns the adjoint of \c *this, that is, a const reference to the decomposition itself as the underlying matrix is self-adjoint. + * + * This method is provided for compatibility with other matrix decompositions, thus enabling generic code such as: + * \code x = decomposition.adjoint().solve(b) \endcode + */ + const LLT& adjoint() const { return *this; }; + + inline Index rows() const { return m_matrix.rows(); } + inline Index cols() const { return m_matrix.cols(); } + + template + LLT rankUpdate(const VectorType& vec, const RealScalar& sigma = 1); + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + EIGEN_DEVICE_FUNC + void _solve_impl(const RhsType &rhs, DstType &dst) const; + #endif + + protected: + + static void check_template_parameters() + { + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar); + } + + /** \internal + * Used to compute and store L + * The strict upper part is not used and even not initialized. + */ + MatrixType m_matrix; + RealScalar m_l1_norm; + bool m_isInitialized; + ComputationInfo m_info; +}; + +namespace internal { + +template struct llt_inplace; + +template +static Index llt_rank_update_lower(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) +{ + using std::sqrt; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; + typedef typename MatrixType::ColXpr ColXpr; + typedef typename internal::remove_all::type ColXprCleaned; + typedef typename ColXprCleaned::SegmentReturnType ColXprSegment; + typedef Matrix TempVectorType; + typedef typename TempVectorType::SegmentReturnType TempVecSegment; + + Index n = mat.cols(); + eigen_assert(mat.rows()==n && vec.size()==n); + + TempVectorType temp; + + if(sigma>0) + { + // This version is based on Givens rotations. + // It is faster than the other one below, but only works for updates, + // i.e., for sigma > 0 + temp = sqrt(sigma) * vec; + + for(Index i=0; i g; + g.makeGivens(mat(i,i), -temp(i), &mat(i,i)); + + Index rs = n-i-1; + if(rs>0) + { + ColXprSegment x(mat.col(i).tail(rs)); + TempVecSegment y(temp.tail(rs)); + apply_rotation_in_the_plane(x, y, g); + } + } + } + else + { + temp = vec; + RealScalar beta = 1; + for(Index j=0; j struct llt_inplace +{ + typedef typename NumTraits::Real RealScalar; + template + static Index unblocked(MatrixType& mat) + { + using std::sqrt; + + eigen_assert(mat.rows()==mat.cols()); + const Index size = mat.rows(); + for(Index k = 0; k < size; ++k) + { + Index rs = size-k-1; // remaining size + + Block A21(mat,k+1,k,rs,1); + Block A10(mat,k,0,1,k); + Block A20(mat,k+1,0,rs,k); + + RealScalar x = numext::real(mat.coeff(k,k)); + if (k>0) x -= A10.squaredNorm(); + if (x<=RealScalar(0)) + return k; + mat.coeffRef(k,k) = x = sqrt(x); + if (k>0 && rs>0) A21.noalias() -= A20 * A10.adjoint(); + if (rs>0) A21 /= x; + } + return -1; + } + + template + static Index blocked(MatrixType& m) + { + eigen_assert(m.rows()==m.cols()); + Index size = m.rows(); + if(size<32) + return unblocked(m); + + Index blockSize = size/8; + blockSize = (blockSize/16)*16; + blockSize = (std::min)((std::max)(blockSize,Index(8)), Index(128)); + + for (Index k=0; k A11(m,k, k, bs,bs); + Block A21(m,k+bs,k, rs,bs); + Block A22(m,k+bs,k+bs,rs,rs); + + Index ret; + if((ret=unblocked(A11))>=0) return k+ret; + if(rs>0) A11.adjoint().template triangularView().template solveInPlace(A21); + if(rs>0) A22.template selfadjointView().rankUpdate(A21,typename NumTraits::Literal(-1)); // bottleneck + } + return -1; + } + + template + static Index rankUpdate(MatrixType& mat, const VectorType& vec, const RealScalar& sigma) + { + return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); + } +}; + +template struct llt_inplace +{ + typedef typename NumTraits::Real RealScalar; + + template + static EIGEN_STRONG_INLINE Index unblocked(MatrixType& mat) + { + Transpose matt(mat); + return llt_inplace::unblocked(matt); + } + template + static EIGEN_STRONG_INLINE Index blocked(MatrixType& mat) + { + Transpose matt(mat); + return llt_inplace::blocked(matt); + } + template + static Index rankUpdate(MatrixType& mat, const VectorType& vec, const RealScalar& sigma) + { + Transpose matt(mat); + return llt_inplace::rankUpdate(matt, vec.conjugate(), sigma); + } +}; + +template struct LLT_Traits +{ + typedef const TriangularView MatrixL; + typedef const TriangularView MatrixU; + static inline MatrixL getL(const MatrixType& m) { return MatrixL(m); } + static inline MatrixU getU(const MatrixType& m) { return MatrixU(m.adjoint()); } + static bool inplace_decomposition(MatrixType& m) + { return llt_inplace::blocked(m)==-1; } +}; + +template struct LLT_Traits +{ + typedef const TriangularView MatrixL; + typedef const TriangularView MatrixU; + static inline MatrixL getL(const MatrixType& m) { return MatrixL(m.adjoint()); } + static inline MatrixU getU(const MatrixType& m) { return MatrixU(m); } + static bool inplace_decomposition(MatrixType& m) + { return llt_inplace::blocked(m)==-1; } +}; + +} // end namespace internal + +/** Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of \a matrix + * + * \returns a reference to *this + * + * Example: \include TutorialLinAlgComputeTwice.cpp + * Output: \verbinclude TutorialLinAlgComputeTwice.out + */ +template +template +LLT& LLT::compute(const EigenBase& a) +{ + check_template_parameters(); + + eigen_assert(a.rows()==a.cols()); + const Index size = a.rows(); + m_matrix.resize(size, size); + if (!internal::is_same_dense(m_matrix, a.derived())) + m_matrix = a.derived(); + + // Compute matrix L1 norm = max abs column sum. + m_l1_norm = RealScalar(0); + // TODO move this code to SelfAdjointView + for (Index col = 0; col < size; ++col) { + RealScalar abs_col_sum; + if (_UpLo == Lower) + abs_col_sum = m_matrix.col(col).tail(size - col).template lpNorm<1>() + m_matrix.row(col).head(col).template lpNorm<1>(); + else + abs_col_sum = m_matrix.col(col).head(col).template lpNorm<1>() + m_matrix.row(col).tail(size - col).template lpNorm<1>(); + if (abs_col_sum > m_l1_norm) + m_l1_norm = abs_col_sum; + } + + m_isInitialized = true; + bool ok = Traits::inplace_decomposition(m_matrix); + m_info = ok ? Success : NumericalIssue; + + return *this; +} + +/** Performs a rank one update (or dowdate) of the current decomposition. + * If A = LL^* before the rank one update, + * then after it we have LL^* = A + sigma * v v^* where \a v must be a vector + * of same dimension. + */ +template +template +LLT<_MatrixType,_UpLo> LLT<_MatrixType,_UpLo>::rankUpdate(const VectorType& v, const RealScalar& sigma) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorType); + eigen_assert(v.size()==m_matrix.cols()); + eigen_assert(m_isInitialized); + if(internal::llt_inplace::rankUpdate(m_matrix,v,sigma)>=0) + m_info = NumericalIssue; + else + m_info = Success; + + return *this; +} + +#ifndef EIGEN_PARSED_BY_DOXYGEN +template +template +void LLT<_MatrixType,_UpLo>::_solve_impl(const RhsType &rhs, DstType &dst) const +{ + dst = rhs; + solveInPlace(dst); +} +#endif + +/** \internal use x = llt_object.solve(x); + * + * This is the \em in-place version of solve(). + * + * \param bAndX represents both the right-hand side matrix b and result x. + * + * This version avoids a copy when the right hand side matrix b is not needed anymore. + * + * \warning The parameter is only marked 'const' to make the C++ compiler accept a temporary expression here. + * This function will const_cast it, so constness isn't honored here. + * + * \sa LLT::solve(), MatrixBase::llt() + */ +template +template +void LLT::solveInPlace(const MatrixBase &bAndX) const +{ + eigen_assert(m_isInitialized && "LLT is not initialized."); + eigen_assert(m_matrix.rows()==bAndX.rows()); + matrixL().solveInPlace(bAndX); + matrixU().solveInPlace(bAndX); +} + +/** \returns the matrix represented by the decomposition, + * i.e., it returns the product: L L^*. + * This function is provided for debug purpose. */ +template +MatrixType LLT::reconstructedMatrix() const +{ + eigen_assert(m_isInitialized && "LLT is not initialized."); + return matrixL() * matrixL().adjoint().toDenseMatrix(); +} + +/** \cholesky_module + * \returns the LLT decomposition of \c *this + * \sa SelfAdjointView::llt() + */ +template +inline const LLT::PlainObject> +MatrixBase::llt() const +{ + return LLT(derived()); +} + +/** \cholesky_module + * \returns the LLT decomposition of \c *this + * \sa SelfAdjointView::llt() + */ +template +inline const LLT::PlainObject, UpLo> +SelfAdjointView::llt() const +{ + return LLT(m_matrix); +} + +} // end namespace Eigen + +#endif // EIGEN_LLT_H diff --git a/SudoDEM2D/lib/Eigen/src/Cholesky/LLT_LAPACKE.h b/SudoDEM2D/lib/Eigen/src/Cholesky/LLT_LAPACKE.h new file mode 100644 index 0000000..bc6489e --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Cholesky/LLT_LAPACKE.h @@ -0,0 +1,99 @@ +/* + Copyright (c) 2011, Intel Corporation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ******************************************************************************** + * Content : Eigen bindings to LAPACKe + * LLt decomposition based on LAPACKE_?potrf function. + ******************************************************************************** +*/ + +#ifndef EIGEN_LLT_LAPACKE_H +#define EIGEN_LLT_LAPACKE_H + +namespace Eigen { + +namespace internal { + +template struct lapacke_llt; + +#define EIGEN_LAPACKE_LLT(EIGTYPE, BLASTYPE, LAPACKE_PREFIX) \ +template<> struct lapacke_llt \ +{ \ + template \ + static inline Index potrf(MatrixType& m, char uplo) \ + { \ + lapack_int matrix_order; \ + lapack_int size, lda, info, StorageOrder; \ + EIGTYPE* a; \ + eigen_assert(m.rows()==m.cols()); \ + /* Set up parameters for ?potrf */ \ + size = convert_index(m.rows()); \ + StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor; \ + matrix_order = StorageOrder==RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \ + a = &(m.coeffRef(0,0)); \ + lda = convert_index(m.outerStride()); \ +\ + info = LAPACKE_##LAPACKE_PREFIX##potrf( matrix_order, uplo, size, (BLASTYPE*)a, lda ); \ + info = (info==0) ? -1 : info>0 ? info-1 : size; \ + return info; \ + } \ +}; \ +template<> struct llt_inplace \ +{ \ + template \ + static Index blocked(MatrixType& m) \ + { \ + return lapacke_llt::potrf(m, 'L'); \ + } \ + template \ + static Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \ + { return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); } \ +}; \ +template<> struct llt_inplace \ +{ \ + template \ + static Index blocked(MatrixType& m) \ + { \ + return lapacke_llt::potrf(m, 'U'); \ + } \ + template \ + static Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \ + { \ + Transpose matt(mat); \ + return llt_inplace::rankUpdate(matt, vec.conjugate(), sigma); \ + } \ +}; + +EIGEN_LAPACKE_LLT(double, double, d) +EIGEN_LAPACKE_LLT(float, float, s) +EIGEN_LAPACKE_LLT(dcomplex, lapack_complex_double, z) +EIGEN_LAPACKE_LLT(scomplex, lapack_complex_float, c) + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_LLT_LAPACKE_H diff --git a/SudoDEM2D/lib/Eigen/src/CholmodSupport/CholmodSupport.h b/SudoDEM2D/lib/Eigen/src/CholmodSupport/CholmodSupport.h new file mode 100644 index 0000000..5719720 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/CholmodSupport/CholmodSupport.h @@ -0,0 +1,639 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2010 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_CHOLMODSUPPORT_H +#define EIGEN_CHOLMODSUPPORT_H + +namespace Eigen { + +namespace internal { + +template struct cholmod_configure_matrix; + +template<> struct cholmod_configure_matrix { + template + static void run(CholmodType& mat) { + mat.xtype = CHOLMOD_REAL; + mat.dtype = CHOLMOD_DOUBLE; + } +}; + +template<> struct cholmod_configure_matrix > { + template + static void run(CholmodType& mat) { + mat.xtype = CHOLMOD_COMPLEX; + mat.dtype = CHOLMOD_DOUBLE; + } +}; + +// Other scalar types are not yet suppotred by Cholmod +// template<> struct cholmod_configure_matrix { +// template +// static void run(CholmodType& mat) { +// mat.xtype = CHOLMOD_REAL; +// mat.dtype = CHOLMOD_SINGLE; +// } +// }; +// +// template<> struct cholmod_configure_matrix > { +// template +// static void run(CholmodType& mat) { +// mat.xtype = CHOLMOD_COMPLEX; +// mat.dtype = CHOLMOD_SINGLE; +// } +// }; + +} // namespace internal + +/** Wraps the Eigen sparse matrix \a mat into a Cholmod sparse matrix object. + * Note that the data are shared. + */ +template +cholmod_sparse viewAsCholmod(Ref > mat) +{ + cholmod_sparse res; + res.nzmax = mat.nonZeros(); + res.nrow = mat.rows(); + res.ncol = mat.cols(); + res.p = mat.outerIndexPtr(); + res.i = mat.innerIndexPtr(); + res.x = mat.valuePtr(); + res.z = 0; + res.sorted = 1; + if(mat.isCompressed()) + { + res.packed = 1; + res.nz = 0; + } + else + { + res.packed = 0; + res.nz = mat.innerNonZeroPtr(); + } + + res.dtype = 0; + res.stype = -1; + + if (internal::is_same<_StorageIndex,int>::value) + { + res.itype = CHOLMOD_INT; + } + else if (internal::is_same<_StorageIndex,long>::value) + { + res.itype = CHOLMOD_LONG; + } + else + { + eigen_assert(false && "Index type not supported yet"); + } + + // setup res.xtype + internal::cholmod_configure_matrix<_Scalar>::run(res); + + res.stype = 0; + + return res; +} + +template +const cholmod_sparse viewAsCholmod(const SparseMatrix<_Scalar,_Options,_Index>& mat) +{ + cholmod_sparse res = viewAsCholmod(Ref >(mat.const_cast_derived())); + return res; +} + +template +const cholmod_sparse viewAsCholmod(const SparseVector<_Scalar,_Options,_Index>& mat) +{ + cholmod_sparse res = viewAsCholmod(Ref >(mat.const_cast_derived())); + return res; +} + +/** Returns a view of the Eigen sparse matrix \a mat as Cholmod sparse matrix. + * The data are not copied but shared. */ +template +cholmod_sparse viewAsCholmod(const SparseSelfAdjointView, UpLo>& mat) +{ + cholmod_sparse res = viewAsCholmod(Ref >(mat.matrix().const_cast_derived())); + + if(UpLo==Upper) res.stype = 1; + if(UpLo==Lower) res.stype = -1; + + return res; +} + +/** Returns a view of the Eigen \b dense matrix \a mat as Cholmod dense matrix. + * The data are not copied but shared. */ +template +cholmod_dense viewAsCholmod(MatrixBase& mat) +{ + EIGEN_STATIC_ASSERT((internal::traits::Flags&RowMajorBit)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); + typedef typename Derived::Scalar Scalar; + + cholmod_dense res; + res.nrow = mat.rows(); + res.ncol = mat.cols(); + res.nzmax = res.nrow * res.ncol; + res.d = Derived::IsVectorAtCompileTime ? mat.derived().size() : mat.derived().outerStride(); + res.x = (void*)(mat.derived().data()); + res.z = 0; + + internal::cholmod_configure_matrix::run(res); + + return res; +} + +/** Returns a view of the Cholmod sparse matrix \a cm as an Eigen sparse matrix. + * The data are not copied but shared. */ +template +MappedSparseMatrix viewAsEigen(cholmod_sparse& cm) +{ + return MappedSparseMatrix + (cm.nrow, cm.ncol, static_cast(cm.p)[cm.ncol], + static_cast(cm.p), static_cast(cm.i),static_cast(cm.x) ); +} + +enum CholmodMode { + CholmodAuto, CholmodSimplicialLLt, CholmodSupernodalLLt, CholmodLDLt +}; + + +/** \ingroup CholmodSupport_Module + * \class CholmodBase + * \brief The base class for the direct Cholesky factorization of Cholmod + * \sa class CholmodSupernodalLLT, class CholmodSimplicialLDLT, class CholmodSimplicialLLT + */ +template +class CholmodBase : public SparseSolverBase +{ + protected: + typedef SparseSolverBase Base; + using Base::derived; + using Base::m_isInitialized; + public: + typedef _MatrixType MatrixType; + enum { UpLo = _UpLo }; + typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; + typedef MatrixType CholMatrixType; + typedef typename MatrixType::StorageIndex StorageIndex; + enum { + ColsAtCompileTime = MatrixType::ColsAtCompileTime, + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime + }; + + public: + + CholmodBase() + : m_cholmodFactor(0), m_info(Success), m_factorizationIsOk(false), m_analysisIsOk(false) + { + EIGEN_STATIC_ASSERT((internal::is_same::value), CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY); + m_shiftOffset[0] = m_shiftOffset[1] = 0.0; + cholmod_start(&m_cholmod); + } + + explicit CholmodBase(const MatrixType& matrix) + : m_cholmodFactor(0), m_info(Success), m_factorizationIsOk(false), m_analysisIsOk(false) + { + EIGEN_STATIC_ASSERT((internal::is_same::value), CHOLMOD_SUPPORTS_DOUBLE_PRECISION_ONLY); + m_shiftOffset[0] = m_shiftOffset[1] = 0.0; + cholmod_start(&m_cholmod); + compute(matrix); + } + + ~CholmodBase() + { + if(m_cholmodFactor) + cholmod_free_factor(&m_cholmodFactor, &m_cholmod); + cholmod_finish(&m_cholmod); + } + + inline StorageIndex cols() const { return internal::convert_index(m_cholmodFactor->n); } + inline StorageIndex rows() const { return internal::convert_index(m_cholmodFactor->n); } + + /** \brief Reports whether previous computation was successful. + * + * \returns \c Success if computation was succesful, + * \c NumericalIssue if the matrix.appears to be negative. + */ + ComputationInfo info() const + { + eigen_assert(m_isInitialized && "Decomposition is not initialized."); + return m_info; + } + + /** Computes the sparse Cholesky decomposition of \a matrix */ + Derived& compute(const MatrixType& matrix) + { + analyzePattern(matrix); + factorize(matrix); + return derived(); + } + + /** Performs a symbolic decomposition on the sparsity pattern of \a matrix. + * + * This function is particularly useful when solving for several problems having the same structure. + * + * \sa factorize() + */ + void analyzePattern(const MatrixType& matrix) + { + if(m_cholmodFactor) + { + cholmod_free_factor(&m_cholmodFactor, &m_cholmod); + m_cholmodFactor = 0; + } + cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView()); + m_cholmodFactor = cholmod_analyze(&A, &m_cholmod); + + this->m_isInitialized = true; + this->m_info = Success; + m_analysisIsOk = true; + m_factorizationIsOk = false; + } + + /** Performs a numeric decomposition of \a matrix + * + * The given matrix must have the same sparsity pattern as the matrix on which the symbolic decomposition has been performed. + * + * \sa analyzePattern() + */ + void factorize(const MatrixType& matrix) + { + eigen_assert(m_analysisIsOk && "You must first call analyzePattern()"); + cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView()); + cholmod_factorize_p(&A, m_shiftOffset, 0, 0, m_cholmodFactor, &m_cholmod); + + // If the factorization failed, minor is the column at which it did. On success minor == n. + this->m_info = (m_cholmodFactor->minor == m_cholmodFactor->n ? Success : NumericalIssue); + m_factorizationIsOk = true; + } + + /** Returns a reference to the Cholmod's configuration structure to get a full control over the performed operations. + * See the Cholmod user guide for details. */ + cholmod_common& cholmod() { return m_cholmod; } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal */ + template + void _solve_impl(const MatrixBase &b, MatrixBase &dest) const + { + eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()"); + const Index size = m_cholmodFactor->n; + EIGEN_UNUSED_VARIABLE(size); + eigen_assert(size==b.rows()); + + // Cholmod needs column-major stoarge without inner-stride, which corresponds to the default behavior of Ref. + Ref > b_ref(b.derived()); + + cholmod_dense b_cd = viewAsCholmod(b_ref); + cholmod_dense* x_cd = cholmod_solve(CHOLMOD_A, m_cholmodFactor, &b_cd, &m_cholmod); + if(!x_cd) + { + this->m_info = NumericalIssue; + return; + } + // TODO optimize this copy by swapping when possible (be careful with alignment, etc.) + dest = Matrix::Map(reinterpret_cast(x_cd->x),b.rows(),b.cols()); + cholmod_free_dense(&x_cd, &m_cholmod); + } + + /** \internal */ + template + void _solve_impl(const SparseMatrixBase &b, SparseMatrixBase &dest) const + { + eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()"); + const Index size = m_cholmodFactor->n; + EIGEN_UNUSED_VARIABLE(size); + eigen_assert(size==b.rows()); + + // note: cs stands for Cholmod Sparse + Ref > b_ref(b.const_cast_derived()); + cholmod_sparse b_cs = viewAsCholmod(b_ref); + cholmod_sparse* x_cs = cholmod_spsolve(CHOLMOD_A, m_cholmodFactor, &b_cs, &m_cholmod); + if(!x_cs) + { + this->m_info = NumericalIssue; + return; + } + // TODO optimize this copy by swapping when possible (be careful with alignment, etc.) + dest.derived() = viewAsEigen(*x_cs); + cholmod_free_sparse(&x_cs, &m_cholmod); + } + #endif // EIGEN_PARSED_BY_DOXYGEN + + + /** Sets the shift parameter that will be used to adjust the diagonal coefficients during the numerical factorization. + * + * During the numerical factorization, an offset term is added to the diagonal coefficients:\n + * \c d_ii = \a offset + \c d_ii + * + * The default is \a offset=0. + * + * \returns a reference to \c *this. + */ + Derived& setShift(const RealScalar& offset) + { + m_shiftOffset[0] = double(offset); + return derived(); + } + + /** \returns the determinant of the underlying matrix from the current factorization */ + Scalar determinant() const + { + using std::exp; + return exp(logDeterminant()); + } + + /** \returns the log determinant of the underlying matrix from the current factorization */ + Scalar logDeterminant() const + { + using std::log; + using numext::real; + eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()"); + + RealScalar logDet = 0; + Scalar *x = static_cast(m_cholmodFactor->x); + if (m_cholmodFactor->is_super) + { + // Supernodal factorization stored as a packed list of dense column-major blocs, + // as described by the following structure: + + // super[k] == index of the first column of the j-th super node + StorageIndex *super = static_cast(m_cholmodFactor->super); + // pi[k] == offset to the description of row indices + StorageIndex *pi = static_cast(m_cholmodFactor->pi); + // px[k] == offset to the respective dense block + StorageIndex *px = static_cast(m_cholmodFactor->px); + + Index nb_super_nodes = m_cholmodFactor->nsuper; + for (Index k=0; k < nb_super_nodes; ++k) + { + StorageIndex ncols = super[k + 1] - super[k]; + StorageIndex nrows = pi[k + 1] - pi[k]; + + Map, 0, InnerStride<> > sk(x + px[k], ncols, InnerStride<>(nrows+1)); + logDet += sk.real().log().sum(); + } + } + else + { + // Simplicial factorization stored as standard CSC matrix. + StorageIndex *p = static_cast(m_cholmodFactor->p); + Index size = m_cholmodFactor->n; + for (Index k=0; kis_ll) + logDet *= 2.0; + return logDet; + }; + + template + void dumpMemory(Stream& /*s*/) + {} + + protected: + mutable cholmod_common m_cholmod; + cholmod_factor* m_cholmodFactor; + double m_shiftOffset[2]; + mutable ComputationInfo m_info; + int m_factorizationIsOk; + int m_analysisIsOk; +}; + +/** \ingroup CholmodSupport_Module + * \class CholmodSimplicialLLT + * \brief A simplicial direct Cholesky (LLT) factorization and solver based on Cholmod + * + * This class allows to solve for A.X = B sparse linear problems via a simplicial LL^T Cholesky factorization + * using the Cholmod library. + * This simplicial variant is equivalent to Eigen's built-in SimplicialLLT class. Therefore, it has little practical interest. + * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices + * X and B can be either dense or sparse. + * + * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * + * \implsparsesolverconcept + * + * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. + * + * \warning Only double precision real and complex scalar types are supported by Cholmod. + * + * \sa \ref TutorialSparseSolverConcept, class CholmodSupernodalLLT, class SimplicialLLT + */ +template +class CholmodSimplicialLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLLT<_MatrixType, _UpLo> > +{ + typedef CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLLT> Base; + using Base::m_cholmod; + + public: + + typedef _MatrixType MatrixType; + + CholmodSimplicialLLT() : Base() { init(); } + + CholmodSimplicialLLT(const MatrixType& matrix) : Base() + { + init(); + this->compute(matrix); + } + + ~CholmodSimplicialLLT() {} + protected: + void init() + { + m_cholmod.final_asis = 0; + m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; + m_cholmod.final_ll = 1; + } +}; + + +/** \ingroup CholmodSupport_Module + * \class CholmodSimplicialLDLT + * \brief A simplicial direct Cholesky (LDLT) factorization and solver based on Cholmod + * + * This class allows to solve for A.X = B sparse linear problems via a simplicial LDL^T Cholesky factorization + * using the Cholmod library. + * This simplicial variant is equivalent to Eigen's built-in SimplicialLDLT class. Therefore, it has little practical interest. + * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices + * X and B can be either dense or sparse. + * + * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * + * \implsparsesolverconcept + * + * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. + * + * \warning Only double precision real and complex scalar types are supported by Cholmod. + * + * \sa \ref TutorialSparseSolverConcept, class CholmodSupernodalLLT, class SimplicialLDLT + */ +template +class CholmodSimplicialLDLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT<_MatrixType, _UpLo> > +{ + typedef CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT> Base; + using Base::m_cholmod; + + public: + + typedef _MatrixType MatrixType; + + CholmodSimplicialLDLT() : Base() { init(); } + + CholmodSimplicialLDLT(const MatrixType& matrix) : Base() + { + init(); + this->compute(matrix); + } + + ~CholmodSimplicialLDLT() {} + protected: + void init() + { + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; + } +}; + +/** \ingroup CholmodSupport_Module + * \class CholmodSupernodalLLT + * \brief A supernodal Cholesky (LLT) factorization and solver based on Cholmod + * + * This class allows to solve for A.X = B sparse linear problems via a supernodal LL^T Cholesky factorization + * using the Cholmod library. + * This supernodal variant performs best on dense enough problems, e.g., 3D FEM, or very high order 2D FEM. + * The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices + * X and B can be either dense or sparse. + * + * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * + * \implsparsesolverconcept + * + * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. + * + * \warning Only double precision real and complex scalar types are supported by Cholmod. + * + * \sa \ref TutorialSparseSolverConcept + */ +template +class CholmodSupernodalLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSupernodalLLT<_MatrixType, _UpLo> > +{ + typedef CholmodBase<_MatrixType, _UpLo, CholmodSupernodalLLT> Base; + using Base::m_cholmod; + + public: + + typedef _MatrixType MatrixType; + + CholmodSupernodalLLT() : Base() { init(); } + + CholmodSupernodalLLT(const MatrixType& matrix) : Base() + { + init(); + this->compute(matrix); + } + + ~CholmodSupernodalLLT() {} + protected: + void init() + { + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_SUPERNODAL; + } +}; + +/** \ingroup CholmodSupport_Module + * \class CholmodDecomposition + * \brief A general Cholesky factorization and solver based on Cholmod + * + * This class allows to solve for A.X = B sparse linear problems via a LL^T or LDL^T Cholesky factorization + * using the Cholmod library. The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices + * X and B can be either dense or sparse. + * + * This variant permits to change the underlying Cholesky method at runtime. + * On the other hand, it does not provide access to the result of the factorization. + * The default is to let Cholmod automatically choose between a simplicial and supernodal factorization. + * + * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<> + * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower + * or Upper. Default is Lower. + * + * \implsparsesolverconcept + * + * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. + * + * \warning Only double precision real and complex scalar types are supported by Cholmod. + * + * \sa \ref TutorialSparseSolverConcept + */ +template +class CholmodDecomposition : public CholmodBase<_MatrixType, _UpLo, CholmodDecomposition<_MatrixType, _UpLo> > +{ + typedef CholmodBase<_MatrixType, _UpLo, CholmodDecomposition> Base; + using Base::m_cholmod; + + public: + + typedef _MatrixType MatrixType; + + CholmodDecomposition() : Base() { init(); } + + CholmodDecomposition(const MatrixType& matrix) : Base() + { + init(); + this->compute(matrix); + } + + ~CholmodDecomposition() {} + + void setMode(CholmodMode mode) + { + switch(mode) + { + case CholmodAuto: + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_AUTO; + break; + case CholmodSimplicialLLt: + m_cholmod.final_asis = 0; + m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; + m_cholmod.final_ll = 1; + break; + case CholmodSupernodalLLt: + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_SUPERNODAL; + break; + case CholmodLDLt: + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; + break; + default: + break; + } + } + protected: + void init() + { + m_cholmod.final_asis = 1; + m_cholmod.supernodal = CHOLMOD_AUTO; + } +}; + +} // end namespace Eigen + +#endif // EIGEN_CHOLMODSUPPORT_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Array.h b/SudoDEM2D/lib/Eigen/src/Core/Array.h new file mode 100644 index 0000000..e10020d --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Array.h @@ -0,0 +1,331 @@ +// 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 EIGEN_ARRAY_H +#define EIGEN_ARRAY_H + +namespace Eigen { + +namespace internal { +template +struct traits > : traits > +{ + typedef ArrayXpr XprKind; + typedef ArrayBase > XprBase; +}; +} + +/** \class Array + * \ingroup Core_Module + * + * \brief General-purpose arrays with easy API for coefficient-wise operations + * + * The %Array class is very similar to the Matrix class. It provides + * general-purpose one- and two-dimensional arrays. The difference between the + * %Array and the %Matrix class is primarily in the API: the API for the + * %Array class provides easy access to coefficient-wise operations, while the + * API for the %Matrix class provides easy access to linear-algebra + * operations. + * + * See documentation of class Matrix for detailed information on the template parameters + * storage layout. + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_ARRAY_PLUGIN. + * + * \sa \blank \ref TutorialArrayClass, \ref TopicClassHierarchy + */ +template +class Array + : public PlainObjectBase > +{ + public: + + typedef PlainObjectBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Array) + + enum { Options = _Options }; + typedef typename Base::PlainObject PlainObject; + + protected: + template + friend struct internal::conservative_resize_like_impl; + + using Base::m_storage; + + public: + + using Base::base; + using Base::coeff; + using Base::coeffRef; + + /** + * The usage of + * using Base::operator=; + * fails on MSVC. Since the code below is working with GCC and MSVC, we skipped + * the usage of 'using'. This should be done only for operator=. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const EigenBase &other) + { + return Base::operator=(other); + } + + /** Set all the entries to \a value. + * \sa DenseBase::setConstant(), DenseBase::fill() + */ + /* This overload is needed because the usage of + * using Base::operator=; + * fails on MSVC. Since the code below is working with GCC and MSVC, we skipped + * the usage of 'using'. This should be done only for operator=. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const Scalar &value) + { + Base::setConstant(value); + return *this; + } + + /** Copies the value of the expression \a other into \c *this with automatic resizing. + * + * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), + * it will be initialized. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const DenseBase& other) + { + return Base::_set(other); + } + + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array& operator=(const Array& other) + { + return Base::_set(other); + } + + /** Default constructor. + * + * For fixed-size matrices, does nothing. + * + * For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix + * is called a null matrix. This constructor is the unique way to create null matrices: resizing + * a matrix to 0 is not supported. + * + * \sa resize(Index,Index) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array() : Base() + { + Base::_check_template_params(); + EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } + +#ifndef EIGEN_PARSED_BY_DOXYGEN + // FIXME is it still needed ?? + /** \internal */ + EIGEN_DEVICE_FUNC + Array(internal::constructor_without_unaligned_array_assert) + : Base(internal::constructor_without_unaligned_array_assert()) + { + Base::_check_template_params(); + EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } +#endif + +#if EIGEN_HAS_RVALUE_REFERENCES + EIGEN_DEVICE_FUNC + Array(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible::value) + : Base(std::move(other)) + { + Base::_check_template_params(); + if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic) + Base::_set_noalias(other); + } + EIGEN_DEVICE_FUNC + Array& operator=(Array&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable::value) + { + other.swap(*this); + return *this; + } +#endif + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE explicit Array(const T& x) + { + Base::_check_template_params(); + Base::template _init1(x); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const T0& val0, const T1& val1) + { + Base::_check_template_params(); + this->template _init2(val0, val1); + } + #else + /** \brief Constructs a fixed-sized array initialized with coefficients starting at \a data */ + EIGEN_DEVICE_FUNC explicit Array(const Scalar *data); + /** Constructs a vector or row-vector with given dimension. \only_for_vectors + * + * Note that this is only useful for dynamic-size vectors. For fixed-size vectors, + * it is redundant to pass the dimension here, so it makes more sense to use the default + * constructor Array() instead. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE explicit Array(Index dim); + /** constructs an initialized 1x1 Array with the given coefficient */ + Array(const Scalar& value); + /** constructs an uninitialized array with \a rows rows and \a cols columns. + * + * This is useful for dynamic-size arrays. For fixed-size arrays, + * it is redundant to pass these parameters, so one should use the default constructor + * Array() instead. */ + Array(Index rows, Index cols); + /** constructs an initialized 2D vector with given coefficients */ + Array(const Scalar& val0, const Scalar& val1); + #endif + + /** constructs an initialized 3D vector with given coefficients */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const Scalar& val0, const Scalar& val1, const Scalar& val2) + { + Base::_check_template_params(); + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Array, 3) + m_storage.data()[0] = val0; + m_storage.data()[1] = val1; + m_storage.data()[2] = val2; + } + /** constructs an initialized 4D vector with given coefficients */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const Scalar& val0, const Scalar& val1, const Scalar& val2, const Scalar& val3) + { + Base::_check_template_params(); + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Array, 4) + m_storage.data()[0] = val0; + m_storage.data()[1] = val1; + m_storage.data()[2] = val2; + m_storage.data()[3] = val3; + } + + /** Copy constructor */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const Array& other) + : Base(other) + { } + + private: + struct PrivateType {}; + public: + + /** \sa MatrixBase::operator=(const EigenBase&) */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Array(const EigenBase &other, + typename internal::enable_if::value, + PrivateType>::type = PrivateType()) + : Base(other.derived()) + { } + + EIGEN_DEVICE_FUNC inline Index innerStride() const { return 1; } + EIGEN_DEVICE_FUNC inline Index outerStride() const { return this->innerSize(); } + + #ifdef EIGEN_ARRAY_PLUGIN + #include EIGEN_ARRAY_PLUGIN + #endif + + private: + + template + friend struct internal::matrix_swap_impl; +}; + +/** \defgroup arraytypedefs Global array typedefs + * \ingroup Core_Module + * + * Eigen defines several typedef shortcuts for most common 1D and 2D array types. + * + * The general patterns are the following: + * + * \c ArrayRowsColsType where \c Rows and \c Cols can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size, + * and where \c Type can be \c i for integer, \c f for float, \c d for double, \c cf for complex float, \c cd + * for complex double. + * + * For example, \c Array33d is a fixed-size 3x3 array type of doubles, and \c ArrayXXf is a dynamic-size matrix of floats. + * + * There are also \c ArraySizeType which are self-explanatory. For example, \c Array4cf is + * a fixed-size 1D array of 4 complex floats. + * + * \sa class Array + */ + +#define EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ +/** \ingroup arraytypedefs */ \ +typedef Array Array##SizeSuffix##SizeSuffix##TypeSuffix; \ +/** \ingroup arraytypedefs */ \ +typedef Array Array##SizeSuffix##TypeSuffix; + +#define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ +/** \ingroup arraytypedefs */ \ +typedef Array Array##Size##X##TypeSuffix; \ +/** \ingroup arraytypedefs */ \ +typedef Array Array##X##Size##TypeSuffix; + +#define EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ +EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 2, 2) \ +EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 3, 3) \ +EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 4, 4) \ +EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 4) + +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(int, i) +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(float, f) +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(double, d) +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex, cf) +EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex, cd) + +#undef EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES +#undef EIGEN_MAKE_ARRAY_TYPEDEFS + +#undef EIGEN_MAKE_ARRAY_TYPEDEFS_LARGE + +#define EIGEN_USING_ARRAY_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_ARRAY_TYPEDEFS_FOR_TYPE(TypeSuffix) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \ + +#define EIGEN_USING_ARRAY_TYPEDEFS \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(i) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(f) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(d) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cf) \ +EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cd) + +} // end namespace Eigen + +#endif // EIGEN_ARRAY_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/ArrayBase.h b/SudoDEM2D/lib/Eigen/src/Core/ArrayBase.h new file mode 100644 index 0000000..3dbc708 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/ArrayBase.h @@ -0,0 +1,226 @@ +// 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 EIGEN_ARRAYBASE_H +#define EIGEN_ARRAYBASE_H + +namespace Eigen { + +template class MatrixWrapper; + +/** \class ArrayBase + * \ingroup Core_Module + * + * \brief Base class for all 1D and 2D array, and related expressions + * + * An array is similar to a dense vector or matrix. While matrices are mathematical + * objects with well defined linear algebra operators, an array is just a collection + * of scalar values arranged in a one or two dimensionnal fashion. As the main consequence, + * all operations applied to an array are performed coefficient wise. Furthermore, + * arrays support scalar math functions of the c++ standard library (e.g., std::sin(x)), and convenient + * constructors allowing to easily write generic code working for both scalar values + * and arrays. + * + * This class is the base that is inherited by all array expression types. + * + * \tparam Derived is the derived type, e.g., an array or an expression type. + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_ARRAYBASE_PLUGIN. + * + * \sa class MatrixBase, \ref TopicClassHierarchy + */ +template class ArrayBase + : public DenseBase +{ + public: +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** The base class for a given storage type. */ + typedef ArrayBase StorageBaseType; + + typedef ArrayBase Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + + typedef DenseBase Base; + using Base::RowsAtCompileTime; + using Base::ColsAtCompileTime; + using Base::SizeAtCompileTime; + using Base::MaxRowsAtCompileTime; + using Base::MaxColsAtCompileTime; + using Base::MaxSizeAtCompileTime; + using Base::IsVectorAtCompileTime; + using Base::Flags; + + using Base::derived; + using Base::const_cast_derived; + using Base::rows; + using Base::cols; + using Base::size; + using Base::coeff; + using Base::coeffRef; + using Base::lazyAssign; + using Base::operator=; + using Base::operator+=; + using Base::operator-=; + using Base::operator*=; + using Base::operator/=; + + typedef typename Base::CoeffReturnType CoeffReturnType; + +#endif // not EIGEN_PARSED_BY_DOXYGEN + +#ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Base::PlainObject PlainObject; + + /** \internal Represents a matrix with all coefficients equal to one another*/ + typedef CwiseNullaryOp,PlainObject> ConstantReturnType; +#endif // not EIGEN_PARSED_BY_DOXYGEN + +#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::ArrayBase +#define EIGEN_DOC_UNARY_ADDONS(X,Y) +# include "../plugins/CommonCwiseUnaryOps.h" +# include "../plugins/MatrixCwiseUnaryOps.h" +# include "../plugins/ArrayCwiseUnaryOps.h" +# include "../plugins/CommonCwiseBinaryOps.h" +# include "../plugins/MatrixCwiseBinaryOps.h" +# include "../plugins/ArrayCwiseBinaryOps.h" +# ifdef EIGEN_ARRAYBASE_PLUGIN +# include EIGEN_ARRAYBASE_PLUGIN +# endif +#undef EIGEN_CURRENT_STORAGE_BASE_CLASS +#undef EIGEN_DOC_UNARY_ADDONS + + /** Special case of the template operator=, in order to prevent the compiler + * from generating a default operator= (issue hit with g++ 4.1) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const ArrayBase& other) + { + internal::call_assignment(derived(), other.derived()); + return derived(); + } + + /** Set all the entries to \a value. + * \sa DenseBase::setConstant(), DenseBase::fill() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const Scalar &value) + { Base::setConstant(value); return derived(); } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator+=(const Scalar& scalar); + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator-=(const Scalar& scalar); + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator+=(const ArrayBase& other); + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator-=(const ArrayBase& other); + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator*=(const ArrayBase& other); + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator/=(const ArrayBase& other); + + public: + EIGEN_DEVICE_FUNC + ArrayBase& array() { return *this; } + EIGEN_DEVICE_FUNC + const ArrayBase& array() const { return *this; } + + /** \returns an \link Eigen::MatrixBase Matrix \endlink expression of this array + * \sa MatrixBase::array() */ + EIGEN_DEVICE_FUNC + MatrixWrapper matrix() { return MatrixWrapper(derived()); } + EIGEN_DEVICE_FUNC + const MatrixWrapper matrix() const { return MatrixWrapper(derived()); } + +// template +// inline void evalTo(Dest& dst) const { dst = matrix(); } + + protected: + EIGEN_DEVICE_FUNC + ArrayBase() : Base() {} + + private: + explicit ArrayBase(Index); + ArrayBase(Index,Index); + template explicit ArrayBase(const ArrayBase&); + protected: + // mixing arrays and matrices is not legal + template Derived& operator+=(const MatrixBase& ) + {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} + // mixing arrays and matrices is not legal + template Derived& operator-=(const MatrixBase& ) + {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} +}; + +/** replaces \c *this by \c *this - \a other. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +ArrayBase::operator-=(const ArrayBase &other) +{ + call_assignment(derived(), other.derived(), internal::sub_assign_op()); + return derived(); +} + +/** replaces \c *this by \c *this + \a other. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +ArrayBase::operator+=(const ArrayBase& other) +{ + call_assignment(derived(), other.derived(), internal::add_assign_op()); + return derived(); +} + +/** replaces \c *this by \c *this * \a other coefficient wise. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +ArrayBase::operator*=(const ArrayBase& other) +{ + call_assignment(derived(), other.derived(), internal::mul_assign_op()); + return derived(); +} + +/** replaces \c *this by \c *this / \a other coefficient wise. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & +ArrayBase::operator/=(const ArrayBase& other) +{ + call_assignment(derived(), other.derived(), internal::div_assign_op()); + return derived(); +} + +} // end namespace Eigen + +#endif // EIGEN_ARRAYBASE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/ArrayWrapper.h b/SudoDEM2D/lib/Eigen/src/Core/ArrayWrapper.h new file mode 100644 index 0000000..688aadd --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/ArrayWrapper.h @@ -0,0 +1,209 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 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_ARRAYWRAPPER_H +#define EIGEN_ARRAYWRAPPER_H + +namespace Eigen { + +/** \class ArrayWrapper + * \ingroup Core_Module + * + * \brief Expression of a mathematical vector or matrix as an array object + * + * This class is the return type of MatrixBase::array(), and most of the time + * this is the only way it is use. + * + * \sa MatrixBase::array(), class MatrixWrapper + */ + +namespace internal { +template +struct traits > + : public traits::type > +{ + typedef ArrayXpr XprKind; + // Let's remove NestByRefBit + enum { + Flags0 = traits::type >::Flags, + LvalueBitFlag = is_lvalue::value ? LvalueBit : 0, + Flags = (Flags0 & ~(NestByRefBit | LvalueBit)) | LvalueBitFlag + }; +}; +} + +template +class ArrayWrapper : public ArrayBase > +{ + public: + typedef ArrayBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(ArrayWrapper) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ArrayWrapper) + typedef typename internal::remove_all::type NestedExpression; + + typedef typename internal::conditional< + internal::is_lvalue::value, + Scalar, + const Scalar + >::type ScalarWithConstIfNotLvalue; + + typedef typename internal::ref_selector::non_const_type NestedExpressionType; + + using Base::coeffRef; + + EIGEN_DEVICE_FUNC + explicit EIGEN_STRONG_INLINE ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {} + + EIGEN_DEVICE_FUNC + inline Index rows() const { return m_expression.rows(); } + EIGEN_DEVICE_FUNC + inline Index cols() const { return m_expression.cols(); } + EIGEN_DEVICE_FUNC + inline Index outerStride() const { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC + inline Index innerStride() const { return m_expression.innerStride(); } + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); } + EIGEN_DEVICE_FUNC + inline const Scalar* data() const { return m_expression.data(); } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + return m_expression.coeffRef(rowId, colId); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + return m_expression.coeffRef(index); + } + + template + EIGEN_DEVICE_FUNC + inline void evalTo(Dest& dst) const { dst = m_expression; } + + const typename internal::remove_all::type& + EIGEN_DEVICE_FUNC + nestedExpression() const + { + return m_expression; + } + + /** Forwards the resizing request to the nested expression + * \sa DenseBase::resize(Index) */ + EIGEN_DEVICE_FUNC + void resize(Index newSize) { m_expression.resize(newSize); } + /** Forwards the resizing request to the nested expression + * \sa DenseBase::resize(Index,Index)*/ + EIGEN_DEVICE_FUNC + void resize(Index rows, Index cols) { m_expression.resize(rows,cols); } + + protected: + NestedExpressionType m_expression; +}; + +/** \class MatrixWrapper + * \ingroup Core_Module + * + * \brief Expression of an array as a mathematical vector or matrix + * + * This class is the return type of ArrayBase::matrix(), and most of the time + * this is the only way it is use. + * + * \sa MatrixBase::matrix(), class ArrayWrapper + */ + +namespace internal { +template +struct traits > + : public traits::type > +{ + typedef MatrixXpr XprKind; + // Let's remove NestByRefBit + enum { + Flags0 = traits::type >::Flags, + LvalueBitFlag = is_lvalue::value ? LvalueBit : 0, + Flags = (Flags0 & ~(NestByRefBit | LvalueBit)) | LvalueBitFlag + }; +}; +} + +template +class MatrixWrapper : public MatrixBase > +{ + public: + typedef MatrixBase > Base; + EIGEN_DENSE_PUBLIC_INTERFACE(MatrixWrapper) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(MatrixWrapper) + typedef typename internal::remove_all::type NestedExpression; + + typedef typename internal::conditional< + internal::is_lvalue::value, + Scalar, + const Scalar + >::type ScalarWithConstIfNotLvalue; + + typedef typename internal::ref_selector::non_const_type NestedExpressionType; + + using Base::coeffRef; + + EIGEN_DEVICE_FUNC + explicit inline MatrixWrapper(ExpressionType& matrix) : m_expression(matrix) {} + + EIGEN_DEVICE_FUNC + inline Index rows() const { return m_expression.rows(); } + EIGEN_DEVICE_FUNC + inline Index cols() const { return m_expression.cols(); } + EIGEN_DEVICE_FUNC + inline Index outerStride() const { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC + inline Index innerStride() const { return m_expression.innerStride(); } + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); } + EIGEN_DEVICE_FUNC + inline const Scalar* data() const { return m_expression.data(); } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + return m_expression.derived().coeffRef(rowId, colId); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + return m_expression.coeffRef(index); + } + + EIGEN_DEVICE_FUNC + const typename internal::remove_all::type& + nestedExpression() const + { + return m_expression; + } + + /** Forwards the resizing request to the nested expression + * \sa DenseBase::resize(Index) */ + EIGEN_DEVICE_FUNC + void resize(Index newSize) { m_expression.resize(newSize); } + /** Forwards the resizing request to the nested expression + * \sa DenseBase::resize(Index,Index)*/ + EIGEN_DEVICE_FUNC + void resize(Index rows, Index cols) { m_expression.resize(rows,cols); } + + protected: + NestedExpressionType m_expression; +}; + +} // end namespace Eigen + +#endif // EIGEN_ARRAYWRAPPER_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Assign.h b/SudoDEM2D/lib/Eigen/src/Core/Assign.h new file mode 100644 index 0000000..53806ba --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Assign.h @@ -0,0 +1,90 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007 Michael Olbrich +// Copyright (C) 2006-2010 Benoit Jacob +// Copyright (C) 2008 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_ASSIGN_H +#define EIGEN_ASSIGN_H + +namespace Eigen { + +template +template +EIGEN_STRONG_INLINE Derived& DenseBase + ::lazyAssign(const DenseBase& other) +{ + enum{ + SameType = internal::is_same::value + }; + + EIGEN_STATIC_ASSERT_LVALUE(Derived) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived) + EIGEN_STATIC_ASSERT(SameType,YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) + + eigen_assert(rows() == other.rows() && cols() == other.cols()); + internal::call_assignment_no_alias(derived(),other.derived()); + + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const MatrixBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const DenseBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const EigenBase& other) +{ + internal::call_assignment(derived(), other.derived()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const ReturnByValue& other) +{ + other.derived().evalTo(derived()); + return derived(); +} + +} // end namespace Eigen + +#endif // EIGEN_ASSIGN_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/AssignEvaluator.h b/SudoDEM2D/lib/Eigen/src/Core/AssignEvaluator.h new file mode 100644 index 0000000..dbe435d --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/AssignEvaluator.h @@ -0,0 +1,935 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2011 Benoit Jacob +// Copyright (C) 2011-2014 Gael Guennebaud +// Copyright (C) 2011-2012 Jitse Niesen +// +// 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_ASSIGN_EVALUATOR_H +#define EIGEN_ASSIGN_EVALUATOR_H + +namespace Eigen { + +// This implementation is based on Assign.h + +namespace internal { + +/*************************************************************************** +* Part 1 : the logic deciding a strategy for traversal and unrolling * +***************************************************************************/ + +// copy_using_evaluator_traits is based on assign_traits + +template +struct copy_using_evaluator_traits +{ + typedef typename DstEvaluator::XprType Dst; + typedef typename Dst::Scalar DstScalar; + + enum { + DstFlags = DstEvaluator::Flags, + SrcFlags = SrcEvaluator::Flags + }; + +public: + enum { + DstAlignment = DstEvaluator::Alignment, + SrcAlignment = SrcEvaluator::Alignment, + DstHasDirectAccess = (DstFlags & DirectAccessBit) == DirectAccessBit, + JointAlignment = EIGEN_PLAIN_ENUM_MIN(DstAlignment,SrcAlignment) + }; + +private: + enum { + InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime) + : int(DstFlags)&RowMajorBit ? int(Dst::ColsAtCompileTime) + : int(Dst::RowsAtCompileTime), + InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime) + : int(DstFlags)&RowMajorBit ? int(Dst::MaxColsAtCompileTime) + : int(Dst::MaxRowsAtCompileTime), + OuterStride = int(outer_stride_at_compile_time::ret), + MaxSizeAtCompileTime = Dst::SizeAtCompileTime + }; + + // TODO distinguish between linear traversal and inner-traversals + typedef typename find_best_packet::type LinearPacketType; + typedef typename find_best_packet::type InnerPacketType; + + enum { + LinearPacketSize = unpacket_traits::size, + InnerPacketSize = unpacket_traits::size + }; + +public: + enum { + LinearRequiredAlignment = unpacket_traits::alignment, + InnerRequiredAlignment = unpacket_traits::alignment + }; + +private: + enum { + DstIsRowMajor = DstFlags&RowMajorBit, + SrcIsRowMajor = SrcFlags&RowMajorBit, + StorageOrdersAgree = (int(DstIsRowMajor) == int(SrcIsRowMajor)), + MightVectorize = bool(StorageOrdersAgree) + && (int(DstFlags) & int(SrcFlags) & ActualPacketAccessBit) + && bool(functor_traits::PacketAccess), + MayInnerVectorize = MightVectorize + && int(InnerSize)!=Dynamic && int(InnerSize)%int(InnerPacketSize)==0 + && int(OuterStride)!=Dynamic && int(OuterStride)%int(InnerPacketSize)==0 + && (EIGEN_UNALIGNED_VECTORIZE || int(JointAlignment)>=int(InnerRequiredAlignment)), + MayLinearize = bool(StorageOrdersAgree) && (int(DstFlags) & int(SrcFlags) & LinearAccessBit), + MayLinearVectorize = bool(MightVectorize) && bool(MayLinearize) && bool(DstHasDirectAccess) + && (EIGEN_UNALIGNED_VECTORIZE || (int(DstAlignment)>=int(LinearRequiredAlignment)) || MaxSizeAtCompileTime == Dynamic), + /* If the destination isn't aligned, we have to do runtime checks and we don't unroll, + so it's only good for large enough sizes. */ + MaySliceVectorize = bool(MightVectorize) && bool(DstHasDirectAccess) + && (int(InnerMaxSize)==Dynamic || int(InnerMaxSize)>=(EIGEN_UNALIGNED_VECTORIZE?InnerPacketSize:(3*InnerPacketSize))) + /* slice vectorization can be slow, so we only want it if the slices are big, which is + indicated by InnerMaxSize rather than InnerSize, think of the case of a dynamic block + in a fixed-size matrix + However, with EIGEN_UNALIGNED_VECTORIZE and unrolling, slice vectorization is still worth it */ + }; + +public: + enum { + Traversal = int(MayLinearVectorize) && (LinearPacketSize>InnerPacketSize) ? int(LinearVectorizedTraversal) + : int(MayInnerVectorize) ? int(InnerVectorizedTraversal) + : int(MayLinearVectorize) ? int(LinearVectorizedTraversal) + : int(MaySliceVectorize) ? int(SliceVectorizedTraversal) + : int(MayLinearize) ? int(LinearTraversal) + : int(DefaultTraversal), + Vectorized = int(Traversal) == InnerVectorizedTraversal + || int(Traversal) == LinearVectorizedTraversal + || int(Traversal) == SliceVectorizedTraversal + }; + + typedef typename conditional::type PacketType; + +private: + enum { + ActualPacketSize = int(Traversal)==LinearVectorizedTraversal ? LinearPacketSize + : Vectorized ? InnerPacketSize + : 1, + UnrollingLimit = EIGEN_UNROLLING_LIMIT * ActualPacketSize, + MayUnrollCompletely = int(Dst::SizeAtCompileTime) != Dynamic + && int(Dst::SizeAtCompileTime) * (int(DstEvaluator::CoeffReadCost)+int(SrcEvaluator::CoeffReadCost)) <= int(UnrollingLimit), + MayUnrollInner = int(InnerSize) != Dynamic + && int(InnerSize) * (int(DstEvaluator::CoeffReadCost)+int(SrcEvaluator::CoeffReadCost)) <= int(UnrollingLimit) + }; + +public: + enum { + Unrolling = (int(Traversal) == int(InnerVectorizedTraversal) || int(Traversal) == int(DefaultTraversal)) + ? ( + int(MayUnrollCompletely) ? int(CompleteUnrolling) + : int(MayUnrollInner) ? int(InnerUnrolling) + : int(NoUnrolling) + ) + : int(Traversal) == int(LinearVectorizedTraversal) + ? ( bool(MayUnrollCompletely) && ( EIGEN_UNALIGNED_VECTORIZE || (int(DstAlignment)>=int(LinearRequiredAlignment))) + ? int(CompleteUnrolling) + : int(NoUnrolling) ) + : int(Traversal) == int(LinearTraversal) + ? ( bool(MayUnrollCompletely) ? int(CompleteUnrolling) + : int(NoUnrolling) ) +#if EIGEN_UNALIGNED_VECTORIZE + : int(Traversal) == int(SliceVectorizedTraversal) + ? ( bool(MayUnrollInner) ? int(InnerUnrolling) + : int(NoUnrolling) ) +#endif + : int(NoUnrolling) + }; + +#ifdef EIGEN_DEBUG_ASSIGN + static void debug() + { + std::cerr << "DstXpr: " << typeid(typename DstEvaluator::XprType).name() << std::endl; + std::cerr << "SrcXpr: " << typeid(typename SrcEvaluator::XprType).name() << std::endl; + std::cerr.setf(std::ios::hex, std::ios::basefield); + std::cerr << "DstFlags" << " = " << DstFlags << " (" << demangle_flags(DstFlags) << " )" << std::endl; + std::cerr << "SrcFlags" << " = " << SrcFlags << " (" << demangle_flags(SrcFlags) << " )" << std::endl; + std::cerr.unsetf(std::ios::hex); + EIGEN_DEBUG_VAR(DstAlignment) + EIGEN_DEBUG_VAR(SrcAlignment) + EIGEN_DEBUG_VAR(LinearRequiredAlignment) + EIGEN_DEBUG_VAR(InnerRequiredAlignment) + EIGEN_DEBUG_VAR(JointAlignment) + EIGEN_DEBUG_VAR(InnerSize) + EIGEN_DEBUG_VAR(InnerMaxSize) + EIGEN_DEBUG_VAR(LinearPacketSize) + EIGEN_DEBUG_VAR(InnerPacketSize) + EIGEN_DEBUG_VAR(ActualPacketSize) + EIGEN_DEBUG_VAR(StorageOrdersAgree) + EIGEN_DEBUG_VAR(MightVectorize) + EIGEN_DEBUG_VAR(MayLinearize) + EIGEN_DEBUG_VAR(MayInnerVectorize) + EIGEN_DEBUG_VAR(MayLinearVectorize) + EIGEN_DEBUG_VAR(MaySliceVectorize) + std::cerr << "Traversal" << " = " << Traversal << " (" << demangle_traversal(Traversal) << ")" << std::endl; + EIGEN_DEBUG_VAR(SrcEvaluator::CoeffReadCost) + EIGEN_DEBUG_VAR(UnrollingLimit) + EIGEN_DEBUG_VAR(MayUnrollCompletely) + EIGEN_DEBUG_VAR(MayUnrollInner) + std::cerr << "Unrolling" << " = " << Unrolling << " (" << demangle_unrolling(Unrolling) << ")" << std::endl; + std::cerr << std::endl; + } +#endif +}; + +/*************************************************************************** +* Part 2 : meta-unrollers +***************************************************************************/ + +/************************ +*** Default traversal *** +************************/ + +template +struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling +{ + // FIXME: this is not very clean, perhaps this information should be provided by the kernel? + typedef typename Kernel::DstEvaluatorType DstEvaluatorType; + typedef typename DstEvaluatorType::XprType DstXprType; + + enum { + outer = Index / DstXprType::InnerSizeAtCompileTime, + inner = Index % DstXprType::InnerSizeAtCompileTime + }; + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + kernel.assignCoeffByOuterInner(outer, inner); + copy_using_evaluator_DefaultTraversal_CompleteUnrolling::run(kernel); + } +}; + +template +struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&) { } +}; + +template +struct copy_using_evaluator_DefaultTraversal_InnerUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer) + { + kernel.assignCoeffByOuterInner(outer, Index_); + copy_using_evaluator_DefaultTraversal_InnerUnrolling::run(kernel, outer); + } +}; + +template +struct copy_using_evaluator_DefaultTraversal_InnerUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, Index) { } +}; + +/*********************** +*** Linear traversal *** +***********************/ + +template +struct copy_using_evaluator_LinearTraversal_CompleteUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel& kernel) + { + kernel.assignCoeff(Index); + copy_using_evaluator_LinearTraversal_CompleteUnrolling::run(kernel); + } +}; + +template +struct copy_using_evaluator_LinearTraversal_CompleteUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&) { } +}; + +/************************** +*** Inner vectorization *** +**************************/ + +template +struct copy_using_evaluator_innervec_CompleteUnrolling +{ + // FIXME: this is not very clean, perhaps this information should be provided by the kernel? + typedef typename Kernel::DstEvaluatorType DstEvaluatorType; + typedef typename DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::PacketType PacketType; + + enum { + outer = Index / DstXprType::InnerSizeAtCompileTime, + inner = Index % DstXprType::InnerSizeAtCompileTime, + SrcAlignment = Kernel::AssignmentTraits::SrcAlignment, + DstAlignment = Kernel::AssignmentTraits::DstAlignment + }; + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + kernel.template assignPacketByOuterInner(outer, inner); + enum { NextIndex = Index + unpacket_traits::size }; + copy_using_evaluator_innervec_CompleteUnrolling::run(kernel); + } +}; + +template +struct copy_using_evaluator_innervec_CompleteUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&) { } +}; + +template +struct copy_using_evaluator_innervec_InnerUnrolling +{ + typedef typename Kernel::PacketType PacketType; + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer) + { + kernel.template assignPacketByOuterInner(outer, Index_); + enum { NextIndex = Index_ + unpacket_traits::size }; + copy_using_evaluator_innervec_InnerUnrolling::run(kernel, outer); + } +}; + +template +struct copy_using_evaluator_innervec_InnerUnrolling +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &, Index) { } +}; + +/*************************************************************************** +* Part 3 : implementation of all cases +***************************************************************************/ + +// dense_assignment_loop is based on assign_impl + +template +struct dense_assignment_loop; + +/************************ +*** Default traversal *** +************************/ + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static void EIGEN_STRONG_INLINE run(Kernel &kernel) + { + for(Index outer = 0; outer < kernel.outerSize(); ++outer) { + for(Index inner = 0; inner < kernel.innerSize(); ++inner) { + kernel.assignCoeffByOuterInner(outer, inner); + } + } + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + copy_using_evaluator_DefaultTraversal_CompleteUnrolling::run(kernel); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + + const Index outerSize = kernel.outerSize(); + for(Index outer = 0; outer < outerSize; ++outer) + copy_using_evaluator_DefaultTraversal_InnerUnrolling::run(kernel, outer); + } +}; + +/*************************** +*** Linear vectorization *** +***************************/ + + +// The goal of unaligned_dense_assignment_loop is simply to factorize the handling +// of the non vectorizable beginning and ending parts + +template +struct unaligned_dense_assignment_loop +{ + // if IsAligned = true, then do nothing + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, Index, Index) {} +}; + +template <> +struct unaligned_dense_assignment_loop +{ + // MSVC must not inline this functions. If it does, it fails to optimize the + // packet access path. + // FIXME check which version exhibits this issue +#if EIGEN_COMP_MSVC + template + static EIGEN_DONT_INLINE void run(Kernel &kernel, + Index start, + Index end) +#else + template + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, + Index start, + Index end) +#endif + { + for (Index index = start; index < end; ++index) + kernel.assignCoeff(index); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + const Index size = kernel.size(); + typedef typename Kernel::Scalar Scalar; + typedef typename Kernel::PacketType PacketType; + enum { + requestedAlignment = Kernel::AssignmentTraits::LinearRequiredAlignment, + packetSize = unpacket_traits::size, + dstIsAligned = int(Kernel::AssignmentTraits::DstAlignment)>=int(requestedAlignment), + dstAlignment = packet_traits::AlignedOnScalar ? int(requestedAlignment) + : int(Kernel::AssignmentTraits::DstAlignment), + srcAlignment = Kernel::AssignmentTraits::JointAlignment + }; + const Index alignedStart = dstIsAligned ? 0 : internal::first_aligned(kernel.dstDataPtr(), size); + const Index alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize; + + unaligned_dense_assignment_loop::run(kernel, 0, alignedStart); + + for(Index index = alignedStart; index < alignedEnd; index += packetSize) + kernel.template assignPacket(index); + + unaligned_dense_assignment_loop<>::run(kernel, alignedEnd, size); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::PacketType PacketType; + + enum { size = DstXprType::SizeAtCompileTime, + packetSize =unpacket_traits::size, + alignedSize = (size/packetSize)*packetSize }; + + copy_using_evaluator_innervec_CompleteUnrolling::run(kernel); + copy_using_evaluator_DefaultTraversal_CompleteUnrolling::run(kernel); + } +}; + +/************************** +*** Inner vectorization *** +**************************/ + +template +struct dense_assignment_loop +{ + typedef typename Kernel::PacketType PacketType; + enum { + SrcAlignment = Kernel::AssignmentTraits::SrcAlignment, + DstAlignment = Kernel::AssignmentTraits::DstAlignment + }; + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + const Index innerSize = kernel.innerSize(); + const Index outerSize = kernel.outerSize(); + const Index packetSize = unpacket_traits::size; + for(Index outer = 0; outer < outerSize; ++outer) + for(Index inner = 0; inner < innerSize; inner+=packetSize) + kernel.template assignPacketByOuterInner(outer, inner); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + copy_using_evaluator_innervec_CompleteUnrolling::run(kernel); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::AssignmentTraits Traits; + const Index outerSize = kernel.outerSize(); + for(Index outer = 0; outer < outerSize; ++outer) + copy_using_evaluator_innervec_InnerUnrolling::run(kernel, outer); + } +}; + +/*********************** +*** Linear traversal *** +***********************/ + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + const Index size = kernel.size(); + for(Index i = 0; i < size; ++i) + kernel.assignCoeff(i); + } +}; + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + copy_using_evaluator_LinearTraversal_CompleteUnrolling::run(kernel); + } +}; + +/************************** +*** Slice vectorization *** +***************************/ + +template +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::Scalar Scalar; + typedef typename Kernel::PacketType PacketType; + enum { + packetSize = unpacket_traits::size, + requestedAlignment = int(Kernel::AssignmentTraits::InnerRequiredAlignment), + alignable = packet_traits::AlignedOnScalar || int(Kernel::AssignmentTraits::DstAlignment)>=sizeof(Scalar), + dstIsAligned = int(Kernel::AssignmentTraits::DstAlignment)>=int(requestedAlignment), + dstAlignment = alignable ? int(requestedAlignment) + : int(Kernel::AssignmentTraits::DstAlignment) + }; + const Scalar *dst_ptr = kernel.dstDataPtr(); + if((!bool(dstIsAligned)) && (UIntPtr(dst_ptr) % sizeof(Scalar))>0) + { + // the pointer is not aligend-on scalar, so alignment is not possible + return dense_assignment_loop::run(kernel); + } + const Index packetAlignedMask = packetSize - 1; + const Index innerSize = kernel.innerSize(); + const Index outerSize = kernel.outerSize(); + const Index alignedStep = alignable ? (packetSize - kernel.outerStride() % packetSize) & packetAlignedMask : 0; + Index alignedStart = ((!alignable) || bool(dstIsAligned)) ? 0 : internal::first_aligned(dst_ptr, innerSize); + + for(Index outer = 0; outer < outerSize; ++outer) + { + const Index alignedEnd = alignedStart + ((innerSize-alignedStart) & ~packetAlignedMask); + // do the non-vectorizable part of the assignment + for(Index inner = 0; inner(outer, inner); + + // do the non-vectorizable part of the assignment + for(Index inner = alignedEnd; inner +struct dense_assignment_loop +{ + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) + { + typedef typename Kernel::DstEvaluatorType::XprType DstXprType; + typedef typename Kernel::PacketType PacketType; + + enum { size = DstXprType::InnerSizeAtCompileTime, + packetSize =unpacket_traits::size, + vectorizableSize = (size/packetSize)*packetSize }; + + for(Index outer = 0; outer < kernel.outerSize(); ++outer) + { + copy_using_evaluator_innervec_InnerUnrolling::run(kernel, outer); + copy_using_evaluator_DefaultTraversal_InnerUnrolling::run(kernel, outer); + } + } +}; +#endif + + +/*************************************************************************** +* Part 4 : Generic dense assignment kernel +***************************************************************************/ + +// This class generalize the assignment of a coefficient (or packet) from one dense evaluator +// to another dense writable evaluator. +// It is parametrized by the two evaluators, and the actual assignment functor. +// This abstraction level permits to keep the evaluation loops as simple and as generic as possible. +// One can customize the assignment using this generic dense_assignment_kernel with different +// functors, or by completely overloading it, by-passing a functor. +template +class generic_dense_assignment_kernel +{ +protected: + typedef typename DstEvaluatorTypeT::XprType DstXprType; + typedef typename SrcEvaluatorTypeT::XprType SrcXprType; +public: + + typedef DstEvaluatorTypeT DstEvaluatorType; + typedef SrcEvaluatorTypeT SrcEvaluatorType; + typedef typename DstEvaluatorType::Scalar Scalar; + typedef copy_using_evaluator_traits AssignmentTraits; + typedef typename AssignmentTraits::PacketType PacketType; + + + EIGEN_DEVICE_FUNC generic_dense_assignment_kernel(DstEvaluatorType &dst, const SrcEvaluatorType &src, const Functor &func, DstXprType& dstExpr) + : m_dst(dst), m_src(src), m_functor(func), m_dstExpr(dstExpr) + { + #ifdef EIGEN_DEBUG_ASSIGN + AssignmentTraits::debug(); + #endif + } + + EIGEN_DEVICE_FUNC Index size() const { return m_dstExpr.size(); } + EIGEN_DEVICE_FUNC Index innerSize() const { return m_dstExpr.innerSize(); } + EIGEN_DEVICE_FUNC Index outerSize() const { return m_dstExpr.outerSize(); } + EIGEN_DEVICE_FUNC Index rows() const { return m_dstExpr.rows(); } + EIGEN_DEVICE_FUNC Index cols() const { return m_dstExpr.cols(); } + EIGEN_DEVICE_FUNC Index outerStride() const { return m_dstExpr.outerStride(); } + + EIGEN_DEVICE_FUNC DstEvaluatorType& dstEvaluator() { return m_dst; } + EIGEN_DEVICE_FUNC const SrcEvaluatorType& srcEvaluator() const { return m_src; } + + /// Assign src(row,col) to dst(row,col) through the assignment functor. + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index row, Index col) + { + m_functor.assignCoeff(m_dst.coeffRef(row,col), m_src.coeff(row,col)); + } + + /// \sa assignCoeff(Index,Index) + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index index) + { + m_functor.assignCoeff(m_dst.coeffRef(index), m_src.coeff(index)); + } + + /// \sa assignCoeff(Index,Index) + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeffByOuterInner(Index outer, Index inner) + { + Index row = rowIndexByOuterInner(outer, inner); + Index col = colIndexByOuterInner(outer, inner); + assignCoeff(row, col); + } + + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacket(Index row, Index col) + { + m_functor.template assignPacket(&m_dst.coeffRef(row,col), m_src.template packet(row,col)); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacket(Index index) + { + m_functor.template assignPacket(&m_dst.coeffRef(index), m_src.template packet(index)); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacketByOuterInner(Index outer, Index inner) + { + Index row = rowIndexByOuterInner(outer, inner); + Index col = colIndexByOuterInner(outer, inner); + assignPacket(row, col); + } + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) + { + typedef typename DstEvaluatorType::ExpressionTraits Traits; + return int(Traits::RowsAtCompileTime) == 1 ? 0 + : int(Traits::ColsAtCompileTime) == 1 ? inner + : int(DstEvaluatorType::Flags)&RowMajorBit ? outer + : inner; + } + + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) + { + typedef typename DstEvaluatorType::ExpressionTraits Traits; + return int(Traits::ColsAtCompileTime) == 1 ? 0 + : int(Traits::RowsAtCompileTime) == 1 ? inner + : int(DstEvaluatorType::Flags)&RowMajorBit ? inner + : outer; + } + + EIGEN_DEVICE_FUNC const Scalar* dstDataPtr() const + { + return m_dstExpr.data(); + } + +protected: + DstEvaluatorType& m_dst; + const SrcEvaluatorType& m_src; + const Functor &m_functor; + // TODO find a way to avoid the needs of the original expression + DstXprType& m_dstExpr; +}; + +/*************************************************************************** +* Part 5 : Entry point for dense rectangular assignment +***************************************************************************/ + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void resize_if_allowed(DstXprType &dst, const SrcXprType& src, const Functor &/*func*/) +{ + EIGEN_ONLY_USED_FOR_DEBUG(dst); + EIGEN_ONLY_USED_FOR_DEBUG(src); + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void resize_if_allowed(DstXprType &dst, const SrcXprType& src, const internal::assign_op &/*func*/) +{ + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if(((dst.rows()!=dstRows) || (dst.cols()!=dstCols))) + dst.resize(dstRows, dstCols); + eigen_assert(dst.rows() == dstRows && dst.cols() == dstCols); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src, const Functor &func) +{ + typedef evaluator DstEvaluatorType; + typedef evaluator SrcEvaluatorType; + + SrcEvaluatorType srcEvaluator(src); + + // NOTE To properly handle A = (A*A.transpose())/s with A rectangular, + // we need to resize the destination after the source evaluator has been created. + resize_if_allowed(dst, src, func); + + DstEvaluatorType dstEvaluator(dst); + + typedef generic_dense_assignment_kernel Kernel; + Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived()); + + dense_assignment_loop::run(kernel); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src) +{ + call_dense_assignment_loop(dst, src, internal::assign_op()); +} + +/*************************************************************************** +* Part 6 : Generic assignment +***************************************************************************/ + +// Based on the respective shapes of the destination and source, +// the class AssignmentKind determine the kind of assignment mechanism. +// AssignmentKind must define a Kind typedef. +template struct AssignmentKind; + +// Assignement kind defined in this file: +struct Dense2Dense {}; +struct EigenBase2EigenBase {}; + +template struct AssignmentKind { typedef EigenBase2EigenBase Kind; }; +template<> struct AssignmentKind { typedef Dense2Dense Kind; }; + +// This is the main assignment class +template< typename DstXprType, typename SrcXprType, typename Functor, + typename Kind = typename AssignmentKind< typename evaluator_traits::Shape , typename evaluator_traits::Shape >::Kind, + typename EnableIf = void> +struct Assignment; + + +// The only purpose of this call_assignment() function is to deal with noalias() / "assume-aliasing" and automatic transposition. +// Indeed, I (Gael) think that this concept of "assume-aliasing" was a mistake, and it makes thing quite complicated. +// So this intermediate function removes everything related to "assume-aliasing" such that Assignment +// does not has to bother about these annoying details. + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment(Dst& dst, const Src& src) +{ + call_assignment(dst, src, internal::assign_op()); +} +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment(const Dst& dst, const Src& src) +{ + call_assignment(dst, src, internal::assign_op()); +} + +// Deal with "assume-aliasing" +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment(Dst& dst, const Src& src, const Func& func, typename enable_if< evaluator_assume_aliasing::value, void*>::type = 0) +{ + typename plain_matrix_type::type tmp(src); + call_assignment_no_alias(dst, tmp, func); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment(Dst& dst, const Src& src, const Func& func, typename enable_if::value, void*>::type = 0) +{ + call_assignment_no_alias(dst, src, func); +} + +// by-pass "assume-aliasing" +// When there is no aliasing, we require that 'dst' has been properly resized +template class StorageBase, typename Src, typename Func> +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment(NoAlias& dst, const Src& src, const Func& func) +{ + call_assignment_no_alias(dst.expression(), src, func); +} + + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment_no_alias(Dst& dst, const Src& src, const Func& func) +{ + enum { + NeedToTranspose = ( (int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) + || (int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1) + ) && int(Dst::SizeAtCompileTime) != 1 + }; + + typedef typename internal::conditional, Dst>::type ActualDstTypeCleaned; + typedef typename internal::conditional, Dst&>::type ActualDstType; + ActualDstType actualDst(dst); + + // TODO check whether this is the right place to perform these checks: + EIGEN_STATIC_ASSERT_LVALUE(Dst) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned,Src) + EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar); + + Assignment::run(actualDst, src, func); +} +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment_no_alias(Dst& dst, const Src& src) +{ + call_assignment_no_alias(dst, src, internal::assign_op()); +} + +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src, const Func& func) +{ + // TODO check whether this is the right place to perform these checks: + EIGEN_STATIC_ASSERT_LVALUE(Dst) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst,Src) + EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename Dst::Scalar,typename Src::Scalar); + + Assignment::run(dst, src, func); +} +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE +void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src) +{ + call_assignment_no_alias_no_transpose(dst, src, internal::assign_op()); +} + +// forward declaration +template void check_for_aliasing(const Dst &dst, const Src &src); + +// Generic Dense to Dense assignment +// Note that the last template argument "Weak" is needed to make it possible to perform +// both partial specialization+SFINAE without ambiguous specialization +template< typename DstXprType, typename SrcXprType, typename Functor, typename Weak> +struct Assignment +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const Functor &func) + { +#ifndef EIGEN_NO_DEBUG + internal::check_for_aliasing(dst, src); +#endif + + call_dense_assignment_loop(dst, src, func); + } +}; + +// Generic assignment through evalTo. +// TODO: not sure we have to keep that one, but it helps porting current code to new evaluator mechanism. +// Note that the last template argument "Weak" is needed to make it possible to perform +// both partial specialization+SFINAE without ambiguous specialization +template< typename DstXprType, typename SrcXprType, typename Functor, typename Weak> +struct Assignment +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &/*func*/) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + src.evalTo(dst); + } + + // NOTE The following two functions are templated to avoid their instanciation if not needed + // This is needed because some expressions supports evalTo only and/or have 'void' as scalar type. + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op &/*func*/) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + src.addTo(dst); + } + + template + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op &/*func*/) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + src.subTo(dst); + } +}; + +} // namespace internal + +} // end namespace Eigen + +#endif // EIGEN_ASSIGN_EVALUATOR_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Assign_MKL.h b/SudoDEM2D/lib/Eigen/src/Core/Assign_MKL.h new file mode 100755 index 0000000..6866095 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Assign_MKL.h @@ -0,0 +1,178 @@ +/* + Copyright (c) 2011, Intel Corporation. All rights reserved. + Copyright (C) 2015 Gael Guennebaud + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ******************************************************************************** + * Content : Eigen bindings to Intel(R) MKL + * MKL VML support for coefficient-wise unary Eigen expressions like a=b.sin() + ******************************************************************************** +*/ + +#ifndef EIGEN_ASSIGN_VML_H +#define EIGEN_ASSIGN_VML_H + +namespace Eigen { + +namespace internal { + +template +class vml_assign_traits +{ + private: + enum { + DstHasDirectAccess = Dst::Flags & DirectAccessBit, + SrcHasDirectAccess = Src::Flags & DirectAccessBit, + StorageOrdersAgree = (int(Dst::IsRowMajor) == int(Src::IsRowMajor)), + InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime) + : int(Dst::Flags)&RowMajorBit ? int(Dst::ColsAtCompileTime) + : int(Dst::RowsAtCompileTime), + InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime) + : int(Dst::Flags)&RowMajorBit ? int(Dst::MaxColsAtCompileTime) + : int(Dst::MaxRowsAtCompileTime), + MaxSizeAtCompileTime = Dst::SizeAtCompileTime, + + MightEnableVml = StorageOrdersAgree && DstHasDirectAccess && SrcHasDirectAccess && Src::InnerStrideAtCompileTime==1 && Dst::InnerStrideAtCompileTime==1, + MightLinearize = MightEnableVml && (int(Dst::Flags) & int(Src::Flags) & LinearAccessBit), + VmlSize = MightLinearize ? MaxSizeAtCompileTime : InnerMaxSize, + LargeEnough = VmlSize==Dynamic || VmlSize>=EIGEN_MKL_VML_THRESHOLD + }; + public: + enum { + EnableVml = MightEnableVml && LargeEnough, + Traversal = MightLinearize ? LinearTraversal : DefaultTraversal + }; +}; + +#define EIGEN_PP_EXPAND(ARG) ARG +#if !defined (EIGEN_FAST_MATH) || (EIGEN_FAST_MATH != 1) +#define EIGEN_VMLMODE_EXPAND_LA , VML_HA +#else +#define EIGEN_VMLMODE_EXPAND_LA , VML_LA +#endif + +#define EIGEN_VMLMODE_EXPAND__ + +#define EIGEN_VMLMODE_PREFIX_LA vm +#define EIGEN_VMLMODE_PREFIX__ v +#define EIGEN_VMLMODE_PREFIX(VMLMODE) EIGEN_CAT(EIGEN_VMLMODE_PREFIX_,VMLMODE) + +#define EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \ + template< typename DstXprType, typename SrcXprNested> \ + struct Assignment, SrcXprNested>, assign_op, \ + Dense2Dense, typename enable_if::EnableVml>::type> { \ + typedef CwiseUnaryOp, SrcXprNested> SrcXprType; \ + static void run(DstXprType &dst, const SrcXprType &src, const assign_op &func) { \ + resize_if_allowed(dst, src, func); \ + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \ + if(vml_assign_traits::Traversal==LinearTraversal) { \ + VMLOP(dst.size(), (const VMLTYPE*)src.nestedExpression().data(), \ + (VMLTYPE*)dst.data() EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_##VMLMODE) ); \ + } else { \ + const Index outerSize = dst.outerSize(); \ + for(Index outer = 0; outer < outerSize; ++outer) { \ + const EIGENTYPE *src_ptr = src.IsRowMajor ? &(src.nestedExpression().coeffRef(outer,0)) : \ + &(src.nestedExpression().coeffRef(0, outer)); \ + EIGENTYPE *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); \ + VMLOP( dst.innerSize(), (const VMLTYPE*)src_ptr, \ + (VMLTYPE*)dst_ptr EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_##VMLMODE)); \ + } \ + } \ + } \ + }; \ + + +#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),s##VMLOP), float, float, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),d##VMLOP), double, double, VMLMODE) + +#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),c##VMLOP), scomplex, MKL_Complex8, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, EIGEN_CAT(EIGEN_VMLMODE_PREFIX(VMLMODE),z##VMLOP), dcomplex, MKL_Complex16, VMLMODE) + +#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS(EIGENOP, VMLOP, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP, VMLMODE) \ + EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(EIGENOP, VMLOP, VMLMODE) + + +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sin, Sin, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(asin, Asin, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sinh, Sinh, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(cos, Cos, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(acos, Acos, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(cosh, Cosh, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(tan, Tan, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(atan, Atan, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(tanh, Tanh, LA) +// EIGEN_MKL_VML_DECLARE_UNARY_CALLS(abs, Abs, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(exp, Exp, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(log, Ln, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(log10, Log10, LA) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS(sqrt, Sqrt, _) + +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(square, Sqr, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_CPLX(arg, Arg, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(round, Round, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(floor, Floor, _) +EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(ceil, Ceil, _) + +#define EIGEN_MKL_VML_DECLARE_POW_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE, VMLMODE) \ + template< typename DstXprType, typename SrcXprNested, typename Plain> \ + struct Assignment, SrcXprNested, \ + const CwiseNullaryOp,Plain> >, assign_op, \ + Dense2Dense, typename enable_if::EnableVml>::type> { \ + typedef CwiseBinaryOp, SrcXprNested, \ + const CwiseNullaryOp,Plain> > SrcXprType; \ + static void run(DstXprType &dst, const SrcXprType &src, const assign_op &func) { \ + resize_if_allowed(dst, src, func); \ + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \ + VMLTYPE exponent = reinterpret_cast(src.rhs().functor().m_other); \ + if(vml_assign_traits::Traversal==LinearTraversal) \ + { \ + VMLOP( dst.size(), (const VMLTYPE*)src.lhs().data(), exponent, \ + (VMLTYPE*)dst.data() EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_##VMLMODE) ); \ + } else { \ + const Index outerSize = dst.outerSize(); \ + for(Index outer = 0; outer < outerSize; ++outer) { \ + const EIGENTYPE *src_ptr = src.IsRowMajor ? &(src.lhs().coeffRef(outer,0)) : \ + &(src.lhs().coeffRef(0, outer)); \ + EIGENTYPE *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); \ + VMLOP( dst.innerSize(), (const VMLTYPE*)src_ptr, exponent, \ + (VMLTYPE*)dst_ptr EIGEN_PP_EXPAND(EIGEN_VMLMODE_EXPAND_##VMLMODE)); \ + } \ + } \ + } \ + }; + +EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmsPowx, float, float, LA) +EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmdPowx, double, double, LA) +EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmcPowx, scomplex, MKL_Complex8, LA) +EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmzPowx, dcomplex, MKL_Complex16, LA) + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_ASSIGN_VML_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/BandMatrix.h b/SudoDEM2D/lib/Eigen/src/Core/BandMatrix.h new file mode 100644 index 0000000..4978c91 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/BandMatrix.h @@ -0,0 +1,353 @@ +// 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 EIGEN_BANDMATRIX_H +#define EIGEN_BANDMATRIX_H + +namespace Eigen { + +namespace internal { + +template +class BandMatrixBase : public EigenBase +{ + public: + + enum { + Flags = internal::traits::Flags, + CoeffReadCost = internal::traits::CoeffReadCost, + RowsAtCompileTime = internal::traits::RowsAtCompileTime, + ColsAtCompileTime = internal::traits::ColsAtCompileTime, + MaxRowsAtCompileTime = internal::traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = internal::traits::MaxColsAtCompileTime, + Supers = internal::traits::Supers, + Subs = internal::traits::Subs, + Options = internal::traits::Options + }; + typedef typename internal::traits::Scalar Scalar; + typedef Matrix DenseMatrixType; + typedef typename DenseMatrixType::StorageIndex StorageIndex; + typedef typename internal::traits::CoefficientsType CoefficientsType; + typedef EigenBase Base; + + protected: + enum { + DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) + ? 1 + Supers + Subs + : Dynamic, + SizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime,ColsAtCompileTime) + }; + + public: + + using Base::derived; + using Base::rows; + using Base::cols; + + /** \returns the number of super diagonals */ + inline Index supers() const { return derived().supers(); } + + /** \returns the number of sub diagonals */ + inline Index subs() const { return derived().subs(); } + + /** \returns an expression of the underlying coefficient matrix */ + inline const CoefficientsType& coeffs() const { return derived().coeffs(); } + + /** \returns an expression of the underlying coefficient matrix */ + inline CoefficientsType& coeffs() { return derived().coeffs(); } + + /** \returns a vector expression of the \a i -th column, + * only the meaningful part is returned. + * \warning the internal storage must be column major. */ + inline Block col(Index i) + { + EIGEN_STATIC_ASSERT((Options&RowMajor)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); + Index start = 0; + Index len = coeffs().rows(); + if (i<=supers()) + { + start = supers()-i; + len = (std::min)(rows(),std::max(0,coeffs().rows() - (supers()-i))); + } + else if (i>=rows()-subs()) + len = std::max(0,coeffs().rows() - (i + 1 - rows() + subs())); + return Block(coeffs(), start, i, len, 1); + } + + /** \returns a vector expression of the main diagonal */ + inline Block diagonal() + { return Block(coeffs(),supers(),0,1,(std::min)(rows(),cols())); } + + /** \returns a vector expression of the main diagonal (const version) */ + inline const Block diagonal() const + { return Block(coeffs(),supers(),0,1,(std::min)(rows(),cols())); } + + template struct DiagonalIntReturnType { + enum { + ReturnOpposite = (Options&SelfAdjoint) && (((Index)>0 && Supers==0) || ((Index)<0 && Subs==0)), + Conjugate = ReturnOpposite && NumTraits::IsComplex, + ActualIndex = ReturnOpposite ? -Index : Index, + DiagonalSize = (RowsAtCompileTime==Dynamic || ColsAtCompileTime==Dynamic) + ? Dynamic + : (ActualIndex<0 + ? EIGEN_SIZE_MIN_PREFER_DYNAMIC(ColsAtCompileTime, RowsAtCompileTime + ActualIndex) + : EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime, ColsAtCompileTime - ActualIndex)) + }; + typedef Block BuildType; + typedef typename internal::conditional,BuildType >, + BuildType>::type Type; + }; + + /** \returns a vector expression of the \a N -th sub or super diagonal */ + template inline typename DiagonalIntReturnType::Type diagonal() + { + return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, (std::max)(0,N), 1, diagonalLength(N)); + } + + /** \returns a vector expression of the \a N -th sub or super diagonal */ + template inline const typename DiagonalIntReturnType::Type diagonal() const + { + return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, (std::max)(0,N), 1, diagonalLength(N)); + } + + /** \returns a vector expression of the \a i -th sub or super diagonal */ + inline Block diagonal(Index i) + { + eigen_assert((i<0 && -i<=subs()) || (i>=0 && i<=supers())); + return Block(coeffs(), supers()-i, std::max(0,i), 1, diagonalLength(i)); + } + + /** \returns a vector expression of the \a i -th sub or super diagonal */ + inline const Block diagonal(Index i) const + { + eigen_assert((i<0 && -i<=subs()) || (i>=0 && i<=supers())); + return Block(coeffs(), supers()-i, std::max(0,i), 1, diagonalLength(i)); + } + + template inline void evalTo(Dest& dst) const + { + dst.resize(rows(),cols()); + dst.setZero(); + dst.diagonal() = diagonal(); + for (Index i=1; i<=supers();++i) + dst.diagonal(i) = diagonal(i); + for (Index i=1; i<=subs();++i) + dst.diagonal(-i) = diagonal(-i); + } + + DenseMatrixType toDenseMatrix() const + { + DenseMatrixType res(rows(),cols()); + evalTo(res); + return res; + } + + protected: + + inline Index diagonalLength(Index i) const + { return i<0 ? (std::min)(cols(),rows()+i) : (std::min)(rows(),cols()-i); } +}; + +/** + * \class BandMatrix + * \ingroup Core_Module + * + * \brief Represents a rectangular matrix with a banded storage + * + * \tparam _Scalar Numeric type, i.e. float, double, int + * \tparam _Rows Number of rows, or \b Dynamic + * \tparam _Cols Number of columns, or \b Dynamic + * \tparam _Supers Number of super diagonal + * \tparam _Subs Number of sub diagonal + * \tparam _Options A combination of either \b #RowMajor or \b #ColMajor, and of \b #SelfAdjoint + * The former controls \ref TopicStorageOrders "storage order", and defaults to + * column-major. The latter controls whether the matrix represents a selfadjoint + * matrix in which case either Supers of Subs have to be null. + * + * \sa class TridiagonalMatrix + */ + +template +struct traits > +{ + typedef _Scalar Scalar; + typedef Dense StorageKind; + typedef Eigen::Index StorageIndex; + enum { + CoeffReadCost = NumTraits::ReadCost, + RowsAtCompileTime = _Rows, + ColsAtCompileTime = _Cols, + MaxRowsAtCompileTime = _Rows, + MaxColsAtCompileTime = _Cols, + Flags = LvalueBit, + Supers = _Supers, + Subs = _Subs, + Options = _Options, + DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) ? 1 + Supers + Subs : Dynamic + }; + typedef Matrix CoefficientsType; +}; + +template +class BandMatrix : public BandMatrixBase > +{ + public: + + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::traits::StorageIndex StorageIndex; + typedef typename internal::traits::CoefficientsType CoefficientsType; + + explicit inline BandMatrix(Index rows=Rows, Index cols=Cols, Index supers=Supers, Index subs=Subs) + : m_coeffs(1+supers+subs,cols), + m_rows(rows), m_supers(supers), m_subs(subs) + { + } + + /** \returns the number of columns */ + inline Index rows() const { return m_rows.value(); } + + /** \returns the number of rows */ + inline Index cols() const { return m_coeffs.cols(); } + + /** \returns the number of super diagonals */ + inline Index supers() const { return m_supers.value(); } + + /** \returns the number of sub diagonals */ + inline Index subs() const { return m_subs.value(); } + + inline const CoefficientsType& coeffs() const { return m_coeffs; } + inline CoefficientsType& coeffs() { return m_coeffs; } + + protected: + + CoefficientsType m_coeffs; + internal::variable_if_dynamic m_rows; + internal::variable_if_dynamic m_supers; + internal::variable_if_dynamic m_subs; +}; + +template +class BandMatrixWrapper; + +template +struct traits > +{ + typedef typename _CoefficientsType::Scalar Scalar; + typedef typename _CoefficientsType::StorageKind StorageKind; + typedef typename _CoefficientsType::StorageIndex StorageIndex; + enum { + CoeffReadCost = internal::traits<_CoefficientsType>::CoeffReadCost, + RowsAtCompileTime = _Rows, + ColsAtCompileTime = _Cols, + MaxRowsAtCompileTime = _Rows, + MaxColsAtCompileTime = _Cols, + Flags = LvalueBit, + Supers = _Supers, + Subs = _Subs, + Options = _Options, + DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) ? 1 + Supers + Subs : Dynamic + }; + typedef _CoefficientsType CoefficientsType; +}; + +template +class BandMatrixWrapper : public BandMatrixBase > +{ + public: + + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::traits::CoefficientsType CoefficientsType; + typedef typename internal::traits::StorageIndex StorageIndex; + + explicit inline BandMatrixWrapper(const CoefficientsType& coeffs, Index rows=_Rows, Index cols=_Cols, Index supers=_Supers, Index subs=_Subs) + : m_coeffs(coeffs), + m_rows(rows), m_supers(supers), m_subs(subs) + { + EIGEN_UNUSED_VARIABLE(cols); + //internal::assert(coeffs.cols()==cols() && (supers()+subs()+1)==coeffs.rows()); + } + + /** \returns the number of columns */ + inline Index rows() const { return m_rows.value(); } + + /** \returns the number of rows */ + inline Index cols() const { return m_coeffs.cols(); } + + /** \returns the number of super diagonals */ + inline Index supers() const { return m_supers.value(); } + + /** \returns the number of sub diagonals */ + inline Index subs() const { return m_subs.value(); } + + inline const CoefficientsType& coeffs() const { return m_coeffs; } + + protected: + + const CoefficientsType& m_coeffs; + internal::variable_if_dynamic m_rows; + internal::variable_if_dynamic m_supers; + internal::variable_if_dynamic m_subs; +}; + +/** + * \class TridiagonalMatrix + * \ingroup Core_Module + * + * \brief Represents a tridiagonal matrix with a compact banded storage + * + * \tparam Scalar Numeric type, i.e. float, double, int + * \tparam Size Number of rows and cols, or \b Dynamic + * \tparam Options Can be 0 or \b SelfAdjoint + * + * \sa class BandMatrix + */ +template +class TridiagonalMatrix : public BandMatrix +{ + typedef BandMatrix Base; + typedef typename Base::StorageIndex StorageIndex; + public: + explicit TridiagonalMatrix(Index size = Size) : Base(size,size,Options&SelfAdjoint?0:1,1) {} + + inline typename Base::template DiagonalIntReturnType<1>::Type super() + { return Base::template diagonal<1>(); } + inline const typename Base::template DiagonalIntReturnType<1>::Type super() const + { return Base::template diagonal<1>(); } + inline typename Base::template DiagonalIntReturnType<-1>::Type sub() + { return Base::template diagonal<-1>(); } + inline const typename Base::template DiagonalIntReturnType<-1>::Type sub() const + { return Base::template diagonal<-1>(); } + protected: +}; + + +struct BandShape {}; + +template +struct evaluator_traits > + : public evaluator_traits_base > +{ + typedef BandShape Shape; +}; + +template +struct evaluator_traits > + : public evaluator_traits_base > +{ + typedef BandShape Shape; +}; + +template<> struct AssignmentKind { typedef EigenBase2EigenBase Kind; }; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_BANDMATRIX_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Block.h b/SudoDEM2D/lib/Eigen/src/Core/Block.h new file mode 100644 index 0000000..11de45c --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Block.h @@ -0,0 +1,452 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2010 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_BLOCK_H +#define EIGEN_BLOCK_H + +namespace Eigen { + +namespace internal { +template +struct traits > : traits +{ + typedef typename traits::Scalar Scalar; + typedef typename traits::StorageKind StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename ref_selector::type XprTypeNested; + typedef typename remove_reference::type _XprTypeNested; + enum{ + MatrixRows = traits::RowsAtCompileTime, + MatrixCols = traits::ColsAtCompileTime, + RowsAtCompileTime = MatrixRows == 0 ? 0 : BlockRows, + ColsAtCompileTime = MatrixCols == 0 ? 0 : BlockCols, + MaxRowsAtCompileTime = BlockRows==0 ? 0 + : RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime) + : int(traits::MaxRowsAtCompileTime), + MaxColsAtCompileTime = BlockCols==0 ? 0 + : ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime) + : int(traits::MaxColsAtCompileTime), + + XprTypeIsRowMajor = (int(traits::Flags)&RowMajorBit) != 0, + IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1 + : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0 + : XprTypeIsRowMajor, + HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor), + InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime), + InnerStrideAtCompileTime = HasSameStorageOrderAsXprType + ? int(inner_stride_at_compile_time::ret) + : int(outer_stride_at_compile_time::ret), + OuterStrideAtCompileTime = HasSameStorageOrderAsXprType + ? int(outer_stride_at_compile_time::ret) + : int(inner_stride_at_compile_time::ret), + + // FIXME, this traits is rather specialized for dense object and it needs to be cleaned further + FlagsLvalueBit = is_lvalue::value ? LvalueBit : 0, + FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0, + Flags = (traits::Flags & (DirectAccessBit | (InnerPanel?CompressedAccessBit:0))) | FlagsLvalueBit | FlagsRowMajorBit, + // FIXME DirectAccessBit should not be handled by expressions + // + // Alignment is needed by MapBase's assertions + // We can sefely set it to false here. Internal alignment errors will be detected by an eigen_internal_assert in the respective evaluator + Alignment = 0 + }; +}; + +template::ret> class BlockImpl_dense; + +} // end namespace internal + +template class BlockImpl; + +/** \class Block + * \ingroup Core_Module + * + * \brief Expression of a fixed-size or dynamic-size block + * + * \tparam XprType the type of the expression in which we are taking a block + * \tparam BlockRows the number of rows of the block we are taking at compile time (optional) + * \tparam BlockCols the number of columns of the block we are taking at compile time (optional) + * \tparam InnerPanel is true, if the block maps to a set of rows of a row major matrix or + * to set of columns of a column major matrix (optional). The parameter allows to determine + * at compile time whether aligned access is possible on the block expression. + * + * This class represents an expression of either a fixed-size or dynamic-size block. It is the return + * type of DenseBase::block(Index,Index,Index,Index) and DenseBase::block(Index,Index) and + * most of the time this is the only way it is used. + * + * However, if you want to directly maniputate block expressions, + * for instance if you want to write a function returning such an expression, you + * will need to use this class. + * + * Here is an example illustrating the dynamic case: + * \include class_Block.cpp + * Output: \verbinclude class_Block.out + * + * \note Even though this expression has dynamic size, in the case where \a XprType + * has fixed size, this expression inherits a fixed maximal size which means that evaluating + * it does not cause a dynamic memory allocation. + * + * Here is an example illustrating the fixed-size case: + * \include class_FixedBlock.cpp + * Output: \verbinclude class_FixedBlock.out + * + * \sa DenseBase::block(Index,Index,Index,Index), DenseBase::block(Index,Index), class VectorBlock + */ +template class Block + : public BlockImpl::StorageKind> +{ + typedef BlockImpl::StorageKind> Impl; + public: + //typedef typename Impl::Base Base; + typedef Impl Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(Block) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block) + + typedef typename internal::remove_all::type NestedExpression; + + /** Column or Row constructor + */ + EIGEN_DEVICE_FUNC + inline Block(XprType& xpr, Index i) : Impl(xpr,i) + { + eigen_assert( (i>=0) && ( + ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i= 0 && BlockRows >= 0 && startRow + BlockRows <= xpr.rows() + && startCol >= 0 && BlockCols >= 0 && startCol + BlockCols <= xpr.cols()); + } + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC + inline Block(XprType& xpr, + Index startRow, Index startCol, + Index blockRows, Index blockCols) + : Impl(xpr, startRow, startCol, blockRows, blockCols) + { + eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows) + && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols)); + eigen_assert(startRow >= 0 && blockRows >= 0 && startRow <= xpr.rows() - blockRows + && startCol >= 0 && blockCols >= 0 && startCol <= xpr.cols() - blockCols); + } +}; + +// The generic default implementation for dense block simplu forward to the internal::BlockImpl_dense +// that must be specialized for direct and non-direct access... +template +class BlockImpl + : public internal::BlockImpl_dense +{ + typedef internal::BlockImpl_dense Impl; + typedef typename XprType::StorageIndex StorageIndex; + public: + typedef Impl Base; + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl) + EIGEN_DEVICE_FUNC inline BlockImpl(XprType& xpr, Index i) : Impl(xpr,i) {} + EIGEN_DEVICE_FUNC inline BlockImpl(XprType& xpr, Index startRow, Index startCol) : Impl(xpr, startRow, startCol) {} + EIGEN_DEVICE_FUNC + inline BlockImpl(XprType& xpr, Index startRow, Index startCol, Index blockRows, Index blockCols) + : Impl(xpr, startRow, startCol, blockRows, blockCols) {} +}; + +namespace internal { + +/** \internal Internal implementation of dense Blocks in the general case. */ +template class BlockImpl_dense + : public internal::dense_xpr_base >::type +{ + typedef Block BlockType; + typedef typename internal::ref_selector::non_const_type XprTypeNested; + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(BlockType) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense) + + // class InnerIterator; // FIXME apparently never used + + /** Column or Row constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, Index i) + : m_xpr(xpr), + // It is a row if and only if BlockRows==1 and BlockCols==XprType::ColsAtCompileTime, + // and it is a column if and only if BlockRows==XprType::RowsAtCompileTime and BlockCols==1, + // all other cases are invalid. + // The case a 1x1 matrix seems ambiguous, but the result is the same anyway. + m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0), + m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0), + m_blockRows(BlockRows==1 ? 1 : xpr.rows()), + m_blockCols(BlockCols==1 ? 1 : xpr.cols()) + {} + + /** Fixed-size constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, Index startRow, Index startCol) + : m_xpr(xpr), m_startRow(startRow), m_startCol(startCol), + m_blockRows(BlockRows), m_blockCols(BlockCols) + {} + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, + Index startRow, Index startCol, + Index blockRows, Index blockCols) + : m_xpr(xpr), m_startRow(startRow), m_startCol(startCol), + m_blockRows(blockRows), m_blockCols(blockCols) + {} + + EIGEN_DEVICE_FUNC inline Index rows() const { return m_blockRows.value(); } + EIGEN_DEVICE_FUNC inline Index cols() const { return m_blockCols.value(); } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index rowId, Index colId) + { + EIGEN_STATIC_ASSERT_LVALUE(XprType) + return m_xpr.coeffRef(rowId + m_startRow.value(), colId + m_startCol.value()); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + return m_xpr.derived().coeffRef(rowId + m_startRow.value(), colId + m_startCol.value()); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const + { + return m_xpr.coeff(rowId + m_startRow.value(), colId + m_startCol.value()); + } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index index) + { + EIGEN_STATIC_ASSERT_LVALUE(XprType) + return m_xpr.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + return m_xpr.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); + } + + EIGEN_DEVICE_FUNC + inline const CoeffReturnType coeff(Index index) const + { + return m_xpr.coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); + } + + template + inline PacketScalar packet(Index rowId, Index colId) const + { + return m_xpr.template packet(rowId + m_startRow.value(), colId + m_startCol.value()); + } + + template + inline void writePacket(Index rowId, Index colId, const PacketScalar& val) + { + m_xpr.template writePacket(rowId + m_startRow.value(), colId + m_startCol.value(), val); + } + + template + inline PacketScalar packet(Index index) const + { + return m_xpr.template packet + (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); + } + + template + inline void writePacket(Index index, const PacketScalar& val) + { + m_xpr.template writePacket + (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), + m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0), val); + } + + #ifdef EIGEN_PARSED_BY_DOXYGEN + /** \sa MapBase::data() */ + EIGEN_DEVICE_FUNC inline const Scalar* data() const; + EIGEN_DEVICE_FUNC inline Index innerStride() const; + EIGEN_DEVICE_FUNC inline Index outerStride() const; + #endif + + EIGEN_DEVICE_FUNC + const typename internal::remove_all::type& nestedExpression() const + { + return m_xpr; + } + + EIGEN_DEVICE_FUNC + XprType& nestedExpression() { return m_xpr; } + + EIGEN_DEVICE_FUNC + StorageIndex startRow() const + { + return m_startRow.value(); + } + + EIGEN_DEVICE_FUNC + StorageIndex startCol() const + { + return m_startCol.value(); + } + + protected: + + XprTypeNested m_xpr; + const internal::variable_if_dynamic m_startRow; + const internal::variable_if_dynamic m_startCol; + const internal::variable_if_dynamic m_blockRows; + const internal::variable_if_dynamic m_blockCols; +}; + +/** \internal Internal implementation of dense Blocks in the direct access case.*/ +template +class BlockImpl_dense + : public MapBase > +{ + typedef Block BlockType; + typedef typename internal::ref_selector::non_const_type XprTypeNested; + enum { + XprTypeIsRowMajor = (int(traits::Flags)&RowMajorBit) != 0 + }; + public: + + typedef MapBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(BlockType) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense) + + /** Column or Row constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, Index i) + : Base(xpr.data() + i * ( ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && (!XprTypeIsRowMajor)) + || ((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && ( XprTypeIsRowMajor)) ? xpr.innerStride() : xpr.outerStride()), + BlockRows==1 ? 1 : xpr.rows(), + BlockCols==1 ? 1 : xpr.cols()), + m_xpr(xpr), + m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0), + m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0) + { + init(); + } + + /** Fixed-size constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, Index startRow, Index startCol) + : Base(xpr.data()+xpr.innerStride()*(XprTypeIsRowMajor?startCol:startRow) + xpr.outerStride()*(XprTypeIsRowMajor?startRow:startCol)), + m_xpr(xpr), m_startRow(startRow), m_startCol(startCol) + { + init(); + } + + /** Dynamic-size constructor + */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, + Index startRow, Index startCol, + Index blockRows, Index blockCols) + : Base(xpr.data()+xpr.innerStride()*(XprTypeIsRowMajor?startCol:startRow) + xpr.outerStride()*(XprTypeIsRowMajor?startRow:startCol), blockRows, blockCols), + m_xpr(xpr), m_startRow(startRow), m_startCol(startCol) + { + init(); + } + + EIGEN_DEVICE_FUNC + const typename internal::remove_all::type& nestedExpression() const + { + return m_xpr; + } + + EIGEN_DEVICE_FUNC + XprType& nestedExpression() { return m_xpr; } + + /** \sa MapBase::innerStride() */ + EIGEN_DEVICE_FUNC + inline Index innerStride() const + { + return internal::traits::HasSameStorageOrderAsXprType + ? m_xpr.innerStride() + : m_xpr.outerStride(); + } + + /** \sa MapBase::outerStride() */ + EIGEN_DEVICE_FUNC + inline Index outerStride() const + { + return m_outerStride; + } + + EIGEN_DEVICE_FUNC + StorageIndex startRow() const + { + return m_startRow.value(); + } + + EIGEN_DEVICE_FUNC + StorageIndex startCol() const + { + return m_startCol.value(); + } + + #ifndef __SUNPRO_CC + // FIXME sunstudio is not friendly with the above friend... + // META-FIXME there is no 'friend' keyword around here. Is this obsolete? + protected: + #endif + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal used by allowAligned() */ + EIGEN_DEVICE_FUNC + inline BlockImpl_dense(XprType& xpr, const Scalar* data, Index blockRows, Index blockCols) + : Base(data, blockRows, blockCols), m_xpr(xpr) + { + init(); + } + #endif + + protected: + EIGEN_DEVICE_FUNC + void init() + { + m_outerStride = internal::traits::HasSameStorageOrderAsXprType + ? m_xpr.outerStride() + : m_xpr.innerStride(); + } + + XprTypeNested m_xpr; + const internal::variable_if_dynamic m_startRow; + const internal::variable_if_dynamic m_startCol; + Index m_outerStride; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_BLOCK_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/BooleanRedux.h b/SudoDEM2D/lib/Eigen/src/Core/BooleanRedux.h new file mode 100644 index 0000000..8409d87 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/BooleanRedux.h @@ -0,0 +1,164 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 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_ALLANDANY_H +#define EIGEN_ALLANDANY_H + +namespace Eigen { + +namespace internal { + +template +struct all_unroller +{ + typedef typename Derived::ExpressionTraits Traits; + enum { + col = (UnrollCount-1) / Traits::RowsAtCompileTime, + row = (UnrollCount-1) % Traits::RowsAtCompileTime + }; + + static inline bool run(const Derived &mat) + { + return all_unroller::run(mat) && mat.coeff(row, col); + } +}; + +template +struct all_unroller +{ + static inline bool run(const Derived &/*mat*/) { return true; } +}; + +template +struct all_unroller +{ + static inline bool run(const Derived &) { return false; } +}; + +template +struct any_unroller +{ + typedef typename Derived::ExpressionTraits Traits; + enum { + col = (UnrollCount-1) / Traits::RowsAtCompileTime, + row = (UnrollCount-1) % Traits::RowsAtCompileTime + }; + + static inline bool run(const Derived &mat) + { + return any_unroller::run(mat) || mat.coeff(row, col); + } +}; + +template +struct any_unroller +{ + static inline bool run(const Derived & /*mat*/) { return false; } +}; + +template +struct any_unroller +{ + static inline bool run(const Derived &) { return false; } +}; + +} // end namespace internal + +/** \returns true if all coefficients are true + * + * Example: \include MatrixBase_all.cpp + * Output: \verbinclude MatrixBase_all.out + * + * \sa any(), Cwise::operator<() + */ +template +inline bool DenseBase::all() const +{ + typedef internal::evaluator Evaluator; + enum { + unroll = SizeAtCompileTime != Dynamic + && SizeAtCompileTime * (Evaluator::CoeffReadCost + NumTraits::AddCost) <= EIGEN_UNROLLING_LIMIT + }; + Evaluator evaluator(derived()); + if(unroll) + return internal::all_unroller::run(evaluator); + else + { + for(Index j = 0; j < cols(); ++j) + for(Index i = 0; i < rows(); ++i) + if (!evaluator.coeff(i, j)) return false; + return true; + } +} + +/** \returns true if at least one coefficient is true + * + * \sa all() + */ +template +inline bool DenseBase::any() const +{ + typedef internal::evaluator Evaluator; + enum { + unroll = SizeAtCompileTime != Dynamic + && SizeAtCompileTime * (Evaluator::CoeffReadCost + NumTraits::AddCost) <= EIGEN_UNROLLING_LIMIT + }; + Evaluator evaluator(derived()); + if(unroll) + return internal::any_unroller::run(evaluator); + else + { + for(Index j = 0; j < cols(); ++j) + for(Index i = 0; i < rows(); ++i) + if (evaluator.coeff(i, j)) return true; + return false; + } +} + +/** \returns the number of coefficients which evaluate to true + * + * \sa all(), any() + */ +template +inline Eigen::Index DenseBase::count() const +{ + return derived().template cast().template cast().sum(); +} + +/** \returns true is \c *this contains at least one Not A Number (NaN). + * + * \sa allFinite() + */ +template +inline bool DenseBase::hasNaN() const +{ +#if EIGEN_COMP_MSVC || (defined __FAST_MATH__) + return derived().array().isNaN().any(); +#else + return !((derived().array()==derived().array()).all()); +#endif +} + +/** \returns true if \c *this contains only finite numbers, i.e., no NaN and no +/-INF values. + * + * \sa hasNaN() + */ +template +inline bool DenseBase::allFinite() const +{ +#if EIGEN_COMP_MSVC || (defined __FAST_MATH__) + return derived().array().isFinite().all(); +#else + return !((derived()-derived()).hasNaN()); +#endif +} + +} // end namespace Eigen + +#endif // EIGEN_ALLANDANY_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/CommaInitializer.h b/SudoDEM2D/lib/Eigen/src/Core/CommaInitializer.h new file mode 100644 index 0000000..d218e98 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/CommaInitializer.h @@ -0,0 +1,160 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2008 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_COMMAINITIALIZER_H +#define EIGEN_COMMAINITIALIZER_H + +namespace Eigen { + +/** \class CommaInitializer + * \ingroup Core_Module + * + * \brief Helper class used by the comma initializer operator + * + * This class is internally used to implement the comma initializer feature. It is + * the return type of MatrixBase::operator<<, and most of the time this is the only + * way it is used. + * + * \sa \blank \ref MatrixBaseCommaInitRef "MatrixBase::operator<<", CommaInitializer::finished() + */ +template +struct CommaInitializer +{ + typedef typename XprType::Scalar Scalar; + + EIGEN_DEVICE_FUNC + inline CommaInitializer(XprType& xpr, const Scalar& s) + : m_xpr(xpr), m_row(0), m_col(1), m_currentBlockRows(1) + { + m_xpr.coeffRef(0,0) = s; + } + + template + EIGEN_DEVICE_FUNC + inline CommaInitializer(XprType& xpr, const DenseBase& other) + : m_xpr(xpr), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows()) + { + m_xpr.block(0, 0, other.rows(), other.cols()) = other; + } + + /* Copy/Move constructor which transfers ownership. This is crucial in + * absence of return value optimization to avoid assertions during destruction. */ + // FIXME in C++11 mode this could be replaced by a proper RValue constructor + EIGEN_DEVICE_FUNC + inline CommaInitializer(const CommaInitializer& o) + : m_xpr(o.m_xpr), m_row(o.m_row), m_col(o.m_col), m_currentBlockRows(o.m_currentBlockRows) { + // Mark original object as finished. In absence of R-value references we need to const_cast: + const_cast(o).m_row = m_xpr.rows(); + const_cast(o).m_col = m_xpr.cols(); + const_cast(o).m_currentBlockRows = 0; + } + + /* inserts a scalar value in the target matrix */ + EIGEN_DEVICE_FUNC + CommaInitializer& operator,(const Scalar& s) + { + if (m_col==m_xpr.cols()) + { + m_row+=m_currentBlockRows; + m_col = 0; + m_currentBlockRows = 1; + eigen_assert(m_row + EIGEN_DEVICE_FUNC + CommaInitializer& operator,(const DenseBase& other) + { + if (m_col==m_xpr.cols() && (other.cols()!=0 || other.rows()!=m_currentBlockRows)) + { + m_row+=m_currentBlockRows; + m_col = 0; + m_currentBlockRows = other.rows(); + eigen_assert(m_row+m_currentBlockRows<=m_xpr.rows() + && "Too many rows passed to comma initializer (operator<<)"); + } + eigen_assert((m_col + other.cols() <= m_xpr.cols()) + && "Too many coefficients passed to comma initializer (operator<<)"); + eigen_assert(m_currentBlockRows==other.rows()); + m_xpr.template block + (m_row, m_col, other.rows(), other.cols()) = other; + m_col += other.cols(); + return *this; + } + + EIGEN_DEVICE_FUNC + inline ~CommaInitializer() +#if defined VERIFY_RAISES_ASSERT && (!defined EIGEN_NO_ASSERTION_CHECKING) && defined EIGEN_EXCEPTIONS + EIGEN_EXCEPTION_SPEC(Eigen::eigen_assert_exception) +#endif + { + finished(); + } + + /** \returns the built matrix once all its coefficients have been set. + * Calling finished is 100% optional. Its purpose is to write expressions + * like this: + * \code + * quaternion.fromRotationMatrix((Matrix3f() << axis0, axis1, axis2).finished()); + * \endcode + */ + EIGEN_DEVICE_FUNC + inline XprType& finished() { + eigen_assert(((m_row+m_currentBlockRows) == m_xpr.rows() || m_xpr.cols() == 0) + && m_col == m_xpr.cols() + && "Too few coefficients passed to comma initializer (operator<<)"); + return m_xpr; + } + + XprType& m_xpr; // target expression + Index m_row; // current row id + Index m_col; // current col id + Index m_currentBlockRows; // current block height +}; + +/** \anchor MatrixBaseCommaInitRef + * Convenient operator to set the coefficients of a matrix. + * + * The coefficients must be provided in a row major order and exactly match + * the size of the matrix. Otherwise an assertion is raised. + * + * Example: \include MatrixBase_set.cpp + * Output: \verbinclude MatrixBase_set.out + * + * \note According the c++ standard, the argument expressions of this comma initializer are evaluated in arbitrary order. + * + * \sa CommaInitializer::finished(), class CommaInitializer + */ +template +inline CommaInitializer DenseBase::operator<< (const Scalar& s) +{ + return CommaInitializer(*static_cast(this), s); +} + +/** \sa operator<<(const Scalar&) */ +template +template +inline CommaInitializer +DenseBase::operator<<(const DenseBase& other) +{ + return CommaInitializer(*static_cast(this), other); +} + +} // end namespace Eigen + +#endif // EIGEN_COMMAINITIALIZER_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/ConditionEstimator.h b/SudoDEM2D/lib/Eigen/src/Core/ConditionEstimator.h new file mode 100644 index 0000000..aa7efdc --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/ConditionEstimator.h @@ -0,0 +1,175 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google.com) +// +// 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_CONDITIONESTIMATOR_H +#define EIGEN_CONDITIONESTIMATOR_H + +namespace Eigen { + +namespace internal { + +template +struct rcond_compute_sign { + static inline Vector run(const Vector& v) { + const RealVector v_abs = v.cwiseAbs(); + return (v_abs.array() == static_cast(0)) + .select(Vector::Ones(v.size()), v.cwiseQuotient(v_abs)); + } +}; + +// Partial specialization to avoid elementwise division for real vectors. +template +struct rcond_compute_sign { + static inline Vector run(const Vector& v) { + return (v.array() < static_cast(0)) + .select(-Vector::Ones(v.size()), Vector::Ones(v.size())); + } +}; + +/** + * \returns an estimate of ||inv(matrix)||_1 given a decomposition of + * \a matrix that implements .solve() and .adjoint().solve() methods. + * + * This function implements Algorithms 4.1 and 5.1 from + * http://www.maths.manchester.ac.uk/~higham/narep/narep135.pdf + * which also forms the basis for the condition number estimators in + * LAPACK. Since at most 10 calls to the solve method of dec are + * performed, the total cost is O(dims^2), as opposed to O(dims^3) + * needed to compute the inverse matrix explicitly. + * + * The most common usage is in estimating the condition number + * ||matrix||_1 * ||inv(matrix)||_1. The first term ||matrix||_1 can be + * computed directly in O(n^2) operations. + * + * Supports the following decompositions: FullPivLU, PartialPivLU, LDLT, and + * LLT. + * + * \sa FullPivLU, PartialPivLU, LDLT, LLT. + */ +template +typename Decomposition::RealScalar rcond_invmatrix_L1_norm_estimate(const Decomposition& dec) +{ + typedef typename Decomposition::MatrixType MatrixType; + typedef typename Decomposition::Scalar Scalar; + typedef typename Decomposition::RealScalar RealScalar; + typedef typename internal::plain_col_type::type Vector; + typedef typename internal::plain_col_type::type RealVector; + const bool is_complex = (NumTraits::IsComplex != 0); + + eigen_assert(dec.rows() == dec.cols()); + const Index n = dec.rows(); + if (n == 0) + return 0; + + // Disable Index to float conversion warning +#ifdef __INTEL_COMPILER + #pragma warning push + #pragma warning ( disable : 2259 ) +#endif + Vector v = dec.solve(Vector::Ones(n) / Scalar(n)); +#ifdef __INTEL_COMPILER + #pragma warning pop +#endif + + // lower_bound is a lower bound on + // ||inv(matrix)||_1 = sup_v ||inv(matrix) v||_1 / ||v||_1 + // and is the objective maximized by the ("super-") gradient ascent + // algorithm below. + RealScalar lower_bound = v.template lpNorm<1>(); + if (n == 1) + return lower_bound; + + // Gradient ascent algorithm follows: We know that the optimum is achieved at + // one of the simplices v = e_i, so in each iteration we follow a + // super-gradient to move towards the optimal one. + RealScalar old_lower_bound = lower_bound; + Vector sign_vector(n); + Vector old_sign_vector; + Index v_max_abs_index = -1; + Index old_v_max_abs_index = v_max_abs_index; + for (int k = 0; k < 4; ++k) + { + sign_vector = internal::rcond_compute_sign::run(v); + if (k > 0 && !is_complex && sign_vector == old_sign_vector) { + // Break if the solution stagnated. + break; + } + // v_max_abs_index = argmax |real( inv(matrix)^T * sign_vector )| + v = dec.adjoint().solve(sign_vector); + v.real().cwiseAbs().maxCoeff(&v_max_abs_index); + if (v_max_abs_index == old_v_max_abs_index) { + // Break if the solution stagnated. + break; + } + // Move to the new simplex e_j, where j = v_max_abs_index. + v = dec.solve(Vector::Unit(n, v_max_abs_index)); // v = inv(matrix) * e_j. + lower_bound = v.template lpNorm<1>(); + if (lower_bound <= old_lower_bound) { + // Break if the gradient step did not increase the lower_bound. + break; + } + if (!is_complex) { + old_sign_vector = sign_vector; + } + old_v_max_abs_index = v_max_abs_index; + old_lower_bound = lower_bound; + } + // The following calculates an independent estimate of ||matrix||_1 by + // multiplying matrix by a vector with entries of slowly increasing + // magnitude and alternating sign: + // v_i = (-1)^{i} (1 + (i / (dim-1))), i = 0,...,dim-1. + // This improvement to Hager's algorithm above is due to Higham. It was + // added to make the algorithm more robust in certain corner cases where + // large elements in the matrix might otherwise escape detection due to + // exact cancellation (especially when op and op_adjoint correspond to a + // sequence of backsubstitutions and permutations), which could cause + // Hager's algorithm to vastly underestimate ||matrix||_1. + Scalar alternating_sign(RealScalar(1)); + for (Index i = 0; i < n; ++i) { + // The static_cast is needed when Scalar is a complex and RealScalar implements expression templates + v[i] = alternating_sign * static_cast(RealScalar(1) + (RealScalar(i) / (RealScalar(n - 1)))); + alternating_sign = -alternating_sign; + } + v = dec.solve(v); + const RealScalar alternate_lower_bound = (2 * v.template lpNorm<1>()) / (3 * RealScalar(n)); + return numext::maxi(lower_bound, alternate_lower_bound); +} + +/** \brief Reciprocal condition number estimator. + * + * Computing a decomposition of a dense matrix takes O(n^3) operations, while + * this method estimates the condition number quickly and reliably in O(n^2) + * operations. + * + * \returns an estimate of the reciprocal condition number + * (1 / (||matrix||_1 * ||inv(matrix)||_1)) of matrix, given ||matrix||_1 and + * its decomposition. Supports the following decompositions: FullPivLU, + * PartialPivLU, LDLT, and LLT. + * + * \sa FullPivLU, PartialPivLU, LDLT, LLT. + */ +template +typename Decomposition::RealScalar +rcond_estimate_helper(typename Decomposition::RealScalar matrix_norm, const Decomposition& dec) +{ + typedef typename Decomposition::RealScalar RealScalar; + eigen_assert(dec.rows() == dec.cols()); + if (dec.rows() == 0) return RealScalar(1); + if (matrix_norm == RealScalar(0)) return RealScalar(0); + if (dec.rows() == 1) return RealScalar(1); + const RealScalar inverse_matrix_norm = rcond_invmatrix_L1_norm_estimate(dec); + return (inverse_matrix_norm == RealScalar(0) ? RealScalar(0) + : (RealScalar(1) / inverse_matrix_norm) / matrix_norm); +} + +} // namespace internal + +} // namespace Eigen + +#endif diff --git a/SudoDEM2D/lib/Eigen/src/Core/CoreEvaluators.h b/SudoDEM2D/lib/Eigen/src/Core/CoreEvaluators.h new file mode 100644 index 0000000..910889e --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/CoreEvaluators.h @@ -0,0 +1,1688 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2011 Benoit Jacob +// Copyright (C) 2011-2014 Gael Guennebaud +// Copyright (C) 2011-2012 Jitse Niesen +// +// 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_COREEVALUATORS_H +#define EIGEN_COREEVALUATORS_H + +namespace Eigen { + +namespace internal { + +// This class returns the evaluator kind from the expression storage kind. +// Default assumes index based accessors +template +struct storage_kind_to_evaluator_kind { + typedef IndexBased Kind; +}; + +// This class returns the evaluator shape from the expression storage kind. +// It can be Dense, Sparse, Triangular, Diagonal, SelfAdjoint, Band, etc. +template struct storage_kind_to_shape; + +template<> struct storage_kind_to_shape { typedef DenseShape Shape; }; +template<> struct storage_kind_to_shape { typedef SolverShape Shape; }; +template<> struct storage_kind_to_shape { typedef PermutationShape Shape; }; +template<> struct storage_kind_to_shape { typedef TranspositionsShape Shape; }; + +// Evaluators have to be specialized with respect to various criteria such as: +// - storage/structure/shape +// - scalar type +// - etc. +// Therefore, we need specialization of evaluator providing additional template arguments for each kind of evaluators. +// We currently distinguish the following kind of evaluators: +// - unary_evaluator for expressions taking only one arguments (CwiseUnaryOp, CwiseUnaryView, Transpose, MatrixWrapper, ArrayWrapper, Reverse, Replicate) +// - binary_evaluator for expression taking two arguments (CwiseBinaryOp) +// - ternary_evaluator for expression taking three arguments (CwiseTernaryOp) +// - product_evaluator for linear algebra products (Product); special case of binary_evaluator because it requires additional tags for dispatching. +// - mapbase_evaluator for Map, Block, Ref +// - block_evaluator for Block (special dispatching to a mapbase_evaluator or unary_evaluator) + +template< typename T, + typename Arg1Kind = typename evaluator_traits::Kind, + typename Arg2Kind = typename evaluator_traits::Kind, + typename Arg3Kind = typename evaluator_traits::Kind, + typename Arg1Scalar = typename traits::Scalar, + typename Arg2Scalar = typename traits::Scalar, + typename Arg3Scalar = typename traits::Scalar> struct ternary_evaluator; + +template< typename T, + typename LhsKind = typename evaluator_traits::Kind, + typename RhsKind = typename evaluator_traits::Kind, + typename LhsScalar = typename traits::Scalar, + typename RhsScalar = typename traits::Scalar> struct binary_evaluator; + +template< typename T, + typename Kind = typename evaluator_traits::Kind, + typename Scalar = typename T::Scalar> struct unary_evaluator; + +// evaluator_traits contains traits for evaluator + +template +struct evaluator_traits_base +{ + // by default, get evaluator kind and shape from storage + typedef typename storage_kind_to_evaluator_kind::StorageKind>::Kind Kind; + typedef typename storage_kind_to_shape::StorageKind>::Shape Shape; +}; + +// Default evaluator traits +template +struct evaluator_traits : public evaluator_traits_base +{ +}; + +template::Shape > +struct evaluator_assume_aliasing { + static const bool value = false; +}; + +// By default, we assume a unary expression: +template +struct evaluator : public unary_evaluator +{ + typedef unary_evaluator Base; + EIGEN_DEVICE_FUNC explicit evaluator(const T& xpr) : Base(xpr) {} +}; + + +// TODO: Think about const-correctness +template +struct evaluator + : evaluator +{ + EIGEN_DEVICE_FUNC + explicit evaluator(const T& xpr) : evaluator(xpr) {} +}; + +// ---------- base class for all evaluators ---------- + +template +struct evaluator_base : public noncopyable +{ + // TODO that's not very nice to have to propagate all these traits. They are currently only needed to handle outer,inner indices. + typedef traits ExpressionTraits; + + enum { + Alignment = 0 + }; +}; + +// -------------------- Matrix and Array -------------------- +// +// evaluator is a common base class for the +// Matrix and Array evaluators. +// Here we directly specialize evaluator. This is not really a unary expression, and it is, by definition, dense, +// so no need for more sophisticated dispatching. + +template +struct evaluator > + : evaluator_base +{ + typedef PlainObjectBase PlainObjectType; + typedef typename PlainObjectType::Scalar Scalar; + typedef typename PlainObjectType::CoeffReturnType CoeffReturnType; + + enum { + IsRowMajor = PlainObjectType::IsRowMajor, + IsVectorAtCompileTime = PlainObjectType::IsVectorAtCompileTime, + RowsAtCompileTime = PlainObjectType::RowsAtCompileTime, + ColsAtCompileTime = PlainObjectType::ColsAtCompileTime, + + CoeffReadCost = NumTraits::ReadCost, + Flags = traits::EvaluatorFlags, + Alignment = traits::Alignment + }; + + EIGEN_DEVICE_FUNC evaluator() + : m_data(0), + m_outerStride(IsVectorAtCompileTime ? 0 + : int(IsRowMajor) ? ColsAtCompileTime + : RowsAtCompileTime) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + EIGEN_DEVICE_FUNC explicit evaluator(const PlainObjectType& m) + : m_data(m.data()), m_outerStride(IsVectorAtCompileTime ? 0 : m.outerStride()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + if (IsRowMajor) + return m_data[row * m_outerStride.value() + col]; + else + return m_data[row + col * m_outerStride.value()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_data[index]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + if (IsRowMajor) + return const_cast(m_data)[row * m_outerStride.value() + col]; + else + return const_cast(m_data)[row + col * m_outerStride.value()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return const_cast(m_data)[index]; + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + if (IsRowMajor) + return ploadt(m_data + row * m_outerStride.value() + col); + else + return ploadt(m_data + row + col * m_outerStride.value()); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return ploadt(m_data + index); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + if (IsRowMajor) + return pstoret + (const_cast(m_data) + row * m_outerStride.value() + col, x); + else + return pstoret + (const_cast(m_data) + row + col * m_outerStride.value(), x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + return pstoret(const_cast(m_data) + index, x); + } + +protected: + const Scalar *m_data; + + // We do not need to know the outer stride for vectors + variable_if_dynamic m_outerStride; +}; + +template +struct evaluator > + : evaluator > > +{ + typedef Matrix XprType; + + EIGEN_DEVICE_FUNC evaluator() {} + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& m) + : evaluator >(m) + { } +}; + +template +struct evaluator > + : evaluator > > +{ + typedef Array XprType; + + EIGEN_DEVICE_FUNC evaluator() {} + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& m) + : evaluator >(m) + { } +}; + +// -------------------- Transpose -------------------- + +template +struct unary_evaluator, IndexBased> + : evaluator_base > +{ + typedef Transpose XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + Flags = evaluator::Flags ^ RowMajorBit, + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& t) : m_argImpl(t.nestedExpression()) {} + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_argImpl.coeff(col, row); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_argImpl.coeff(index); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_argImpl.coeffRef(col, row); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + typename XprType::Scalar& coeffRef(Index index) + { + return m_argImpl.coeffRef(index); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_argImpl.template packet(col, row); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_argImpl.template packet(index); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + m_argImpl.template writePacket(col, row, x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + m_argImpl.template writePacket(index, x); + } + +protected: + evaluator m_argImpl; +}; + +// -------------------- CwiseNullaryOp -------------------- +// Like Matrix and Array, this is not really a unary expression, so we directly specialize evaluator. +// Likewise, there is not need to more sophisticated dispatching here. + +template::value, + bool has_unary = has_unary_operator::value, + bool has_binary = has_binary_operator::value> +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const { return op(i,j); } + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const { return op(i); } + + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j) const { return op.template packetOp(i,j); } + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i) const { return op.template packetOp(i); } +}; + +template +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType=0, IndexType=0) const { return op(); } + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType=0, IndexType=0) const { return op.template packetOp(); } +}; + +template +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j=0) const { return op(i,j); } + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j=0) const { return op.template packetOp(i,j); } +}; + +// We need the following specialization for vector-only functors assigned to a runtime vector, +// for instance, using linspace and assigning a RowVectorXd to a MatrixXd or even a row of a MatrixXd. +// In this case, i==0 and j is used for the actual iteration. +template +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const { + eigen_assert(i==0 || j==0); + return op(i+j); + } + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j) const { + eigen_assert(i==0 || j==0); + return op.template packetOp(i+j); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const { return op(i); } + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i) const { return op.template packetOp(i); } +}; + +template +struct nullary_wrapper {}; + +#if 0 && EIGEN_COMP_MSVC>0 +// Disable this ugly workaround. This is now handled in traits::match, +// but this piece of code might still become handly if some other weird compilation +// erros pop up again. + +// MSVC exhibits a weird compilation error when +// compiling: +// Eigen::MatrixXf A = MatrixXf::Random(3,3); +// Ref R = 2.f*A; +// and that has_*ary_operator> have not been instantiated yet. +// The "problem" is that evaluator<2.f*A> is instantiated by traits::match<2.f*A> +// and at that time has_*ary_operator returns true regardless of T. +// Then nullary_wrapper is badly instantiated as nullary_wrapper<.,.,true,true,true>. +// The trick is thus to defer the proper instantiation of nullary_wrapper when coeff(), +// and packet() are really instantiated as implemented below: + +// This is a simple wrapper around Index to enforce the re-instantiation of +// has_*ary_operator when needed. +template struct nullary_wrapper_workaround_msvc { + nullary_wrapper_workaround_msvc(const T&); + operator T()const; +}; + +template +struct nullary_wrapper +{ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const { + return nullary_wrapper >::value, + has_unary_operator >::value, + has_binary_operator >::value>().operator()(op,i,j); + } + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const { + return nullary_wrapper >::value, + has_unary_operator >::value, + has_binary_operator >::value>().operator()(op,i); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j) const { + return nullary_wrapper >::value, + has_unary_operator >::value, + has_binary_operator >::value>().template packetOp(op,i,j); + } + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i) const { + return nullary_wrapper >::value, + has_unary_operator >::value, + has_binary_operator >::value>().template packetOp(op,i); + } +}; +#endif // MSVC workaround + +template +struct evaluator > + : evaluator_base > +{ + typedef CwiseNullaryOp XprType; + typedef typename internal::remove_all::type PlainObjectTypeCleaned; + + enum { + CoeffReadCost = internal::functor_traits::Cost, + + Flags = (evaluator::Flags + & ( HereditaryBits + | (functor_has_linear_access::ret ? LinearAccessBit : 0) + | (functor_traits::PacketAccess ? PacketAccessBit : 0))) + | (functor_traits::IsRepeatable ? 0 : EvalBeforeNestingBit), + Alignment = AlignedMax + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& n) + : m_functor(n.functor()), m_wrapper() + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(IndexType row, IndexType col) const + { + return m_wrapper(m_functor, row, col); + } + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(IndexType index) const + { + return m_wrapper(m_functor,index); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(IndexType row, IndexType col) const + { + return m_wrapper.template packetOp(m_functor, row, col); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(IndexType index) const + { + return m_wrapper.template packetOp(m_functor, index); + } + +protected: + const NullaryOp m_functor; + const internal::nullary_wrapper m_wrapper; +}; + +// -------------------- CwiseUnaryOp -------------------- + +template +struct unary_evaluator, IndexBased > + : evaluator_base > +{ + typedef CwiseUnaryOp XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost + functor_traits::Cost, + + Flags = evaluator::Flags + & (HereditaryBits | LinearAccessBit | (functor_traits::PacketAccess ? PacketAccessBit : 0)), + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit unary_evaluator(const XprType& op) + : m_functor(op.functor()), + m_argImpl(op.nestedExpression()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_functor(m_argImpl.coeff(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_functor(m_argImpl.coeff(index)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_functor.packetOp(m_argImpl.template packet(row, col)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_functor.packetOp(m_argImpl.template packet(index)); + } + +protected: + const UnaryOp m_functor; + evaluator m_argImpl; +}; + +// -------------------- CwiseTernaryOp -------------------- + +// this is a ternary expression +template +struct evaluator > + : public ternary_evaluator > +{ + typedef CwiseTernaryOp XprType; + typedef ternary_evaluator > Base; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {} +}; + +template +struct ternary_evaluator, IndexBased, IndexBased> + : evaluator_base > +{ + typedef CwiseTernaryOp XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost + evaluator::CoeffReadCost + evaluator::CoeffReadCost + functor_traits::Cost, + + Arg1Flags = evaluator::Flags, + Arg2Flags = evaluator::Flags, + Arg3Flags = evaluator::Flags, + SameType = is_same::value && is_same::value, + StorageOrdersAgree = (int(Arg1Flags)&RowMajorBit)==(int(Arg2Flags)&RowMajorBit) && (int(Arg1Flags)&RowMajorBit)==(int(Arg3Flags)&RowMajorBit), + Flags0 = (int(Arg1Flags) | int(Arg2Flags) | int(Arg3Flags)) & ( + HereditaryBits + | (int(Arg1Flags) & int(Arg2Flags) & int(Arg3Flags) & + ( (StorageOrdersAgree ? LinearAccessBit : 0) + | (functor_traits::PacketAccess && StorageOrdersAgree && SameType ? PacketAccessBit : 0) + ) + ) + ), + Flags = (Flags0 & ~RowMajorBit) | (Arg1Flags & RowMajorBit), + Alignment = EIGEN_PLAIN_ENUM_MIN( + EIGEN_PLAIN_ENUM_MIN(evaluator::Alignment, evaluator::Alignment), + evaluator::Alignment) + }; + + EIGEN_DEVICE_FUNC explicit ternary_evaluator(const XprType& xpr) + : m_functor(xpr.functor()), + m_arg1Impl(xpr.arg1()), + m_arg2Impl(xpr.arg2()), + m_arg3Impl(xpr.arg3()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_functor(m_arg1Impl.coeff(row, col), m_arg2Impl.coeff(row, col), m_arg3Impl.coeff(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_functor(m_arg1Impl.coeff(index), m_arg2Impl.coeff(index), m_arg3Impl.coeff(index)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_functor.packetOp(m_arg1Impl.template packet(row, col), + m_arg2Impl.template packet(row, col), + m_arg3Impl.template packet(row, col)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_functor.packetOp(m_arg1Impl.template packet(index), + m_arg2Impl.template packet(index), + m_arg3Impl.template packet(index)); + } + +protected: + const TernaryOp m_functor; + evaluator m_arg1Impl; + evaluator m_arg2Impl; + evaluator m_arg3Impl; +}; + +// -------------------- CwiseBinaryOp -------------------- + +// this is a binary expression +template +struct evaluator > + : public binary_evaluator > +{ + typedef CwiseBinaryOp XprType; + typedef binary_evaluator > Base; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {} +}; + +template +struct binary_evaluator, IndexBased, IndexBased> + : evaluator_base > +{ + typedef CwiseBinaryOp XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost + evaluator::CoeffReadCost + functor_traits::Cost, + + LhsFlags = evaluator::Flags, + RhsFlags = evaluator::Flags, + SameType = is_same::value, + StorageOrdersAgree = (int(LhsFlags)&RowMajorBit)==(int(RhsFlags)&RowMajorBit), + Flags0 = (int(LhsFlags) | int(RhsFlags)) & ( + HereditaryBits + | (int(LhsFlags) & int(RhsFlags) & + ( (StorageOrdersAgree ? LinearAccessBit : 0) + | (functor_traits::PacketAccess && StorageOrdersAgree && SameType ? PacketAccessBit : 0) + ) + ) + ), + Flags = (Flags0 & ~RowMajorBit) | (LhsFlags & RowMajorBit), + Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator::Alignment,evaluator::Alignment) + }; + + EIGEN_DEVICE_FUNC explicit binary_evaluator(const XprType& xpr) + : m_functor(xpr.functor()), + m_lhsImpl(xpr.lhs()), + m_rhsImpl(xpr.rhs()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_functor(m_lhsImpl.coeff(row, col), m_rhsImpl.coeff(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_functor(m_lhsImpl.coeff(index), m_rhsImpl.coeff(index)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_functor.packetOp(m_lhsImpl.template packet(row, col), + m_rhsImpl.template packet(row, col)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_functor.packetOp(m_lhsImpl.template packet(index), + m_rhsImpl.template packet(index)); + } + +protected: + const BinaryOp m_functor; + evaluator m_lhsImpl; + evaluator m_rhsImpl; +}; + +// -------------------- CwiseUnaryView -------------------- + +template +struct unary_evaluator, IndexBased> + : evaluator_base > +{ + typedef CwiseUnaryView XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost + functor_traits::Cost, + + Flags = (evaluator::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit)), + + Alignment = 0 // FIXME it is not very clear why alignment is necessarily lost... + }; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& op) + : m_unaryOp(op.functor()), + m_argImpl(op.nestedExpression()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_unaryOp(m_argImpl.coeff(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_unaryOp(m_argImpl.coeff(index)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_unaryOp(m_argImpl.coeffRef(row, col)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_unaryOp(m_argImpl.coeffRef(index)); + } + +protected: + const UnaryOp m_unaryOp; + evaluator m_argImpl; +}; + +// -------------------- Map -------------------- + +// FIXME perhaps the PlainObjectType could be provided by Derived::PlainObject ? +// but that might complicate template specialization +template +struct mapbase_evaluator; + +template +struct mapbase_evaluator : evaluator_base +{ + typedef Derived XprType; + typedef typename XprType::PointerType PointerType; + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + enum { + IsRowMajor = XprType::RowsAtCompileTime, + ColsAtCompileTime = XprType::ColsAtCompileTime, + CoeffReadCost = NumTraits::ReadCost + }; + + EIGEN_DEVICE_FUNC explicit mapbase_evaluator(const XprType& map) + : m_data(const_cast(map.data())), + m_innerStride(map.innerStride()), + m_outerStride(map.outerStride()) + { + EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(evaluator::Flags&PacketAccessBit, internal::inner_stride_at_compile_time::ret==1), + PACKET_ACCESS_REQUIRES_TO_HAVE_INNER_STRIDE_FIXED_TO_1); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_data[col * colStride() + row * rowStride()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_data[index * m_innerStride.value()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_data[col * colStride() + row * rowStride()]; + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_data[index * m_innerStride.value()]; + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + PointerType ptr = m_data + row * rowStride() + col * colStride(); + return internal::ploadt(ptr); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return internal::ploadt(m_data + index * m_innerStride.value()); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + PointerType ptr = m_data + row * rowStride() + col * colStride(); + return internal::pstoret(ptr, x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + internal::pstoret(m_data + index * m_innerStride.value(), x); + } +protected: + EIGEN_DEVICE_FUNC + inline Index rowStride() const { return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value(); } + EIGEN_DEVICE_FUNC + inline Index colStride() const { return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value(); } + + PointerType m_data; + const internal::variable_if_dynamic m_innerStride; + const internal::variable_if_dynamic m_outerStride; +}; + +template +struct evaluator > + : public mapbase_evaluator, PlainObjectType> +{ + typedef Map XprType; + typedef typename XprType::Scalar Scalar; + // TODO: should check for smaller packet types once we can handle multi-sized packet types + typedef typename packet_traits::type PacketScalar; + + enum { + InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0 + ? int(PlainObjectType::InnerStrideAtCompileTime) + : int(StrideType::InnerStrideAtCompileTime), + OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0 + ? int(PlainObjectType::OuterStrideAtCompileTime) + : int(StrideType::OuterStrideAtCompileTime), + HasNoInnerStride = InnerStrideAtCompileTime == 1, + HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0, + HasNoStride = HasNoInnerStride && HasNoOuterStride, + IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic, + + PacketAccessMask = bool(HasNoInnerStride) ? ~int(0) : ~int(PacketAccessBit), + LinearAccessMask = bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime) ? ~int(0) : ~int(LinearAccessBit), + Flags = int( evaluator::Flags) & (LinearAccessMask&PacketAccessMask), + + Alignment = int(MapOptions)&int(AlignedMask) + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& map) + : mapbase_evaluator(map) + { } +}; + +// -------------------- Ref -------------------- + +template +struct evaluator > + : public mapbase_evaluator, PlainObjectType> +{ + typedef Ref XprType; + + enum { + Flags = evaluator >::Flags, + Alignment = evaluator >::Alignment + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& ref) + : mapbase_evaluator(ref) + { } +}; + +// -------------------- Block -------------------- + +template::ret> struct block_evaluator; + +template +struct evaluator > + : block_evaluator +{ + typedef Block XprType; + typedef typename XprType::Scalar Scalar; + // TODO: should check for smaller packet types once we can handle multi-sized packet types + typedef typename packet_traits::type PacketScalar; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + + RowsAtCompileTime = traits::RowsAtCompileTime, + ColsAtCompileTime = traits::ColsAtCompileTime, + MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = traits::MaxColsAtCompileTime, + + ArgTypeIsRowMajor = (int(evaluator::Flags)&RowMajorBit) != 0, + IsRowMajor = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? 1 + : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0 + : ArgTypeIsRowMajor, + HasSameStorageOrderAsArgType = (IsRowMajor == ArgTypeIsRowMajor), + InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime), + InnerStrideAtCompileTime = HasSameStorageOrderAsArgType + ? int(inner_stride_at_compile_time::ret) + : int(outer_stride_at_compile_time::ret), + OuterStrideAtCompileTime = HasSameStorageOrderAsArgType + ? int(outer_stride_at_compile_time::ret) + : int(inner_stride_at_compile_time::ret), + MaskPacketAccessBit = (InnerStrideAtCompileTime == 1 || HasSameStorageOrderAsArgType) ? PacketAccessBit : 0, + + FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1 || (InnerPanel && (evaluator::Flags&LinearAccessBit))) ? LinearAccessBit : 0, + FlagsRowMajorBit = XprType::Flags&RowMajorBit, + Flags0 = evaluator::Flags & ( (HereditaryBits & ~RowMajorBit) | + DirectAccessBit | + MaskPacketAccessBit), + Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit, + + PacketAlignment = unpacket_traits::alignment, + Alignment0 = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) + && (OuterStrideAtCompileTime!=0) + && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % int(PacketAlignment)) == 0)) ? int(PacketAlignment) : 0, + Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator::Alignment, Alignment0) + }; + typedef block_evaluator block_evaluator_type; + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& block) : block_evaluator_type(block) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } +}; + +// no direct-access => dispatch to a unary evaluator +template +struct block_evaluator + : unary_evaluator > +{ + typedef Block XprType; + + EIGEN_DEVICE_FUNC explicit block_evaluator(const XprType& block) + : unary_evaluator(block) + {} +}; + +template +struct unary_evaluator, IndexBased> + : evaluator_base > +{ + typedef Block XprType; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& block) + : m_argImpl(block.nestedExpression()), + m_startRow(block.startRow()), + m_startCol(block.startCol()), + m_linear_offset(InnerPanel?(XprType::IsRowMajor ? block.startRow()*block.cols() : block.startCol()*block.rows()):0) + { } + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + enum { + RowsAtCompileTime = XprType::RowsAtCompileTime, + ForwardLinearAccess = InnerPanel && bool(evaluator::Flags&LinearAccessBit) + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_argImpl.coeff(m_startRow.value() + row, m_startCol.value() + col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + if (ForwardLinearAccess) + return m_argImpl.coeff(m_linear_offset.value() + index); + else + return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_argImpl.coeffRef(m_startRow.value() + row, m_startCol.value() + col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + if (ForwardLinearAccess) + return m_argImpl.coeffRef(m_linear_offset.value() + index); + else + return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_argImpl.template packet(m_startRow.value() + row, m_startCol.value() + col); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + if (ForwardLinearAccess) + return m_argImpl.template packet(m_linear_offset.value() + index); + else + return packet(RowsAtCompileTime == 1 ? 0 : index, + RowsAtCompileTime == 1 ? index : 0); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + return m_argImpl.template writePacket(m_startRow.value() + row, m_startCol.value() + col, x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + if (ForwardLinearAccess) + return m_argImpl.template writePacket(m_linear_offset.value() + index, x); + else + return writePacket(RowsAtCompileTime == 1 ? 0 : index, + RowsAtCompileTime == 1 ? index : 0, + x); + } + +protected: + evaluator m_argImpl; + const variable_if_dynamic m_startRow; + const variable_if_dynamic m_startCol; + const variable_if_dynamic m_linear_offset; +}; + +// TODO: This evaluator does not actually use the child evaluator; +// all action is via the data() as returned by the Block expression. + +template +struct block_evaluator + : mapbase_evaluator, + typename Block::PlainObject> +{ + typedef Block XprType; + typedef typename XprType::Scalar Scalar; + + EIGEN_DEVICE_FUNC explicit block_evaluator(const XprType& block) + : mapbase_evaluator(block) + { + // TODO: for the 3.3 release, this should be turned to an internal assertion, but let's keep it as is for the beta lifetime + eigen_assert(((internal::UIntPtr(block.data()) % EIGEN_PLAIN_ENUM_MAX(1,evaluator::Alignment)) == 0) && "data is not aligned"); + } +}; + + +// -------------------- Select -------------------- +// NOTE shall we introduce a ternary_evaluator? + +// TODO enable vectorization for Select +template +struct evaluator > + : evaluator_base > +{ + typedef Select XprType; + enum { + CoeffReadCost = evaluator::CoeffReadCost + + EIGEN_PLAIN_ENUM_MAX(evaluator::CoeffReadCost, + evaluator::CoeffReadCost), + + Flags = (unsigned int)evaluator::Flags & evaluator::Flags & HereditaryBits, + + Alignment = EIGEN_PLAIN_ENUM_MIN(evaluator::Alignment, evaluator::Alignment) + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& select) + : m_conditionImpl(select.conditionMatrix()), + m_thenImpl(select.thenMatrix()), + m_elseImpl(select.elseMatrix()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + if (m_conditionImpl.coeff(row, col)) + return m_thenImpl.coeff(row, col); + else + return m_elseImpl.coeff(row, col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + if (m_conditionImpl.coeff(index)) + return m_thenImpl.coeff(index); + else + return m_elseImpl.coeff(index); + } + +protected: + evaluator m_conditionImpl; + evaluator m_thenImpl; + evaluator m_elseImpl; +}; + + +// -------------------- Replicate -------------------- + +template +struct unary_evaluator > + : evaluator_base > +{ + typedef Replicate XprType; + typedef typename XprType::CoeffReturnType CoeffReturnType; + enum { + Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor + }; + typedef typename internal::nested_eval::type ArgTypeNested; + typedef typename internal::remove_all::type ArgTypeNestedCleaned; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + LinearAccessMask = XprType::IsVectorAtCompileTime ? LinearAccessBit : 0, + Flags = (evaluator::Flags & (HereditaryBits|LinearAccessMask) & ~RowMajorBit) | (traits::Flags & RowMajorBit), + + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& replicate) + : m_arg(replicate.nestedExpression()), + m_argImpl(m_arg), + m_rows(replicate.nestedExpression().rows()), + m_cols(replicate.nestedExpression().cols()) + {} + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + // try to avoid using modulo; this is a pure optimization strategy + const Index actual_row = internal::traits::RowsAtCompileTime==1 ? 0 + : RowFactor==1 ? row + : row % m_rows.value(); + const Index actual_col = internal::traits::ColsAtCompileTime==1 ? 0 + : ColFactor==1 ? col + : col % m_cols.value(); + + return m_argImpl.coeff(actual_row, actual_col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + // try to avoid using modulo; this is a pure optimization strategy + const Index actual_index = internal::traits::RowsAtCompileTime==1 + ? (ColFactor==1 ? index : index%m_cols.value()) + : (RowFactor==1 ? index : index%m_rows.value()); + + return m_argImpl.coeff(actual_index); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + const Index actual_row = internal::traits::RowsAtCompileTime==1 ? 0 + : RowFactor==1 ? row + : row % m_rows.value(); + const Index actual_col = internal::traits::ColsAtCompileTime==1 ? 0 + : ColFactor==1 ? col + : col % m_cols.value(); + + return m_argImpl.template packet(actual_row, actual_col); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + const Index actual_index = internal::traits::RowsAtCompileTime==1 + ? (ColFactor==1 ? index : index%m_cols.value()) + : (RowFactor==1 ? index : index%m_rows.value()); + + return m_argImpl.template packet(actual_index); + } + +protected: + const ArgTypeNested m_arg; + evaluator m_argImpl; + const variable_if_dynamic m_rows; + const variable_if_dynamic m_cols; +}; + + +// -------------------- PartialReduxExpr -------------------- + +template< typename ArgType, typename MemberOp, int Direction> +struct evaluator > + : evaluator_base > +{ + typedef PartialReduxExpr XprType; + typedef typename internal::nested_eval::type ArgTypeNested; + typedef typename internal::remove_all::type ArgTypeNestedCleaned; + typedef typename ArgType::Scalar InputScalar; + typedef typename XprType::Scalar Scalar; + enum { + TraversalSize = Direction==int(Vertical) ? int(ArgType::RowsAtCompileTime) : int(ArgType::ColsAtCompileTime) + }; + typedef typename MemberOp::template Cost CostOpType; + enum { + CoeffReadCost = TraversalSize==Dynamic ? HugeCost + : TraversalSize * evaluator::CoeffReadCost + int(CostOpType::value), + + Flags = (traits::Flags&RowMajorBit) | (evaluator::Flags&(HereditaryBits&(~RowMajorBit))) | LinearAccessBit, + + Alignment = 0 // FIXME this will need to be improved once PartialReduxExpr is vectorized + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType xpr) + : m_arg(xpr.nestedExpression()), m_functor(xpr.functor()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(TraversalSize==Dynamic ? HugeCost : int(CostOpType::value)); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const Scalar coeff(Index i, Index j) const + { + if (Direction==Vertical) + return m_functor(m_arg.col(j)); + else + return m_functor(m_arg.row(i)); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const Scalar coeff(Index index) const + { + if (Direction==Vertical) + return m_functor(m_arg.col(index)); + else + return m_functor(m_arg.row(index)); + } + +protected: + typename internal::add_const_on_value_type::type m_arg; + const MemberOp m_functor; +}; + + +// -------------------- MatrixWrapper and ArrayWrapper -------------------- +// +// evaluator_wrapper_base is a common base class for the +// MatrixWrapper and ArrayWrapper evaluators. + +template +struct evaluator_wrapper_base + : evaluator_base +{ + typedef typename remove_all::type ArgType; + enum { + CoeffReadCost = evaluator::CoeffReadCost, + Flags = evaluator::Flags, + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC explicit evaluator_wrapper_base(const ArgType& arg) : m_argImpl(arg) {} + + typedef typename ArgType::Scalar Scalar; + typedef typename ArgType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_argImpl.coeff(row, col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_argImpl.coeff(index); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_argImpl.coeffRef(row, col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_argImpl.coeffRef(index); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + return m_argImpl.template packet(row, col); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + return m_argImpl.template packet(index); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + m_argImpl.template writePacket(row, col, x); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + m_argImpl.template writePacket(index, x); + } + +protected: + evaluator m_argImpl; +}; + +template +struct unary_evaluator > + : evaluator_wrapper_base > +{ + typedef MatrixWrapper XprType; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& wrapper) + : evaluator_wrapper_base >(wrapper.nestedExpression()) + { } +}; + +template +struct unary_evaluator > + : evaluator_wrapper_base > +{ + typedef ArrayWrapper XprType; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& wrapper) + : evaluator_wrapper_base >(wrapper.nestedExpression()) + { } +}; + + +// -------------------- Reverse -------------------- + +// defined in Reverse.h: +template struct reverse_packet_cond; + +template +struct unary_evaluator > + : evaluator_base > +{ + typedef Reverse XprType; + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + enum { + IsRowMajor = XprType::IsRowMajor, + IsColMajor = !IsRowMajor, + ReverseRow = (Direction == Vertical) || (Direction == BothDirections), + ReverseCol = (Direction == Horizontal) || (Direction == BothDirections), + ReversePacket = (Direction == BothDirections) + || ((Direction == Vertical) && IsColMajor) + || ((Direction == Horizontal) && IsRowMajor), + + CoeffReadCost = evaluator::CoeffReadCost, + + // let's enable LinearAccess only with vectorization because of the product overhead + // FIXME enable DirectAccess with negative strides? + Flags0 = evaluator::Flags, + LinearAccess = ( (Direction==BothDirections) && (int(Flags0)&PacketAccessBit) ) + || ((ReverseRow && XprType::ColsAtCompileTime==1) || (ReverseCol && XprType::RowsAtCompileTime==1)) + ? LinearAccessBit : 0, + + Flags = int(Flags0) & (HereditaryBits | PacketAccessBit | LinearAccess), + + Alignment = 0 // FIXME in some rare cases, Alignment could be preserved, like a Vector4f. + }; + + EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& reverse) + : m_argImpl(reverse.nestedExpression()), + m_rows(ReverseRow ? reverse.nestedExpression().rows() : 1), + m_cols(ReverseCol ? reverse.nestedExpression().cols() : 1) + { } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index col) const + { + return m_argImpl.coeff(ReverseRow ? m_rows.value() - row - 1 : row, + ReverseCol ? m_cols.value() - col - 1 : col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_argImpl.coeff(m_rows.value() * m_cols.value() - index - 1); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index col) + { + return m_argImpl.coeffRef(ReverseRow ? m_rows.value() - row - 1 : row, + ReverseCol ? m_cols.value() - col - 1 : col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_argImpl.coeffRef(m_rows.value() * m_cols.value() - index - 1); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index row, Index col) const + { + enum { + PacketSize = unpacket_traits::size, + OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1, + OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1 + }; + typedef internal::reverse_packet_cond reverse_packet; + return reverse_packet::run(m_argImpl.template packet( + ReverseRow ? m_rows.value() - row - OffsetRow : row, + ReverseCol ? m_cols.value() - col - OffsetCol : col)); + } + + template + EIGEN_STRONG_INLINE + PacketType packet(Index index) const + { + enum { PacketSize = unpacket_traits::size }; + return preverse(m_argImpl.template packet(m_rows.value() * m_cols.value() - index - PacketSize)); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index row, Index col, const PacketType& x) + { + // FIXME we could factorize some code with packet(i,j) + enum { + PacketSize = unpacket_traits::size, + OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1, + OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1 + }; + typedef internal::reverse_packet_cond reverse_packet; + m_argImpl.template writePacket( + ReverseRow ? m_rows.value() - row - OffsetRow : row, + ReverseCol ? m_cols.value() - col - OffsetCol : col, + reverse_packet::run(x)); + } + + template + EIGEN_STRONG_INLINE + void writePacket(Index index, const PacketType& x) + { + enum { PacketSize = unpacket_traits::size }; + m_argImpl.template writePacket + (m_rows.value() * m_cols.value() - index - PacketSize, preverse(x)); + } + +protected: + evaluator m_argImpl; + + // If we do not reverse rows, then we do not need to know the number of rows; same for columns + // Nonetheless, in this case it is important to set to 1 such that the coeff(index) method works fine for vectors. + const variable_if_dynamic m_rows; + const variable_if_dynamic m_cols; +}; + + +// -------------------- Diagonal -------------------- + +template +struct evaluator > + : evaluator_base > +{ + typedef Diagonal XprType; + + enum { + CoeffReadCost = evaluator::CoeffReadCost, + + Flags = (unsigned int)(evaluator::Flags & (HereditaryBits | DirectAccessBit) & ~RowMajorBit) | LinearAccessBit, + + Alignment = 0 + }; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& diagonal) + : m_argImpl(diagonal.nestedExpression()), + m_index(diagonal.index()) + { } + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index row, Index) const + { + return m_argImpl.coeff(row + rowOffset(), row + colOffset()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + CoeffReturnType coeff(Index index) const + { + return m_argImpl.coeff(index + rowOffset(), index + colOffset()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index row, Index) + { + return m_argImpl.coeffRef(row + rowOffset(), row + colOffset()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Scalar& coeffRef(Index index) + { + return m_argImpl.coeffRef(index + rowOffset(), index + colOffset()); + } + +protected: + evaluator m_argImpl; + const internal::variable_if_dynamicindex m_index; + +private: + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowOffset() const { return m_index.value() > 0 ? 0 : -m_index.value(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colOffset() const { return m_index.value() > 0 ? m_index.value() : 0; } +}; + + +//---------------------------------------------------------------------- +// deprecated code +//---------------------------------------------------------------------- + +// -------------------- EvalToTemp -------------------- + +// expression class for evaluating nested expression to a temporary + +template class EvalToTemp; + +template +struct traits > + : public traits +{ }; + +template +class EvalToTemp + : public dense_xpr_base >::type +{ + public: + + typedef typename dense_xpr_base::type Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(EvalToTemp) + + explicit EvalToTemp(const ArgType& arg) + : m_arg(arg) + { } + + const ArgType& arg() const + { + return m_arg; + } + + Index rows() const + { + return m_arg.rows(); + } + + Index cols() const + { + return m_arg.cols(); + } + + private: + const ArgType& m_arg; +}; + +template +struct evaluator > + : public evaluator +{ + typedef EvalToTemp XprType; + typedef typename ArgType::PlainObject PlainObject; + typedef evaluator Base; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) + : m_result(xpr.arg()) + { + ::new (static_cast(this)) Base(m_result); + } + + // This constructor is used when nesting an EvalTo evaluator in another evaluator + EIGEN_DEVICE_FUNC evaluator(const ArgType& arg) + : m_result(arg) + { + ::new (static_cast(this)) Base(m_result); + } + +protected: + PlainObject m_result; +}; + +} // namespace internal + +} // end namespace Eigen + +#endif // EIGEN_COREEVALUATORS_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/CoreIterators.h b/SudoDEM2D/lib/Eigen/src/Core/CoreIterators.h new file mode 100644 index 0000000..4eb42b9 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/CoreIterators.h @@ -0,0 +1,127 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2014 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_COREITERATORS_H +#define EIGEN_COREITERATORS_H + +namespace Eigen { + +/* This file contains the respective InnerIterator definition of the expressions defined in Eigen/Core + */ + +namespace internal { + +template +class inner_iterator_selector; + +} + +/** \class InnerIterator + * \brief An InnerIterator allows to loop over the element of any matrix expression. + * + * \warning To be used with care because an evaluator is constructed every time an InnerIterator iterator is constructed. + * + * TODO: add a usage example + */ +template +class InnerIterator +{ +protected: + typedef internal::inner_iterator_selector::Kind> IteratorType; + typedef internal::evaluator EvaluatorType; + typedef typename internal::traits::Scalar Scalar; +public: + /** Construct an iterator over the \a outerId -th row or column of \a xpr */ + InnerIterator(const XprType &xpr, const Index &outerId) + : m_eval(xpr), m_iter(m_eval, outerId, xpr.innerSize()) + {} + + /// \returns the value of the current coefficient. + EIGEN_STRONG_INLINE Scalar value() const { return m_iter.value(); } + /** Increment the iterator \c *this to the next non-zero coefficient. + * Explicit zeros are not skipped over. To skip explicit zeros, see class SparseView + */ + EIGEN_STRONG_INLINE InnerIterator& operator++() { m_iter.operator++(); return *this; } + /// \returns the column or row index of the current coefficient. + EIGEN_STRONG_INLINE Index index() const { return m_iter.index(); } + /// \returns the row index of the current coefficient. + EIGEN_STRONG_INLINE Index row() const { return m_iter.row(); } + /// \returns the column index of the current coefficient. + EIGEN_STRONG_INLINE Index col() const { return m_iter.col(); } + /// \returns \c true if the iterator \c *this still references a valid coefficient. + EIGEN_STRONG_INLINE operator bool() const { return m_iter; } + +protected: + EvaluatorType m_eval; + IteratorType m_iter; +private: + // If you get here, then you're not using the right InnerIterator type, e.g.: + // SparseMatrix A; + // SparseMatrix::InnerIterator it(A,0); + template InnerIterator(const EigenBase&,Index outer); +}; + +namespace internal { + +// Generic inner iterator implementation for dense objects +template +class inner_iterator_selector +{ +protected: + typedef evaluator EvaluatorType; + typedef typename traits::Scalar Scalar; + enum { IsRowMajor = (XprType::Flags&RowMajorBit)==RowMajorBit }; + +public: + EIGEN_STRONG_INLINE inner_iterator_selector(const EvaluatorType &eval, const Index &outerId, const Index &innerSize) + : m_eval(eval), m_inner(0), m_outer(outerId), m_end(innerSize) + {} + + EIGEN_STRONG_INLINE Scalar value() const + { + return (IsRowMajor) ? m_eval.coeff(m_outer, m_inner) + : m_eval.coeff(m_inner, m_outer); + } + + EIGEN_STRONG_INLINE inner_iterator_selector& operator++() { m_inner++; return *this; } + + EIGEN_STRONG_INLINE Index index() const { return m_inner; } + inline Index row() const { return IsRowMajor ? m_outer : index(); } + inline Index col() const { return IsRowMajor ? index() : m_outer; } + + EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; } + +protected: + const EvaluatorType& m_eval; + Index m_inner; + const Index m_outer; + const Index m_end; +}; + +// For iterator-based evaluator, inner-iterator is already implemented as +// evaluator<>::InnerIterator +template +class inner_iterator_selector + : public evaluator::InnerIterator +{ +protected: + typedef typename evaluator::InnerIterator Base; + typedef evaluator EvaluatorType; + +public: + EIGEN_STRONG_INLINE inner_iterator_selector(const EvaluatorType &eval, const Index &outerId, const Index &/*innerSize*/) + : Base(eval, outerId) + {} +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_COREITERATORS_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/CwiseBinaryOp.h b/SudoDEM2D/lib/Eigen/src/Core/CwiseBinaryOp.h new file mode 100644 index 0000000..a36765e --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/CwiseBinaryOp.h @@ -0,0 +1,184 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2014 Gael Guennebaud +// Copyright (C) 2006-2008 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_CWISE_BINARY_OP_H +#define EIGEN_CWISE_BINARY_OP_H + +namespace Eigen { + +namespace internal { +template +struct traits > +{ + // we must not inherit from traits since it has + // the potential to cause problems with MSVC + typedef typename remove_all::type Ancestor; + typedef typename traits::XprKind XprKind; + enum { + RowsAtCompileTime = traits::RowsAtCompileTime, + ColsAtCompileTime = traits::ColsAtCompileTime, + MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = traits::MaxColsAtCompileTime + }; + + // even though we require Lhs and Rhs to have the same scalar type (see CwiseBinaryOp constructor), + // we still want to handle the case when the result type is different. + typedef typename result_of< + BinaryOp( + const typename Lhs::Scalar&, + const typename Rhs::Scalar& + ) + >::type Scalar; + typedef typename cwise_promote_storage_type::StorageKind, + typename traits::StorageKind, + BinaryOp>::ret StorageKind; + typedef typename promote_index_type::StorageIndex, + typename traits::StorageIndex>::type StorageIndex; + typedef typename Lhs::Nested LhsNested; + typedef typename Rhs::Nested RhsNested; + typedef typename remove_reference::type _LhsNested; + typedef typename remove_reference::type _RhsNested; + enum { + Flags = cwise_promote_storage_order::StorageKind,typename traits::StorageKind,_LhsNested::Flags & RowMajorBit,_RhsNested::Flags & RowMajorBit>::value + }; +}; +} // end namespace internal + +template +class CwiseBinaryOpImpl; + +/** \class CwiseBinaryOp + * \ingroup Core_Module + * + * \brief Generic expression where a coefficient-wise binary operator is applied to two expressions + * + * \tparam BinaryOp template functor implementing the operator + * \tparam LhsType the type of the left-hand side + * \tparam RhsType the type of the right-hand side + * + * This class represents an expression where a coefficient-wise binary operator is applied to two expressions. + * It is the return type of binary operators, by which we mean only those binary operators where + * both the left-hand side and the right-hand side are Eigen expressions. + * For example, the return type of matrix1+matrix2 is a CwiseBinaryOp. + * + * Most of the time, this is the only way that it is used, so you typically don't have to name + * CwiseBinaryOp types explicitly. + * + * \sa MatrixBase::binaryExpr(const MatrixBase &,const CustomBinaryOp &) const, class CwiseUnaryOp, class CwiseNullaryOp + */ +template +class CwiseBinaryOp : + public CwiseBinaryOpImpl< + BinaryOp, LhsType, RhsType, + typename internal::cwise_promote_storage_type::StorageKind, + typename internal::traits::StorageKind, + BinaryOp>::ret>, + internal::no_assignment_operator +{ + public: + + typedef typename internal::remove_all::type Functor; + typedef typename internal::remove_all::type Lhs; + typedef typename internal::remove_all::type Rhs; + + typedef typename CwiseBinaryOpImpl< + BinaryOp, LhsType, RhsType, + typename internal::cwise_promote_storage_type::StorageKind, + typename internal::traits::StorageKind, + BinaryOp>::ret>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseBinaryOp) + + typedef typename internal::ref_selector::type LhsNested; + typedef typename internal::ref_selector::type RhsNested; + typedef typename internal::remove_reference::type _LhsNested; + typedef typename internal::remove_reference::type _RhsNested; + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CwiseBinaryOp(const Lhs& aLhs, const Rhs& aRhs, const BinaryOp& func = BinaryOp()) + : m_lhs(aLhs), m_rhs(aRhs), m_functor(func) + { + EIGEN_CHECK_BINARY_COMPATIBILIY(BinaryOp,typename Lhs::Scalar,typename Rhs::Scalar); + // require the sizes to match + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs) + eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols()); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index rows() const { + // return the fixed size type if available to enable compile time optimizations + if (internal::traits::type>::RowsAtCompileTime==Dynamic) + return m_rhs.rows(); + else + return m_lhs.rows(); + } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index cols() const { + // return the fixed size type if available to enable compile time optimizations + if (internal::traits::type>::ColsAtCompileTime==Dynamic) + return m_rhs.cols(); + else + return m_lhs.cols(); + } + + /** \returns the left hand side nested expression */ + EIGEN_DEVICE_FUNC + const _LhsNested& lhs() const { return m_lhs; } + /** \returns the right hand side nested expression */ + EIGEN_DEVICE_FUNC + const _RhsNested& rhs() const { return m_rhs; } + /** \returns the functor representing the binary operation */ + EIGEN_DEVICE_FUNC + const BinaryOp& functor() const { return m_functor; } + + protected: + LhsNested m_lhs; + RhsNested m_rhs; + const BinaryOp m_functor; +}; + +// Generic API dispatcher +template +class CwiseBinaryOpImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; +}; + +/** replaces \c *this by \c *this - \a other. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_STRONG_INLINE Derived & +MatrixBase::operator-=(const MatrixBase &other) +{ + call_assignment(derived(), other.derived(), internal::sub_assign_op()); + return derived(); +} + +/** replaces \c *this by \c *this + \a other. + * + * \returns a reference to \c *this + */ +template +template +EIGEN_STRONG_INLINE Derived & +MatrixBase::operator+=(const MatrixBase& other) +{ + call_assignment(derived(), other.derived(), internal::add_assign_op()); + return derived(); +} + +} // end namespace Eigen + +#endif // EIGEN_CWISE_BINARY_OP_H + diff --git a/SudoDEM2D/lib/Eigen/src/Core/CwiseNullaryOp.h b/SudoDEM2D/lib/Eigen/src/Core/CwiseNullaryOp.h new file mode 100644 index 0000000..ddd607e --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/CwiseNullaryOp.h @@ -0,0 +1,866 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2010 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_CWISE_NULLARY_OP_H +#define EIGEN_CWISE_NULLARY_OP_H + +namespace Eigen { + +namespace internal { +template +struct traits > : traits +{ + enum { + Flags = traits::Flags & RowMajorBit + }; +}; + +} // namespace internal + +/** \class CwiseNullaryOp + * \ingroup Core_Module + * + * \brief Generic expression of a matrix where all coefficients are defined by a functor + * + * \tparam NullaryOp template functor implementing the operator + * \tparam PlainObjectType the underlying plain matrix/array type + * + * This class represents an expression of a generic nullary operator. + * It is the return type of the Ones(), Zero(), Constant(), Identity() and Random() methods, + * and most of the time this is the only way it is used. + * + * However, if you want to write a function returning such an expression, you + * will need to use this class. + * + * The functor NullaryOp must expose one of the following method: + + + + +
\c operator()() if the procedural generation does not depend on the coefficient entries (e.g., random numbers)
\c operator()(Index i)if the procedural generation makes sense for vectors only and that it depends on the coefficient index \c i (e.g., linspace)
\c operator()(Index i,Index j)if the procedural generation depends on the matrix coordinates \c i, \c j (e.g., to generate a checkerboard with 0 and 1)
+ * It is also possible to expose the last two operators if the generation makes sense for matrices but can be optimized for vectors. + * + * See DenseBase::NullaryExpr(Index,const CustomNullaryOp&) for an example binding + * C++11 random number generators. + * + * A nullary expression can also be used to implement custom sophisticated matrix manipulations + * that cannot be covered by the existing set of natively supported matrix manipulations. + * See this \ref TopicCustomizing_NullaryExpr "page" for some examples and additional explanations + * on the behavior of CwiseNullaryOp. + * + * \sa class CwiseUnaryOp, class CwiseBinaryOp, DenseBase::NullaryExpr + */ +template +class CwiseNullaryOp : public internal::dense_xpr_base< CwiseNullaryOp >::type, internal::no_assignment_operator +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(CwiseNullaryOp) + + EIGEN_DEVICE_FUNC + CwiseNullaryOp(Index rows, Index cols, const NullaryOp& func = NullaryOp()) + : m_rows(rows), m_cols(cols), m_functor(func) + { + eigen_assert(rows >= 0 + && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) + && cols >= 0 + && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols)); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index rows() const { return m_rows.value(); } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index cols() const { return m_cols.value(); } + + /** \returns the functor representing the nullary operation */ + EIGEN_DEVICE_FUNC + const NullaryOp& functor() const { return m_functor; } + + protected: + const internal::variable_if_dynamic m_rows; + const internal::variable_if_dynamic m_cols; + const NullaryOp m_functor; +}; + + +/** \returns an expression of a matrix defined by a custom functor \a func + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used + * instead. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp::PlainObject> +DenseBase::NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func) +{ + return CwiseNullaryOp(rows, cols, func); +} + +/** \returns an expression of a matrix defined by a custom functor \a func + * + * The parameter \a size is the size of the returned vector. + * Must be compatible with this MatrixBase type. + * + * \only_for_vectors + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Zero() should be used + * instead. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * Here is an example with C++11 random generators: \include random_cpp11.cpp + * Output: \verbinclude random_cpp11.out + * + * \sa class CwiseNullaryOp + */ +template +template +EIGEN_STRONG_INLINE const CwiseNullaryOp::PlainObject> +DenseBase::NullaryExpr(Index size, const CustomNullaryOp& func) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + if(RowsAtCompileTime == 1) return CwiseNullaryOp(1, size, func); + else return CwiseNullaryOp(size, 1, func); +} + +/** \returns an expression of a matrix defined by a custom functor \a func + * + * This variant is only for fixed-size DenseBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp::PlainObject> +DenseBase::NullaryExpr(const CustomNullaryOp& func) +{ + return CwiseNullaryOp(RowsAtCompileTime, ColsAtCompileTime, func); +} + +/** \returns an expression of a constant matrix of value \a value + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this DenseBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used + * instead. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Constant(Index rows, Index cols, const Scalar& value) +{ + return DenseBase::NullaryExpr(rows, cols, internal::scalar_constant_op(value)); +} + +/** \returns an expression of a constant matrix of value \a value + * + * The parameter \a size is the size of the returned vector. + * Must be compatible with this DenseBase type. + * + * \only_for_vectors + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Zero() should be used + * instead. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Constant(Index size, const Scalar& value) +{ + return DenseBase::NullaryExpr(size, internal::scalar_constant_op(value)); +} + +/** \returns an expression of a constant matrix of value \a value + * + * This variant is only for fixed-size DenseBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * The template parameter \a CustomNullaryOp is the type of the functor. + * + * \sa class CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Constant(const Scalar& value) +{ + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + return DenseBase::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_constant_op(value)); +} + +/** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(Index,const Scalar&,const Scalar&) + * + * \sa LinSpaced(Index,Scalar,Scalar), setLinSpaced(Index,const Scalar&,const Scalar&) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType +DenseBase::LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return DenseBase::NullaryExpr(size, internal::linspaced_op(low,high,size)); +} + +/** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(const Scalar&,const Scalar&) + * + * \sa LinSpaced(Scalar,Scalar) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType +DenseBase::LinSpaced(Sequential_t, const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + return DenseBase::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op(low,high,Derived::SizeAtCompileTime)); +} + +/** + * \brief Sets a linearly spaced vector. + * + * The function generates 'size' equally spaced values in the closed interval [low,high]. + * When size is set to 1, a vector of length 1 containing 'high' is returned. + * + * \only_for_vectors + * + * Example: \include DenseBase_LinSpaced.cpp + * Output: \verbinclude DenseBase_LinSpaced.out + * + * For integer scalar types, an even spacing is possible if and only if the length of the range, + * i.e., \c high-low is a scalar multiple of \c size-1, or if \c size is a scalar multiple of the + * number of values \c high-low+1 (meaning each value can be repeated the same number of time). + * If one of these two considions is not satisfied, then \c high is lowered to the largest value + * satisfying one of this constraint. + * Here are some examples: + * + * Example: \include DenseBase_LinSpacedInt.cpp + * Output: \verbinclude DenseBase_LinSpacedInt.out + * + * \sa setLinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType +DenseBase::LinSpaced(Index size, const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return DenseBase::NullaryExpr(size, internal::linspaced_op(low,high,size)); +} + +/** + * \copydoc DenseBase::LinSpaced(Index, const Scalar&, const Scalar&) + * Special version for fixed size types which does not require the size parameter. + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType +DenseBase::LinSpaced(const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + return DenseBase::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op(low,high,Derived::SizeAtCompileTime)); +} + +/** \returns true if all coefficients in this matrix are approximately equal to \a val, to within precision \a prec */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isApproxToConstant +(const Scalar& val, const RealScalar& prec) const +{ + typename internal::nested_eval::type self(derived()); + for(Index j = 0; j < cols(); ++j) + for(Index i = 0; i < rows(); ++i) + if(!internal::isApprox(self.coeff(i, j), val, prec)) + return false; + return true; +} + +/** This is just an alias for isApproxToConstant(). + * + * \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isConstant +(const Scalar& val, const RealScalar& prec) const +{ + return isApproxToConstant(val, prec); +} + +/** Alias for setConstant(): sets all coefficients in this expression to \a val. + * + * \sa setConstant(), Constant(), class CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void DenseBase::fill(const Scalar& val) +{ + setConstant(val); +} + +/** Sets all coefficients in this expression to value \a val. + * + * \sa fill(), setConstant(Index,const Scalar&), setConstant(Index,Index,const Scalar&), setZero(), setOnes(), Constant(), class CwiseNullaryOp, setZero(), setOnes() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setConstant(const Scalar& val) +{ + return derived() = Constant(rows(), cols(), val); +} + +/** Resizes to the given \a size, and sets all coefficients in this expression to the given value \a val. + * + * \only_for_vectors + * + * Example: \include Matrix_setConstant_int.cpp + * Output: \verbinclude Matrix_setConstant_int.out + * + * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setConstant(Index size, const Scalar& val) +{ + resize(size); + return setConstant(val); +} + +/** Resizes to the given size, and sets all coefficients in this expression to the given value \a val. + * + * \param rows the new number of rows + * \param cols the new number of columns + * \param val the value to which all coefficients are set + * + * Example: \include Matrix_setConstant_int_int.cpp + * Output: \verbinclude Matrix_setConstant_int_int.out + * + * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setConstant(Index rows, Index cols, const Scalar& val) +{ + resize(rows, cols); + return setConstant(val); +} + +/** + * \brief Sets a linearly spaced vector. + * + * The function generates 'size' equally spaced values in the closed interval [low,high]. + * When size is set to 1, a vector of length 1 containing 'high' is returned. + * + * \only_for_vectors + * + * Example: \include DenseBase_setLinSpaced.cpp + * Output: \verbinclude DenseBase_setLinSpaced.out + * + * For integer scalar types, do not miss the explanations on the definition + * of \link LinSpaced(Index,const Scalar&,const Scalar&) even spacing \endlink. + * + * \sa LinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setLinSpaced(Index newSize, const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return derived() = Derived::NullaryExpr(newSize, internal::linspaced_op(low,high,newSize)); +} + +/** + * \brief Sets a linearly spaced vector. + * + * The function fills \c *this with equally spaced values in the closed interval [low,high]. + * When size is set to 1, a vector of length 1 containing 'high' is returned. + * + * \only_for_vectors + * + * For integer scalar types, do not miss the explanations on the definition + * of \link LinSpaced(Index,const Scalar&,const Scalar&) even spacing \endlink. + * + * \sa LinSpaced(Index,const Scalar&,const Scalar&), setLinSpaced(Index, const Scalar&, const Scalar&), CwiseNullaryOp + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setLinSpaced(const Scalar& low, const Scalar& high) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return setLinSpaced(size(), low, high); +} + +// zero: + +/** \returns an expression of a zero matrix. + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used + * instead. + * + * Example: \include MatrixBase_zero_int_int.cpp + * Output: \verbinclude MatrixBase_zero_int_int.out + * + * \sa Zero(), Zero(Index) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Zero(Index rows, Index cols) +{ + return Constant(rows, cols, Scalar(0)); +} + +/** \returns an expression of a zero vector. + * + * The parameter \a size is the size of the returned vector. + * Must be compatible with this MatrixBase type. + * + * \only_for_vectors + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Zero() should be used + * instead. + * + * Example: \include MatrixBase_zero_int.cpp + * Output: \verbinclude MatrixBase_zero_int.out + * + * \sa Zero(), Zero(Index,Index) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Zero(Index size) +{ + return Constant(size, Scalar(0)); +} + +/** \returns an expression of a fixed-size zero matrix or vector. + * + * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * Example: \include MatrixBase_zero.cpp + * Output: \verbinclude MatrixBase_zero.out + * + * \sa Zero(Index), Zero(Index,Index) + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Zero() +{ + return Constant(Scalar(0)); +} + +/** \returns true if *this is approximately equal to the zero matrix, + * within the precision given by \a prec. + * + * Example: \include MatrixBase_isZero.cpp + * Output: \verbinclude MatrixBase_isZero.out + * + * \sa class CwiseNullaryOp, Zero() + */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isZero(const RealScalar& prec) const +{ + typename internal::nested_eval::type self(derived()); + for(Index j = 0; j < cols(); ++j) + for(Index i = 0; i < rows(); ++i) + if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast(1), prec)) + return false; + return true; +} + +/** Sets all coefficients in this expression to zero. + * + * Example: \include MatrixBase_setZero.cpp + * Output: \verbinclude MatrixBase_setZero.out + * + * \sa class CwiseNullaryOp, Zero() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setZero() +{ + return setConstant(Scalar(0)); +} + +/** Resizes to the given \a size, and sets all coefficients in this expression to zero. + * + * \only_for_vectors + * + * Example: \include Matrix_setZero_int.cpp + * Output: \verbinclude Matrix_setZero_int.out + * + * \sa DenseBase::setZero(), setZero(Index,Index), class CwiseNullaryOp, DenseBase::Zero() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setZero(Index newSize) +{ + resize(newSize); + return setConstant(Scalar(0)); +} + +/** Resizes to the given size, and sets all coefficients in this expression to zero. + * + * \param rows the new number of rows + * \param cols the new number of columns + * + * Example: \include Matrix_setZero_int_int.cpp + * Output: \verbinclude Matrix_setZero_int_int.out + * + * \sa DenseBase::setZero(), setZero(Index), class CwiseNullaryOp, DenseBase::Zero() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setZero(Index rows, Index cols) +{ + resize(rows, cols); + return setConstant(Scalar(0)); +} + +// ones: + +/** \returns an expression of a matrix where all coefficients equal one. + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Ones() should be used + * instead. + * + * Example: \include MatrixBase_ones_int_int.cpp + * Output: \verbinclude MatrixBase_ones_int_int.out + * + * \sa Ones(), Ones(Index), isOnes(), class Ones + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Ones(Index rows, Index cols) +{ + return Constant(rows, cols, Scalar(1)); +} + +/** \returns an expression of a vector where all coefficients equal one. + * + * The parameter \a newSize is the size of the returned vector. + * Must be compatible with this MatrixBase type. + * + * \only_for_vectors + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Ones() should be used + * instead. + * + * Example: \include MatrixBase_ones_int.cpp + * Output: \verbinclude MatrixBase_ones_int.out + * + * \sa Ones(), Ones(Index,Index), isOnes(), class Ones + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Ones(Index newSize) +{ + return Constant(newSize, Scalar(1)); +} + +/** \returns an expression of a fixed-size matrix or vector where all coefficients equal one. + * + * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * Example: \include MatrixBase_ones.cpp + * Output: \verbinclude MatrixBase_ones.out + * + * \sa Ones(Index), Ones(Index,Index), isOnes(), class Ones + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType +DenseBase::Ones() +{ + return Constant(Scalar(1)); +} + +/** \returns true if *this is approximately equal to the matrix where all coefficients + * are equal to 1, within the precision given by \a prec. + * + * Example: \include MatrixBase_isOnes.cpp + * Output: \verbinclude MatrixBase_isOnes.out + * + * \sa class CwiseNullaryOp, Ones() + */ +template +EIGEN_DEVICE_FUNC bool DenseBase::isOnes +(const RealScalar& prec) const +{ + return isApproxToConstant(Scalar(1), prec); +} + +/** Sets all coefficients in this expression to one. + * + * Example: \include MatrixBase_setOnes.cpp + * Output: \verbinclude MatrixBase_setOnes.out + * + * \sa class CwiseNullaryOp, Ones() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::setOnes() +{ + return setConstant(Scalar(1)); +} + +/** Resizes to the given \a newSize, and sets all coefficients in this expression to one. + * + * \only_for_vectors + * + * Example: \include Matrix_setOnes_int.cpp + * Output: \verbinclude Matrix_setOnes_int.out + * + * \sa MatrixBase::setOnes(), setOnes(Index,Index), class CwiseNullaryOp, MatrixBase::Ones() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setOnes(Index newSize) +{ + resize(newSize); + return setConstant(Scalar(1)); +} + +/** Resizes to the given size, and sets all coefficients in this expression to one. + * + * \param rows the new number of rows + * \param cols the new number of columns + * + * Example: \include Matrix_setOnes_int_int.cpp + * Output: \verbinclude Matrix_setOnes_int_int.out + * + * \sa MatrixBase::setOnes(), setOnes(Index), class CwiseNullaryOp, MatrixBase::Ones() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setOnes(Index rows, Index cols) +{ + resize(rows, cols); + return setConstant(Scalar(1)); +} + +// Identity: + +/** \returns an expression of the identity matrix (not necessarily square). + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Identity() should be used + * instead. + * + * Example: \include MatrixBase_identity_int_int.cpp + * Output: \verbinclude MatrixBase_identity_int_int.out + * + * \sa Identity(), setIdentity(), isIdentity() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::IdentityReturnType +MatrixBase::Identity(Index rows, Index cols) +{ + return DenseBase::NullaryExpr(rows, cols, internal::scalar_identity_op()); +} + +/** \returns an expression of the identity matrix (not necessarily square). + * + * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you + * need to use the variant taking size arguments. + * + * Example: \include MatrixBase_identity.cpp + * Output: \verbinclude MatrixBase_identity.out + * + * \sa Identity(Index,Index), setIdentity(), isIdentity() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::IdentityReturnType +MatrixBase::Identity() +{ + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + return MatrixBase::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_identity_op()); +} + +/** \returns true if *this is approximately equal to the identity matrix + * (not necessarily square), + * within the precision given by \a prec. + * + * Example: \include MatrixBase_isIdentity.cpp + * Output: \verbinclude MatrixBase_isIdentity.out + * + * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), setIdentity() + */ +template +bool MatrixBase::isIdentity +(const RealScalar& prec) const +{ + typename internal::nested_eval::type self(derived()); + for(Index j = 0; j < cols(); ++j) + { + for(Index i = 0; i < rows(); ++i) + { + if(i == j) + { + if(!internal::isApprox(self.coeff(i, j), static_cast(1), prec)) + return false; + } + else + { + if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast(1), prec)) + return false; + } + } + } + return true; +} + +namespace internal { + +template=16)> +struct setIdentity_impl +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Derived& run(Derived& m) + { + return m = Derived::Identity(m.rows(), m.cols()); + } +}; + +template +struct setIdentity_impl +{ + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Derived& run(Derived& m) + { + m.setZero(); + const Index size = numext::mini(m.rows(), m.cols()); + for(Index i = 0; i < size; ++i) m.coeffRef(i,i) = typename Derived::Scalar(1); + return m; + } +}; + +} // end namespace internal + +/** Writes the identity expression (not necessarily square) into *this. + * + * Example: \include MatrixBase_setIdentity.cpp + * Output: \verbinclude MatrixBase_setIdentity.out + * + * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), isIdentity() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase::setIdentity() +{ + return internal::setIdentity_impl::run(derived()); +} + +/** \brief Resizes to the given size, and writes the identity expression (not necessarily square) into *this. + * + * \param rows the new number of rows + * \param cols the new number of columns + * + * Example: \include Matrix_setIdentity_int_int.cpp + * Output: \verbinclude Matrix_setIdentity_int_int.out + * + * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Identity() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& MatrixBase::setIdentity(Index rows, Index cols) +{ + derived().resize(rows, cols); + return setIdentity(); +} + +/** \returns an expression of the i-th unit (basis) vector. + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::Unit(Index newSize, Index i) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i); +} + +/** \returns an expression of the i-th unit (basis) vector. + * + * \only_for_vectors + * + * This variant is for fixed-size vector only. + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::Unit(Index i) +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + return BasisReturnType(SquareMatrixType::Identity(),i); +} + +/** \returns an expression of the X axis unit vector (1{,0}^*) + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitX() +{ return Derived::Unit(0); } + +/** \returns an expression of the Y axis unit vector (0,1{,0}^*) + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitY() +{ return Derived::Unit(1); } + +/** \returns an expression of the Z axis unit vector (0,0,1{,0}^*) + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitZ() +{ return Derived::Unit(2); } + +/** \returns an expression of the W axis unit vector (0,0,0,1) + * + * \only_for_vectors + * + * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() + */ +template +EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitW() +{ return Derived::Unit(3); } + +} // end namespace Eigen + +#endif // EIGEN_CWISE_NULLARY_OP_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/CwiseTernaryOp.h b/SudoDEM2D/lib/Eigen/src/Core/CwiseTernaryOp.h new file mode 100644 index 0000000..9f3576f --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/CwiseTernaryOp.h @@ -0,0 +1,197 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2014 Gael Guennebaud +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2016 Eugene Brevdo +// +// 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_CWISE_TERNARY_OP_H +#define EIGEN_CWISE_TERNARY_OP_H + +namespace Eigen { + +namespace internal { +template +struct traits > { + // we must not inherit from traits since it has + // the potential to cause problems with MSVC + typedef typename remove_all::type Ancestor; + typedef typename traits::XprKind XprKind; + enum { + RowsAtCompileTime = traits::RowsAtCompileTime, + ColsAtCompileTime = traits::ColsAtCompileTime, + MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = traits::MaxColsAtCompileTime + }; + + // even though we require Arg1, Arg2, and Arg3 to have the same scalar type + // (see CwiseTernaryOp constructor), + // we still want to handle the case when the result type is different. + typedef typename result_of::type Scalar; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::StorageIndex StorageIndex; + + typedef typename Arg1::Nested Arg1Nested; + typedef typename Arg2::Nested Arg2Nested; + typedef typename Arg3::Nested Arg3Nested; + typedef typename remove_reference::type _Arg1Nested; + typedef typename remove_reference::type _Arg2Nested; + typedef typename remove_reference::type _Arg3Nested; + enum { Flags = _Arg1Nested::Flags & RowMajorBit }; +}; +} // end namespace internal + +template +class CwiseTernaryOpImpl; + +/** \class CwiseTernaryOp + * \ingroup Core_Module + * + * \brief Generic expression where a coefficient-wise ternary operator is + * applied to two expressions + * + * \tparam TernaryOp template functor implementing the operator + * \tparam Arg1Type the type of the first argument + * \tparam Arg2Type the type of the second argument + * \tparam Arg3Type the type of the third argument + * + * This class represents an expression where a coefficient-wise ternary + * operator is applied to three expressions. + * It is the return type of ternary operators, by which we mean only those + * ternary operators where + * all three arguments are Eigen expressions. + * For example, the return type of betainc(matrix1, matrix2, matrix3) is a + * CwiseTernaryOp. + * + * Most of the time, this is the only way that it is used, so you typically + * don't have to name + * CwiseTernaryOp types explicitly. + * + * \sa MatrixBase::ternaryExpr(const MatrixBase &, const + * MatrixBase &, const CustomTernaryOp &) const, class CwiseBinaryOp, + * class CwiseUnaryOp, class CwiseNullaryOp + */ +template +class CwiseTernaryOp : public CwiseTernaryOpImpl< + TernaryOp, Arg1Type, Arg2Type, Arg3Type, + typename internal::traits::StorageKind>, + internal::no_assignment_operator +{ + public: + typedef typename internal::remove_all::type Arg1; + typedef typename internal::remove_all::type Arg2; + typedef typename internal::remove_all::type Arg3; + + typedef typename CwiseTernaryOpImpl< + TernaryOp, Arg1Type, Arg2Type, Arg3Type, + typename internal::traits::StorageKind>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseTernaryOp) + + typedef typename internal::ref_selector::type Arg1Nested; + typedef typename internal::ref_selector::type Arg2Nested; + typedef typename internal::ref_selector::type Arg3Nested; + typedef typename internal::remove_reference::type _Arg1Nested; + typedef typename internal::remove_reference::type _Arg2Nested; + typedef typename internal::remove_reference::type _Arg3Nested; + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CwiseTernaryOp(const Arg1& a1, const Arg2& a2, + const Arg3& a3, + const TernaryOp& func = TernaryOp()) + : m_arg1(a1), m_arg2(a2), m_arg3(a3), m_functor(func) { + // require the sizes to match + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg2) + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Arg1, Arg3) + + // The index types should match + EIGEN_STATIC_ASSERT((internal::is_same< + typename internal::traits::StorageKind, + typename internal::traits::StorageKind>::value), + STORAGE_KIND_MUST_MATCH) + EIGEN_STATIC_ASSERT((internal::is_same< + typename internal::traits::StorageKind, + typename internal::traits::StorageKind>::value), + STORAGE_KIND_MUST_MATCH) + + eigen_assert(a1.rows() == a2.rows() && a1.cols() == a2.cols() && + a1.rows() == a3.rows() && a1.cols() == a3.cols()); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index rows() const { + // return the fixed size type if available to enable compile time + // optimizations + if (internal::traits::type>:: + RowsAtCompileTime == Dynamic && + internal::traits::type>:: + RowsAtCompileTime == Dynamic) + return m_arg3.rows(); + else if (internal::traits::type>:: + RowsAtCompileTime == Dynamic && + internal::traits::type>:: + RowsAtCompileTime == Dynamic) + return m_arg2.rows(); + else + return m_arg1.rows(); + } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index cols() const { + // return the fixed size type if available to enable compile time + // optimizations + if (internal::traits::type>:: + ColsAtCompileTime == Dynamic && + internal::traits::type>:: + ColsAtCompileTime == Dynamic) + return m_arg3.cols(); + else if (internal::traits::type>:: + ColsAtCompileTime == Dynamic && + internal::traits::type>:: + ColsAtCompileTime == Dynamic) + return m_arg2.cols(); + else + return m_arg1.cols(); + } + + /** \returns the first argument nested expression */ + EIGEN_DEVICE_FUNC + const _Arg1Nested& arg1() const { return m_arg1; } + /** \returns the first argument nested expression */ + EIGEN_DEVICE_FUNC + const _Arg2Nested& arg2() const { return m_arg2; } + /** \returns the third argument nested expression */ + EIGEN_DEVICE_FUNC + const _Arg3Nested& arg3() const { return m_arg3; } + /** \returns the functor representing the ternary operation */ + EIGEN_DEVICE_FUNC + const TernaryOp& functor() const { return m_functor; } + + protected: + Arg1Nested m_arg1; + Arg2Nested m_arg2; + Arg3Nested m_arg3; + const TernaryOp m_functor; +}; + +// Generic API dispatcher +template +class CwiseTernaryOpImpl + : public internal::generic_xpr_base< + CwiseTernaryOp >::type { + public: + typedef typename internal::generic_xpr_base< + CwiseTernaryOp >::type Base; +}; + +} // end namespace Eigen + +#endif // EIGEN_CWISE_TERNARY_OP_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryOp.h b/SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryOp.h new file mode 100644 index 0000000..1d2dd19 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryOp.h @@ -0,0 +1,103 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2014 Gael Guennebaud +// Copyright (C) 2006-2008 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_CWISE_UNARY_OP_H +#define EIGEN_CWISE_UNARY_OP_H + +namespace Eigen { + +namespace internal { +template +struct traits > + : traits +{ + typedef typename result_of< + UnaryOp(const typename XprType::Scalar&) + >::type Scalar; + typedef typename XprType::Nested XprTypeNested; + typedef typename remove_reference::type _XprTypeNested; + enum { + Flags = _XprTypeNested::Flags & RowMajorBit + }; +}; +} + +template +class CwiseUnaryOpImpl; + +/** \class CwiseUnaryOp + * \ingroup Core_Module + * + * \brief Generic expression where a coefficient-wise unary operator is applied to an expression + * + * \tparam UnaryOp template functor implementing the operator + * \tparam XprType the type of the expression to which we are applying the unary operator + * + * This class represents an expression where a unary operator is applied to an expression. + * It is the return type of all operations taking exactly 1 input expression, regardless of the + * presence of other inputs such as scalars. For example, the operator* in the expression 3*matrix + * is considered unary, because only the right-hand side is an expression, and its + * return type is a specialization of CwiseUnaryOp. + * + * Most of the time, this is the only way that it is used, so you typically don't have to name + * CwiseUnaryOp types explicitly. + * + * \sa MatrixBase::unaryExpr(const CustomUnaryOp &) const, class CwiseBinaryOp, class CwiseNullaryOp + */ +template +class CwiseUnaryOp : public CwiseUnaryOpImpl::StorageKind>, internal::no_assignment_operator +{ + public: + + typedef typename CwiseUnaryOpImpl::StorageKind>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryOp) + typedef typename internal::ref_selector::type XprTypeNested; + typedef typename internal::remove_all::type NestedExpression; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp()) + : m_xpr(xpr), m_functor(func) {} + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Index rows() const { return m_xpr.rows(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Index cols() const { return m_xpr.cols(); } + + /** \returns the functor representing the unary operation */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const UnaryOp& functor() const { return m_functor; } + + /** \returns the nested expression */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + const typename internal::remove_all::type& + nestedExpression() const { return m_xpr; } + + /** \returns the nested expression */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + typename internal::remove_all::type& + nestedExpression() { return m_xpr; } + + protected: + XprTypeNested m_xpr; + const UnaryOp m_functor; +}; + +// Generic API dispatcher +template +class CwiseUnaryOpImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; +}; + +} // end namespace Eigen + +#endif // EIGEN_CWISE_UNARY_OP_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryView.h b/SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryView.h new file mode 100644 index 0000000..2710330 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/CwiseUnaryView.h @@ -0,0 +1,128 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 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_CWISE_UNARY_VIEW_H +#define EIGEN_CWISE_UNARY_VIEW_H + +namespace Eigen { + +namespace internal { +template +struct traits > + : traits +{ + typedef typename result_of< + ViewOp(const typename traits::Scalar&) + >::type Scalar; + typedef typename MatrixType::Nested MatrixTypeNested; + typedef typename remove_all::type _MatrixTypeNested; + enum { + FlagsLvalueBit = is_lvalue::value ? LvalueBit : 0, + Flags = traits<_MatrixTypeNested>::Flags & (RowMajorBit | FlagsLvalueBit | DirectAccessBit), // FIXME DirectAccessBit should not be handled by expressions + MatrixTypeInnerStride = inner_stride_at_compile_time::ret, + // need to cast the sizeof's from size_t to int explicitly, otherwise: + // "error: no integral type can represent all of the enumerator values + InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic + ? int(Dynamic) + : int(MatrixTypeInnerStride) * int(sizeof(typename traits::Scalar) / sizeof(Scalar)), + OuterStrideAtCompileTime = outer_stride_at_compile_time::ret == Dynamic + ? int(Dynamic) + : outer_stride_at_compile_time::ret * int(sizeof(typename traits::Scalar) / sizeof(Scalar)) + }; +}; +} + +template +class CwiseUnaryViewImpl; + +/** \class CwiseUnaryView + * \ingroup Core_Module + * + * \brief Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector + * + * \tparam ViewOp template functor implementing the view + * \tparam MatrixType the type of the matrix we are applying the unary operator + * + * This class represents a lvalue expression of a generic unary view operator of a matrix or a vector. + * It is the return type of real() and imag(), and most of the time this is the only way it is used. + * + * \sa MatrixBase::unaryViewExpr(const CustomUnaryOp &) const, class CwiseUnaryOp + */ +template +class CwiseUnaryView : public CwiseUnaryViewImpl::StorageKind> +{ + public: + + typedef typename CwiseUnaryViewImpl::StorageKind>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryView) + typedef typename internal::ref_selector::non_const_type MatrixTypeNested; + typedef typename internal::remove_all::type NestedExpression; + + explicit inline CwiseUnaryView(MatrixType& mat, const ViewOp& func = ViewOp()) + : m_matrix(mat), m_functor(func) {} + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryView) + + EIGEN_STRONG_INLINE Index rows() const { return m_matrix.rows(); } + EIGEN_STRONG_INLINE Index cols() const { return m_matrix.cols(); } + + /** \returns the functor representing unary operation */ + const ViewOp& functor() const { return m_functor; } + + /** \returns the nested expression */ + const typename internal::remove_all::type& + nestedExpression() const { return m_matrix; } + + /** \returns the nested expression */ + typename internal::remove_reference::type& + nestedExpression() { return m_matrix.const_cast_derived(); } + + protected: + MatrixTypeNested m_matrix; + ViewOp m_functor; +}; + +// Generic API dispatcher +template +class CwiseUnaryViewImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; +}; + +template +class CwiseUnaryViewImpl + : public internal::dense_xpr_base< CwiseUnaryView >::type +{ + public: + + typedef CwiseUnaryView Derived; + typedef typename internal::dense_xpr_base< CwiseUnaryView >::type Base; + + EIGEN_DENSE_PUBLIC_INTERFACE(Derived) + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryViewImpl) + + EIGEN_DEVICE_FUNC inline Scalar* data() { return &(this->coeffRef(0)); } + EIGEN_DEVICE_FUNC inline const Scalar* data() const { return &(this->coeff(0)); } + + EIGEN_DEVICE_FUNC inline Index innerStride() const + { + return derived().nestedExpression().innerStride() * sizeof(typename internal::traits::Scalar) / sizeof(Scalar); + } + + EIGEN_DEVICE_FUNC inline Index outerStride() const + { + return derived().nestedExpression().outerStride() * sizeof(typename internal::traits::Scalar) / sizeof(Scalar); + } +}; + +} // end namespace Eigen + +#endif // EIGEN_CWISE_UNARY_VIEW_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/DenseBase.h b/SudoDEM2D/lib/Eigen/src/Core/DenseBase.h new file mode 100644 index 0000000..90066ae --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/DenseBase.h @@ -0,0 +1,611 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007-2010 Benoit Jacob +// Copyright (C) 2008-2010 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_DENSEBASE_H +#define EIGEN_DENSEBASE_H + +namespace Eigen { + +namespace internal { + +// The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type. +// This dummy function simply aims at checking that at compile time. +static inline void check_DenseIndex_is_signed() { + EIGEN_STATIC_ASSERT(NumTraits::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE); +} + +} // end namespace internal + +/** \class DenseBase + * \ingroup Core_Module + * + * \brief Base class for all dense matrices, vectors, and arrays + * + * This class is the base that is inherited by all dense objects (matrix, vector, arrays, + * and related expression types). The common Eigen API for dense objects is contained in this class. + * + * \tparam Derived is the derived type, e.g., a matrix type or an expression. + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_DENSEBASE_PLUGIN. + * + * \sa \blank \ref TopicClassHierarchy + */ +template class DenseBase +#ifndef EIGEN_PARSED_BY_DOXYGEN + : public DenseCoeffsBase +#else + : public DenseCoeffsBase +#endif // not EIGEN_PARSED_BY_DOXYGEN +{ + public: + + /** Inner iterator type to iterate over the coefficients of a row or column. + * \sa class InnerIterator + */ + typedef Eigen::InnerIterator InnerIterator; + + typedef typename internal::traits::StorageKind StorageKind; + + /** + * \brief The type used to store indices + * \details This typedef is relevant for types that store multiple indices such as + * PermutationMatrix or Transpositions, otherwise it defaults to Eigen::Index + * \sa \blank \ref TopicPreprocessorDirectives, Eigen::Index, SparseMatrixBase. + */ + typedef typename internal::traits::StorageIndex StorageIndex; + + /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex, etc. */ + typedef typename internal::traits::Scalar Scalar; + + /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex, etc. + * + * It is an alias for the Scalar type */ + typedef Scalar value_type; + + typedef typename NumTraits::Real RealScalar; + typedef DenseCoeffsBase Base; + + using Base::derived; + using Base::const_cast_derived; + using Base::rows; + using Base::cols; + using Base::size; + using Base::rowIndexByOuterInner; + using Base::colIndexByOuterInner; + using Base::coeff; + using Base::coeffByOuterInner; + using Base::operator(); + using Base::operator[]; + using Base::x; + using Base::y; + using Base::z; + using Base::w; + using Base::stride; + using Base::innerStride; + using Base::outerStride; + using Base::rowStride; + using Base::colStride; + typedef typename Base::CoeffReturnType CoeffReturnType; + + enum { + + RowsAtCompileTime = internal::traits::RowsAtCompileTime, + /**< The number of rows at compile-time. This is just a copy of the value provided + * by the \a Derived type. If a value is not known at compile-time, + * it is set to the \a Dynamic constant. + * \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */ + + ColsAtCompileTime = internal::traits::ColsAtCompileTime, + /**< The number of columns at compile-time. This is just a copy of the value provided + * by the \a Derived type. If a value is not known at compile-time, + * it is set to the \a Dynamic constant. + * \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */ + + + SizeAtCompileTime = (internal::size_at_compile_time::RowsAtCompileTime, + internal::traits::ColsAtCompileTime>::ret), + /**< This is equal to the number of coefficients, i.e. the number of + * rows times the number of columns, or to \a Dynamic if this is not + * known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */ + + MaxRowsAtCompileTime = internal::traits::MaxRowsAtCompileTime, + /**< This value is equal to the maximum possible number of rows that this expression + * might have. If this expression might have an arbitrarily high number of rows, + * this value is set to \a Dynamic. + * + * This value is useful to know when evaluating an expression, in order to determine + * whether it is possible to avoid doing a dynamic memory allocation. + * + * \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime + */ + + MaxColsAtCompileTime = internal::traits::MaxColsAtCompileTime, + /**< This value is equal to the maximum possible number of columns that this expression + * might have. If this expression might have an arbitrarily high number of columns, + * this value is set to \a Dynamic. + * + * This value is useful to know when evaluating an expression, in order to determine + * whether it is possible to avoid doing a dynamic memory allocation. + * + * \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime + */ + + MaxSizeAtCompileTime = (internal::size_at_compile_time::MaxRowsAtCompileTime, + internal::traits::MaxColsAtCompileTime>::ret), + /**< This value is equal to the maximum possible number of coefficients that this expression + * might have. If this expression might have an arbitrarily high number of coefficients, + * this value is set to \a Dynamic. + * + * This value is useful to know when evaluating an expression, in order to determine + * whether it is possible to avoid doing a dynamic memory allocation. + * + * \sa SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime + */ + + IsVectorAtCompileTime = internal::traits::MaxRowsAtCompileTime == 1 + || internal::traits::MaxColsAtCompileTime == 1, + /**< This is set to true if either the number of rows or the number of + * columns is known at compile-time to be equal to 1. Indeed, in that case, + * we are dealing with a column-vector (if there is only one column) or with + * a row-vector (if there is only one row). */ + + Flags = internal::traits::Flags, + /**< This stores expression \ref flags flags which may or may not be inherited by new expressions + * constructed from this one. See the \ref flags "list of flags". + */ + + IsRowMajor = int(Flags) & RowMajorBit, /**< True if this expression has row-major storage order. */ + + InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime) + : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime), + + InnerStrideAtCompileTime = internal::inner_stride_at_compile_time::ret, + OuterStrideAtCompileTime = internal::outer_stride_at_compile_time::ret + }; + + typedef typename internal::find_best_packet::type PacketScalar; + + enum { IsPlainObjectBase = 0 }; + + /** The plain matrix type corresponding to this expression. + * \sa PlainObject */ + typedef Matrix::Scalar, + internal::traits::RowsAtCompileTime, + internal::traits::ColsAtCompileTime, + AutoAlign | (internal::traits::Flags&RowMajorBit ? RowMajor : ColMajor), + internal::traits::MaxRowsAtCompileTime, + internal::traits::MaxColsAtCompileTime + > PlainMatrix; + + /** The plain array type corresponding to this expression. + * \sa PlainObject */ + typedef Array::Scalar, + internal::traits::RowsAtCompileTime, + internal::traits::ColsAtCompileTime, + AutoAlign | (internal::traits::Flags&RowMajorBit ? RowMajor : ColMajor), + internal::traits::MaxRowsAtCompileTime, + internal::traits::MaxColsAtCompileTime + > PlainArray; + + /** \brief The plain matrix or array type corresponding to this expression. + * + * This is not necessarily exactly the return type of eval(). In the case of plain matrices, + * the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed + * that the return type of eval() is either PlainObject or const PlainObject&. + */ + typedef typename internal::conditional::XprKind,MatrixXpr >::value, + PlainMatrix, PlainArray>::type PlainObject; + + /** \returns the number of nonzero coefficients which is in practice the number + * of stored coefficients. */ + EIGEN_DEVICE_FUNC + inline Index nonZeros() const { return size(); } + + /** \returns the outer size. + * + * \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension + * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of columns for a + * column-major matrix, and the number of rows for a row-major matrix. */ + EIGEN_DEVICE_FUNC + Index outerSize() const + { + return IsVectorAtCompileTime ? 1 + : int(IsRowMajor) ? this->rows() : this->cols(); + } + + /** \returns the inner size. + * + * \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension + * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a + * column-major matrix, and the number of columns for a row-major matrix. */ + EIGEN_DEVICE_FUNC + Index innerSize() const + { + return IsVectorAtCompileTime ? this->size() + : int(IsRowMajor) ? this->cols() : this->rows(); + } + + /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are + * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does + * nothing else. + */ + EIGEN_DEVICE_FUNC + void resize(Index newSize) + { + EIGEN_ONLY_USED_FOR_DEBUG(newSize); + eigen_assert(newSize == this->size() + && "DenseBase::resize() does not actually allow to resize."); + } + /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are + * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does + * nothing else. + */ + EIGEN_DEVICE_FUNC + void resize(Index rows, Index cols) + { + EIGEN_ONLY_USED_FOR_DEBUG(rows); + EIGEN_ONLY_USED_FOR_DEBUG(cols); + eigen_assert(rows == this->rows() && cols == this->cols() + && "DenseBase::resize() does not actually allow to resize."); + } + +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal Represents a matrix with all coefficients equal to one another*/ + typedef CwiseNullaryOp,PlainObject> ConstantReturnType; + /** \internal \deprecated Represents a vector with linearly spaced coefficients that allows sequential access only. */ + typedef CwiseNullaryOp,PlainObject> SequentialLinSpacedReturnType; + /** \internal Represents a vector with linearly spaced coefficients that allows random access. */ + typedef CwiseNullaryOp,PlainObject> RandomAccessLinSpacedReturnType; + /** \internal the return type of MatrixBase::eigenvalues() */ + typedef Matrix::Scalar>::Real, internal::traits::ColsAtCompileTime, 1> EigenvaluesReturnType; + +#endif // not EIGEN_PARSED_BY_DOXYGEN + + /** Copies \a other into *this. \returns a reference to *this. */ + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const DenseBase& other); + + /** Special case of the template operator=, in order to prevent the compiler + * from generating a default operator= (issue hit with g++ 4.1) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const DenseBase& other); + + template + EIGEN_DEVICE_FUNC + Derived& operator=(const EigenBase &other); + + template + EIGEN_DEVICE_FUNC + Derived& operator+=(const EigenBase &other); + + template + EIGEN_DEVICE_FUNC + Derived& operator-=(const EigenBase &other); + + template + EIGEN_DEVICE_FUNC + Derived& operator=(const ReturnByValue& func); + + /** \internal + * Copies \a other into *this without evaluating other. \returns a reference to *this. + * \deprecated */ + template + EIGEN_DEVICE_FUNC + Derived& lazyAssign(const DenseBase& other); + + EIGEN_DEVICE_FUNC + CommaInitializer operator<< (const Scalar& s); + + /** \deprecated it now returns \c *this */ + template + EIGEN_DEPRECATED + const Derived& flagged() const + { return derived(); } + + template + EIGEN_DEVICE_FUNC + CommaInitializer operator<< (const DenseBase& other); + + typedef Transpose TransposeReturnType; + EIGEN_DEVICE_FUNC + TransposeReturnType transpose(); + typedef typename internal::add_const >::type ConstTransposeReturnType; + EIGEN_DEVICE_FUNC + ConstTransposeReturnType transpose() const; + EIGEN_DEVICE_FUNC + void transposeInPlace(); + + EIGEN_DEVICE_FUNC static const ConstantReturnType + Constant(Index rows, Index cols, const Scalar& value); + EIGEN_DEVICE_FUNC static const ConstantReturnType + Constant(Index size, const Scalar& value); + EIGEN_DEVICE_FUNC static const ConstantReturnType + Constant(const Scalar& value); + + EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType + LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high); + EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType + LinSpaced(Index size, const Scalar& low, const Scalar& high); + EIGEN_DEVICE_FUNC static const SequentialLinSpacedReturnType + LinSpaced(Sequential_t, const Scalar& low, const Scalar& high); + EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType + LinSpaced(const Scalar& low, const Scalar& high); + + template EIGEN_DEVICE_FUNC + static const CwiseNullaryOp + NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func); + template EIGEN_DEVICE_FUNC + static const CwiseNullaryOp + NullaryExpr(Index size, const CustomNullaryOp& func); + template EIGEN_DEVICE_FUNC + static const CwiseNullaryOp + NullaryExpr(const CustomNullaryOp& func); + + EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index rows, Index cols); + EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(Index size); + EIGEN_DEVICE_FUNC static const ConstantReturnType Zero(); + EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index rows, Index cols); + EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(Index size); + EIGEN_DEVICE_FUNC static const ConstantReturnType Ones(); + + EIGEN_DEVICE_FUNC void fill(const Scalar& value); + EIGEN_DEVICE_FUNC Derived& setConstant(const Scalar& value); + EIGEN_DEVICE_FUNC Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high); + EIGEN_DEVICE_FUNC Derived& setLinSpaced(const Scalar& low, const Scalar& high); + EIGEN_DEVICE_FUNC Derived& setZero(); + EIGEN_DEVICE_FUNC Derived& setOnes(); + EIGEN_DEVICE_FUNC Derived& setRandom(); + + template EIGEN_DEVICE_FUNC + bool isApprox(const DenseBase& other, + const RealScalar& prec = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC + bool isMuchSmallerThan(const RealScalar& other, + const RealScalar& prec = NumTraits::dummy_precision()) const; + template EIGEN_DEVICE_FUNC + bool isMuchSmallerThan(const DenseBase& other, + const RealScalar& prec = NumTraits::dummy_precision()) const; + + EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits::dummy_precision()) const; + + inline bool hasNaN() const; + inline bool allFinite() const; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator*=(const Scalar& other); + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator/=(const Scalar& other); + + typedef typename internal::add_const_on_value_type::type>::type EvalReturnType; + /** \returns the matrix or vector obtained by evaluating this expression. + * + * Notice that in the case of a plain matrix or vector (not an expression) this function just returns + * a const reference, in order to avoid a useless copy. + * + * \warning Be carefull with eval() and the auto C++ keyword, as detailed in this \link TopicPitfalls_auto_keyword page \endlink. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE EvalReturnType eval() const + { + // Even though MSVC does not honor strong inlining when the return type + // is a dynamic matrix, we desperately need strong inlining for fixed + // size types on MSVC. + return typename internal::eval::type(derived()); + } + + /** swaps *this with the expression \a other. + * + */ + template + EIGEN_DEVICE_FUNC + void swap(const DenseBase& other) + { + EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY); + eigen_assert(rows()==other.rows() && cols()==other.cols()); + call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op()); + } + + /** swaps *this with the matrix or array \a other. + * + */ + template + EIGEN_DEVICE_FUNC + void swap(PlainObjectBase& other) + { + eigen_assert(rows()==other.rows() && cols()==other.cols()); + call_assignment(derived(), other.derived(), internal::swap_assign_op()); + } + + EIGEN_DEVICE_FUNC inline const NestByValue nestByValue() const; + EIGEN_DEVICE_FUNC inline const ForceAlignedAccess forceAlignedAccess() const; + EIGEN_DEVICE_FUNC inline ForceAlignedAccess forceAlignedAccess(); + template EIGEN_DEVICE_FUNC + inline const typename internal::conditional,Derived&>::type forceAlignedAccessIf() const; + template EIGEN_DEVICE_FUNC + inline typename internal::conditional,Derived&>::type forceAlignedAccessIf(); + + EIGEN_DEVICE_FUNC Scalar sum() const; + EIGEN_DEVICE_FUNC Scalar mean() const; + EIGEN_DEVICE_FUNC Scalar trace() const; + + EIGEN_DEVICE_FUNC Scalar prod() const; + + EIGEN_DEVICE_FUNC typename internal::traits::Scalar minCoeff() const; + EIGEN_DEVICE_FUNC typename internal::traits::Scalar maxCoeff() const; + + template EIGEN_DEVICE_FUNC + typename internal::traits::Scalar minCoeff(IndexType* row, IndexType* col) const; + template EIGEN_DEVICE_FUNC + typename internal::traits::Scalar maxCoeff(IndexType* row, IndexType* col) const; + template EIGEN_DEVICE_FUNC + typename internal::traits::Scalar minCoeff(IndexType* index) const; + template EIGEN_DEVICE_FUNC + typename internal::traits::Scalar maxCoeff(IndexType* index) const; + + template + EIGEN_DEVICE_FUNC + Scalar redux(const BinaryOp& func) const; + + template + EIGEN_DEVICE_FUNC + void visit(Visitor& func) const; + + /** \returns a WithFormat proxy object allowing to print a matrix the with given + * format \a fmt. + * + * See class IOFormat for some examples. + * + * \sa class IOFormat, class WithFormat + */ + inline const WithFormat format(const IOFormat& fmt) const + { + return WithFormat(derived(), fmt); + } + + /** \returns the unique coefficient of a 1x1 expression */ + EIGEN_DEVICE_FUNC + CoeffReturnType value() const + { + EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) + eigen_assert(this->rows() == 1 && this->cols() == 1); + return derived().coeff(0,0); + } + + EIGEN_DEVICE_FUNC bool all() const; + EIGEN_DEVICE_FUNC bool any() const; + EIGEN_DEVICE_FUNC Index count() const; + + typedef VectorwiseOp RowwiseReturnType; + typedef const VectorwiseOp ConstRowwiseReturnType; + typedef VectorwiseOp ColwiseReturnType; + typedef const VectorwiseOp ConstColwiseReturnType; + + /** \returns a VectorwiseOp wrapper of *this providing additional partial reduction operations + * + * Example: \include MatrixBase_rowwise.cpp + * Output: \verbinclude MatrixBase_rowwise.out + * + * \sa colwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting + */ + //Code moved here due to a CUDA compiler bug + EIGEN_DEVICE_FUNC inline ConstRowwiseReturnType rowwise() const { + return ConstRowwiseReturnType(derived()); + } + EIGEN_DEVICE_FUNC RowwiseReturnType rowwise(); + + /** \returns a VectorwiseOp wrapper of *this providing additional partial reduction operations + * + * Example: \include MatrixBase_colwise.cpp + * Output: \verbinclude MatrixBase_colwise.out + * + * \sa rowwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting + */ + EIGEN_DEVICE_FUNC inline ConstColwiseReturnType colwise() const { + return ConstColwiseReturnType(derived()); + } + EIGEN_DEVICE_FUNC ColwiseReturnType colwise(); + + typedef CwiseNullaryOp,PlainObject> RandomReturnType; + static const RandomReturnType Random(Index rows, Index cols); + static const RandomReturnType Random(Index size); + static const RandomReturnType Random(); + + template + const Select + select(const DenseBase& thenMatrix, + const DenseBase& elseMatrix) const; + + template + inline const Select + select(const DenseBase& thenMatrix, const typename ThenDerived::Scalar& elseScalar) const; + + template + inline const Select + select(const typename ElseDerived::Scalar& thenScalar, const DenseBase& elseMatrix) const; + + template RealScalar lpNorm() const; + + template + EIGEN_DEVICE_FUNC + const Replicate replicate() const; + /** + * \return an expression of the replication of \c *this + * + * Example: \include MatrixBase_replicate_int_int.cpp + * Output: \verbinclude MatrixBase_replicate_int_int.out + * + * \sa VectorwiseOp::replicate(), DenseBase::replicate(), class Replicate + */ + //Code moved here due to a CUDA compiler bug + EIGEN_DEVICE_FUNC + const Replicate replicate(Index rowFactor, Index colFactor) const + { + return Replicate(derived(), rowFactor, colFactor); + } + + typedef Reverse ReverseReturnType; + typedef const Reverse ConstReverseReturnType; + EIGEN_DEVICE_FUNC ReverseReturnType reverse(); + /** This is the const version of reverse(). */ + //Code moved here due to a CUDA compiler bug + EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const + { + return ConstReverseReturnType(derived()); + } + EIGEN_DEVICE_FUNC void reverseInPlace(); + +#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase +#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL +#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) +# include "../plugins/BlockMethods.h" +# ifdef EIGEN_DENSEBASE_PLUGIN +# include EIGEN_DENSEBASE_PLUGIN +# endif +#undef EIGEN_CURRENT_STORAGE_BASE_CLASS +#undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL +#undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF + + // disable the use of evalTo for dense objects with a nice compilation error + template + EIGEN_DEVICE_FUNC + inline void evalTo(Dest& ) const + { + EIGEN_STATIC_ASSERT((internal::is_same::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS); + } + + protected: + /** Default constructor. Do nothing. */ + EIGEN_DEVICE_FUNC DenseBase() + { + /* Just checks for self-consistency of the flags. + * Only do it when debugging Eigen, as this borders on paranoiac and could slow compilation down + */ +#ifdef EIGEN_INTERNAL_DEBUGGING + EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor)) + && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))), + INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION) +#endif + } + + private: + EIGEN_DEVICE_FUNC explicit DenseBase(int); + EIGEN_DEVICE_FUNC DenseBase(int,int); + template EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase&); +}; + +} // end namespace Eigen + +#endif // EIGEN_DENSEBASE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/DenseCoeffsBase.h b/SudoDEM2D/lib/Eigen/src/Core/DenseCoeffsBase.h new file mode 100644 index 0000000..c4af48a --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/DenseCoeffsBase.h @@ -0,0 +1,681 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2010 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_DENSECOEFFSBASE_H +#define EIGEN_DENSECOEFFSBASE_H + +namespace Eigen { + +namespace internal { +template struct add_const_on_value_type_if_arithmetic +{ + typedef typename conditional::value, T, typename add_const_on_value_type::type>::type type; +}; +} + +/** \brief Base class providing read-only coefficient access to matrices and arrays. + * \ingroup Core_Module + * \tparam Derived Type of the derived class + * \tparam #ReadOnlyAccessors Constant indicating read-only access + * + * This class defines the \c operator() \c const function and friends, which can be used to read specific + * entries of a matrix or array. + * + * \sa DenseCoeffsBase, DenseCoeffsBase, + * \ref TopicClassHierarchy + */ +template +class DenseCoeffsBase : public EigenBase +{ + public: + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + + // Explanation for this CoeffReturnType typedef. + // - This is the return type of the coeff() method. + // - The LvalueBit means exactly that we can offer a coeffRef() method, which means exactly that we can get references + // to coeffs, which means exactly that we can have coeff() return a const reference (as opposed to returning a value). + // - The is_artihmetic check is required since "const int", "const double", etc. will cause warnings on some systems + // while the declaration of "const T", where T is a non arithmetic type does not. Always returning "const Scalar&" is + // not possible, since the underlying expressions might not offer a valid address the reference could be referring to. + typedef typename internal::conditional::Flags&LvalueBit), + const Scalar&, + typename internal::conditional::value, Scalar, const Scalar>::type + >::type CoeffReturnType; + + typedef typename internal::add_const_on_value_type_if_arithmetic< + typename internal::packet_traits::type + >::type PacketReturnType; + + typedef EigenBase Base; + using Base::rows; + using Base::cols; + using Base::size; + using Base::derived; + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) const + { + return int(Derived::RowsAtCompileTime) == 1 ? 0 + : int(Derived::ColsAtCompileTime) == 1 ? inner + : int(Derived::Flags)&RowMajorBit ? outer + : inner; + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) const + { + return int(Derived::ColsAtCompileTime) == 1 ? 0 + : int(Derived::RowsAtCompileTime) == 1 ? inner + : int(Derived::Flags)&RowMajorBit ? inner + : outer; + } + + /** Short version: don't use this function, use + * \link operator()(Index,Index) const \endlink instead. + * + * Long version: this function is similar to + * \link operator()(Index,Index) const \endlink, but without the assertion. + * Use this for limiting the performance cost of debugging code when doing + * repeated coefficient access. Only use this when it is guaranteed that the + * parameters \a row and \a col are in range. + * + * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this + * function equivalent to \link operator()(Index,Index) const \endlink. + * + * \sa operator()(Index,Index) const, coeffRef(Index,Index), coeff(Index) const + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const + { + eigen_internal_assert(row >= 0 && row < rows() + && col >= 0 && col < cols()); + return internal::evaluator(derived()).coeff(row,col); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType coeffByOuterInner(Index outer, Index inner) const + { + return coeff(rowIndexByOuterInner(outer, inner), + colIndexByOuterInner(outer, inner)); + } + + /** \returns the coefficient at given the given row and column. + * + * \sa operator()(Index,Index), operator[](Index) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType operator()(Index row, Index col) const + { + eigen_assert(row >= 0 && row < rows() + && col >= 0 && col < cols()); + return coeff(row, col); + } + + /** Short version: don't use this function, use + * \link operator[](Index) const \endlink instead. + * + * Long version: this function is similar to + * \link operator[](Index) const \endlink, but without the assertion. + * Use this for limiting the performance cost of debugging code when doing + * repeated coefficient access. Only use this when it is guaranteed that the + * parameter \a index is in range. + * + * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this + * function equivalent to \link operator[](Index) const \endlink. + * + * \sa operator[](Index) const, coeffRef(Index), coeff(Index,Index) const + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + coeff(Index index) const + { + EIGEN_STATIC_ASSERT(internal::evaluator::Flags & LinearAccessBit, + THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) + eigen_internal_assert(index >= 0 && index < size()); + return internal::evaluator(derived()).coeff(index); + } + + + /** \returns the coefficient at given index. + * + * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. + * + * \sa operator[](Index), operator()(Index,Index) const, x() const, y() const, + * z() const, w() const + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + operator[](Index index) const + { + EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime, + THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD) + eigen_assert(index >= 0 && index < size()); + return coeff(index); + } + + /** \returns the coefficient at given index. + * + * This is synonymous to operator[](Index) const. + * + * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. + * + * \sa operator[](Index), operator()(Index,Index) const, x() const, y() const, + * z() const, w() const + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + operator()(Index index) const + { + eigen_assert(index >= 0 && index < size()); + return coeff(index); + } + + /** equivalent to operator[](0). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + x() const { return (*this)[0]; } + + /** equivalent to operator[](1). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + y() const + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=2, OUT_OF_RANGE_ACCESS); + return (*this)[1]; + } + + /** equivalent to operator[](2). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + z() const + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=3, OUT_OF_RANGE_ACCESS); + return (*this)[2]; + } + + /** equivalent to operator[](3). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE CoeffReturnType + w() const + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=4, OUT_OF_RANGE_ACCESS); + return (*this)[3]; + } + + /** \internal + * \returns the packet of coefficients starting at the given row and column. It is your responsibility + * to ensure that a packet really starts there. This method is only available on expressions having the + * PacketAccessBit. + * + * The \a LoadMode parameter may have the value \a #Aligned or \a #Unaligned. Its effect is to select + * the appropriate vectorization instruction. Aligned access is faster, but is only possible for packets + * starting at an address which is a multiple of the packet size. + */ + + template + EIGEN_STRONG_INLINE PacketReturnType packet(Index row, Index col) const + { + typedef typename internal::packet_traits::type DefaultPacketType; + eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); + return internal::evaluator(derived()).template packet(row,col); + } + + + /** \internal */ + template + EIGEN_STRONG_INLINE PacketReturnType packetByOuterInner(Index outer, Index inner) const + { + return packet(rowIndexByOuterInner(outer, inner), + colIndexByOuterInner(outer, inner)); + } + + /** \internal + * \returns the packet of coefficients starting at the given index. It is your responsibility + * to ensure that a packet really starts there. This method is only available on expressions having the + * PacketAccessBit and the LinearAccessBit. + * + * The \a LoadMode parameter may have the value \a #Aligned or \a #Unaligned. Its effect is to select + * the appropriate vectorization instruction. Aligned access is faster, but is only possible for packets + * starting at an address which is a multiple of the packet size. + */ + + template + EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const + { + EIGEN_STATIC_ASSERT(internal::evaluator::Flags & LinearAccessBit, + THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) + typedef typename internal::packet_traits::type DefaultPacketType; + eigen_internal_assert(index >= 0 && index < size()); + return internal::evaluator(derived()).template packet(index); + } + + protected: + // explanation: DenseBase is doing "using ..." on the methods from DenseCoeffsBase. + // But some methods are only available in the DirectAccess case. + // So we add dummy methods here with these names, so that "using... " doesn't fail. + // It's not private so that the child class DenseBase can access them, and it's not public + // either since it's an implementation detail, so has to be protected. + void coeffRef(); + void coeffRefByOuterInner(); + void writePacket(); + void writePacketByOuterInner(); + void copyCoeff(); + void copyCoeffByOuterInner(); + void copyPacket(); + void copyPacketByOuterInner(); + void stride(); + void innerStride(); + void outerStride(); + void rowStride(); + void colStride(); +}; + +/** \brief Base class providing read/write coefficient access to matrices and arrays. + * \ingroup Core_Module + * \tparam Derived Type of the derived class + * \tparam #WriteAccessors Constant indicating read/write access + * + * This class defines the non-const \c operator() function and friends, which can be used to write specific + * entries of a matrix or array. This class inherits DenseCoeffsBase which + * defines the const variant for reading specific entries. + * + * \sa DenseCoeffsBase, \ref TopicClassHierarchy + */ +template +class DenseCoeffsBase : public DenseCoeffsBase +{ + public: + + typedef DenseCoeffsBase Base; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + + using Base::coeff; + using Base::rows; + using Base::cols; + using Base::size; + using Base::derived; + using Base::rowIndexByOuterInner; + using Base::colIndexByOuterInner; + using Base::operator[]; + using Base::operator(); + using Base::x; + using Base::y; + using Base::z; + using Base::w; + + /** Short version: don't use this function, use + * \link operator()(Index,Index) \endlink instead. + * + * Long version: this function is similar to + * \link operator()(Index,Index) \endlink, but without the assertion. + * Use this for limiting the performance cost of debugging code when doing + * repeated coefficient access. Only use this when it is guaranteed that the + * parameters \a row and \a col are in range. + * + * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this + * function equivalent to \link operator()(Index,Index) \endlink. + * + * \sa operator()(Index,Index), coeff(Index, Index) const, coeffRef(Index) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) + { + eigen_internal_assert(row >= 0 && row < rows() + && col >= 0 && col < cols()); + return internal::evaluator(derived()).coeffRef(row,col); + } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + coeffRefByOuterInner(Index outer, Index inner) + { + return coeffRef(rowIndexByOuterInner(outer, inner), + colIndexByOuterInner(outer, inner)); + } + + /** \returns a reference to the coefficient at given the given row and column. + * + * \sa operator[](Index) + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + operator()(Index row, Index col) + { + eigen_assert(row >= 0 && row < rows() + && col >= 0 && col < cols()); + return coeffRef(row, col); + } + + + /** Short version: don't use this function, use + * \link operator[](Index) \endlink instead. + * + * Long version: this function is similar to + * \link operator[](Index) \endlink, but without the assertion. + * Use this for limiting the performance cost of debugging code when doing + * repeated coefficient access. Only use this when it is guaranteed that the + * parameters \a row and \a col are in range. + * + * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this + * function equivalent to \link operator[](Index) \endlink. + * + * \sa operator[](Index), coeff(Index) const, coeffRef(Index,Index) + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + coeffRef(Index index) + { + EIGEN_STATIC_ASSERT(internal::evaluator::Flags & LinearAccessBit, + THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) + eigen_internal_assert(index >= 0 && index < size()); + return internal::evaluator(derived()).coeffRef(index); + } + + /** \returns a reference to the coefficient at given index. + * + * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. + * + * \sa operator[](Index) const, operator()(Index,Index), x(), y(), z(), w() + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + operator[](Index index) + { + EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime, + THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD) + eigen_assert(index >= 0 && index < size()); + return coeffRef(index); + } + + /** \returns a reference to the coefficient at given index. + * + * This is synonymous to operator[](Index). + * + * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. + * + * \sa operator[](Index) const, operator()(Index,Index), x(), y(), z(), w() + */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + operator()(Index index) + { + eigen_assert(index >= 0 && index < size()); + return coeffRef(index); + } + + /** equivalent to operator[](0). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + x() { return (*this)[0]; } + + /** equivalent to operator[](1). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + y() + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=2, OUT_OF_RANGE_ACCESS); + return (*this)[1]; + } + + /** equivalent to operator[](2). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + z() + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=3, OUT_OF_RANGE_ACCESS); + return (*this)[2]; + } + + /** equivalent to operator[](3). */ + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& + w() + { + EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime==-1 || Derived::SizeAtCompileTime>=4, OUT_OF_RANGE_ACCESS); + return (*this)[3]; + } +}; + +/** \brief Base class providing direct read-only coefficient access to matrices and arrays. + * \ingroup Core_Module + * \tparam Derived Type of the derived class + * \tparam #DirectAccessors Constant indicating direct access + * + * This class defines functions to work with strides which can be used to access entries directly. This class + * inherits DenseCoeffsBase which defines functions to access entries read-only using + * \c operator() . + * + * \sa \blank \ref TopicClassHierarchy + */ +template +class DenseCoeffsBase : public DenseCoeffsBase +{ + public: + + typedef DenseCoeffsBase Base; + typedef typename internal::traits::Scalar Scalar; + typedef typename NumTraits::Real RealScalar; + + using Base::rows; + using Base::cols; + using Base::size; + using Base::derived; + + /** \returns the pointer increment between two consecutive elements within a slice in the inner direction. + * + * \sa outerStride(), rowStride(), colStride() + */ + EIGEN_DEVICE_FUNC + inline Index innerStride() const + { + return derived().innerStride(); + } + + /** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns + * in a column-major matrix). + * + * \sa innerStride(), rowStride(), colStride() + */ + EIGEN_DEVICE_FUNC + inline Index outerStride() const + { + return derived().outerStride(); + } + + // FIXME shall we remove it ? + inline Index stride() const + { + return Derived::IsVectorAtCompileTime ? innerStride() : outerStride(); + } + + /** \returns the pointer increment between two consecutive rows. + * + * \sa innerStride(), outerStride(), colStride() + */ + EIGEN_DEVICE_FUNC + inline Index rowStride() const + { + return Derived::IsRowMajor ? outerStride() : innerStride(); + } + + /** \returns the pointer increment between two consecutive columns. + * + * \sa innerStride(), outerStride(), rowStride() + */ + EIGEN_DEVICE_FUNC + inline Index colStride() const + { + return Derived::IsRowMajor ? innerStride() : outerStride(); + } +}; + +/** \brief Base class providing direct read/write coefficient access to matrices and arrays. + * \ingroup Core_Module + * \tparam Derived Type of the derived class + * \tparam #DirectWriteAccessors Constant indicating direct access + * + * This class defines functions to work with strides which can be used to access entries directly. This class + * inherits DenseCoeffsBase which defines functions to access entries read/write using + * \c operator(). + * + * \sa \blank \ref TopicClassHierarchy + */ +template +class DenseCoeffsBase + : public DenseCoeffsBase +{ + public: + + typedef DenseCoeffsBase Base; + typedef typename internal::traits::Scalar Scalar; + typedef typename NumTraits::Real RealScalar; + + using Base::rows; + using Base::cols; + using Base::size; + using Base::derived; + + /** \returns the pointer increment between two consecutive elements within a slice in the inner direction. + * + * \sa outerStride(), rowStride(), colStride() + */ + EIGEN_DEVICE_FUNC + inline Index innerStride() const + { + return derived().innerStride(); + } + + /** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns + * in a column-major matrix). + * + * \sa innerStride(), rowStride(), colStride() + */ + EIGEN_DEVICE_FUNC + inline Index outerStride() const + { + return derived().outerStride(); + } + + // FIXME shall we remove it ? + inline Index stride() const + { + return Derived::IsVectorAtCompileTime ? innerStride() : outerStride(); + } + + /** \returns the pointer increment between two consecutive rows. + * + * \sa innerStride(), outerStride(), colStride() + */ + EIGEN_DEVICE_FUNC + inline Index rowStride() const + { + return Derived::IsRowMajor ? outerStride() : innerStride(); + } + + /** \returns the pointer increment between two consecutive columns. + * + * \sa innerStride(), outerStride(), rowStride() + */ + EIGEN_DEVICE_FUNC + inline Index colStride() const + { + return Derived::IsRowMajor ? innerStride() : outerStride(); + } +}; + +namespace internal { + +template +struct first_aligned_impl +{ + static inline Index run(const Derived&) + { return 0; } +}; + +template +struct first_aligned_impl +{ + static inline Index run(const Derived& m) + { + return internal::first_aligned(m.data(), m.size()); + } +}; + +/** \internal \returns the index of the first element of the array stored by \a m that is properly aligned with respect to \a Alignment for vectorization. + * + * \tparam Alignment requested alignment in Bytes. + * + * There is also the variant first_aligned(const Scalar*, Integer) defined in Memory.h. See it for more + * documentation. + */ +template +static inline Index first_aligned(const DenseBase& m) +{ + enum { ReturnZero = (int(evaluator::Alignment) >= Alignment) || !(Derived::Flags & DirectAccessBit) }; + return first_aligned_impl::run(m.derived()); +} + +template +static inline Index first_default_aligned(const DenseBase& m) +{ + typedef typename Derived::Scalar Scalar; + typedef typename packet_traits::type DefaultPacketType; + return internal::first_aligned::alignment),Derived>(m); +} + +template::ret> +struct inner_stride_at_compile_time +{ + enum { ret = traits::InnerStrideAtCompileTime }; +}; + +template +struct inner_stride_at_compile_time +{ + enum { ret = 0 }; +}; + +template::ret> +struct outer_stride_at_compile_time +{ + enum { ret = traits::OuterStrideAtCompileTime }; +}; + +template +struct outer_stride_at_compile_time +{ + enum { ret = 0 }; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_DENSECOEFFSBASE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/DenseStorage.h b/SudoDEM2D/lib/Eigen/src/Core/DenseStorage.h new file mode 100644 index 0000000..7958fee --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/DenseStorage.h @@ -0,0 +1,570 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2009 Benoit Jacob +// Copyright (C) 2010-2013 Hauke Heibel +// +// 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_MATRIXSTORAGE_H +#define EIGEN_MATRIXSTORAGE_H + +#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN + #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X) X; EIGEN_DENSE_STORAGE_CTOR_PLUGIN; +#else + #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(X) +#endif + +namespace Eigen { + +namespace internal { + +struct constructor_without_unaligned_array_assert {}; + +template +EIGEN_DEVICE_FUNC +void check_static_allocation_size() +{ + // if EIGEN_STACK_ALLOCATION_LIMIT is defined to 0, then no limit + #if EIGEN_STACK_ALLOCATION_LIMIT + EIGEN_STATIC_ASSERT(Size * sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG); + #endif +} + +/** \internal + * Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned: + * to 16 bytes boundary if the total size is a multiple of 16 bytes. + */ +template ::value > +struct plain_array +{ + T array[Size]; + + EIGEN_DEVICE_FUNC + plain_array() + { + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC + plain_array(constructor_without_unaligned_array_assert) + { + check_static_allocation_size(); + } +}; + +#if defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT) + #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) +#elif EIGEN_GNUC_AT_LEAST(4,7) + // GCC 4.7 is too aggressive in its optimizations and remove the alignement test based on the fact the array is declared to be aligned. + // See this bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900 + // Hiding the origin of the array pointer behind a function argument seems to do the trick even if the function is inlined: + template + EIGEN_ALWAYS_INLINE PtrType eigen_unaligned_array_assert_workaround_gcc47(PtrType array) { return array; } + #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \ + eigen_assert((internal::UIntPtr(eigen_unaligned_array_assert_workaround_gcc47(array)) & (sizemask)) == 0 \ + && "this assertion is explained here: " \ + "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \ + " **** READ THIS WEB PAGE !!! ****"); +#else + #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \ + eigen_assert((internal::UIntPtr(array) & (sizemask)) == 0 \ + && "this assertion is explained here: " \ + "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \ + " **** READ THIS WEB PAGE !!! ****"); +#endif + +template +struct plain_array +{ + EIGEN_ALIGN_TO_BOUNDARY(8) T array[Size]; + + EIGEN_DEVICE_FUNC + plain_array() + { + EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(7); + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC + plain_array(constructor_without_unaligned_array_assert) + { + check_static_allocation_size(); + } +}; + +template +struct plain_array +{ + EIGEN_ALIGN_TO_BOUNDARY(16) T array[Size]; + + EIGEN_DEVICE_FUNC + plain_array() + { + EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(15); + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC + plain_array(constructor_without_unaligned_array_assert) + { + check_static_allocation_size(); + } +}; + +template +struct plain_array +{ + EIGEN_ALIGN_TO_BOUNDARY(32) T array[Size]; + + EIGEN_DEVICE_FUNC + plain_array() + { + EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(31); + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC + plain_array(constructor_without_unaligned_array_assert) + { + check_static_allocation_size(); + } +}; + +template +struct plain_array +{ + EIGEN_ALIGN_TO_BOUNDARY(64) T array[Size]; + + EIGEN_DEVICE_FUNC + plain_array() + { + EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(63); + check_static_allocation_size(); + } + + EIGEN_DEVICE_FUNC + plain_array(constructor_without_unaligned_array_assert) + { + check_static_allocation_size(); + } +}; + +template +struct plain_array +{ + T array[1]; + EIGEN_DEVICE_FUNC plain_array() {} + EIGEN_DEVICE_FUNC plain_array(constructor_without_unaligned_array_assert) {} +}; + +} // end namespace internal + +/** \internal + * + * \class DenseStorage + * \ingroup Core_Module + * + * \brief Stores the data of a matrix + * + * This class stores the data of fixed-size, dynamic-size or mixed matrices + * in a way as compact as possible. + * + * \sa Matrix + */ +template class DenseStorage; + +// purely fixed-size matrix +template class DenseStorage +{ + internal::plain_array m_data; + public: + EIGEN_DEVICE_FUNC DenseStorage() { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size) + } + EIGEN_DEVICE_FUNC + explicit DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(internal::constructor_without_unaligned_array_assert()) {} + EIGEN_DEVICE_FUNC + DenseStorage(const DenseStorage& other) : m_data(other.m_data) { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size) + } + EIGEN_DEVICE_FUNC + DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) m_data = other.m_data; + return *this; + } + EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + eigen_internal_assert(size==rows*cols && rows==_Rows && cols==_Cols); + EIGEN_UNUSED_VARIABLE(size); + EIGEN_UNUSED_VARIABLE(rows); + EIGEN_UNUSED_VARIABLE(cols); + } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { std::swap(m_data,other.m_data); } + EIGEN_DEVICE_FUNC static Index rows(void) {return _Rows;} + EIGEN_DEVICE_FUNC static Index cols(void) {return _Cols;} + EIGEN_DEVICE_FUNC void conservativeResize(Index,Index,Index) {} + EIGEN_DEVICE_FUNC void resize(Index,Index,Index) {} + EIGEN_DEVICE_FUNC const T *data() const { return m_data.array; } + EIGEN_DEVICE_FUNC T *data() { return m_data.array; } +}; + +// null matrix +template class DenseStorage +{ + public: + EIGEN_DEVICE_FUNC DenseStorage() {} + EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) {} + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage&) {} + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage&) { return *this; } + EIGEN_DEVICE_FUNC DenseStorage(Index,Index,Index) {} + EIGEN_DEVICE_FUNC void swap(DenseStorage& ) {} + EIGEN_DEVICE_FUNC static Index rows(void) {return _Rows;} + EIGEN_DEVICE_FUNC static Index cols(void) {return _Cols;} + EIGEN_DEVICE_FUNC void conservativeResize(Index,Index,Index) {} + EIGEN_DEVICE_FUNC void resize(Index,Index,Index) {} + EIGEN_DEVICE_FUNC const T *data() const { return 0; } + EIGEN_DEVICE_FUNC T *data() { return 0; } +}; + +// more specializations for null matrices; these are necessary to resolve ambiguities +template class DenseStorage +: public DenseStorage { }; + +template class DenseStorage +: public DenseStorage { }; + +template class DenseStorage +: public DenseStorage { }; + +// dynamic-size matrix with fixed-size storage +template class DenseStorage +{ + internal::plain_array m_data; + Index m_rows; + Index m_cols; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_data(other.m_data), m_rows(other.m_rows), m_cols(other.m_cols) {} + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + m_data = other.m_data; + m_rows = other.m_rows; + m_cols = other.m_cols; + } + return *this; + } + EIGEN_DEVICE_FUNC DenseStorage(Index, Index rows, Index cols) : m_rows(rows), m_cols(cols) {} + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) + { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); std::swap(m_cols,other.m_cols); } + EIGEN_DEVICE_FUNC Index rows() const {return m_rows;} + EIGEN_DEVICE_FUNC Index cols() const {return m_cols;} + EIGEN_DEVICE_FUNC void conservativeResize(Index, Index rows, Index cols) { m_rows = rows; m_cols = cols; } + EIGEN_DEVICE_FUNC void resize(Index, Index rows, Index cols) { m_rows = rows; m_cols = cols; } + EIGEN_DEVICE_FUNC const T *data() const { return m_data.array; } + EIGEN_DEVICE_FUNC T *data() { return m_data.array; } +}; + +// dynamic-size matrix with fixed-size storage and fixed width +template class DenseStorage +{ + internal::plain_array m_data; + Index m_rows; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_rows(0) {} + EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0) {} + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_data(other.m_data), m_rows(other.m_rows) {} + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + m_data = other.m_data; + m_rows = other.m_rows; + } + return *this; + } + EIGEN_DEVICE_FUNC DenseStorage(Index, Index rows, Index) : m_rows(rows) {} + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); } + EIGEN_DEVICE_FUNC Index rows(void) const {return m_rows;} + EIGEN_DEVICE_FUNC Index cols(void) const {return _Cols;} + EIGEN_DEVICE_FUNC void conservativeResize(Index, Index rows, Index) { m_rows = rows; } + EIGEN_DEVICE_FUNC void resize(Index, Index rows, Index) { m_rows = rows; } + EIGEN_DEVICE_FUNC const T *data() const { return m_data.array; } + EIGEN_DEVICE_FUNC T *data() { return m_data.array; } +}; + +// dynamic-size matrix with fixed-size storage and fixed height +template class DenseStorage +{ + internal::plain_array m_data; + Index m_cols; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_cols(0) {} + EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(0) {} + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) : m_data(other.m_data), m_cols(other.m_cols) {} + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + m_data = other.m_data; + m_cols = other.m_cols; + } + return *this; + } + EIGEN_DEVICE_FUNC DenseStorage(Index, Index, Index cols) : m_cols(cols) {} + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_cols,other.m_cols); } + EIGEN_DEVICE_FUNC Index rows(void) const {return _Rows;} + EIGEN_DEVICE_FUNC Index cols(void) const {return m_cols;} + void conservativeResize(Index, Index, Index cols) { m_cols = cols; } + void resize(Index, Index, Index cols) { m_cols = cols; } + EIGEN_DEVICE_FUNC const T *data() const { return m_data.array; } + EIGEN_DEVICE_FUNC T *data() { return m_data.array; } +}; + +// purely dynamic matrix. +template class DenseStorage +{ + T *m_data; + Index m_rows; + Index m_cols; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC explicit DenseStorage(internal::constructor_without_unaligned_array_assert) + : m_data(0), m_rows(0), m_cols(0) {} + EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) + : m_data(internal::conditional_aligned_new_auto(size)), m_rows(rows), m_cols(cols) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + eigen_internal_assert(size==rows*cols && rows>=0 && cols >=0); + } + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) + : m_data(internal::conditional_aligned_new_auto(other.m_rows*other.m_cols)) + , m_rows(other.m_rows) + , m_cols(other.m_cols) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_rows*m_cols) + internal::smart_copy(other.m_data, other.m_data+other.m_rows*other.m_cols, m_data); + } + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + DenseStorage tmp(other); + this->swap(tmp); + } + return *this; + } +#if EIGEN_HAS_RVALUE_REFERENCES + EIGEN_DEVICE_FUNC + DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT + : m_data(std::move(other.m_data)) + , m_rows(std::move(other.m_rows)) + , m_cols(std::move(other.m_cols)) + { + other.m_data = nullptr; + other.m_rows = 0; + other.m_cols = 0; + } + EIGEN_DEVICE_FUNC + DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT + { + using std::swap; + swap(m_data, other.m_data); + swap(m_rows, other.m_rows); + swap(m_cols, other.m_cols); + return *this; + } +#endif + EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, m_rows*m_cols); } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) + { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); std::swap(m_cols,other.m_cols); } + EIGEN_DEVICE_FUNC Index rows(void) const {return m_rows;} + EIGEN_DEVICE_FUNC Index cols(void) const {return m_cols;} + void conservativeResize(Index size, Index rows, Index cols) + { + m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, m_rows*m_cols); + m_rows = rows; + m_cols = cols; + } + EIGEN_DEVICE_FUNC void resize(Index size, Index rows, Index cols) + { + if(size != m_rows*m_cols) + { + internal::conditional_aligned_delete_auto(m_data, m_rows*m_cols); + if (size) + m_data = internal::conditional_aligned_new_auto(size); + else + m_data = 0; + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + } + m_rows = rows; + m_cols = cols; + } + EIGEN_DEVICE_FUNC const T *data() const { return m_data; } + EIGEN_DEVICE_FUNC T *data() { return m_data; } +}; + +// matrix with dynamic width and fixed height (so that matrix has dynamic size). +template class DenseStorage +{ + T *m_data; + Index m_cols; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_data(0), m_cols(0) {} + explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_cols(0) {} + EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) : m_data(internal::conditional_aligned_new_auto(size)), m_cols(cols) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + eigen_internal_assert(size==rows*cols && rows==_Rows && cols >=0); + EIGEN_UNUSED_VARIABLE(rows); + } + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) + : m_data(internal::conditional_aligned_new_auto(_Rows*other.m_cols)) + , m_cols(other.m_cols) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_cols*_Rows) + internal::smart_copy(other.m_data, other.m_data+_Rows*m_cols, m_data); + } + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + DenseStorage tmp(other); + this->swap(tmp); + } + return *this; + } +#if EIGEN_HAS_RVALUE_REFERENCES + EIGEN_DEVICE_FUNC + DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT + : m_data(std::move(other.m_data)) + , m_cols(std::move(other.m_cols)) + { + other.m_data = nullptr; + other.m_cols = 0; + } + EIGEN_DEVICE_FUNC + DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT + { + using std::swap; + swap(m_data, other.m_data); + swap(m_cols, other.m_cols); + return *this; + } +#endif + EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, _Rows*m_cols); } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_cols,other.m_cols); } + EIGEN_DEVICE_FUNC static Index rows(void) {return _Rows;} + EIGEN_DEVICE_FUNC Index cols(void) const {return m_cols;} + EIGEN_DEVICE_FUNC void conservativeResize(Index size, Index, Index cols) + { + m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, _Rows*m_cols); + m_cols = cols; + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index, Index cols) + { + if(size != _Rows*m_cols) + { + internal::conditional_aligned_delete_auto(m_data, _Rows*m_cols); + if (size) + m_data = internal::conditional_aligned_new_auto(size); + else + m_data = 0; + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + } + m_cols = cols; + } + EIGEN_DEVICE_FUNC const T *data() const { return m_data; } + EIGEN_DEVICE_FUNC T *data() { return m_data; } +}; + +// matrix with dynamic height and fixed width (so that matrix has dynamic size). +template class DenseStorage +{ + T *m_data; + Index m_rows; + public: + EIGEN_DEVICE_FUNC DenseStorage() : m_data(0), m_rows(0) {} + explicit DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_rows(0) {} + EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) : m_data(internal::conditional_aligned_new_auto(size)), m_rows(rows) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + eigen_internal_assert(size==rows*cols && rows>=0 && cols == _Cols); + EIGEN_UNUSED_VARIABLE(cols); + } + EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage& other) + : m_data(internal::conditional_aligned_new_auto(other.m_rows*_Cols)) + , m_rows(other.m_rows) + { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = m_rows*_Cols) + internal::smart_copy(other.m_data, other.m_data+other.m_rows*_Cols, m_data); + } + EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) + { + DenseStorage tmp(other); + this->swap(tmp); + } + return *this; + } +#if EIGEN_HAS_RVALUE_REFERENCES + EIGEN_DEVICE_FUNC + DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT + : m_data(std::move(other.m_data)) + , m_rows(std::move(other.m_rows)) + { + other.m_data = nullptr; + other.m_rows = 0; + } + EIGEN_DEVICE_FUNC + DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT + { + using std::swap; + swap(m_data, other.m_data); + swap(m_rows, other.m_rows); + return *this; + } +#endif + EIGEN_DEVICE_FUNC ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, _Cols*m_rows); } + EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); } + EIGEN_DEVICE_FUNC Index rows(void) const {return m_rows;} + EIGEN_DEVICE_FUNC static Index cols(void) {return _Cols;} + void conservativeResize(Index size, Index rows, Index) + { + m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, m_rows*_Cols); + m_rows = rows; + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index size, Index rows, Index) + { + if(size != m_rows*_Cols) + { + internal::conditional_aligned_delete_auto(m_data, _Cols*m_rows); + if (size) + m_data = internal::conditional_aligned_new_auto(size); + else + m_data = 0; + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) + } + m_rows = rows; + } + EIGEN_DEVICE_FUNC const T *data() const { return m_data; } + EIGEN_DEVICE_FUNC T *data() { return m_data; } +}; + +} // end namespace Eigen + +#endif // EIGEN_MATRIX_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Diagonal.h b/SudoDEM2D/lib/Eigen/src/Core/Diagonal.h new file mode 100644 index 0000000..afcaf35 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Diagonal.h @@ -0,0 +1,260 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007-2009 Benoit Jacob +// Copyright (C) 2009-2010 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_DIAGONAL_H +#define EIGEN_DIAGONAL_H + +namespace Eigen { + +/** \class Diagonal + * \ingroup Core_Module + * + * \brief Expression of a diagonal/subdiagonal/superdiagonal in a matrix + * + * \param MatrixType the type of the object in which we are taking a sub/main/super diagonal + * \param DiagIndex the index of the sub/super diagonal. The default is 0 and it means the main diagonal. + * A positive value means a superdiagonal, a negative value means a subdiagonal. + * You can also use DynamicIndex so the index can be set at runtime. + * + * The matrix is not required to be square. + * + * This class represents an expression of the main diagonal, or any sub/super diagonal + * of a square matrix. It is the return type of MatrixBase::diagonal() and MatrixBase::diagonal(Index) and most of the + * time this is the only way it is used. + * + * \sa MatrixBase::diagonal(), MatrixBase::diagonal(Index) + */ + +namespace internal { +template +struct traits > + : traits +{ + typedef typename ref_selector::type MatrixTypeNested; + typedef typename remove_reference::type _MatrixTypeNested; + typedef typename MatrixType::StorageKind StorageKind; + enum { + RowsAtCompileTime = (int(DiagIndex) == DynamicIndex || int(MatrixType::SizeAtCompileTime) == Dynamic) ? Dynamic + : (EIGEN_PLAIN_ENUM_MIN(MatrixType::RowsAtCompileTime - EIGEN_PLAIN_ENUM_MAX(-DiagIndex, 0), + MatrixType::ColsAtCompileTime - EIGEN_PLAIN_ENUM_MAX( DiagIndex, 0))), + ColsAtCompileTime = 1, + MaxRowsAtCompileTime = int(MatrixType::MaxSizeAtCompileTime) == Dynamic ? Dynamic + : DiagIndex == DynamicIndex ? EIGEN_SIZE_MIN_PREFER_FIXED(MatrixType::MaxRowsAtCompileTime, + MatrixType::MaxColsAtCompileTime) + : (EIGEN_PLAIN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime - EIGEN_PLAIN_ENUM_MAX(-DiagIndex, 0), + MatrixType::MaxColsAtCompileTime - EIGEN_PLAIN_ENUM_MAX( DiagIndex, 0))), + MaxColsAtCompileTime = 1, + MaskLvalueBit = is_lvalue::value ? LvalueBit : 0, + Flags = (unsigned int)_MatrixTypeNested::Flags & (RowMajorBit | MaskLvalueBit | DirectAccessBit) & ~RowMajorBit, // FIXME DirectAccessBit should not be handled by expressions + MatrixTypeOuterStride = outer_stride_at_compile_time::ret, + InnerStrideAtCompileTime = MatrixTypeOuterStride == Dynamic ? Dynamic : MatrixTypeOuterStride+1, + OuterStrideAtCompileTime = 0 + }; +}; +} + +template class Diagonal + : public internal::dense_xpr_base< Diagonal >::type +{ + public: + + enum { DiagIndex = _DiagIndex }; + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal) + + EIGEN_DEVICE_FUNC + explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) + { + eigen_assert( a_index <= m_matrix.cols() && -a_index <= m_matrix.rows() ); + } + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal) + + EIGEN_DEVICE_FUNC + inline Index rows() const + { + return m_index.value()<0 ? numext::mini(m_matrix.cols(),m_matrix.rows()+m_index.value()) + : numext::mini(m_matrix.rows(),m_matrix.cols()-m_index.value()); + } + + EIGEN_DEVICE_FUNC + inline Index cols() const { return 1; } + + EIGEN_DEVICE_FUNC + inline Index innerStride() const + { + return m_matrix.outerStride() + 1; + } + + EIGEN_DEVICE_FUNC + inline Index outerStride() const + { + return 0; + } + + typedef typename internal::conditional< + internal::is_lvalue::value, + Scalar, + const Scalar + >::type ScalarWithConstIfNotLvalue; + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue* data() { return &(m_matrix.coeffRef(rowOffset(), colOffset())); } + EIGEN_DEVICE_FUNC + inline const Scalar* data() const { return &(m_matrix.coeffRef(rowOffset(), colOffset())); } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index row, Index) + { + EIGEN_STATIC_ASSERT_LVALUE(MatrixType) + return m_matrix.coeffRef(row+rowOffset(), row+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index row, Index) const + { + return m_matrix.coeffRef(row+rowOffset(), row+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline CoeffReturnType coeff(Index row, Index) const + { + return m_matrix.coeff(row+rowOffset(), row+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline Scalar& coeffRef(Index idx) + { + EIGEN_STATIC_ASSERT_LVALUE(MatrixType) + return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index idx) const + { + return m_matrix.coeffRef(idx+rowOffset(), idx+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline CoeffReturnType coeff(Index idx) const + { + return m_matrix.coeff(idx+rowOffset(), idx+colOffset()); + } + + EIGEN_DEVICE_FUNC + inline const typename internal::remove_all::type& + nestedExpression() const + { + return m_matrix; + } + + EIGEN_DEVICE_FUNC + inline Index index() const + { + return m_index.value(); + } + + protected: + typename internal::ref_selector::non_const_type m_matrix; + const internal::variable_if_dynamicindex m_index; + + private: + // some compilers may fail to optimize std::max etc in case of compile-time constants... + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index absDiagIndex() const { return m_index.value()>0 ? m_index.value() : -m_index.value(); } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index rowOffset() const { return m_index.value()>0 ? 0 : -m_index.value(); } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index colOffset() const { return m_index.value()>0 ? m_index.value() : 0; } + // trigger a compile-time error if someone try to call packet + template typename MatrixType::PacketReturnType packet(Index) const; + template typename MatrixType::PacketReturnType packet(Index,Index) const; +}; + +/** \returns an expression of the main diagonal of the matrix \c *this + * + * \c *this is not required to be square. + * + * Example: \include MatrixBase_diagonal.cpp + * Output: \verbinclude MatrixBase_diagonal.out + * + * \sa class Diagonal */ +template +inline typename MatrixBase::DiagonalReturnType +MatrixBase::diagonal() +{ + return DiagonalReturnType(derived()); +} + +/** This is the const version of diagonal(). */ +template +inline typename MatrixBase::ConstDiagonalReturnType +MatrixBase::diagonal() const +{ + return ConstDiagonalReturnType(derived()); +} + +/** \returns an expression of the \a DiagIndex-th sub or super diagonal of the matrix \c *this + * + * \c *this is not required to be square. + * + * The template parameter \a DiagIndex represent a super diagonal if \a DiagIndex > 0 + * and a sub diagonal otherwise. \a DiagIndex == 0 is equivalent to the main diagonal. + * + * Example: \include MatrixBase_diagonal_int.cpp + * Output: \verbinclude MatrixBase_diagonal_int.out + * + * \sa MatrixBase::diagonal(), class Diagonal */ +template +inline typename MatrixBase::DiagonalDynamicIndexReturnType +MatrixBase::diagonal(Index index) +{ + return DiagonalDynamicIndexReturnType(derived(), index); +} + +/** This is the const version of diagonal(Index). */ +template +inline typename MatrixBase::ConstDiagonalDynamicIndexReturnType +MatrixBase::diagonal(Index index) const +{ + return ConstDiagonalDynamicIndexReturnType(derived(), index); +} + +/** \returns an expression of the \a DiagIndex-th sub or super diagonal of the matrix \c *this + * + * \c *this is not required to be square. + * + * The template parameter \a DiagIndex represent a super diagonal if \a DiagIndex > 0 + * and a sub diagonal otherwise. \a DiagIndex == 0 is equivalent to the main diagonal. + * + * Example: \include MatrixBase_diagonal_template_int.cpp + * Output: \verbinclude MatrixBase_diagonal_template_int.out + * + * \sa MatrixBase::diagonal(), class Diagonal */ +template +template +inline typename MatrixBase::template DiagonalIndexReturnType::Type +MatrixBase::diagonal() +{ + return typename DiagonalIndexReturnType::Type(derived()); +} + +/** This is the const version of diagonal(). */ +template +template +inline typename MatrixBase::template ConstDiagonalIndexReturnType::Type +MatrixBase::diagonal() const +{ + return typename ConstDiagonalIndexReturnType::Type(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_DIAGONAL_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/DiagonalMatrix.h b/SudoDEM2D/lib/Eigen/src/Core/DiagonalMatrix.h new file mode 100644 index 0000000..ecfdce8 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/DiagonalMatrix.h @@ -0,0 +1,343 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Gael Guennebaud +// Copyright (C) 2007-2009 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_DIAGONALMATRIX_H +#define EIGEN_DIAGONALMATRIX_H + +namespace Eigen { + +#ifndef EIGEN_PARSED_BY_DOXYGEN +template +class DiagonalBase : public EigenBase +{ + public: + typedef typename internal::traits::DiagonalVectorType DiagonalVectorType; + typedef typename DiagonalVectorType::Scalar Scalar; + typedef typename DiagonalVectorType::RealScalar RealScalar; + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::StorageIndex StorageIndex; + + enum { + RowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, + ColsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, + MaxRowsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, + MaxColsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, + IsVectorAtCompileTime = 0, + Flags = NoPreferredStorageOrderBit + }; + + typedef Matrix DenseMatrixType; + typedef DenseMatrixType DenseType; + typedef DiagonalMatrix PlainObject; + + EIGEN_DEVICE_FUNC + inline const Derived& derived() const { return *static_cast(this); } + EIGEN_DEVICE_FUNC + inline Derived& derived() { return *static_cast(this); } + + EIGEN_DEVICE_FUNC + DenseMatrixType toDenseMatrix() const { return derived(); } + + EIGEN_DEVICE_FUNC + inline const DiagonalVectorType& diagonal() const { return derived().diagonal(); } + EIGEN_DEVICE_FUNC + inline DiagonalVectorType& diagonal() { return derived().diagonal(); } + + EIGEN_DEVICE_FUNC + inline Index rows() const { return diagonal().size(); } + EIGEN_DEVICE_FUNC + inline Index cols() const { return diagonal().size(); } + + template + EIGEN_DEVICE_FUNC + const Product + operator*(const MatrixBase &matrix) const + { + return Product(derived(),matrix.derived()); + } + + typedef DiagonalWrapper, const DiagonalVectorType> > InverseReturnType; + EIGEN_DEVICE_FUNC + inline const InverseReturnType + inverse() const + { + return InverseReturnType(diagonal().cwiseInverse()); + } + + EIGEN_DEVICE_FUNC + inline const DiagonalWrapper + operator*(const Scalar& scalar) const + { + return DiagonalWrapper(diagonal() * scalar); + } + EIGEN_DEVICE_FUNC + friend inline const DiagonalWrapper + operator*(const Scalar& scalar, const DiagonalBase& other) + { + return DiagonalWrapper(scalar * other.diagonal()); + } +}; + +#endif + +/** \class DiagonalMatrix + * \ingroup Core_Module + * + * \brief Represents a diagonal matrix with its storage + * + * \param _Scalar the type of coefficients + * \param SizeAtCompileTime the dimension of the matrix, or Dynamic + * \param MaxSizeAtCompileTime the dimension of the matrix, or Dynamic. This parameter is optional and defaults + * to SizeAtCompileTime. Most of the time, you do not need to specify it. + * + * \sa class DiagonalWrapper + */ + +namespace internal { +template +struct traits > + : traits > +{ + typedef Matrix<_Scalar,SizeAtCompileTime,1,0,MaxSizeAtCompileTime,1> DiagonalVectorType; + typedef DiagonalShape StorageKind; + enum { + Flags = LvalueBit | NoPreferredStorageOrderBit + }; +}; +} +template +class DiagonalMatrix + : public DiagonalBase > +{ + public: + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename internal::traits::DiagonalVectorType DiagonalVectorType; + typedef const DiagonalMatrix& Nested; + typedef _Scalar Scalar; + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::StorageIndex StorageIndex; + #endif + + protected: + + DiagonalVectorType m_diagonal; + + public: + + /** const version of diagonal(). */ + EIGEN_DEVICE_FUNC + inline const DiagonalVectorType& diagonal() const { return m_diagonal; } + /** \returns a reference to the stored vector of diagonal coefficients. */ + EIGEN_DEVICE_FUNC + inline DiagonalVectorType& diagonal() { return m_diagonal; } + + /** Default constructor without initialization */ + EIGEN_DEVICE_FUNC + inline DiagonalMatrix() {} + + /** Constructs a diagonal matrix with given dimension */ + EIGEN_DEVICE_FUNC + explicit inline DiagonalMatrix(Index dim) : m_diagonal(dim) {} + + /** 2D constructor. */ + EIGEN_DEVICE_FUNC + inline DiagonalMatrix(const Scalar& x, const Scalar& y) : m_diagonal(x,y) {} + + /** 3D constructor. */ + EIGEN_DEVICE_FUNC + inline DiagonalMatrix(const Scalar& x, const Scalar& y, const Scalar& z) : m_diagonal(x,y,z) {} + + /** Copy constructor. */ + template + EIGEN_DEVICE_FUNC + inline DiagonalMatrix(const DiagonalBase& other) : m_diagonal(other.diagonal()) {} + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** copy constructor. prevent a default copy constructor from hiding the other templated constructor */ + inline DiagonalMatrix(const DiagonalMatrix& other) : m_diagonal(other.diagonal()) {} + #endif + + /** generic constructor from expression of the diagonal coefficients */ + template + EIGEN_DEVICE_FUNC + explicit inline DiagonalMatrix(const MatrixBase& other) : m_diagonal(other) + {} + + /** Copy operator. */ + template + EIGEN_DEVICE_FUNC + DiagonalMatrix& operator=(const DiagonalBase& other) + { + m_diagonal = other.diagonal(); + return *this; + } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + EIGEN_DEVICE_FUNC + DiagonalMatrix& operator=(const DiagonalMatrix& other) + { + m_diagonal = other.diagonal(); + return *this; + } + #endif + + /** Resizes to given size. */ + EIGEN_DEVICE_FUNC + inline void resize(Index size) { m_diagonal.resize(size); } + /** Sets all coefficients to zero. */ + EIGEN_DEVICE_FUNC + inline void setZero() { m_diagonal.setZero(); } + /** Resizes and sets all coefficients to zero. */ + EIGEN_DEVICE_FUNC + inline void setZero(Index size) { m_diagonal.setZero(size); } + /** Sets this matrix to be the identity matrix of the current size. */ + EIGEN_DEVICE_FUNC + inline void setIdentity() { m_diagonal.setOnes(); } + /** Sets this matrix to be the identity matrix of the given size. */ + EIGEN_DEVICE_FUNC + inline void setIdentity(Index size) { m_diagonal.setOnes(size); } +}; + +/** \class DiagonalWrapper + * \ingroup Core_Module + * + * \brief Expression of a diagonal matrix + * + * \param _DiagonalVectorType the type of the vector of diagonal coefficients + * + * This class is an expression of a diagonal matrix, but not storing its own vector of diagonal coefficients, + * instead wrapping an existing vector expression. It is the return type of MatrixBase::asDiagonal() + * and most of the time this is the only way that it is used. + * + * \sa class DiagonalMatrix, class DiagonalBase, MatrixBase::asDiagonal() + */ + +namespace internal { +template +struct traits > +{ + typedef _DiagonalVectorType DiagonalVectorType; + typedef typename DiagonalVectorType::Scalar Scalar; + typedef typename DiagonalVectorType::StorageIndex StorageIndex; + typedef DiagonalShape StorageKind; + typedef typename traits::XprKind XprKind; + enum { + RowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, + ColsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, + MaxRowsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, + MaxColsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, + Flags = (traits::Flags & LvalueBit) | NoPreferredStorageOrderBit + }; +}; +} + +template +class DiagonalWrapper + : public DiagonalBase >, internal::no_assignment_operator +{ + public: + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef _DiagonalVectorType DiagonalVectorType; + typedef DiagonalWrapper Nested; + #endif + + /** Constructor from expression of diagonal coefficients to wrap. */ + EIGEN_DEVICE_FUNC + explicit inline DiagonalWrapper(DiagonalVectorType& a_diagonal) : m_diagonal(a_diagonal) {} + + /** \returns a const reference to the wrapped expression of diagonal coefficients. */ + EIGEN_DEVICE_FUNC + const DiagonalVectorType& diagonal() const { return m_diagonal; } + + protected: + typename DiagonalVectorType::Nested m_diagonal; +}; + +/** \returns a pseudo-expression of a diagonal matrix with *this as vector of diagonal coefficients + * + * \only_for_vectors + * + * Example: \include MatrixBase_asDiagonal.cpp + * Output: \verbinclude MatrixBase_asDiagonal.out + * + * \sa class DiagonalWrapper, class DiagonalMatrix, diagonal(), isDiagonal() + **/ +template +inline const DiagonalWrapper +MatrixBase::asDiagonal() const +{ + return DiagonalWrapper(derived()); +} + +/** \returns true if *this is approximately equal to a diagonal matrix, + * within the precision given by \a prec. + * + * Example: \include MatrixBase_isDiagonal.cpp + * Output: \verbinclude MatrixBase_isDiagonal.out + * + * \sa asDiagonal() + */ +template +bool MatrixBase::isDiagonal(const RealScalar& prec) const +{ + if(cols() != rows()) return false; + RealScalar maxAbsOnDiagonal = static_cast(-1); + for(Index j = 0; j < cols(); ++j) + { + RealScalar absOnDiagonal = numext::abs(coeff(j,j)); + if(absOnDiagonal > maxAbsOnDiagonal) maxAbsOnDiagonal = absOnDiagonal; + } + for(Index j = 0; j < cols(); ++j) + for(Index i = 0; i < j; ++i) + { + if(!internal::isMuchSmallerThan(coeff(i, j), maxAbsOnDiagonal, prec)) return false; + if(!internal::isMuchSmallerThan(coeff(j, i), maxAbsOnDiagonal, prec)) return false; + } + return true; +} + +namespace internal { + +template<> struct storage_kind_to_shape { typedef DiagonalShape Shape; }; + +struct Diagonal2Dense {}; + +template<> struct AssignmentKind { typedef Diagonal2Dense Kind; }; + +// Diagonal matrix to Dense assignment +template< typename DstXprType, typename SrcXprType, typename Functor> +struct Assignment +{ + static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &/*func*/) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + + dst.setZero(); + dst.diagonal() = src.diagonal(); + } + + static void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op &/*func*/) + { dst.diagonal() += src.diagonal(); } + + static void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op &/*func*/) + { dst.diagonal() -= src.diagonal(); } +}; + +} // namespace internal + +} // end namespace Eigen + +#endif // EIGEN_DIAGONALMATRIX_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/DiagonalProduct.h b/SudoDEM2D/lib/Eigen/src/Core/DiagonalProduct.h new file mode 100644 index 0000000..d372b93 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/DiagonalProduct.h @@ -0,0 +1,28 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2007-2009 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_DIAGONALPRODUCT_H +#define EIGEN_DIAGONALPRODUCT_H + +namespace Eigen { + +/** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. + */ +template +template +inline const Product +MatrixBase::operator*(const DiagonalBase &a_diagonal) const +{ + return Product(derived(),a_diagonal.derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_DIAGONALPRODUCT_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Dot.h b/SudoDEM2D/lib/Eigen/src/Core/Dot.h new file mode 100644 index 0000000..1fe7a84 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Dot.h @@ -0,0 +1,318 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008, 2010 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_DOT_H +#define EIGEN_DOT_H + +namespace Eigen { + +namespace internal { + +// helper function for dot(). The problem is that if we put that in the body of dot(), then upon calling dot +// with mismatched types, the compiler emits errors about failing to instantiate cwiseProduct BEFORE +// looking at the static assertions. Thus this is a trick to get better compile errors. +template +struct dot_nocheck +{ + typedef scalar_conj_product_op::Scalar,typename traits::Scalar> conj_prod; + typedef typename conj_prod::result_type ResScalar; + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE + static ResScalar run(const MatrixBase& a, const MatrixBase& b) + { + return a.template binaryExpr(b).sum(); + } +}; + +template +struct dot_nocheck +{ + typedef scalar_conj_product_op::Scalar,typename traits::Scalar> conj_prod; + typedef typename conj_prod::result_type ResScalar; + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE + static ResScalar run(const MatrixBase& a, const MatrixBase& b) + { + return a.transpose().template binaryExpr(b).sum(); + } +}; + +} // end namespace internal + +/** \fn MatrixBase::dot + * \returns the dot product of *this with other. + * + * \only_for_vectors + * + * \note If the scalar type is complex numbers, then this function returns the hermitian + * (sesquilinear) dot product, conjugate-linear in the first variable and linear in the + * second variable. + * + * \sa squaredNorm(), norm() + */ +template +template +EIGEN_DEVICE_FUNC +EIGEN_STRONG_INLINE +typename ScalarBinaryOpTraits::Scalar,typename internal::traits::Scalar>::ReturnType +MatrixBase::dot(const MatrixBase& other) const +{ + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) + EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) +#if !(defined(EIGEN_NO_STATIC_ASSERT) && defined(EIGEN_NO_DEBUG)) + typedef internal::scalar_conj_product_op func; + EIGEN_CHECK_BINARY_COMPATIBILIY(func,Scalar,typename OtherDerived::Scalar); +#endif + + eigen_assert(size() == other.size()); + + return internal::dot_nocheck::run(*this, other); +} + +//---------- implementation of L2 norm and related functions ---------- + +/** \returns, for vectors, the squared \em l2 norm of \c *this, and for matrices the Frobenius norm. + * In both cases, it consists in the sum of the square of all the matrix entries. + * For vectors, this is also equals to the dot product of \c *this with itself. + * + * \sa dot(), norm(), lpNorm() + */ +template +EIGEN_STRONG_INLINE typename NumTraits::Scalar>::Real MatrixBase::squaredNorm() const +{ + return numext::real((*this).cwiseAbs2().sum()); +} + +/** \returns, for vectors, the \em l2 norm of \c *this, and for matrices the Frobenius norm. + * In both cases, it consists in the square root of the sum of the square of all the matrix entries. + * For vectors, this is also equals to the square root of the dot product of \c *this with itself. + * + * \sa lpNorm(), dot(), squaredNorm() + */ +template +EIGEN_STRONG_INLINE typename NumTraits::Scalar>::Real MatrixBase::norm() const +{ + return numext::sqrt(squaredNorm()); +} + +/** \returns an expression of the quotient of \c *this by its own norm. + * + * \warning If the input vector is too small (i.e., this->norm()==0), + * then this function returns a copy of the input. + * + * \only_for_vectors + * + * \sa norm(), normalize() + */ +template +EIGEN_STRONG_INLINE const typename MatrixBase::PlainObject +MatrixBase::normalized() const +{ + typedef typename internal::nested_eval::type _Nested; + _Nested n(derived()); + RealScalar z = n.squaredNorm(); + // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU + if(z>RealScalar(0)) + return n / numext::sqrt(z); + else + return n; +} + +/** Normalizes the vector, i.e. divides it by its own norm. + * + * \only_for_vectors + * + * \warning If the input vector is too small (i.e., this->norm()==0), then \c *this is left unchanged. + * + * \sa norm(), normalized() + */ +template +EIGEN_STRONG_INLINE void MatrixBase::normalize() +{ + RealScalar z = squaredNorm(); + // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU + if(z>RealScalar(0)) + derived() /= numext::sqrt(z); +} + +/** \returns an expression of the quotient of \c *this by its own norm while avoiding underflow and overflow. + * + * \only_for_vectors + * + * This method is analogue to the normalized() method, but it reduces the risk of + * underflow and overflow when computing the norm. + * + * \warning If the input vector is too small (i.e., this->norm()==0), + * then this function returns a copy of the input. + * + * \sa stableNorm(), stableNormalize(), normalized() + */ +template +EIGEN_STRONG_INLINE const typename MatrixBase::PlainObject +MatrixBase::stableNormalized() const +{ + typedef typename internal::nested_eval::type _Nested; + _Nested n(derived()); + RealScalar w = n.cwiseAbs().maxCoeff(); + RealScalar z = (n/w).squaredNorm(); + if(z>RealScalar(0)) + return n / (numext::sqrt(z)*w); + else + return n; +} + +/** Normalizes the vector while avoid underflow and overflow + * + * \only_for_vectors + * + * This method is analogue to the normalize() method, but it reduces the risk of + * underflow and overflow when computing the norm. + * + * \warning If the input vector is too small (i.e., this->norm()==0), then \c *this is left unchanged. + * + * \sa stableNorm(), stableNormalized(), normalize() + */ +template +EIGEN_STRONG_INLINE void MatrixBase::stableNormalize() +{ + RealScalar w = cwiseAbs().maxCoeff(); + RealScalar z = (derived()/w).squaredNorm(); + if(z>RealScalar(0)) + derived() /= numext::sqrt(z)*w; +} + +//---------- implementation of other norms ---------- + +namespace internal { + +template +struct lpNorm_selector +{ + typedef typename NumTraits::Scalar>::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const MatrixBase& m) + { + EIGEN_USING_STD_MATH(pow) + return pow(m.cwiseAbs().array().pow(p).sum(), RealScalar(1)/p); + } +}; + +template +struct lpNorm_selector +{ + EIGEN_DEVICE_FUNC + static inline typename NumTraits::Scalar>::Real run(const MatrixBase& m) + { + return m.cwiseAbs().sum(); + } +}; + +template +struct lpNorm_selector +{ + EIGEN_DEVICE_FUNC + static inline typename NumTraits::Scalar>::Real run(const MatrixBase& m) + { + return m.norm(); + } +}; + +template +struct lpNorm_selector +{ + typedef typename NumTraits::Scalar>::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const MatrixBase& m) + { + if(Derived::SizeAtCompileTime==0 || (Derived::SizeAtCompileTime==Dynamic && m.size()==0)) + return RealScalar(0); + return m.cwiseAbs().maxCoeff(); + } +}; + +} // end namespace internal + +/** \returns the \b coefficient-wise \f$ \ell^p \f$ norm of \c *this, that is, returns the p-th root of the sum of the p-th powers of the absolute values + * of the coefficients of \c *this. If \a p is the special value \a Eigen::Infinity, this function returns the \f$ \ell^\infty \f$ + * norm, that is the maximum of the absolute values of the coefficients of \c *this. + * + * In all cases, if \c *this is empty, then the value 0 is returned. + * + * \note For matrices, this function does not compute the operator-norm. That is, if \c *this is a matrix, then its coefficients are interpreted as a 1D vector. Nonetheless, you can easily compute the 1-norm and \f$\infty\f$-norm matrix operator norms using \link TutorialReductionsVisitorsBroadcastingReductionsNorm partial reductions \endlink. + * + * \sa norm() + */ +template +template +#ifndef EIGEN_PARSED_BY_DOXYGEN +inline typename NumTraits::Scalar>::Real +#else +MatrixBase::RealScalar +#endif +MatrixBase::lpNorm() const +{ + return internal::lpNorm_selector::run(*this); +} + +//---------- implementation of isOrthogonal / isUnitary ---------- + +/** \returns true if *this is approximately orthogonal to \a other, + * within the precision given by \a prec. + * + * Example: \include MatrixBase_isOrthogonal.cpp + * Output: \verbinclude MatrixBase_isOrthogonal.out + */ +template +template +bool MatrixBase::isOrthogonal +(const MatrixBase& other, const RealScalar& prec) const +{ + typename internal::nested_eval::type nested(derived()); + typename internal::nested_eval::type otherNested(other.derived()); + return numext::abs2(nested.dot(otherNested)) <= prec * prec * nested.squaredNorm() * otherNested.squaredNorm(); +} + +/** \returns true if *this is approximately an unitary matrix, + * within the precision given by \a prec. In the case where the \a Scalar + * type is real numbers, a unitary matrix is an orthogonal matrix, whence the name. + * + * \note This can be used to check whether a family of vectors forms an orthonormal basis. + * Indeed, \c m.isUnitary() returns true if and only if the columns (equivalently, the rows) of m form an + * orthonormal basis. + * + * Example: \include MatrixBase_isUnitary.cpp + * Output: \verbinclude MatrixBase_isUnitary.out + */ +template +bool MatrixBase::isUnitary(const RealScalar& prec) const +{ + typename internal::nested_eval::type self(derived()); + for(Index i = 0; i < cols(); ++i) + { + if(!internal::isApprox(self.col(i).squaredNorm(), static_cast(1), prec)) + return false; + for(Index j = 0; j < i; ++j) + if(!internal::isMuchSmallerThan(self.col(i).dot(self.col(j)), static_cast(1), prec)) + return false; + } + return true; +} + +} // end namespace Eigen + +#endif // EIGEN_DOT_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/EigenBase.h b/SudoDEM2D/lib/Eigen/src/Core/EigenBase.h new file mode 100644 index 0000000..b195506 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/EigenBase.h @@ -0,0 +1,159 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Benoit Jacob +// 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 EIGEN_EIGENBASE_H +#define EIGEN_EIGENBASE_H + +namespace Eigen { + +/** \class EigenBase + * \ingroup Core_Module + * + * Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor MatrixBase(T). + * + * In other words, an EigenBase object is an object that can be copied into a MatrixBase. + * + * Besides MatrixBase-derived classes, this also includes special matrix classes such as diagonal matrices, etc. + * + * Notice that this class is trivial, it is only used to disambiguate overloaded functions. + * + * \sa \blank \ref TopicClassHierarchy + */ +template struct EigenBase +{ +// typedef typename internal::plain_matrix_type::type PlainObject; + + /** \brief The interface type of indices + * \details To change this, \c \#define the preprocessor symbol \c EIGEN_DEFAULT_DENSE_INDEX_TYPE. + * \deprecated Since Eigen 3.3, its usage is deprecated. Use Eigen::Index instead. + * \sa StorageIndex, \ref TopicPreprocessorDirectives. + */ + typedef Eigen::Index Index; + + // FIXME is it needed? + typedef typename internal::traits::StorageKind StorageKind; + + /** \returns a reference to the derived object */ + EIGEN_DEVICE_FUNC + Derived& derived() { return *static_cast(this); } + /** \returns a const reference to the derived object */ + EIGEN_DEVICE_FUNC + const Derived& derived() const { return *static_cast(this); } + + EIGEN_DEVICE_FUNC + inline Derived& const_cast_derived() const + { return *static_cast(const_cast(this)); } + EIGEN_DEVICE_FUNC + inline const Derived& const_derived() const + { return *static_cast(this); } + + /** \returns the number of rows. \sa cols(), RowsAtCompileTime */ + EIGEN_DEVICE_FUNC + inline Index rows() const { return derived().rows(); } + /** \returns the number of columns. \sa rows(), ColsAtCompileTime*/ + EIGEN_DEVICE_FUNC + inline Index cols() const { return derived().cols(); } + /** \returns the number of coefficients, which is rows()*cols(). + * \sa rows(), cols(), SizeAtCompileTime. */ + EIGEN_DEVICE_FUNC + inline Index size() const { return rows() * cols(); } + + /** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */ + template + EIGEN_DEVICE_FUNC + inline void evalTo(Dest& dst) const + { derived().evalTo(dst); } + + /** \internal Don't use it, but do the equivalent: \code dst += *this; \endcode */ + template + EIGEN_DEVICE_FUNC + inline void addTo(Dest& dst) const + { + // This is the default implementation, + // derived class can reimplement it in a more optimized way. + typename Dest::PlainObject res(rows(),cols()); + evalTo(res); + dst += res; + } + + /** \internal Don't use it, but do the equivalent: \code dst -= *this; \endcode */ + template + EIGEN_DEVICE_FUNC + inline void subTo(Dest& dst) const + { + // This is the default implementation, + // derived class can reimplement it in a more optimized way. + typename Dest::PlainObject res(rows(),cols()); + evalTo(res); + dst -= res; + } + + /** \internal Don't use it, but do the equivalent: \code dst.applyOnTheRight(*this); \endcode */ + template + EIGEN_DEVICE_FUNC inline void applyThisOnTheRight(Dest& dst) const + { + // This is the default implementation, + // derived class can reimplement it in a more optimized way. + dst = dst * this->derived(); + } + + /** \internal Don't use it, but do the equivalent: \code dst.applyOnTheLeft(*this); \endcode */ + template + EIGEN_DEVICE_FUNC inline void applyThisOnTheLeft(Dest& dst) const + { + // This is the default implementation, + // derived class can reimplement it in a more optimized way. + dst = this->derived() * dst; + } + +}; + +/*************************************************************************** +* Implementation of matrix base methods +***************************************************************************/ + +/** \brief Copies the generic expression \a other into *this. + * + * \details The expression must provide a (templated) evalTo(Derived& dst) const + * function which does the actual job. In practice, this allows any user to write + * its own special matrix without having to modify MatrixBase + * + * \returns a reference to *this. + */ +template +template +EIGEN_DEVICE_FUNC +Derived& DenseBase::operator=(const EigenBase &other) +{ + call_assignment(derived(), other.derived()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +Derived& DenseBase::operator+=(const EigenBase &other) +{ + call_assignment(derived(), other.derived(), internal::add_assign_op()); + return derived(); +} + +template +template +EIGEN_DEVICE_FUNC +Derived& DenseBase::operator-=(const EigenBase &other) +{ + call_assignment(derived(), other.derived(), internal::sub_assign_op()); + return derived(); +} + +} // end namespace Eigen + +#endif // EIGEN_EIGENBASE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/ForceAlignedAccess.h b/SudoDEM2D/lib/Eigen/src/Core/ForceAlignedAccess.h new file mode 100644 index 0000000..7b08b45 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/ForceAlignedAccess.h @@ -0,0 +1,146 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 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_FORCEALIGNEDACCESS_H +#define EIGEN_FORCEALIGNEDACCESS_H + +namespace Eigen { + +/** \class ForceAlignedAccess + * \ingroup Core_Module + * + * \brief Enforce aligned packet loads and stores regardless of what is requested + * + * \param ExpressionType the type of the object of which we are forcing aligned packet access + * + * This class is the return type of MatrixBase::forceAlignedAccess() + * and most of the time this is the only way it is used. + * + * \sa MatrixBase::forceAlignedAccess() + */ + +namespace internal { +template +struct traits > : public traits +{}; +} + +template class ForceAlignedAccess + : public internal::dense_xpr_base< ForceAlignedAccess >::type +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(ForceAlignedAccess) + + EIGEN_DEVICE_FUNC explicit inline ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {} + + EIGEN_DEVICE_FUNC inline Index rows() const { return m_expression.rows(); } + EIGEN_DEVICE_FUNC inline Index cols() const { return m_expression.cols(); } + EIGEN_DEVICE_FUNC inline Index outerStride() const { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC inline Index innerStride() const { return m_expression.innerStride(); } + + EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index row, Index col) const + { + return m_expression.coeff(row, col); + } + + EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index row, Index col) + { + return m_expression.const_cast_derived().coeffRef(row, col); + } + + EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index index) const + { + return m_expression.coeff(index); + } + + EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index index) + { + return m_expression.const_cast_derived().coeffRef(index); + } + + template + inline const PacketScalar packet(Index row, Index col) const + { + return m_expression.template packet(row, col); + } + + template + inline void writePacket(Index row, Index col, const PacketScalar& x) + { + m_expression.const_cast_derived().template writePacket(row, col, x); + } + + template + inline const PacketScalar packet(Index index) const + { + return m_expression.template packet(index); + } + + template + inline void writePacket(Index index, const PacketScalar& x) + { + m_expression.const_cast_derived().template writePacket(index, x); + } + + EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; } + + protected: + const ExpressionType& m_expression; + + private: + ForceAlignedAccess& operator=(const ForceAlignedAccess&); +}; + +/** \returns an expression of *this with forced aligned access + * \sa forceAlignedAccessIf(),class ForceAlignedAccess + */ +template +inline const ForceAlignedAccess +MatrixBase::forceAlignedAccess() const +{ + return ForceAlignedAccess(derived()); +} + +/** \returns an expression of *this with forced aligned access + * \sa forceAlignedAccessIf(), class ForceAlignedAccess + */ +template +inline ForceAlignedAccess +MatrixBase::forceAlignedAccess() +{ + return ForceAlignedAccess(derived()); +} + +/** \returns an expression of *this with forced aligned access if \a Enable is true. + * \sa forceAlignedAccess(), class ForceAlignedAccess + */ +template +template +inline typename internal::add_const_on_value_type,Derived&>::type>::type +MatrixBase::forceAlignedAccessIf() const +{ + return derived(); // FIXME This should not work but apparently is never used +} + +/** \returns an expression of *this with forced aligned access if \a Enable is true. + * \sa forceAlignedAccess(), class ForceAlignedAccess + */ +template +template +inline typename internal::conditional,Derived&>::type +MatrixBase::forceAlignedAccessIf() +{ + return derived(); // FIXME This should not work but apparently is never used +} + +} // end namespace Eigen + +#endif // EIGEN_FORCEALIGNEDACCESS_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Fuzzy.h b/SudoDEM2D/lib/Eigen/src/Core/Fuzzy.h new file mode 100644 index 0000000..3e403a0 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Fuzzy.h @@ -0,0 +1,155 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2008 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_FUZZY_H +#define EIGEN_FUZZY_H + +namespace Eigen { + +namespace internal +{ + +template::IsInteger> +struct isApprox_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) + { + typename internal::nested_eval::type nested(x); + typename internal::nested_eval::type otherNested(y); + return (nested - otherNested).cwiseAbs2().sum() <= prec * prec * numext::mini(nested.cwiseAbs2().sum(), otherNested.cwiseAbs2().sum()); + } +}; + +template +struct isApprox_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar&) + { + return x.matrix() == y.matrix(); + } +}; + +template::IsInteger> +struct isMuchSmallerThan_object_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) + { + return x.cwiseAbs2().sum() <= numext::abs2(prec) * y.cwiseAbs2().sum(); + } +}; + +template +struct isMuchSmallerThan_object_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const OtherDerived&, const typename Derived::RealScalar&) + { + return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix(); + } +}; + +template::IsInteger> +struct isMuchSmallerThan_scalar_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const typename Derived::RealScalar& y, const typename Derived::RealScalar& prec) + { + return x.cwiseAbs2().sum() <= numext::abs2(prec * y); + } +}; + +template +struct isMuchSmallerThan_scalar_selector +{ + EIGEN_DEVICE_FUNC + static bool run(const Derived& x, const typename Derived::RealScalar&, const typename Derived::RealScalar&) + { + return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix(); + } +}; + +} // end namespace internal + + +/** \returns \c true if \c *this is approximately equal to \a other, within the precision + * determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. Two vectors \f$ v \f$ and \f$ w \f$ + * are considered to be approximately equal within precision \f$ p \f$ if + * \f[ \Vert v - w \Vert \leqslant p\,\min(\Vert v\Vert, \Vert w\Vert). \f] + * For matrices, the comparison is done using the Hilbert-Schmidt norm (aka Frobenius norm + * L2 norm). + * + * \note Because of the multiplicativeness of this comparison, one can't use this function + * to check whether \c *this is approximately equal to the zero matrix or vector. + * Indeed, \c isApprox(zero) returns false unless \c *this itself is exactly the zero matrix + * or vector. If you want to test whether \c *this is zero, use internal::isMuchSmallerThan(const + * RealScalar&, RealScalar) instead. + * + * \sa internal::isMuchSmallerThan(const RealScalar&, RealScalar) const + */ +template +template +bool DenseBase::isApprox( + const DenseBase& other, + const RealScalar& prec +) const +{ + return internal::isApprox_selector::run(derived(), other.derived(), prec); +} + +/** \returns \c true if the norm of \c *this is much smaller than \a other, + * within the precision determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. A vector \f$ v \f$ is + * considered to be much smaller than \f$ x \f$ within precision \f$ p \f$ if + * \f[ \Vert v \Vert \leqslant p\,\vert x\vert. \f] + * + * For matrices, the comparison is done using the Hilbert-Schmidt norm. For this reason, + * the value of the reference scalar \a other should come from the Hilbert-Schmidt norm + * of a reference matrix of same dimensions. + * + * \sa isApprox(), isMuchSmallerThan(const DenseBase&, RealScalar) const + */ +template +bool DenseBase::isMuchSmallerThan( + const typename NumTraits::Real& other, + const RealScalar& prec +) const +{ + return internal::isMuchSmallerThan_scalar_selector::run(derived(), other, prec); +} + +/** \returns \c true if the norm of \c *this is much smaller than the norm of \a other, + * within the precision determined by \a prec. + * + * \note The fuzzy compares are done multiplicatively. A vector \f$ v \f$ is + * considered to be much smaller than a vector \f$ w \f$ within precision \f$ p \f$ if + * \f[ \Vert v \Vert \leqslant p\,\Vert w\Vert. \f] + * For matrices, the comparison is done using the Hilbert-Schmidt norm. + * + * \sa isApprox(), isMuchSmallerThan(const RealScalar&, RealScalar) const + */ +template +template +bool DenseBase::isMuchSmallerThan( + const DenseBase& other, + const RealScalar& prec +) const +{ + return internal::isMuchSmallerThan_object_selector::run(derived(), other.derived(), prec); +} + +} // end namespace Eigen + +#endif // EIGEN_FUZZY_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/GeneralProduct.h b/SudoDEM2D/lib/Eigen/src/Core/GeneralProduct.h new file mode 100644 index 0000000..6f0cc80 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/GeneralProduct.h @@ -0,0 +1,455 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2008-2011 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_GENERAL_PRODUCT_H +#define EIGEN_GENERAL_PRODUCT_H + +namespace Eigen { + +enum { + Large = 2, + Small = 3 +}; + +namespace internal { + +template struct product_type_selector; + +template struct product_size_category +{ + enum { + #ifndef EIGEN_CUDA_ARCH + is_large = MaxSize == Dynamic || + Size >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD || + (Size==Dynamic && MaxSize>=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD), + #else + is_large = 0, + #endif + value = is_large ? Large + : Size == 1 ? 1 + : Small + }; +}; + +template struct product_type +{ + typedef typename remove_all::type _Lhs; + typedef typename remove_all::type _Rhs; + enum { + MaxRows = traits<_Lhs>::MaxRowsAtCompileTime, + Rows = traits<_Lhs>::RowsAtCompileTime, + MaxCols = traits<_Rhs>::MaxColsAtCompileTime, + Cols = traits<_Rhs>::ColsAtCompileTime, + MaxDepth = EIGEN_SIZE_MIN_PREFER_FIXED(traits<_Lhs>::MaxColsAtCompileTime, + traits<_Rhs>::MaxRowsAtCompileTime), + Depth = EIGEN_SIZE_MIN_PREFER_FIXED(traits<_Lhs>::ColsAtCompileTime, + traits<_Rhs>::RowsAtCompileTime) + }; + + // the splitting into different lines of code here, introducing the _select enums and the typedef below, + // is to work around an internal compiler error with gcc 4.1 and 4.2. +private: + enum { + rows_select = product_size_category::value, + cols_select = product_size_category::value, + depth_select = product_size_category::value + }; + typedef product_type_selector selector; + +public: + enum { + value = selector::ret, + ret = selector::ret + }; +#ifdef EIGEN_DEBUG_PRODUCT + static void debug() + { + EIGEN_DEBUG_VAR(Rows); + EIGEN_DEBUG_VAR(Cols); + EIGEN_DEBUG_VAR(Depth); + EIGEN_DEBUG_VAR(rows_select); + EIGEN_DEBUG_VAR(cols_select); + EIGEN_DEBUG_VAR(depth_select); + EIGEN_DEBUG_VAR(value); + } +#endif +}; + +/* The following allows to select the kind of product at compile time + * based on the three dimensions of the product. + * This is a compile time mapping from {1,Small,Large}^3 -> {product types} */ +// FIXME I'm not sure the current mapping is the ideal one. +template struct product_type_selector { enum { ret = OuterProduct }; }; +template struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; +template struct product_type_selector<1, N, 1> { enum { ret = LazyCoeffBasedProductMode }; }; +template struct product_type_selector<1, 1, Depth> { enum { ret = InnerProduct }; }; +template<> struct product_type_selector<1, 1, 1> { enum { ret = InnerProduct }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector<1, Small,Small> { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; +template<> struct product_type_selector<1, Large,Small> { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector<1, Large,Large> { enum { ret = GemvProduct }; }; +template<> struct product_type_selector<1, Small,Large> { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = GemvProduct }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; +template<> struct product_type_selector { enum { ret = GemmProduct }; }; + +} // end namespace internal + +/*********************************************************************** +* Implementation of Inner Vector Vector Product +***********************************************************************/ + +// FIXME : maybe the "inner product" could return a Scalar +// instead of a 1x1 matrix ?? +// Pro: more natural for the user +// Cons: this could be a problem if in a meta unrolled algorithm a matrix-matrix +// product ends up to a row-vector times col-vector product... To tackle this use +// case, we could have a specialization for Block with: operator=(Scalar x); + +/*********************************************************************** +* Implementation of Outer Vector Vector Product +***********************************************************************/ + +/*********************************************************************** +* Implementation of General Matrix Vector Product +***********************************************************************/ + +/* According to the shape/flags of the matrix we have to distinghish 3 different cases: + * 1 - the matrix is col-major, BLAS compatible and M is large => call fast BLAS-like colmajor routine + * 2 - the matrix is row-major, BLAS compatible and N is large => call fast BLAS-like rowmajor routine + * 3 - all other cases are handled using a simple loop along the outer-storage direction. + * Therefore we need a lower level meta selector. + * Furthermore, if the matrix is the rhs, then the product has to be transposed. + */ +namespace internal { + +template +struct gemv_dense_selector; + +} // end namespace internal + +namespace internal { + +template struct gemv_static_vector_if; + +template +struct gemv_static_vector_if +{ + EIGEN_STRONG_INLINE Scalar* data() { eigen_internal_assert(false && "should never be called"); return 0; } +}; + +template +struct gemv_static_vector_if +{ + EIGEN_STRONG_INLINE Scalar* data() { return 0; } +}; + +template +struct gemv_static_vector_if +{ + enum { + ForceAlignment = internal::packet_traits::Vectorizable, + PacketSize = internal::packet_traits::size + }; + #if EIGEN_MAX_STATIC_ALIGN_BYTES!=0 + internal::plain_array m_data; + EIGEN_STRONG_INLINE Scalar* data() { return m_data.array; } + #else + // Some architectures cannot align on the stack, + // => let's manually enforce alignment by allocating more data and return the address of the first aligned element. + internal::plain_array m_data; + EIGEN_STRONG_INLINE Scalar* data() { + return ForceAlignment + ? reinterpret_cast((internal::UIntPtr(m_data.array) & ~(std::size_t(EIGEN_MAX_ALIGN_BYTES-1))) + EIGEN_MAX_ALIGN_BYTES) + : m_data.array; + } + #endif +}; + +// The vector is on the left => transposition +template +struct gemv_dense_selector +{ + template + static void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + Transpose destT(dest); + enum { OtherStorageOrder = StorageOrder == RowMajor ? ColMajor : RowMajor }; + gemv_dense_selector + ::run(rhs.transpose(), lhs.transpose(), destT, alpha); + } +}; + +template<> struct gemv_dense_selector +{ + template + static inline void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + typedef typename Lhs::Scalar LhsScalar; + typedef typename Rhs::Scalar RhsScalar; + typedef typename Dest::Scalar ResScalar; + typedef typename Dest::RealScalar RealScalar; + + typedef internal::blas_traits LhsBlasTraits; + typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; + typedef internal::blas_traits RhsBlasTraits; + typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; + + typedef Map, EIGEN_PLAIN_ENUM_MIN(AlignedMax,internal::packet_traits::size)> MappedDest; + + ActualLhsType actualLhs = LhsBlasTraits::extract(lhs); + ActualRhsType actualRhs = RhsBlasTraits::extract(rhs); + + ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(lhs) + * RhsBlasTraits::extractScalarFactor(rhs); + + // make sure Dest is a compile-time vector type (bug 1166) + typedef typename conditional::type ActualDest; + + enum { + // FIXME find a way to allow an inner stride on the result if packet_traits::size==1 + // on, the other hand it is good for the cache to pack the vector anyways... + EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime==1), + ComplexByReal = (NumTraits::IsComplex) && (!NumTraits::IsComplex), + MightCannotUseDest = (!EvalToDestAtCompileTime) || ComplexByReal + }; + + typedef const_blas_data_mapper LhsMapper; + typedef const_blas_data_mapper RhsMapper; + RhsScalar compatibleAlpha = get_factor::run(actualAlpha); + + if(!MightCannotUseDest) + { + // shortcut if we are sure to be able to use dest directly, + // this ease the compiler to generate cleaner and more optimzized code for most common cases + general_matrix_vector_product + ::run( + actualLhs.rows(), actualLhs.cols(), + LhsMapper(actualLhs.data(), actualLhs.outerStride()), + RhsMapper(actualRhs.data(), actualRhs.innerStride()), + dest.data(), 1, + compatibleAlpha); + } + else + { + gemv_static_vector_if static_dest; + + const bool alphaIsCompatible = (!ComplexByReal) || (numext::imag(actualAlpha)==RealScalar(0)); + const bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible; + + ei_declare_aligned_stack_constructed_variable(ResScalar,actualDestPtr,dest.size(), + evalToDest ? dest.data() : static_dest.data()); + + if(!evalToDest) + { + #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN + Index size = dest.size(); + EIGEN_DENSE_STORAGE_CTOR_PLUGIN + #endif + if(!alphaIsCompatible) + { + MappedDest(actualDestPtr, dest.size()).setZero(); + compatibleAlpha = RhsScalar(1); + } + else + MappedDest(actualDestPtr, dest.size()) = dest; + } + + general_matrix_vector_product + ::run( + actualLhs.rows(), actualLhs.cols(), + LhsMapper(actualLhs.data(), actualLhs.outerStride()), + RhsMapper(actualRhs.data(), actualRhs.innerStride()), + actualDestPtr, 1, + compatibleAlpha); + + if (!evalToDest) + { + if(!alphaIsCompatible) + dest.matrix() += actualAlpha * MappedDest(actualDestPtr, dest.size()); + else + dest = MappedDest(actualDestPtr, dest.size()); + } + } + } +}; + +template<> struct gemv_dense_selector +{ + template + static void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + typedef typename Lhs::Scalar LhsScalar; + typedef typename Rhs::Scalar RhsScalar; + typedef typename Dest::Scalar ResScalar; + + typedef internal::blas_traits LhsBlasTraits; + typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; + typedef internal::blas_traits RhsBlasTraits; + typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; + typedef typename internal::remove_all::type ActualRhsTypeCleaned; + + typename add_const::type actualLhs = LhsBlasTraits::extract(lhs); + typename add_const::type actualRhs = RhsBlasTraits::extract(rhs); + + ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(lhs) + * RhsBlasTraits::extractScalarFactor(rhs); + + enum { + // FIXME find a way to allow an inner stride on the result if packet_traits::size==1 + // on, the other hand it is good for the cache to pack the vector anyways... + DirectlyUseRhs = ActualRhsTypeCleaned::InnerStrideAtCompileTime==1 + }; + + gemv_static_vector_if static_rhs; + + ei_declare_aligned_stack_constructed_variable(RhsScalar,actualRhsPtr,actualRhs.size(), + DirectlyUseRhs ? const_cast(actualRhs.data()) : static_rhs.data()); + + if(!DirectlyUseRhs) + { + #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN + Index size = actualRhs.size(); + EIGEN_DENSE_STORAGE_CTOR_PLUGIN + #endif + Map(actualRhsPtr, actualRhs.size()) = actualRhs; + } + + typedef const_blas_data_mapper LhsMapper; + typedef const_blas_data_mapper RhsMapper; + general_matrix_vector_product + ::run( + actualLhs.rows(), actualLhs.cols(), + LhsMapper(actualLhs.data(), actualLhs.outerStride()), + RhsMapper(actualRhsPtr, 1), + dest.data(), dest.col(0).innerStride(), //NOTE if dest is not a vector at compile-time, then dest.innerStride() might be wrong. (bug 1166) + actualAlpha); + } +}; + +template<> struct gemv_dense_selector +{ + template + static void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + EIGEN_STATIC_ASSERT((!nested_eval::Evaluate),EIGEN_INTERNAL_COMPILATION_ERROR_OR_YOU_MADE_A_PROGRAMMING_MISTAKE); + // TODO if rhs is large enough it might be beneficial to make sure that dest is sequentially stored in memory, otherwise use a temp + typename nested_eval::type actual_rhs(rhs); + const Index size = rhs.rows(); + for(Index k=0; k struct gemv_dense_selector +{ + template + static void run(const Lhs &lhs, const Rhs &rhs, Dest& dest, const typename Dest::Scalar& alpha) + { + EIGEN_STATIC_ASSERT((!nested_eval::Evaluate),EIGEN_INTERNAL_COMPILATION_ERROR_OR_YOU_MADE_A_PROGRAMMING_MISTAKE); + typename nested_eval::type actual_rhs(rhs); + const Index rows = dest.rows(); + for(Index i=0; i +template +inline const Product +MatrixBase::operator*(const MatrixBase &other) const +{ + // A note regarding the function declaration: In MSVC, this function will sometimes + // not be inlined since DenseStorage is an unwindable object for dynamic + // matrices and product types are holding a member to store the result. + // Thus it does not help tagging this function with EIGEN_STRONG_INLINE. + enum { + ProductIsValid = Derived::ColsAtCompileTime==Dynamic + || OtherDerived::RowsAtCompileTime==Dynamic + || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime), + AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime, + SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived) + }; + // note to the lost user: + // * for a dot product use: v1.dot(v2) + // * for a coeff-wise product use: v1.cwiseProduct(v2) + EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes), + INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS) + EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors), + INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION) + EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT) +#ifdef EIGEN_DEBUG_PRODUCT + internal::product_type::debug(); +#endif + + return Product(derived(), other.derived()); +} + +/** \returns an expression of the matrix product of \c *this and \a other without implicit evaluation. + * + * The returned product will behave like any other expressions: the coefficients of the product will be + * computed once at a time as requested. This might be useful in some extremely rare cases when only + * a small and no coherent fraction of the result's coefficients have to be computed. + * + * \warning This version of the matrix product can be much much slower. So use it only if you know + * what you are doing and that you measured a true speed improvement. + * + * \sa operator*(const MatrixBase&) + */ +template +template +const Product +MatrixBase::lazyProduct(const MatrixBase &other) const +{ + enum { + ProductIsValid = Derived::ColsAtCompileTime==Dynamic + || OtherDerived::RowsAtCompileTime==Dynamic + || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime), + AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime, + SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived) + }; + // note to the lost user: + // * for a dot product use: v1.dot(v2) + // * for a coeff-wise product use: v1.cwiseProduct(v2) + EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes), + INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS) + EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors), + INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION) + EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT) + + return Product(derived(), other.derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_PRODUCT_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/GenericPacketMath.h b/SudoDEM2D/lib/Eigen/src/Core/GenericPacketMath.h new file mode 100644 index 0000000..029f8ac --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/GenericPacketMath.h @@ -0,0 +1,593 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2008 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_GENERIC_PACKET_MATH_H +#define EIGEN_GENERIC_PACKET_MATH_H + +namespace Eigen { + +namespace internal { + +/** \internal + * \file GenericPacketMath.h + * + * Default implementation for types not supported by the vectorization. + * In practice these functions are provided to make easier the writing + * of generic vectorized code. + */ + +#ifndef EIGEN_DEBUG_ALIGNED_LOAD +#define EIGEN_DEBUG_ALIGNED_LOAD +#endif + +#ifndef EIGEN_DEBUG_UNALIGNED_LOAD +#define EIGEN_DEBUG_UNALIGNED_LOAD +#endif + +#ifndef EIGEN_DEBUG_ALIGNED_STORE +#define EIGEN_DEBUG_ALIGNED_STORE +#endif + +#ifndef EIGEN_DEBUG_UNALIGNED_STORE +#define EIGEN_DEBUG_UNALIGNED_STORE +#endif + +struct default_packet_traits +{ + enum { + HasHalfPacket = 0, + + HasAdd = 1, + HasSub = 1, + HasMul = 1, + HasNegate = 1, + HasAbs = 1, + HasArg = 0, + HasAbs2 = 1, + HasMin = 1, + HasMax = 1, + HasConj = 1, + HasSetLinear = 1, + HasBlend = 0, + + HasDiv = 0, + HasSqrt = 0, + HasRsqrt = 0, + HasExp = 0, + HasLog = 0, + HasLog1p = 0, + HasLog10 = 0, + HasPow = 0, + + HasSin = 0, + HasCos = 0, + HasTan = 0, + HasASin = 0, + HasACos = 0, + HasATan = 0, + HasSinh = 0, + HasCosh = 0, + HasTanh = 0, + HasLGamma = 0, + HasDiGamma = 0, + HasZeta = 0, + HasPolygamma = 0, + HasErf = 0, + HasErfc = 0, + HasIGamma = 0, + HasIGammac = 0, + HasBetaInc = 0, + + HasRound = 0, + HasFloor = 0, + HasCeil = 0, + + HasSign = 0 + }; +}; + +template struct packet_traits : default_packet_traits +{ + typedef T type; + typedef T half; + enum { + Vectorizable = 0, + size = 1, + AlignedOnScalar = 0, + HasHalfPacket = 0 + }; + enum { + HasAdd = 0, + HasSub = 0, + HasMul = 0, + HasNegate = 0, + HasAbs = 0, + HasAbs2 = 0, + HasMin = 0, + HasMax = 0, + HasConj = 0, + HasSetLinear = 0 + }; +}; + +template struct packet_traits : packet_traits { }; + +template struct type_casting_traits { + enum { + VectorizedCast = 0, + SrcCoeffRatio = 1, + TgtCoeffRatio = 1 + }; +}; + + +/** \internal \returns static_cast(a) (coeff-wise) */ +template +EIGEN_DEVICE_FUNC inline TgtPacket +pcast(const SrcPacket& a) { + return static_cast(a); +} +template +EIGEN_DEVICE_FUNC inline TgtPacket +pcast(const SrcPacket& a, const SrcPacket& /*b*/) { + return static_cast(a); +} + +template +EIGEN_DEVICE_FUNC inline TgtPacket +pcast(const SrcPacket& a, const SrcPacket& /*b*/, const SrcPacket& /*c*/, const SrcPacket& /*d*/) { + return static_cast(a); +} + +/** \internal \returns a + b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +padd(const Packet& a, + const Packet& b) { return a+b; } + +/** \internal \returns a - b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +psub(const Packet& a, + const Packet& b) { return a-b; } + +/** \internal \returns -a (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pnegate(const Packet& a) { return -a; } + +/** \internal \returns conj(a) (coeff-wise) */ + +template EIGEN_DEVICE_FUNC inline Packet +pconj(const Packet& a) { return numext::conj(a); } + +/** \internal \returns a * b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pmul(const Packet& a, + const Packet& b) { return a*b; } + +/** \internal \returns a / b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pdiv(const Packet& a, + const Packet& b) { return a/b; } + +/** \internal \returns the min of \a a and \a b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pmin(const Packet& a, + const Packet& b) { return numext::mini(a, b); } + +/** \internal \returns the max of \a a and \a b (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pmax(const Packet& a, + const Packet& b) { return numext::maxi(a, b); } + +/** \internal \returns the absolute value of \a a */ +template EIGEN_DEVICE_FUNC inline Packet +pabs(const Packet& a) { using std::abs; return abs(a); } + +/** \internal \returns the phase angle of \a a */ +template EIGEN_DEVICE_FUNC inline Packet +parg(const Packet& a) { using numext::arg; return arg(a); } + +/** \internal \returns the bitwise and of \a a and \a b */ +template EIGEN_DEVICE_FUNC inline Packet +pand(const Packet& a, const Packet& b) { return a & b; } + +/** \internal \returns the bitwise or of \a a and \a b */ +template EIGEN_DEVICE_FUNC inline Packet +por(const Packet& a, const Packet& b) { return a | b; } + +/** \internal \returns the bitwise xor of \a a and \a b */ +template EIGEN_DEVICE_FUNC inline Packet +pxor(const Packet& a, const Packet& b) { return a ^ b; } + +/** \internal \returns the bitwise andnot of \a a and \a b */ +template EIGEN_DEVICE_FUNC inline Packet +pandnot(const Packet& a, const Packet& b) { return a & (!b); } + +/** \internal \returns a packet version of \a *from, from must be 16 bytes aligned */ +template EIGEN_DEVICE_FUNC inline Packet +pload(const typename unpacket_traits::type* from) { return *from; } + +/** \internal \returns a packet version of \a *from, (un-aligned load) */ +template EIGEN_DEVICE_FUNC inline Packet +ploadu(const typename unpacket_traits::type* from) { return *from; } + +/** \internal \returns a packet with constant coefficients \a a, e.g.: (a,a,a,a) */ +template EIGEN_DEVICE_FUNC inline Packet +pset1(const typename unpacket_traits::type& a) { return a; } + +/** \internal \returns a packet with constant coefficients \a a[0], e.g.: (a[0],a[0],a[0],a[0]) */ +template EIGEN_DEVICE_FUNC inline Packet +pload1(const typename unpacket_traits::type *a) { return pset1(*a); } + +/** \internal \returns a packet with elements of \a *from duplicated. + * For instance, for a packet of 8 elements, 4 scalars will be read from \a *from and + * duplicated to form: {from[0],from[0],from[1],from[1],from[2],from[2],from[3],from[3]} + * Currently, this function is only used for scalar * complex products. + */ +template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet +ploaddup(const typename unpacket_traits::type* from) { return *from; } + +/** \internal \returns a packet with elements of \a *from quadrupled. + * For instance, for a packet of 8 elements, 2 scalars will be read from \a *from and + * replicated to form: {from[0],from[0],from[0],from[0],from[1],from[1],from[1],from[1]} + * Currently, this function is only used in matrix products. + * For packet-size smaller or equal to 4, this function is equivalent to pload1 + */ +template EIGEN_DEVICE_FUNC inline Packet +ploadquad(const typename unpacket_traits::type* from) +{ return pload1(from); } + +/** \internal equivalent to + * \code + * a0 = pload1(a+0); + * a1 = pload1(a+1); + * a2 = pload1(a+2); + * a3 = pload1(a+3); + * \endcode + * \sa pset1, pload1, ploaddup, pbroadcast2 + */ +template EIGEN_DEVICE_FUNC +inline void pbroadcast4(const typename unpacket_traits::type *a, + Packet& a0, Packet& a1, Packet& a2, Packet& a3) +{ + a0 = pload1(a+0); + a1 = pload1(a+1); + a2 = pload1(a+2); + a3 = pload1(a+3); +} + +/** \internal equivalent to + * \code + * a0 = pload1(a+0); + * a1 = pload1(a+1); + * \endcode + * \sa pset1, pload1, ploaddup, pbroadcast4 + */ +template EIGEN_DEVICE_FUNC +inline void pbroadcast2(const typename unpacket_traits::type *a, + Packet& a0, Packet& a1) +{ + a0 = pload1(a+0); + a1 = pload1(a+1); +} + +/** \internal \brief Returns a packet with coefficients (a,a+1,...,a+packet_size-1). */ +template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet +plset(const typename unpacket_traits::type& a) { return a; } + +/** \internal copy the packet \a from to \a *to, \a to must be 16 bytes aligned */ +template EIGEN_DEVICE_FUNC inline void pstore(Scalar* to, const Packet& from) +{ (*to) = from; } + +/** \internal copy the packet \a from to \a *to, (un-aligned store) */ +template EIGEN_DEVICE_FUNC inline void pstoreu(Scalar* to, const Packet& from) +{ (*to) = from; } + + template EIGEN_DEVICE_FUNC inline Packet pgather(const Scalar* from, Index /*stride*/) + { return ploadu(from); } + + template EIGEN_DEVICE_FUNC inline void pscatter(Scalar* to, const Packet& from, Index /*stride*/) + { pstore(to, from); } + +/** \internal tries to do cache prefetching of \a addr */ +template EIGEN_DEVICE_FUNC inline void prefetch(const Scalar* addr) +{ +#ifdef __CUDA_ARCH__ +#if defined(__LP64__) + // 64-bit pointer operand constraint for inlined asm + asm(" prefetch.L1 [ %1 ];" : "=l"(addr) : "l"(addr)); +#else + // 32-bit pointer operand constraint for inlined asm + asm(" prefetch.L1 [ %1 ];" : "=r"(addr) : "r"(addr)); +#endif +#elif (!EIGEN_COMP_MSVC) && (EIGEN_COMP_GNUC || EIGEN_COMP_CLANG || EIGEN_COMP_ICC) + __builtin_prefetch(addr); +#endif +} + +/** \internal \returns the first element of a packet */ +template EIGEN_DEVICE_FUNC inline typename unpacket_traits::type pfirst(const Packet& a) +{ return a; } + +/** \internal \returns a packet where the element i contains the sum of the packet of \a vec[i] */ +template EIGEN_DEVICE_FUNC inline Packet +preduxp(const Packet* vecs) { return vecs[0]; } + +/** \internal \returns the sum of the elements of \a a*/ +template EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux(const Packet& a) +{ return a; } + +/** \internal \returns the sum of the elements of \a a by block of 4 elements. + * For a packet {a0, a1, a2, a3, a4, a5, a6, a7}, it returns a half packet {a0+a4, a1+a5, a2+a6, a3+a7} + * For packet-size smaller or equal to 4, this boils down to a noop. + */ +template EIGEN_DEVICE_FUNC inline +typename conditional<(unpacket_traits::size%8)==0,typename unpacket_traits::half,Packet>::type +predux_downto4(const Packet& a) +{ return a; } + +/** \internal \returns the product of the elements of \a a*/ +template EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux_mul(const Packet& a) +{ return a; } + +/** \internal \returns the min of the elements of \a a*/ +template EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux_min(const Packet& a) +{ return a; } + +/** \internal \returns the max of the elements of \a a*/ +template EIGEN_DEVICE_FUNC inline typename unpacket_traits::type predux_max(const Packet& a) +{ return a; } + +/** \internal \returns the reversed elements of \a a*/ +template EIGEN_DEVICE_FUNC inline Packet preverse(const Packet& a) +{ return a; } + +/** \internal \returns \a a with real and imaginary part flipped (for complex type only) */ +template EIGEN_DEVICE_FUNC inline Packet pcplxflip(const Packet& a) +{ + // FIXME: uncomment the following in case we drop the internal imag and real functions. +// using std::imag; +// using std::real; + return Packet(imag(a),real(a)); +} + +/************************** +* Special math functions +***************************/ + +/** \internal \returns the sine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet psin(const Packet& a) { using std::sin; return sin(a); } + +/** \internal \returns the cosine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pcos(const Packet& a) { using std::cos; return cos(a); } + +/** \internal \returns the tan of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet ptan(const Packet& a) { using std::tan; return tan(a); } + +/** \internal \returns the arc sine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pasin(const Packet& a) { using std::asin; return asin(a); } + +/** \internal \returns the arc cosine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pacos(const Packet& a) { using std::acos; return acos(a); } + +/** \internal \returns the arc tangent of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet patan(const Packet& a) { using std::atan; return atan(a); } + +/** \internal \returns the hyperbolic sine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet psinh(const Packet& a) { using std::sinh; return sinh(a); } + +/** \internal \returns the hyperbolic cosine of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pcosh(const Packet& a) { using std::cosh; return cosh(a); } + +/** \internal \returns the hyperbolic tan of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet ptanh(const Packet& a) { using std::tanh; return tanh(a); } + +/** \internal \returns the exp of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pexp(const Packet& a) { using std::exp; return exp(a); } + +/** \internal \returns the log of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet plog(const Packet& a) { using std::log; return log(a); } + +/** \internal \returns the log1p of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet plog1p(const Packet& a) { return numext::log1p(a); } + +/** \internal \returns the log10 of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet plog10(const Packet& a) { using std::log10; return log10(a); } + +/** \internal \returns the square-root of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet psqrt(const Packet& a) { using std::sqrt; return sqrt(a); } + +/** \internal \returns the reciprocal square-root of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet prsqrt(const Packet& a) { + return pdiv(pset1(1), psqrt(a)); +} + +/** \internal \returns the rounded value of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pround(const Packet& a) { using numext::round; return round(a); } + +/** \internal \returns the floor of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pfloor(const Packet& a) { using numext::floor; return floor(a); } + +/** \internal \returns the ceil of \a a (coeff-wise) */ +template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +Packet pceil(const Packet& a) { using numext::ceil; return ceil(a); } + +/*************************************************************************** +* The following functions might not have to be overwritten for vectorized types +***************************************************************************/ + +/** \internal copy a packet with constant coeficient \a a (e.g., [a,a,a,a]) to \a *to. \a to must be 16 bytes aligned */ +// NOTE: this function must really be templated on the packet type (think about different packet types for the same scalar type) +template +inline void pstore1(typename unpacket_traits::type* to, const typename unpacket_traits::type& a) +{ + pstore(to, pset1(a)); +} + +/** \internal \returns a * b + c (coeff-wise) */ +template EIGEN_DEVICE_FUNC inline Packet +pmadd(const Packet& a, + const Packet& b, + const Packet& c) +{ return padd(pmul(a, b),c); } + +/** \internal \returns a packet version of \a *from. + * The pointer \a from must be aligned on a \a Alignment bytes boundary. */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt(const typename unpacket_traits::type* from) +{ + if(Alignment >= unpacket_traits::alignment) + return pload(from); + else + return ploadu(from); +} + +/** \internal copy the packet \a from to \a *to. + * The pointer \a from must be aligned on a \a Alignment bytes boundary. */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pstoret(Scalar* to, const Packet& from) +{ + if(Alignment >= unpacket_traits::alignment) + pstore(to, from); + else + pstoreu(to, from); +} + +/** \internal \returns a packet version of \a *from. + * Unlike ploadt, ploadt_ro takes advantage of the read-only memory path on the + * hardware if available to speedup the loading of data that won't be modified + * by the current computation. + */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt_ro(const typename unpacket_traits::type* from) +{ + return ploadt(from); +} + +/** \internal default implementation of palign() allowing partial specialization */ +template +struct palign_impl +{ + // by default data are aligned, so there is nothing to be done :) + static inline void run(PacketType&, const PacketType&) {} +}; + +/** \internal update \a first using the concatenation of the packet_size minus \a Offset last elements + * of \a first and \a Offset first elements of \a second. + * + * This function is currently only used to optimize matrix-vector products on unligned matrices. + * It takes 2 packets that represent a contiguous memory array, and returns a packet starting + * at the position \a Offset. For instance, for packets of 4 elements, we have: + * Input: + * - first = {f0,f1,f2,f3} + * - second = {s0,s1,s2,s3} + * Output: + * - if Offset==0 then {f0,f1,f2,f3} + * - if Offset==1 then {f1,f2,f3,s0} + * - if Offset==2 then {f2,f3,s0,s1} + * - if Offset==3 then {f3,s0,s1,s3} + */ +template +inline void palign(PacketType& first, const PacketType& second) +{ + palign_impl::run(first,second); +} + +/*************************************************************************** +* Fast complex products (GCC generates a function call which is very slow) +***************************************************************************/ + +// Eigen+CUDA does not support complexes. +#ifndef __CUDACC__ + +template<> inline std::complex pmul(const std::complex& a, const std::complex& b) +{ return std::complex(real(a)*real(b) - imag(a)*imag(b), imag(a)*real(b) + real(a)*imag(b)); } + +template<> inline std::complex pmul(const std::complex& a, const std::complex& b) +{ return std::complex(real(a)*real(b) - imag(a)*imag(b), imag(a)*real(b) + real(a)*imag(b)); } + +#endif + + +/*************************************************************************** + * PacketBlock, that is a collection of N packets where the number of words + * in the packet is a multiple of N. +***************************************************************************/ +template ::size> struct PacketBlock { + Packet packet[N]; +}; + +template EIGEN_DEVICE_FUNC inline void +ptranspose(PacketBlock& /*kernel*/) { + // Nothing to do in the scalar case, i.e. a 1x1 matrix. +} + +/*************************************************************************** + * Selector, i.e. vector of N boolean values used to select (i.e. blend) + * words from 2 packets. +***************************************************************************/ +template struct Selector { + bool select[N]; +}; + +template EIGEN_DEVICE_FUNC inline Packet +pblend(const Selector::size>& ifPacket, const Packet& thenPacket, const Packet& elsePacket) { + return ifPacket.select[0] ? thenPacket : elsePacket; +} + +/** \internal \returns \a a with the first coefficient replaced by the scalar b */ +template EIGEN_DEVICE_FUNC inline Packet +pinsertfirst(const Packet& a, typename unpacket_traits::type b) +{ + // Default implementation based on pblend. + // It must be specialized for higher performance. + Selector::size> mask; + mask.select[0] = true; + // This for loop should be optimized away by the compiler. + for(Index i=1; i::size; ++i) + mask.select[i] = false; + return pblend(mask, pset1(b), a); +} + +/** \internal \returns \a a with the last coefficient replaced by the scalar b */ +template EIGEN_DEVICE_FUNC inline Packet +pinsertlast(const Packet& a, typename unpacket_traits::type b) +{ + // Default implementation based on pblend. + // It must be specialized for higher performance. + Selector::size> mask; + // This for loop should be optimized away by the compiler. + for(Index i=0; i::size-1; ++i) + mask.select[i] = false; + mask.select[unpacket_traits::size-1] = true; + return pblend(mask, pset1(b), a); +} + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_GENERIC_PACKET_MATH_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/GlobalFunctions.h b/SudoDEM2D/lib/Eigen/src/Core/GlobalFunctions.h new file mode 100644 index 0000000..769dc25 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/GlobalFunctions.h @@ -0,0 +1,187 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2010-2016 Gael Guennebaud +// Copyright (C) 2010 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_GLOBAL_FUNCTIONS_H +#define EIGEN_GLOBAL_FUNCTIONS_H + +#ifdef EIGEN_PARSED_BY_DOXYGEN + +#define EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(NAME,FUNCTOR,DOC_OP,DOC_DETAILS) \ + /** \returns an expression of the coefficient-wise DOC_OP of \a x + + DOC_DETAILS + + \sa Math functions, class CwiseUnaryOp + */ \ + template \ + inline const Eigen::CwiseUnaryOp, const Derived> \ + NAME(const Eigen::ArrayBase& x); + +#else + +#define EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(NAME,FUNCTOR,DOC_OP,DOC_DETAILS) \ + template \ + inline const Eigen::CwiseUnaryOp, const Derived> \ + (NAME)(const Eigen::ArrayBase& x) { \ + return Eigen::CwiseUnaryOp, const Derived>(x.derived()); \ + } + +#endif // EIGEN_PARSED_BY_DOXYGEN + +#define EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(NAME,FUNCTOR) \ + \ + template \ + struct NAME##_retval > \ + { \ + typedef const Eigen::CwiseUnaryOp, const Derived> type; \ + }; \ + template \ + struct NAME##_impl > \ + { \ + static inline typename NAME##_retval >::type run(const Eigen::ArrayBase& x) \ + { \ + return typename NAME##_retval >::type(x.derived()); \ + } \ + }; + +namespace Eigen +{ + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(real,scalar_real_op,real part,\sa ArrayBase::real) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(imag,scalar_imag_op,imaginary part,\sa ArrayBase::imag) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(conj,scalar_conjugate_op,complex conjugate,\sa ArrayBase::conjugate) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(inverse,scalar_inverse_op,inverse,\sa ArrayBase::inverse) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sin,scalar_sin_op,sine,\sa ArrayBase::sin) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cos,scalar_cos_op,cosine,\sa ArrayBase::cos) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(tan,scalar_tan_op,tangent,\sa ArrayBase::tan) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(atan,scalar_atan_op,arc-tangent,\sa ArrayBase::atan) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(asin,scalar_asin_op,arc-sine,\sa ArrayBase::asin) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(acos,scalar_acos_op,arc-consine,\sa ArrayBase::acos) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sinh,scalar_sinh_op,hyperbolic sine,\sa ArrayBase::sinh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cosh,scalar_cosh_op,hyperbolic cosine,\sa ArrayBase::cosh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(tanh,scalar_tanh_op,hyperbolic tangent,\sa ArrayBase::tanh) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(lgamma,scalar_lgamma_op,natural logarithm of the gamma function,\sa ArrayBase::lgamma) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(digamma,scalar_digamma_op,derivative of lgamma,\sa ArrayBase::digamma) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(erf,scalar_erf_op,error function,\sa ArrayBase::erf) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(erfc,scalar_erfc_op,complement error function,\sa ArrayBase::erfc) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(exp,scalar_exp_op,exponential,\sa ArrayBase::exp) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log,scalar_log_op,natural logarithm,\sa Eigen::log10 DOXCOMMA ArrayBase::log) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log1p,scalar_log1p_op,natural logarithm of 1 plus the value,\sa ArrayBase::log1p) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log10,scalar_log10_op,base 10 logarithm,\sa Eigen::log DOXCOMMA ArrayBase::log) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs,scalar_abs_op,absolute value,\sa ArrayBase::abs DOXCOMMA MatrixBase::cwiseAbs) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs2,scalar_abs2_op,squared absolute value,\sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(arg,scalar_arg_op,complex argument,\sa ArrayBase::arg) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sqrt,scalar_sqrt_op,square root,\sa ArrayBase::sqrt DOXCOMMA MatrixBase::cwiseSqrt) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(rsqrt,scalar_rsqrt_op,reciprocal square root,\sa ArrayBase::rsqrt) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(square,scalar_square_op,square (power 2),\sa Eigen::abs2 DOXCOMMA Eigen::pow DOXCOMMA ArrayBase::square) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cube,scalar_cube_op,cube (power 3),\sa Eigen::pow DOXCOMMA ArrayBase::cube) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(round,scalar_round_op,nearest integer,\sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(floor,scalar_floor_op,nearest integer not greater than the giben value,\sa Eigen::ceil DOXCOMMA ArrayBase::floor) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(ceil,scalar_ceil_op,nearest integer not less than the giben value,\sa Eigen::floor DOXCOMMA ArrayBase::ceil) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isnan,scalar_isnan_op,not-a-number test,\sa Eigen::isinf DOXCOMMA Eigen::isfinite DOXCOMMA ArrayBase::isnan) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isinf,scalar_isinf_op,infinite value test,\sa Eigen::isnan DOXCOMMA Eigen::isfinite DOXCOMMA ArrayBase::isinf) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(isfinite,scalar_isfinite_op,finite value test,\sa Eigen::isinf DOXCOMMA Eigen::isnan DOXCOMMA ArrayBase::isfinite) + EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sign,scalar_sign_op,sign (or 0),\sa ArrayBase::sign) + + /** \returns an expression of the coefficient-wise power of \a x to the given constant \a exponent. + * + * \tparam ScalarExponent is the scalar type of \a exponent. It must be compatible with the scalar type of the given expression (\c Derived::Scalar). + * + * \sa ArrayBase::pow() + * + * \relates ArrayBase + */ +#ifdef EIGEN_PARSED_BY_DOXYGEN + template + inline const CwiseBinaryOp,Derived,Constant > + pow(const Eigen::ArrayBase& x, const ScalarExponent& exponent); +#else + template + inline typename internal::enable_if< !(internal::is_same::value) && EIGEN_SCALAR_BINARY_SUPPORTED(pow,typename Derived::Scalar,ScalarExponent), + const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,ScalarExponent,pow) >::type + pow(const Eigen::ArrayBase& x, const ScalarExponent& exponent) { + return x.derived().pow(exponent); + } + + template + inline const EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,typename Derived::Scalar,pow) + pow(const Eigen::ArrayBase& x, const typename Derived::Scalar& exponent) { + return x.derived().pow(exponent); + } +#endif + + /** \returns an expression of the coefficient-wise power of \a x to the given array of \a exponents. + * + * This function computes the coefficient-wise power. + * + * Example: \include Cwise_array_power_array.cpp + * Output: \verbinclude Cwise_array_power_array.out + * + * \sa ArrayBase::pow() + * + * \relates ArrayBase + */ + template + inline const Eigen::CwiseBinaryOp, const Derived, const ExponentDerived> + pow(const Eigen::ArrayBase& x, const Eigen::ArrayBase& exponents) + { + return Eigen::CwiseBinaryOp, const Derived, const ExponentDerived>( + x.derived(), + exponents.derived() + ); + } + + /** \returns an expression of the coefficient-wise power of the scalar \a x to the given array of \a exponents. + * + * This function computes the coefficient-wise power between a scalar and an array of exponents. + * + * \tparam Scalar is the scalar type of \a x. It must be compatible with the scalar type of the given array expression (\c Derived::Scalar). + * + * Example: \include Cwise_scalar_power_array.cpp + * Output: \verbinclude Cwise_scalar_power_array.out + * + * \sa ArrayBase::pow() + * + * \relates ArrayBase + */ +#ifdef EIGEN_PARSED_BY_DOXYGEN + template + inline const CwiseBinaryOp,Constant,Derived> + pow(const Scalar& x,const Eigen::ArrayBase& x); +#else + template + inline typename internal::enable_if< !(internal::is_same::value) && EIGEN_SCALAR_BINARY_SUPPORTED(pow,Scalar,typename Derived::Scalar), + const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(Scalar,Derived,pow) >::type + pow(const Scalar& x, const Eigen::ArrayBase& exponents) + { + return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(Scalar,Derived,pow)( + typename internal::plain_constant_type::type(exponents.rows(), exponents.cols(), x), exponents.derived() ); + } + + template + inline const EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename Derived::Scalar,Derived,pow) + pow(const typename Derived::Scalar& x, const Eigen::ArrayBase& exponents) + { + return EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(typename Derived::Scalar,Derived,pow)( + typename internal::plain_constant_type::type(exponents.rows(), exponents.cols(), x), exponents.derived() ); + } +#endif + + + namespace internal + { + EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(real,scalar_real_op) + EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(imag,scalar_imag_op) + EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(abs2,scalar_abs2_op) + } +} + +// TODO: cleanly disable those functions that are not supported on Array (numext::real_ref, internal::random, internal::isApprox...) + +#endif // EIGEN_GLOBAL_FUNCTIONS_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/IO.h b/SudoDEM2D/lib/Eigen/src/Core/IO.h new file mode 100644 index 0000000..da7fd6c --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/IO.h @@ -0,0 +1,225 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2008 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_IO_H +#define EIGEN_IO_H + +namespace Eigen { + +enum { DontAlignCols = 1 }; +enum { StreamPrecision = -1, + FullPrecision = -2 }; + +namespace internal { +template +std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt); +} + +/** \class IOFormat + * \ingroup Core_Module + * + * \brief Stores a set of parameters controlling the way matrices are printed + * + * List of available parameters: + * - \b precision number of digits for floating point values, or one of the special constants \c StreamPrecision and \c FullPrecision. + * The default is the special value \c StreamPrecision which means to use the + * stream's own precision setting, as set for instance using \c cout.precision(3). The other special value + * \c FullPrecision means that the number of digits will be computed to match the full precision of each floating-point + * type. + * - \b flags an OR-ed combination of flags, the default value is 0, the only currently available flag is \c DontAlignCols which + * allows to disable the alignment of columns, resulting in faster code. + * - \b coeffSeparator string printed between two coefficients of the same row + * - \b rowSeparator string printed between two rows + * - \b rowPrefix string printed at the beginning of each row + * - \b rowSuffix string printed at the end of each row + * - \b matPrefix string printed at the beginning of the matrix + * - \b matSuffix string printed at the end of the matrix + * + * Example: \include IOFormat.cpp + * Output: \verbinclude IOFormat.out + * + * \sa DenseBase::format(), class WithFormat + */ +struct IOFormat +{ + /** Default constructor, see class IOFormat for the meaning of the parameters */ + IOFormat(int _precision = StreamPrecision, int _flags = 0, + const std::string& _coeffSeparator = " ", + const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="", + const std::string& _matPrefix="", const std::string& _matSuffix="") + : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator), + rowSpacer(""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags) + { + // TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline + // don't add rowSpacer if columns are not to be aligned + if((flags & DontAlignCols)) + return; + int i = int(matSuffix.length())-1; + while (i>=0 && matSuffix[i]!='\n') + { + rowSpacer += ' '; + i--; + } + } + std::string matPrefix, matSuffix; + std::string rowPrefix, rowSuffix, rowSeparator, rowSpacer; + std::string coeffSeparator; + int precision; + int flags; +}; + +/** \class WithFormat + * \ingroup Core_Module + * + * \brief Pseudo expression providing matrix output with given format + * + * \tparam ExpressionType the type of the object on which IO stream operations are performed + * + * This class represents an expression with stream operators controlled by a given IOFormat. + * It is the return type of DenseBase::format() + * and most of the time this is the only way it is used. + * + * See class IOFormat for some examples. + * + * \sa DenseBase::format(), class IOFormat + */ +template +class WithFormat +{ + public: + + WithFormat(const ExpressionType& matrix, const IOFormat& format) + : m_matrix(matrix), m_format(format) + {} + + friend std::ostream & operator << (std::ostream & s, const WithFormat& wf) + { + return internal::print_matrix(s, wf.m_matrix.eval(), wf.m_format); + } + + protected: + typename ExpressionType::Nested m_matrix; + IOFormat m_format; +}; + +namespace internal { + +// NOTE: This helper is kept for backward compatibility with previous code specializing +// this internal::significant_decimals_impl structure. In the future we should directly +// call digits10() which has been introduced in July 2016 in 3.3. +template +struct significant_decimals_impl +{ + static inline int run() + { + return NumTraits::digits10(); + } +}; + +/** \internal + * print the matrix \a _m to the output stream \a s using the output format \a fmt */ +template +std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt) +{ + if(_m.size() == 0) + { + s << fmt.matPrefix << fmt.matSuffix; + return s; + } + + typename Derived::Nested m = _m; + typedef typename Derived::Scalar Scalar; + + Index width = 0; + + std::streamsize explicit_precision; + if(fmt.precision == StreamPrecision) + { + explicit_precision = 0; + } + else if(fmt.precision == FullPrecision) + { + if (NumTraits::IsInteger) + { + explicit_precision = 0; + } + else + { + explicit_precision = significant_decimals_impl::run(); + } + } + else + { + explicit_precision = fmt.precision; + } + + std::streamsize old_precision = 0; + if(explicit_precision) old_precision = s.precision(explicit_precision); + + bool align_cols = !(fmt.flags & DontAlignCols); + if(align_cols) + { + // compute the largest width + for(Index j = 0; j < m.cols(); ++j) + for(Index i = 0; i < m.rows(); ++i) + { + std::stringstream sstr; + sstr.copyfmt(s); + sstr << m.coeff(i,j); + width = std::max(width, Index(sstr.str().length())); + } + } + s << fmt.matPrefix; + for(Index i = 0; i < m.rows(); ++i) + { + if (i) + s << fmt.rowSpacer; + s << fmt.rowPrefix; + if(width) s.width(width); + s << m.coeff(i, 0); + for(Index j = 1; j < m.cols(); ++j) + { + s << fmt.coeffSeparator; + if (width) s.width(width); + s << m.coeff(i, j); + } + s << fmt.rowSuffix; + if( i < m.rows() - 1) + s << fmt.rowSeparator; + } + s << fmt.matSuffix; + if(explicit_precision) s.precision(old_precision); + return s; +} + +} // end namespace internal + +/** \relates DenseBase + * + * Outputs the matrix, to the given stream. + * + * If you wish to print the matrix with a format different than the default, use DenseBase::format(). + * + * It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers. + * If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters. + * + * \sa DenseBase::format() + */ +template +std::ostream & operator << +(std::ostream & s, + const DenseBase & m) +{ + return internal::print_matrix(s, m.eval(), EIGEN_DEFAULT_IO_FORMAT); +} + +} // end namespace Eigen + +#endif // EIGEN_IO_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Inverse.h b/SudoDEM2D/lib/Eigen/src/Core/Inverse.h new file mode 100644 index 0000000..b76f043 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Inverse.h @@ -0,0 +1,118 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2014 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_INVERSE_H +#define EIGEN_INVERSE_H + +namespace Eigen { + +template class InverseImpl; + +namespace internal { + +template +struct traits > + : traits +{ + typedef typename XprType::PlainObject PlainObject; + typedef traits BaseTraits; + enum { + Flags = BaseTraits::Flags & RowMajorBit + }; +}; + +} // end namespace internal + +/** \class Inverse + * + * \brief Expression of the inverse of another expression + * + * \tparam XprType the type of the expression we are taking the inverse + * + * This class represents an abstract expression of A.inverse() + * and most of the time this is the only way it is used. + * + */ +template +class Inverse : public InverseImpl::StorageKind> +{ +public: + typedef typename XprType::StorageIndex StorageIndex; + typedef typename XprType::PlainObject PlainObject; + typedef typename XprType::Scalar Scalar; + typedef typename internal::ref_selector::type XprTypeNested; + typedef typename internal::remove_all::type XprTypeNestedCleaned; + typedef typename internal::ref_selector::type Nested; + typedef typename internal::remove_all::type NestedExpression; + + explicit EIGEN_DEVICE_FUNC Inverse(const XprType &xpr) + : m_xpr(xpr) + {} + + EIGEN_DEVICE_FUNC Index rows() const { return m_xpr.rows(); } + EIGEN_DEVICE_FUNC Index cols() const { return m_xpr.cols(); } + + EIGEN_DEVICE_FUNC const XprTypeNestedCleaned& nestedExpression() const { return m_xpr; } + +protected: + XprTypeNested m_xpr; +}; + +// Generic API dispatcher +template +class InverseImpl + : public internal::generic_xpr_base >::type +{ +public: + typedef typename internal::generic_xpr_base >::type Base; + typedef typename XprType::Scalar Scalar; +private: + + Scalar coeff(Index row, Index col) const; + Scalar coeff(Index i) const; +}; + +namespace internal { + +/** \internal + * \brief Default evaluator for Inverse expression. + * + * This default evaluator for Inverse expression simply evaluate the inverse into a temporary + * by a call to internal::call_assignment_no_alias. + * Therefore, inverse implementers only have to specialize Assignment, ...> for + * there own nested expression. + * + * \sa class Inverse + */ +template +struct unary_evaluator > + : public evaluator::PlainObject> +{ + typedef Inverse InverseType; + typedef typename InverseType::PlainObject PlainObject; + typedef evaluator Base; + + enum { Flags = Base::Flags | EvalBeforeNestingBit }; + + unary_evaluator(const InverseType& inv_xpr) + : m_result(inv_xpr.rows(), inv_xpr.cols()) + { + ::new (static_cast(this)) Base(m_result); + internal::call_assignment_no_alias(m_result, inv_xpr); + } + +protected: + PlainObject m_result; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_INVERSE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Map.h b/SudoDEM2D/lib/Eigen/src/Core/Map.h new file mode 100644 index 0000000..548bf9a --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Map.h @@ -0,0 +1,171 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007-2010 Benoit Jacob +// Copyright (C) 2008 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_MAP_H +#define EIGEN_MAP_H + +namespace Eigen { + +namespace internal { +template +struct traits > + : public traits +{ + typedef traits TraitsBase; + enum { + PlainObjectTypeInnerSize = ((traits::Flags&RowMajorBit)==RowMajorBit) + ? PlainObjectType::ColsAtCompileTime + : PlainObjectType::RowsAtCompileTime, + + InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0 + ? int(PlainObjectType::InnerStrideAtCompileTime) + : int(StrideType::InnerStrideAtCompileTime), + OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0 + ? (InnerStrideAtCompileTime==Dynamic || PlainObjectTypeInnerSize==Dynamic + ? Dynamic + : int(InnerStrideAtCompileTime) * int(PlainObjectTypeInnerSize)) + : int(StrideType::OuterStrideAtCompileTime), + Alignment = int(MapOptions)&int(AlignedMask), + Flags0 = TraitsBase::Flags & (~NestByRefBit), + Flags = is_lvalue::value ? int(Flags0) : (int(Flags0) & ~LvalueBit) + }; +private: + enum { Options }; // Expressions don't have Options +}; +} + +/** \class Map + * \ingroup Core_Module + * + * \brief A matrix or vector expression mapping an existing array of data. + * + * \tparam PlainObjectType the equivalent matrix type of the mapped data + * \tparam MapOptions specifies the pointer alignment in bytes. It can be: \c #Aligned128, , \c #Aligned64, \c #Aligned32, \c #Aligned16, \c #Aligned8 or \c #Unaligned. + * The default is \c #Unaligned. + * \tparam StrideType optionally specifies strides. By default, Map assumes the memory layout + * of an ordinary, contiguous array. This can be overridden by specifying strides. + * The type passed here must be a specialization of the Stride template, see examples below. + * + * This class represents a matrix or vector expression mapping an existing array of data. + * It can be used to let Eigen interface without any overhead with non-Eigen data structures, + * such as plain C arrays or structures from other libraries. By default, it assumes that the + * data is laid out contiguously in memory. You can however override this by explicitly specifying + * inner and outer strides. + * + * Here's an example of simply mapping a contiguous array as a \ref TopicStorageOrders "column-major" matrix: + * \include Map_simple.cpp + * Output: \verbinclude Map_simple.out + * + * If you need to map non-contiguous arrays, you can do so by specifying strides: + * + * Here's an example of mapping an array as a vector, specifying an inner stride, that is, the pointer + * increment between two consecutive coefficients. Here, we're specifying the inner stride as a compile-time + * fixed value. + * \include Map_inner_stride.cpp + * Output: \verbinclude Map_inner_stride.out + * + * Here's an example of mapping an array while specifying an outer stride. Here, since we're mapping + * as a column-major matrix, 'outer stride' means the pointer increment between two consecutive columns. + * Here, we're specifying the outer stride as a runtime parameter. Note that here \c OuterStride<> is + * a short version of \c OuterStride because the default template parameter of OuterStride + * is \c Dynamic + * \include Map_outer_stride.cpp + * Output: \verbinclude Map_outer_stride.out + * + * For more details and for an example of specifying both an inner and an outer stride, see class Stride. + * + * \b Tip: to change the array of data mapped by a Map object, you can use the C++ + * placement new syntax: + * + * Example: \include Map_placement_new.cpp + * Output: \verbinclude Map_placement_new.out + * + * This class is the return type of PlainObjectBase::Map() but can also be used directly. + * + * \sa PlainObjectBase::Map(), \ref TopicStorageOrders + */ +template class Map + : public MapBase > +{ + public: + + typedef MapBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Map) + + typedef typename Base::PointerType PointerType; + typedef PointerType PointerArgType; + EIGEN_DEVICE_FUNC + inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; } + + EIGEN_DEVICE_FUNC + inline Index innerStride() const + { + return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; + } + + EIGEN_DEVICE_FUNC + inline Index outerStride() const + { + return int(StrideType::OuterStrideAtCompileTime) != 0 ? m_stride.outer() + : int(internal::traits::OuterStrideAtCompileTime) != Dynamic ? Index(internal::traits::OuterStrideAtCompileTime) + : IsVectorAtCompileTime ? (this->size() * innerStride()) + : (int(Flags)&RowMajorBit) ? (this->cols() * innerStride()) + : (this->rows() * innerStride()); + } + + /** Constructor in the fixed-size case. + * + * \param dataPtr pointer to the array to map + * \param stride optional Stride object, passing the strides. + */ + EIGEN_DEVICE_FUNC + explicit inline Map(PointerArgType dataPtr, const StrideType& stride = StrideType()) + : Base(cast_to_pointer_type(dataPtr)), m_stride(stride) + { + PlainObjectType::Base::_check_template_params(); + } + + /** Constructor in the dynamic-size vector case. + * + * \param dataPtr pointer to the array to map + * \param size the size of the vector expression + * \param stride optional Stride object, passing the strides. + */ + EIGEN_DEVICE_FUNC + inline Map(PointerArgType dataPtr, Index size, const StrideType& stride = StrideType()) + : Base(cast_to_pointer_type(dataPtr), size), m_stride(stride) + { + PlainObjectType::Base::_check_template_params(); + } + + /** Constructor in the dynamic-size matrix case. + * + * \param dataPtr pointer to the array to map + * \param rows the number of rows of the matrix expression + * \param cols the number of columns of the matrix expression + * \param stride optional Stride object, passing the strides. + */ + EIGEN_DEVICE_FUNC + inline Map(PointerArgType dataPtr, Index rows, Index cols, const StrideType& stride = StrideType()) + : Base(cast_to_pointer_type(dataPtr), rows, cols), m_stride(stride) + { + PlainObjectType::Base::_check_template_params(); + } + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Map) + + protected: + StrideType m_stride; +}; + + +} // end namespace Eigen + +#endif // EIGEN_MAP_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/MapBase.h b/SudoDEM2D/lib/Eigen/src/Core/MapBase.h new file mode 100644 index 0000000..020f939 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/MapBase.h @@ -0,0 +1,299 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2007-2010 Benoit Jacob +// Copyright (C) 2008 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_MAPBASE_H +#define EIGEN_MAPBASE_H + +#define EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) \ + EIGEN_STATIC_ASSERT((int(internal::evaluator::Flags) & LinearAccessBit) || Derived::IsVectorAtCompileTime, \ + YOU_ARE_TRYING_TO_USE_AN_INDEX_BASED_ACCESSOR_ON_AN_EXPRESSION_THAT_DOES_NOT_SUPPORT_THAT) + +namespace Eigen { + +/** \ingroup Core_Module + * + * \brief Base class for dense Map and Block expression with direct access + * + * This base class provides the const low-level accessors (e.g. coeff, coeffRef) of dense + * Map and Block objects with direct access. + * Typical users do not have to directly deal with this class. + * + * This class can be extended by through the macro plugin \c EIGEN_MAPBASE_PLUGIN. + * See \link TopicCustomizing_Plugins customizing Eigen \endlink for details. + * + * The \c Derived class has to provide the following two methods describing the memory layout: + * \code Index innerStride() const; \endcode + * \code Index outerStride() const; \endcode + * + * \sa class Map, class Block + */ +template class MapBase + : public internal::dense_xpr_base::type +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + enum { + RowsAtCompileTime = internal::traits::RowsAtCompileTime, + ColsAtCompileTime = internal::traits::ColsAtCompileTime, + SizeAtCompileTime = Base::SizeAtCompileTime + }; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + typedef typename internal::conditional< + bool(internal::is_lvalue::value), + Scalar *, + const Scalar *>::type + PointerType; + + using Base::derived; +// using Base::RowsAtCompileTime; +// using Base::ColsAtCompileTime; +// using Base::SizeAtCompileTime; + using Base::MaxRowsAtCompileTime; + using Base::MaxColsAtCompileTime; + using Base::MaxSizeAtCompileTime; + using Base::IsVectorAtCompileTime; + using Base::Flags; + using Base::IsRowMajor; + + using Base::rows; + using Base::cols; + using Base::size; + using Base::coeff; + using Base::coeffRef; + using Base::lazyAssign; + using Base::eval; + + using Base::innerStride; + using Base::outerStride; + using Base::rowStride; + using Base::colStride; + + // bug 217 - compile error on ICC 11.1 + using Base::operator=; + + typedef typename Base::CoeffReturnType CoeffReturnType; + + /** \copydoc DenseBase::rows() */ + EIGEN_DEVICE_FUNC inline Index rows() const { return m_rows.value(); } + /** \copydoc DenseBase::cols() */ + EIGEN_DEVICE_FUNC inline Index cols() const { return m_cols.value(); } + + /** Returns a pointer to the first coefficient of the matrix or vector. + * + * \note When addressing this data, make sure to honor the strides returned by innerStride() and outerStride(). + * + * \sa innerStride(), outerStride() + */ + EIGEN_DEVICE_FUNC inline const Scalar* data() const { return m_data; } + + /** \copydoc PlainObjectBase::coeff(Index,Index) const */ + EIGEN_DEVICE_FUNC + inline const Scalar& coeff(Index rowId, Index colId) const + { + return m_data[colId * colStride() + rowId * rowStride()]; + } + + /** \copydoc PlainObjectBase::coeff(Index) const */ + EIGEN_DEVICE_FUNC + inline const Scalar& coeff(Index index) const + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + return m_data[index * innerStride()]; + } + + /** \copydoc PlainObjectBase::coeffRef(Index,Index) const */ + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index rowId, Index colId) const + { + return this->m_data[colId * colStride() + rowId * rowStride()]; + } + + /** \copydoc PlainObjectBase::coeffRef(Index) const */ + EIGEN_DEVICE_FUNC + inline const Scalar& coeffRef(Index index) const + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + return this->m_data[index * innerStride()]; + } + + /** \internal */ + template + inline PacketScalar packet(Index rowId, Index colId) const + { + return internal::ploadt + (m_data + (colId * colStride() + rowId * rowStride())); + } + + /** \internal */ + template + inline PacketScalar packet(Index index) const + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + return internal::ploadt(m_data + index * innerStride()); + } + + /** \internal Constructor for fixed size matrices or vectors */ + EIGEN_DEVICE_FUNC + explicit inline MapBase(PointerType dataPtr) : m_data(dataPtr), m_rows(RowsAtCompileTime), m_cols(ColsAtCompileTime) + { + EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) + checkSanity(); + } + + /** \internal Constructor for dynamically sized vectors */ + EIGEN_DEVICE_FUNC + inline MapBase(PointerType dataPtr, Index vecSize) + : m_data(dataPtr), + m_rows(RowsAtCompileTime == Dynamic ? vecSize : Index(RowsAtCompileTime)), + m_cols(ColsAtCompileTime == Dynamic ? vecSize : Index(ColsAtCompileTime)) + { + EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) + eigen_assert(vecSize >= 0); + eigen_assert(dataPtr == 0 || SizeAtCompileTime == Dynamic || SizeAtCompileTime == vecSize); + checkSanity(); + } + + /** \internal Constructor for dynamically sized matrices */ + EIGEN_DEVICE_FUNC + inline MapBase(PointerType dataPtr, Index rows, Index cols) + : m_data(dataPtr), m_rows(rows), m_cols(cols) + { + eigen_assert( (dataPtr == 0) + || ( rows >= 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) + && cols >= 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == cols))); + checkSanity(); + } + + #ifdef EIGEN_MAPBASE_PLUGIN + #include EIGEN_MAPBASE_PLUGIN + #endif + + protected: + + template + EIGEN_DEVICE_FUNC + void checkSanity(typename internal::enable_if<(internal::traits::Alignment>0),void*>::type = 0) const + { +#if EIGEN_MAX_ALIGN_BYTES>0 + eigen_assert(( ((internal::UIntPtr(m_data) % internal::traits::Alignment) == 0) + || (cols() * rows() * innerStride() * sizeof(Scalar)) < internal::traits::Alignment ) && "data is not aligned"); +#endif + } + + template + EIGEN_DEVICE_FUNC + void checkSanity(typename internal::enable_if::Alignment==0,void*>::type = 0) const + {} + + PointerType m_data; + const internal::variable_if_dynamic m_rows; + const internal::variable_if_dynamic m_cols; +}; + +/** \ingroup Core_Module + * + * \brief Base class for non-const dense Map and Block expression with direct access + * + * This base class provides the non-const low-level accessors (e.g. coeff and coeffRef) of + * dense Map and Block objects with direct access. + * It inherits MapBase which defines the const variant for reading specific entries. + * + * \sa class Map, class Block + */ +template class MapBase + : public MapBase +{ + typedef MapBase ReadOnlyMapBase; + public: + + typedef MapBase Base; + + typedef typename Base::Scalar Scalar; + typedef typename Base::PacketScalar PacketScalar; + typedef typename Base::StorageIndex StorageIndex; + typedef typename Base::PointerType PointerType; + + using Base::derived; + using Base::rows; + using Base::cols; + using Base::size; + using Base::coeff; + using Base::coeffRef; + + using Base::innerStride; + using Base::outerStride; + using Base::rowStride; + using Base::colStride; + + typedef typename internal::conditional< + internal::is_lvalue::value, + Scalar, + const Scalar + >::type ScalarWithConstIfNotLvalue; + + EIGEN_DEVICE_FUNC + inline const Scalar* data() const { return this->m_data; } + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue* data() { return this->m_data; } // no const-cast here so non-const-correct code will give a compile error + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue& coeffRef(Index row, Index col) + { + return this->m_data[col * colStride() + row * rowStride()]; + } + + EIGEN_DEVICE_FUNC + inline ScalarWithConstIfNotLvalue& coeffRef(Index index) + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + return this->m_data[index * innerStride()]; + } + + template + inline void writePacket(Index row, Index col, const PacketScalar& val) + { + internal::pstoret + (this->m_data + (col * colStride() + row * rowStride()), val); + } + + template + inline void writePacket(Index index, const PacketScalar& val) + { + EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) + internal::pstoret + (this->m_data + index * innerStride(), val); + } + + EIGEN_DEVICE_FUNC explicit inline MapBase(PointerType dataPtr) : Base(dataPtr) {} + EIGEN_DEVICE_FUNC inline MapBase(PointerType dataPtr, Index vecSize) : Base(dataPtr, vecSize) {} + EIGEN_DEVICE_FUNC inline MapBase(PointerType dataPtr, Index rows, Index cols) : Base(dataPtr, rows, cols) {} + + EIGEN_DEVICE_FUNC + Derived& operator=(const MapBase& other) + { + ReadOnlyMapBase::Base::operator=(other); + return derived(); + } + + // In theory we could simply refer to Base:Base::operator=, but MSVC does not like Base::Base, + // see bugs 821 and 920. + using ReadOnlyMapBase::Base::operator=; +}; + +#undef EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS + +} // end namespace Eigen + +#endif // EIGEN_MAPBASE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/MathFunctions.h b/SudoDEM2D/lib/Eigen/src/Core/MathFunctions.h new file mode 100644 index 0000000..6eb974d --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/MathFunctions.h @@ -0,0 +1,1407 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2010 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_MATHFUNCTIONS_H +#define EIGEN_MATHFUNCTIONS_H + +// source: http://www.geom.uiuc.edu/~huberty/math5337/groupe/digits.html +// TODO this should better be moved to NumTraits +#define EIGEN_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406L + + +namespace Eigen { + +// On WINCE, std::abs is defined for int only, so let's defined our own overloads: +// This issue has been confirmed with MSVC 2008 only, but the issue might exist for more recent versions too. +#if EIGEN_OS_WINCE && EIGEN_COMP_MSVC && EIGEN_COMP_MSVC<=1500 +long abs(long x) { return (labs(x)); } +double abs(double x) { return (fabs(x)); } +float abs(float x) { return (fabsf(x)); } +long double abs(long double x) { return (fabsl(x)); } +#endif + +namespace internal { + +/** \internal \class global_math_functions_filtering_base + * + * What it does: + * Defines a typedef 'type' as follows: + * - if type T has a member typedef Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl, then + * global_math_functions_filtering_base::type is a typedef for it. + * - otherwise, global_math_functions_filtering_base::type is a typedef for T. + * + * How it's used: + * To allow to defined the global math functions (like sin...) in certain cases, like the Array expressions. + * When you do sin(array1+array2), the object array1+array2 has a complicated expression type, all what you want to know + * is that it inherits ArrayBase. So we implement a partial specialization of sin_impl for ArrayBase. + * So we must make sure to use sin_impl > and not sin_impl, otherwise our partial specialization + * won't be used. How does sin know that? That's exactly what global_math_functions_filtering_base tells it. + * + * How it's implemented: + * SFINAE in the style of enable_if. Highly susceptible of breaking compilers. With GCC, it sure does work, but if you replace + * the typename dummy by an integer template parameter, it doesn't work anymore! + */ + +template +struct global_math_functions_filtering_base +{ + typedef T type; +}; + +template struct always_void { typedef void type; }; + +template +struct global_math_functions_filtering_base + ::type + > +{ + typedef typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl type; +}; + +#define EIGEN_MATHFUNC_IMPL(func, scalar) Eigen::internal::func##_impl::type> +#define EIGEN_MATHFUNC_RETVAL(func, scalar) typename Eigen::internal::func##_retval::type>::type + +/**************************************************************************** +* Implementation of real * +****************************************************************************/ + +template::IsComplex> +struct real_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return x; + } +}; + +template +struct real_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + using std::real; + return real(x); + } +}; + +template struct real_impl : real_default_impl {}; + +#ifdef __CUDA_ARCH__ +template +struct real_impl > +{ + typedef T RealScalar; + EIGEN_DEVICE_FUNC + static inline T run(const std::complex& x) + { + return x.real(); + } +}; +#endif + +template +struct real_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of imag * +****************************************************************************/ + +template::IsComplex> +struct imag_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar&) + { + return RealScalar(0); + } +}; + +template +struct imag_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + using std::imag; + return imag(x); + } +}; + +template struct imag_impl : imag_default_impl {}; + +#ifdef __CUDA_ARCH__ +template +struct imag_impl > +{ + typedef T RealScalar; + EIGEN_DEVICE_FUNC + static inline T run(const std::complex& x) + { + return x.imag(); + } +}; +#endif + +template +struct imag_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of real_ref * +****************************************************************************/ + +template +struct real_ref_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar& run(Scalar& x) + { + return reinterpret_cast(&x)[0]; + } + EIGEN_DEVICE_FUNC + static inline const RealScalar& run(const Scalar& x) + { + return reinterpret_cast(&x)[0]; + } +}; + +template +struct real_ref_retval +{ + typedef typename NumTraits::Real & type; +}; + +/**************************************************************************** +* Implementation of imag_ref * +****************************************************************************/ + +template +struct imag_ref_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar& run(Scalar& x) + { + return reinterpret_cast(&x)[1]; + } + EIGEN_DEVICE_FUNC + static inline const RealScalar& run(const Scalar& x) + { + return reinterpret_cast(&x)[1]; + } +}; + +template +struct imag_ref_default_impl +{ + EIGEN_DEVICE_FUNC + static inline Scalar run(Scalar&) + { + return Scalar(0); + } + EIGEN_DEVICE_FUNC + static inline const Scalar run(const Scalar&) + { + return Scalar(0); + } +}; + +template +struct imag_ref_impl : imag_ref_default_impl::IsComplex> {}; + +template +struct imag_ref_retval +{ + typedef typename NumTraits::Real & type; +}; + +/**************************************************************************** +* Implementation of conj * +****************************************************************************/ + +template::IsComplex> +struct conj_impl +{ + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& x) + { + return x; + } +}; + +template +struct conj_impl +{ + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& x) + { + using std::conj; + return conj(x); + } +}; + +template +struct conj_retval +{ + typedef Scalar type; +}; + +/**************************************************************************** +* Implementation of abs2 * +****************************************************************************/ + +template +struct abs2_impl_default +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return x*x; + } +}; + +template +struct abs2_impl_default // IsComplex +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return real(x)*real(x) + imag(x)*imag(x); + } +}; + +template +struct abs2_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return abs2_impl_default::IsComplex>::run(x); + } +}; + +template +struct abs2_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of norm1 * +****************************************************************************/ + +template +struct norm1_default_impl +{ + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + EIGEN_USING_STD_MATH(abs); + return abs(real(x)) + abs(imag(x)); + } +}; + +template +struct norm1_default_impl +{ + EIGEN_DEVICE_FUNC + static inline Scalar run(const Scalar& x) + { + EIGEN_USING_STD_MATH(abs); + return abs(x); + } +}; + +template +struct norm1_impl : norm1_default_impl::IsComplex> {}; + +template +struct norm1_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of hypot * +****************************************************************************/ + +template struct hypot_impl; + +template +struct hypot_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of cast * +****************************************************************************/ + +template +struct cast_impl +{ + EIGEN_DEVICE_FUNC + static inline NewType run(const OldType& x) + { + return static_cast(x); + } +}; + +// here, for once, we're plainly returning NewType: we don't want cast to do weird things. + +template +EIGEN_DEVICE_FUNC +inline NewType cast(const OldType& x) +{ + return cast_impl::run(x); +} + +/**************************************************************************** +* Implementation of round * +****************************************************************************/ + +#if EIGEN_HAS_CXX11_MATH + template + struct round_impl { + static inline Scalar run(const Scalar& x) + { + EIGEN_STATIC_ASSERT((!NumTraits::IsComplex), NUMERIC_TYPE_MUST_BE_REAL) + using std::round; + return round(x); + } + }; +#else + template + struct round_impl + { + static inline Scalar run(const Scalar& x) + { + EIGEN_STATIC_ASSERT((!NumTraits::IsComplex), NUMERIC_TYPE_MUST_BE_REAL) + EIGEN_USING_STD_MATH(floor); + EIGEN_USING_STD_MATH(ceil); + return (x > Scalar(0)) ? floor(x + Scalar(0.5)) : ceil(x - Scalar(0.5)); + } + }; +#endif + +template +struct round_retval +{ + typedef Scalar type; +}; + +/**************************************************************************** +* Implementation of arg * +****************************************************************************/ + +#if EIGEN_HAS_CXX11_MATH + template + struct arg_impl { + static inline Scalar run(const Scalar& x) + { + EIGEN_USING_STD_MATH(arg); + return arg(x); + } + }; +#else + template::IsComplex> + struct arg_default_impl + { + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + return (x < Scalar(0)) ? Scalar(EIGEN_PI) : Scalar(0); } + }; + + template + struct arg_default_impl + { + typedef typename NumTraits::Real RealScalar; + EIGEN_DEVICE_FUNC + static inline RealScalar run(const Scalar& x) + { + EIGEN_USING_STD_MATH(arg); + return arg(x); + } + }; + + template struct arg_impl : arg_default_impl {}; +#endif + +template +struct arg_retval +{ + typedef typename NumTraits::Real type; +}; + +/**************************************************************************** +* Implementation of log1p * +****************************************************************************/ + +namespace std_fallback { + // fallback log1p implementation in case there is no log1p(Scalar) function in namespace of Scalar, + // or that there is no suitable std::log1p function available + template + EIGEN_DEVICE_FUNC inline Scalar log1p(const Scalar& x) { + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) + typedef typename NumTraits::Real RealScalar; + EIGEN_USING_STD_MATH(log); + Scalar x1p = RealScalar(1) + x; + return numext::equal_strict(x1p, Scalar(1)) ? x : x * ( log(x1p) / (x1p - RealScalar(1)) ); + } +} + +template +struct log1p_impl { + static inline Scalar run(const Scalar& x) + { + EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) + #if EIGEN_HAS_CXX11_MATH + using std::log1p; + #endif + using std_fallback::log1p; + return log1p(x); + } +}; + + +template +struct log1p_retval +{ + typedef Scalar type; +}; + +/**************************************************************************** +* Implementation of pow * +****************************************************************************/ + +template::IsInteger&&NumTraits::IsInteger> +struct pow_impl +{ + //typedef Scalar retval; + typedef typename ScalarBinaryOpTraits >::ReturnType result_type; + static EIGEN_DEVICE_FUNC inline result_type run(const ScalarX& x, const ScalarY& y) + { + EIGEN_USING_STD_MATH(pow); + return pow(x, y); + } +}; + +template +struct pow_impl +{ + typedef ScalarX result_type; + static EIGEN_DEVICE_FUNC inline ScalarX run(ScalarX x, ScalarY y) + { + ScalarX res(1); + eigen_assert(!NumTraits::IsSigned || y >= 0); + if(y & 1) res *= x; + y >>= 1; + while(y) + { + x *= x; + if(y&1) res *= x; + y >>= 1; + } + return res; + } +}; + +/**************************************************************************** +* Implementation of random * +****************************************************************************/ + +template +struct random_default_impl {}; + +template +struct random_impl : random_default_impl::IsComplex, NumTraits::IsInteger> {}; + +template +struct random_retval +{ + typedef Scalar type; +}; + +template inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y); +template inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(); + +template +struct random_default_impl +{ + static inline Scalar run(const Scalar& x, const Scalar& y) + { + return x + (y-x) * Scalar(std::rand()) / Scalar(RAND_MAX); + } + static inline Scalar run() + { + return run(Scalar(NumTraits::IsSigned ? -1 : 0), Scalar(1)); + } +}; + +enum { + meta_floor_log2_terminate, + meta_floor_log2_move_up, + meta_floor_log2_move_down, + meta_floor_log2_bogus +}; + +template struct meta_floor_log2_selector +{ + enum { middle = (lower + upper) / 2, + value = (upper <= lower + 1) ? int(meta_floor_log2_terminate) + : (n < (1 << middle)) ? int(meta_floor_log2_move_down) + : (n==0) ? int(meta_floor_log2_bogus) + : int(meta_floor_log2_move_up) + }; +}; + +template::value> +struct meta_floor_log2 {}; + +template +struct meta_floor_log2 +{ + enum { value = meta_floor_log2::middle>::value }; +}; + +template +struct meta_floor_log2 +{ + enum { value = meta_floor_log2::middle, upper>::value }; +}; + +template +struct meta_floor_log2 +{ + enum { value = (n >= ((unsigned int)(1) << (lower+1))) ? lower+1 : lower }; +}; + +template +struct meta_floor_log2 +{ + // no value, error at compile time +}; + +template +struct random_default_impl +{ + static inline Scalar run(const Scalar& x, const Scalar& y) + { + typedef typename conditional::IsSigned,std::ptrdiff_t,std::size_t>::type ScalarX; + if(y=x the result converted to an unsigned long is still correct. + std::size_t range = ScalarX(y)-ScalarX(x); + std::size_t offset = 0; + // rejection sampling + std::size_t divisor = 1; + std::size_t multiplier = 1; + if(range range); + return Scalar(ScalarX(x) + offset); + } + + static inline Scalar run() + { +#ifdef EIGEN_MAKING_DOCS + return run(Scalar(NumTraits::IsSigned ? -10 : 0), Scalar(10)); +#else + enum { rand_bits = meta_floor_log2<(unsigned int)(RAND_MAX)+1>::value, + scalar_bits = sizeof(Scalar) * CHAR_BIT, + shift = EIGEN_PLAIN_ENUM_MAX(0, int(rand_bits) - int(scalar_bits)), + offset = NumTraits::IsSigned ? (1 << (EIGEN_PLAIN_ENUM_MIN(rand_bits,scalar_bits)-1)) : 0 + }; + return Scalar((std::rand() >> shift) - offset); +#endif + } +}; + +template +struct random_default_impl +{ + static inline Scalar run(const Scalar& x, const Scalar& y) + { + return Scalar(random(real(x), real(y)), + random(imag(x), imag(y))); + } + static inline Scalar run() + { + typedef typename NumTraits::Real RealScalar; + return Scalar(random(), random()); + } +}; + +template +inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y) +{ + return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(x, y); +} + +template +inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random() +{ + return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(); +} + +// Implementatin of is* functions + +// std::is* do not work with fast-math and gcc, std::is* are available on MSVC 2013 and newer, as well as in clang. +#if (EIGEN_HAS_CXX11_MATH && !(EIGEN_COMP_GNUC_STRICT && __FINITE_MATH_ONLY__)) || (EIGEN_COMP_MSVC>=1800) || (EIGEN_COMP_CLANG) +#define EIGEN_USE_STD_FPCLASSIFY 1 +#else +#define EIGEN_USE_STD_FPCLASSIFY 0 +#endif + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isnan_impl(const T&) { return false; } + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isinf_impl(const T&) { return false; } + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isfinite_impl(const T&) { return true; } + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type +isfinite_impl(const T& x) +{ + #ifdef __CUDA_ARCH__ + return (::isfinite)(x); + #elif EIGEN_USE_STD_FPCLASSIFY + using std::isfinite; + return isfinite EIGEN_NOT_A_MACRO (x); + #else + return x<=NumTraits::highest() && x>=NumTraits::lowest(); + #endif +} + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type +isinf_impl(const T& x) +{ + #ifdef __CUDA_ARCH__ + return (::isinf)(x); + #elif EIGEN_USE_STD_FPCLASSIFY + using std::isinf; + return isinf EIGEN_NOT_A_MACRO (x); + #else + return x>NumTraits::highest() || x::lowest(); + #endif +} + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type +isnan_impl(const T& x) +{ + #ifdef __CUDA_ARCH__ + return (::isnan)(x); + #elif EIGEN_USE_STD_FPCLASSIFY + using std::isnan; + return isnan EIGEN_NOT_A_MACRO (x); + #else + return x != x; + #endif +} + +#if (!EIGEN_USE_STD_FPCLASSIFY) + +#if EIGEN_COMP_MSVC + +template EIGEN_DEVICE_FUNC bool isinf_msvc_helper(T x) +{ + return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF; +} + +//MSVC defines a _isnan builtin function, but for double only +EIGEN_DEVICE_FUNC inline bool isnan_impl(const long double& x) { return _isnan(x)!=0; } +EIGEN_DEVICE_FUNC inline bool isnan_impl(const double& x) { return _isnan(x)!=0; } +EIGEN_DEVICE_FUNC inline bool isnan_impl(const float& x) { return _isnan(x)!=0; } + +EIGEN_DEVICE_FUNC inline bool isinf_impl(const long double& x) { return isinf_msvc_helper(x); } +EIGEN_DEVICE_FUNC inline bool isinf_impl(const double& x) { return isinf_msvc_helper(x); } +EIGEN_DEVICE_FUNC inline bool isinf_impl(const float& x) { return isinf_msvc_helper(x); } + +#elif (defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ && EIGEN_COMP_GNUC) + +#if EIGEN_GNUC_AT_LEAST(5,0) + #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((optimize("no-finite-math-only"))) +#else + // NOTE the inline qualifier and noinline attribute are both needed: the former is to avoid linking issue (duplicate symbol), + // while the second prevent too aggressive optimizations in fast-math mode: + #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((noinline,optimize("no-finite-math-only"))) +#endif + +template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const long double& x) { return __builtin_isnan(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const double& x) { return __builtin_isnan(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const float& x) { return __builtin_isnan(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const double& x) { return __builtin_isinf(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const float& x) { return __builtin_isinf(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const long double& x) { return __builtin_isinf(x); } + +#undef EIGEN_TMP_NOOPT_ATTRIB + +#endif + +#endif + +// The following overload are defined at the end of this file +template EIGEN_DEVICE_FUNC bool isfinite_impl(const std::complex& x); +template EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex& x); +template EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex& x); + +template T generic_fast_tanh_float(const T& a_x); + +} // end namespace internal + +/**************************************************************************** +* Generic math functions * +****************************************************************************/ + +namespace numext { + +#ifndef __CUDA_ARCH__ +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y) +{ + EIGEN_USING_STD_MATH(min); + return min EIGEN_NOT_A_MACRO (x,y); +} + +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y) +{ + EIGEN_USING_STD_MATH(max); + return max EIGEN_NOT_A_MACRO (x,y); +} +#else +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y) +{ + return y < x ? y : x; +} +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE float mini(const float& x, const float& y) +{ + return fminf(x, y); +} +template +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y) +{ + return x < y ? y : x; +} +template<> +EIGEN_DEVICE_FUNC +EIGEN_ALWAYS_INLINE float maxi(const float& x, const float& y) +{ + return fmaxf(x, y); +} +#endif + + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(real, Scalar) real(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(real, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline typename internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x) +{ + return internal::real_ref_impl::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) real_ref(Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(real_ref, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(imag, Scalar) imag(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(imag, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(arg, Scalar) arg(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(arg, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline typename internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x) +{ + return internal::imag_ref_impl::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) imag_ref(Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(imag_ref, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(conj, Scalar) conj(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(conj, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(abs2, Scalar) abs2(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(abs2, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(norm1, Scalar) norm1(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(norm1, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar& y) +{ + return EIGEN_MATHFUNC_IMPL(hypot, Scalar)::run(x, y); +} + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(log1p, Scalar) log1p(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(log1p, Scalar)::run(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float log1p(const float &x) { return ::log1pf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double log1p(const double &x) { return ::log1p(x); } +#endif + +template +EIGEN_DEVICE_FUNC +inline typename internal::pow_impl::result_type pow(const ScalarX& x, const ScalarY& y) +{ + return internal::pow_impl::run(x, y); +} + +template EIGEN_DEVICE_FUNC bool (isnan) (const T &x) { return internal::isnan_impl(x); } +template EIGEN_DEVICE_FUNC bool (isinf) (const T &x) { return internal::isinf_impl(x); } +template EIGEN_DEVICE_FUNC bool (isfinite)(const T &x) { return internal::isfinite_impl(x); } + +template +EIGEN_DEVICE_FUNC +inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x) +{ + return EIGEN_MATHFUNC_IMPL(round, Scalar)::run(x); +} + +template +EIGEN_DEVICE_FUNC +T (floor)(const T& x) +{ + EIGEN_USING_STD_MATH(floor); + return floor(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float floor(const float &x) { return ::floorf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double floor(const double &x) { return ::floor(x); } +#endif + +template +EIGEN_DEVICE_FUNC +T (ceil)(const T& x) +{ + EIGEN_USING_STD_MATH(ceil); + return ceil(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float ceil(const float &x) { return ::ceilf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double ceil(const double &x) { return ::ceil(x); } +#endif + + +/** Log base 2 for 32 bits positive integers. + * Conveniently returns 0 for x==0. */ +inline int log2(int x) +{ + eigen_assert(x>=0); + unsigned int v(x); + static const int table[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + return table[(v * 0x07C4ACDDU) >> 27]; +} + +/** \returns the square root of \a x. + * + * It is essentially equivalent to \code using std::sqrt; return sqrt(x); \endcode, + * but slightly faster for float/double and some compilers (e.g., gcc), thanks to + * specializations when SSE is enabled. + * + * It's usage is justified in performance critical functions, like norm/normalize. + */ +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T sqrt(const T &x) +{ + EIGEN_USING_STD_MATH(sqrt); + return sqrt(x); +} + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T log(const T &x) { + EIGEN_USING_STD_MATH(log); + return log(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float log(const float &x) { return ::logf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double log(const double &x) { return ::log(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +typename internal::enable_if::IsSigned || NumTraits::IsComplex,typename NumTraits::Real>::type +abs(const T &x) { + EIGEN_USING_STD_MATH(abs); + return abs(x); +} + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +typename internal::enable_if::IsSigned || NumTraits::IsComplex),typename NumTraits::Real>::type +abs(const T &x) { + return x; +} + +#if defined(__SYCL_DEVICE_ONLY__) +EIGEN_ALWAYS_INLINE float abs(float x) { return cl::sycl::fabs(x); } +EIGEN_ALWAYS_INLINE double abs(double x) { return cl::sycl::fabs(x); } +#endif // defined(__SYCL_DEVICE_ONLY__) + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float abs(const float &x) { return ::fabsf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double abs(const double &x) { return ::fabs(x); } + +template <> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float abs(const std::complex& x) { + return ::hypotf(x.real(), x.imag()); +} + +template <> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double abs(const std::complex& x) { + return ::hypot(x.real(), x.imag()); +} +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T exp(const T &x) { + EIGEN_USING_STD_MATH(exp); + return exp(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float exp(const float &x) { return ::expf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double exp(const double &x) { return ::exp(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T cos(const T &x) { + EIGEN_USING_STD_MATH(cos); + return cos(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float cos(const float &x) { return ::cosf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double cos(const double &x) { return ::cos(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T sin(const T &x) { + EIGEN_USING_STD_MATH(sin); + return sin(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float sin(const float &x) { return ::sinf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double sin(const double &x) { return ::sin(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T tan(const T &x) { + EIGEN_USING_STD_MATH(tan); + return tan(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float tan(const float &x) { return ::tanf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double tan(const double &x) { return ::tan(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T acos(const T &x) { + EIGEN_USING_STD_MATH(acos); + return acos(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float acos(const float &x) { return ::acosf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double acos(const double &x) { return ::acos(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T asin(const T &x) { + EIGEN_USING_STD_MATH(asin); + return asin(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float asin(const float &x) { return ::asinf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double asin(const double &x) { return ::asin(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T atan(const T &x) { + EIGEN_USING_STD_MATH(atan); + return atan(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float atan(const float &x) { return ::atanf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double atan(const double &x) { return ::atan(x); } +#endif + + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T cosh(const T &x) { + EIGEN_USING_STD_MATH(cosh); + return cosh(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float cosh(const float &x) { return ::coshf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double cosh(const double &x) { return ::cosh(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T sinh(const T &x) { + EIGEN_USING_STD_MATH(sinh); + return sinh(x); +} + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float sinh(const float &x) { return ::sinhf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double sinh(const double &x) { return ::sinh(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T tanh(const T &x) { + EIGEN_USING_STD_MATH(tanh); + return tanh(x); +} + +#if (!defined(__CUDACC__)) && EIGEN_FAST_MATH +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float tanh(float x) { return internal::generic_fast_tanh_float(x); } +#endif + +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float tanh(const float &x) { return ::tanhf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double tanh(const double &x) { return ::tanh(x); } +#endif + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T fmod(const T& a, const T& b) { + EIGEN_USING_STD_MATH(fmod); + return fmod(a, b); +} + +#ifdef __CUDACC__ +template <> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float fmod(const float& a, const float& b) { + return ::fmodf(a, b); +} + +template <> +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double fmod(const double& a, const double& b) { + return ::fmod(a, b); +} +#endif + +} // end namespace numext + +namespace internal { + +template +EIGEN_DEVICE_FUNC bool isfinite_impl(const std::complex& x) +{ + return (numext::isfinite)(numext::real(x)) && (numext::isfinite)(numext::imag(x)); +} + +template +EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex& x) +{ + return (numext::isnan)(numext::real(x)) || (numext::isnan)(numext::imag(x)); +} + +template +EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex& x) +{ + return ((numext::isinf)(numext::real(x)) || (numext::isinf)(numext::imag(x))) && (!(numext::isnan)(x)); +} + +/**************************************************************************** +* Implementation of fuzzy comparisons * +****************************************************************************/ + +template +struct scalar_fuzzy_default_impl {}; + +template +struct scalar_fuzzy_default_impl +{ + typedef typename NumTraits::Real RealScalar; + template EIGEN_DEVICE_FUNC + static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec) + { + return numext::abs(x) <= numext::abs(y) * prec; + } + EIGEN_DEVICE_FUNC + static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec) + { + return numext::abs(x - y) <= numext::mini(numext::abs(x), numext::abs(y)) * prec; + } + EIGEN_DEVICE_FUNC + static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec) + { + return x <= y || isApprox(x, y, prec); + } +}; + +template +struct scalar_fuzzy_default_impl +{ + typedef typename NumTraits::Real RealScalar; + template EIGEN_DEVICE_FUNC + static inline bool isMuchSmallerThan(const Scalar& x, const Scalar&, const RealScalar&) + { + return x == Scalar(0); + } + EIGEN_DEVICE_FUNC + static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar&) + { + return x == y; + } + EIGEN_DEVICE_FUNC + static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar&) + { + return x <= y; + } +}; + +template +struct scalar_fuzzy_default_impl +{ + typedef typename NumTraits::Real RealScalar; + template EIGEN_DEVICE_FUNC + static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec) + { + return numext::abs2(x) <= numext::abs2(y) * prec * prec; + } + EIGEN_DEVICE_FUNC + static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec) + { + return numext::abs2(x - y) <= numext::mini(numext::abs2(x), numext::abs2(y)) * prec * prec; + } +}; + +template +struct scalar_fuzzy_impl : scalar_fuzzy_default_impl::IsComplex, NumTraits::IsInteger> {}; + +template EIGEN_DEVICE_FUNC +inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, + const typename NumTraits::Real &precision = NumTraits::dummy_precision()) +{ + return scalar_fuzzy_impl::template isMuchSmallerThan(x, y, precision); +} + +template EIGEN_DEVICE_FUNC +inline bool isApprox(const Scalar& x, const Scalar& y, + const typename NumTraits::Real &precision = NumTraits::dummy_precision()) +{ + return scalar_fuzzy_impl::isApprox(x, y, precision); +} + +template EIGEN_DEVICE_FUNC +inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, + const typename NumTraits::Real &precision = NumTraits::dummy_precision()) +{ + return scalar_fuzzy_impl::isApproxOrLessThan(x, y, precision); +} + +/****************************************** +*** The special case of the bool type *** +******************************************/ + +template<> struct random_impl +{ + static inline bool run() + { + return random(0,1)==0 ? false : true; + } +}; + +template<> struct scalar_fuzzy_impl +{ + typedef bool RealScalar; + + template EIGEN_DEVICE_FUNC + static inline bool isMuchSmallerThan(const bool& x, const bool&, const bool&) + { + return !x; + } + + EIGEN_DEVICE_FUNC + static inline bool isApprox(bool x, bool y, bool) + { + return x == y; + } + + EIGEN_DEVICE_FUNC + static inline bool isApproxOrLessThan(const bool& x, const bool& y, const bool&) + { + return (!x) || y; + } + +}; + + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_MATHFUNCTIONS_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/MathFunctionsImpl.h b/SudoDEM2D/lib/Eigen/src/Core/MathFunctionsImpl.h new file mode 100644 index 0000000..9c1ceb0 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/MathFunctionsImpl.h @@ -0,0 +1,101 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2014 Pedro Gonnet (pedro.gonnet@gmail.com) +// Copyright (C) 2016 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_MATHFUNCTIONSIMPL_H +#define EIGEN_MATHFUNCTIONSIMPL_H + +namespace Eigen { + +namespace internal { + +/** \internal \returns the hyperbolic tan of \a a (coeff-wise) + Doesn't do anything fancy, just a 13/6-degree rational interpolant which + is accurate up to a couple of ulp in the range [-9, 9], outside of which + the tanh(x) = +/-1. + + This implementation works on both scalars and packets. +*/ +template +T generic_fast_tanh_float(const T& a_x) +{ + // Clamp the inputs to the range [-9, 9] since anything outside + // this range is +/-1.0f in single-precision. + const T plus_9 = pset1(9.f); + const T minus_9 = pset1(-9.f); + // NOTE GCC prior to 6.3 might improperly optimize this max/min + // step such that if a_x is nan, x will be either 9 or -9, + // and tanh will return 1 or -1 instead of nan. + // This is supposed to be fixed in gcc6.3, + // see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72867 + const T x = pmax(minus_9,pmin(plus_9,a_x)); + // The monomial coefficients of the numerator polynomial (odd). + const T alpha_1 = pset1(4.89352455891786e-03f); + const T alpha_3 = pset1(6.37261928875436e-04f); + const T alpha_5 = pset1(1.48572235717979e-05f); + const T alpha_7 = pset1(5.12229709037114e-08f); + const T alpha_9 = pset1(-8.60467152213735e-11f); + const T alpha_11 = pset1(2.00018790482477e-13f); + const T alpha_13 = pset1(-2.76076847742355e-16f); + + // The monomial coefficients of the denominator polynomial (even). + const T beta_0 = pset1(4.89352518554385e-03f); + const T beta_2 = pset1(2.26843463243900e-03f); + const T beta_4 = pset1(1.18534705686654e-04f); + const T beta_6 = pset1(1.19825839466702e-06f); + + // Since the polynomials are odd/even, we need x^2. + const T x2 = pmul(x, x); + + // Evaluate the numerator polynomial p. + T p = pmadd(x2, alpha_13, alpha_11); + p = pmadd(x2, p, alpha_9); + p = pmadd(x2, p, alpha_7); + p = pmadd(x2, p, alpha_5); + p = pmadd(x2, p, alpha_3); + p = pmadd(x2, p, alpha_1); + p = pmul(x, p); + + // Evaluate the denominator polynomial p. + T q = pmadd(x2, beta_6, beta_4); + q = pmadd(x2, q, beta_2); + q = pmadd(x2, q, beta_0); + + // Divide the numerator by the denominator. + return pdiv(p, q); +} + +template +EIGEN_STRONG_INLINE +RealScalar positive_real_hypot(const RealScalar& x, const RealScalar& y) +{ + EIGEN_USING_STD_MATH(sqrt); + RealScalar p, qp; + p = numext::maxi(x,y); + if(p==RealScalar(0)) return RealScalar(0); + qp = numext::mini(y,x) / p; + return p * sqrt(RealScalar(1) + qp*qp); +} + +template +struct hypot_impl +{ + typedef typename NumTraits::Real RealScalar; + static inline RealScalar run(const Scalar& x, const Scalar& y) + { + EIGEN_USING_STD_MATH(abs); + return positive_real_hypot(abs(x), abs(y)); + } +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_MATHFUNCTIONSIMPL_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Matrix.h b/SudoDEM2D/lib/Eigen/src/Core/Matrix.h new file mode 100644 index 0000000..90c336d --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Matrix.h @@ -0,0 +1,461 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2010 Benoit Jacob +// Copyright (C) 2008-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 EIGEN_MATRIX_H +#define EIGEN_MATRIX_H + +namespace Eigen { + +namespace internal { +template +struct traits > +{ +private: + enum { size = internal::size_at_compile_time<_Rows,_Cols>::ret }; + typedef typename find_best_packet<_Scalar,size>::type PacketScalar; + enum { + row_major_bit = _Options&RowMajor ? RowMajorBit : 0, + is_dynamic_size_storage = _MaxRows==Dynamic || _MaxCols==Dynamic, + max_size = is_dynamic_size_storage ? Dynamic : _MaxRows*_MaxCols, + default_alignment = compute_default_alignment<_Scalar,max_size>::value, + actual_alignment = ((_Options&DontAlign)==0) ? default_alignment : 0, + required_alignment = unpacket_traits::alignment, + packet_access_bit = (packet_traits<_Scalar>::Vectorizable && (EIGEN_UNALIGNED_VECTORIZE || (actual_alignment>=required_alignment))) ? PacketAccessBit : 0 + }; + +public: + typedef _Scalar Scalar; + typedef Dense StorageKind; + typedef Eigen::Index StorageIndex; + typedef MatrixXpr XprKind; + enum { + RowsAtCompileTime = _Rows, + ColsAtCompileTime = _Cols, + MaxRowsAtCompileTime = _MaxRows, + MaxColsAtCompileTime = _MaxCols, + Flags = compute_matrix_flags<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ret, + Options = _Options, + InnerStrideAtCompileTime = 1, + OuterStrideAtCompileTime = (Options&RowMajor) ? ColsAtCompileTime : RowsAtCompileTime, + + // FIXME, the following flag in only used to define NeedsToAlign in PlainObjectBase + EvaluatorFlags = LinearAccessBit | DirectAccessBit | packet_access_bit | row_major_bit, + Alignment = actual_alignment + }; +}; +} + +/** \class Matrix + * \ingroup Core_Module + * + * \brief The matrix class, also used for vectors and row-vectors + * + * The %Matrix class is the work-horse for all \em dense (\ref dense "note") matrices and vectors within Eigen. + * Vectors are matrices with one column, and row-vectors are matrices with one row. + * + * The %Matrix class encompasses \em both fixed-size and dynamic-size objects (\ref fixedsize "note"). + * + * The first three template parameters are required: + * \tparam _Scalar Numeric type, e.g. float, double, int or std::complex. + * User defined scalar types are supported as well (see \ref user_defined_scalars "here"). + * \tparam _Rows Number of rows, or \b Dynamic + * \tparam _Cols Number of columns, or \b Dynamic + * + * The remaining template parameters are optional -- in most cases you don't have to worry about them. + * \tparam _Options A combination of either \b #RowMajor or \b #ColMajor, and of either + * \b #AutoAlign or \b #DontAlign. + * The former controls \ref TopicStorageOrders "storage order", and defaults to column-major. The latter controls alignment, which is required + * for vectorization. It defaults to aligning matrices except for fixed sizes that aren't a multiple of the packet size. + * \tparam _MaxRows Maximum number of rows. Defaults to \a _Rows (\ref maxrows "note"). + * \tparam _MaxCols Maximum number of columns. Defaults to \a _Cols (\ref maxrows "note"). + * + * Eigen provides a number of typedefs covering the usual cases. Here are some examples: + * + * \li \c Matrix2d is a 2x2 square matrix of doubles (\c Matrix) + * \li \c Vector4f is a vector of 4 floats (\c Matrix) + * \li \c RowVector3i is a row-vector of 3 ints (\c Matrix) + * + * \li \c MatrixXf is a dynamic-size matrix of floats (\c Matrix) + * \li \c VectorXf is a dynamic-size vector of floats (\c Matrix) + * + * \li \c Matrix2Xf is a partially fixed-size (dynamic-size) matrix of floats (\c Matrix) + * \li \c MatrixX3d is a partially dynamic-size (fixed-size) matrix of double (\c Matrix) + * + * See \link matrixtypedefs this page \endlink for a complete list of predefined \em %Matrix and \em Vector typedefs. + * + * You can access elements of vectors and matrices using normal subscripting: + * + * \code + * Eigen::VectorXd v(10); + * v[0] = 0.1; + * v[1] = 0.2; + * v(0) = 0.3; + * v(1) = 0.4; + * + * Eigen::MatrixXi m(10, 10); + * m(0, 1) = 1; + * m(0, 2) = 2; + * m(0, 3) = 3; + * \endcode + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_MATRIX_PLUGIN. + * + * Some notes: + * + *
+ *
\anchor dense Dense versus sparse:
+ *
This %Matrix class handles dense, not sparse matrices and vectors. For sparse matrices and vectors, see the Sparse module. + * + * Dense matrices and vectors are plain usual arrays of coefficients. All the coefficients are stored, in an ordinary contiguous array. + * This is unlike Sparse matrices and vectors where the coefficients are stored as a list of nonzero coefficients.
+ * + *
\anchor fixedsize Fixed-size versus dynamic-size:
+ *
Fixed-size means that the numbers of rows and columns are known are compile-time. In this case, Eigen allocates the array + * of coefficients as a fixed-size array, as a class member. This makes sense for very small matrices, typically up to 4x4, sometimes up + * to 16x16. Larger matrices should be declared as dynamic-size even if one happens to know their size at compile-time. + * + * Dynamic-size means that the numbers of rows or columns are not necessarily known at compile-time. In this case they are runtime + * variables, and the array of coefficients is allocated dynamically on the heap. + * + * Note that \em dense matrices, be they Fixed-size or Dynamic-size, do not expand dynamically in the sense of a std::map. + * If you want this behavior, see the Sparse module.
+ * + *
\anchor maxrows _MaxRows and _MaxCols:
+ *
In most cases, one just leaves these parameters to the default values. + * These parameters mean the maximum size of rows and columns that the matrix may have. They are useful in cases + * when the exact numbers of rows and columns are not known are compile-time, but it is known at compile-time that they cannot + * exceed a certain value. This happens when taking dynamic-size blocks inside fixed-size matrices: in this case _MaxRows and _MaxCols + * are the dimensions of the original matrix, while _Rows and _Cols are Dynamic.
+ *
+ * + * ABI and storage layout + * + * The table below summarizes the ABI of some possible Matrix instances which is fixed thorough the lifetime of Eigen 3. + * + * + * + * + * + * + *
Matrix typeEquivalent C structure
\code Matrix \endcode\code + * struct { + * T *data; // with (size_t(data)%EIGEN_MAX_ALIGN_BYTES)==0 + * Eigen::Index rows, cols; + * }; + * \endcode
\code + * Matrix + * Matrix \endcode\code + * struct { + * T *data; // with (size_t(data)%EIGEN_MAX_ALIGN_BYTES)==0 + * Eigen::Index size; + * }; + * \endcode
\code Matrix \endcode\code + * struct { + * T data[Rows*Cols]; // with (size_t(data)%A(Rows*Cols*sizeof(T)))==0 + * }; + * \endcode
\code Matrix \endcode\code + * struct { + * T data[MaxRows*MaxCols]; // with (size_t(data)%A(MaxRows*MaxCols*sizeof(T)))==0 + * Eigen::Index rows, cols; + * }; + * \endcode
+ * Note that in this table Rows, Cols, MaxRows and MaxCols are all positive integers. A(S) is defined to the largest possible power-of-two + * smaller to EIGEN_MAX_STATIC_ALIGN_BYTES. + * + * \see MatrixBase for the majority of the API methods for matrices, \ref TopicClassHierarchy, + * \ref TopicStorageOrders + */ + +template +class Matrix + : public PlainObjectBase > +{ + public: + + /** \brief Base class typedef. + * \sa PlainObjectBase + */ + typedef PlainObjectBase Base; + + enum { Options = _Options }; + + EIGEN_DENSE_PUBLIC_INTERFACE(Matrix) + + typedef typename Base::PlainObject PlainObject; + + using Base::base; + using Base::coeffRef; + + /** + * \brief Assigns matrices to each other. + * + * \note This is a special case of the templated operator=. Its purpose is + * to prevent a default operator= from hiding the templated operator=. + * + * \callgraph + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix& operator=(const Matrix& other) + { + return Base::_set(other); + } + + /** \internal + * \brief Copies the value of the expression \a other into \c *this with automatic resizing. + * + * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), + * it will be initialized. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix& operator=(const DenseBase& other) + { + return Base::_set(other); + } + + /* Here, doxygen failed to copy the brief information when using \copydoc */ + + /** + * \brief Copies the generic expression \a other into *this. + * \copydetails DenseBase::operator=(const EigenBase &other) + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix& operator=(const EigenBase &other) + { + return Base::operator=(other); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix& operator=(const ReturnByValue& func) + { + return Base::operator=(func); + } + + /** \brief Default constructor. + * + * For fixed-size matrices, does nothing. + * + * For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix + * is called a null matrix. This constructor is the unique way to create null matrices: resizing + * a matrix to 0 is not supported. + * + * \sa resize(Index,Index) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix() : Base() + { + Base::_check_template_params(); + EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } + + // FIXME is it still needed + EIGEN_DEVICE_FUNC + explicit Matrix(internal::constructor_without_unaligned_array_assert) + : Base(internal::constructor_without_unaligned_array_assert()) + { Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED } + +#if EIGEN_HAS_RVALUE_REFERENCES + EIGEN_DEVICE_FUNC + Matrix(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible::value) + : Base(std::move(other)) + { + Base::_check_template_params(); + if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic) + Base::_set_noalias(other); + } + EIGEN_DEVICE_FUNC + Matrix& operator=(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable::value) + { + other.swap(*this); + return *this; + } +#endif + + #ifndef EIGEN_PARSED_BY_DOXYGEN + + // This constructor is for both 1x1 matrices and dynamic vectors + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE explicit Matrix(const T& x) + { + Base::_check_template_params(); + Base::template _init1(x); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const T0& x, const T1& y) + { + Base::_check_template_params(); + Base::template _init2(x, y); + } + #else + /** \brief Constructs a fixed-sized matrix initialized with coefficients starting at \a data */ + EIGEN_DEVICE_FUNC + explicit Matrix(const Scalar *data); + + /** \brief Constructs a vector or row-vector with given dimension. \only_for_vectors + * + * This is useful for dynamic-size vectors. For fixed-size vectors, + * it is redundant to pass these parameters, so one should use the default constructor + * Matrix() instead. + * + * \warning This constructor is disabled for fixed-size \c 1x1 matrices. For instance, + * calling Matrix(1) will call the initialization constructor: Matrix(const Scalar&). + * For fixed-size \c 1x1 matrices it is therefore recommended to use the default + * constructor Matrix() instead, especially when using one of the non standard + * \c EIGEN_INITIALIZE_MATRICES_BY_{ZERO,\c NAN} macros (see \ref TopicPreprocessorDirectives). + */ + EIGEN_STRONG_INLINE explicit Matrix(Index dim); + /** \brief Constructs an initialized 1x1 matrix with the given coefficient */ + Matrix(const Scalar& x); + /** \brief Constructs an uninitialized matrix with \a rows rows and \a cols columns. + * + * This is useful for dynamic-size matrices. For fixed-size matrices, + * it is redundant to pass these parameters, so one should use the default constructor + * Matrix() instead. + * + * \warning This constructor is disabled for fixed-size \c 1x2 and \c 2x1 vectors. For instance, + * calling Matrix2f(2,1) will call the initialization constructor: Matrix(const Scalar& x, const Scalar& y). + * For fixed-size \c 1x2 or \c 2x1 vectors it is therefore recommended to use the default + * constructor Matrix() instead, especially when using one of the non standard + * \c EIGEN_INITIALIZE_MATRICES_BY_{ZERO,\c NAN} macros (see \ref TopicPreprocessorDirectives). + */ + EIGEN_DEVICE_FUNC + Matrix(Index rows, Index cols); + + /** \brief Constructs an initialized 2D vector with given coefficients */ + Matrix(const Scalar& x, const Scalar& y); + #endif + + /** \brief Constructs an initialized 3D vector with given coefficients */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z) + { + Base::_check_template_params(); + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3) + m_storage.data()[0] = x; + m_storage.data()[1] = y; + m_storage.data()[2] = z; + } + /** \brief Constructs an initialized 4D vector with given coefficients */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w) + { + Base::_check_template_params(); + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4) + m_storage.data()[0] = x; + m_storage.data()[1] = y; + m_storage.data()[2] = z; + m_storage.data()[3] = w; + } + + + /** \brief Copy constructor */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const Matrix& other) : Base(other) + { } + + /** \brief Copy constructor for generic expressions. + * \sa MatrixBase::operator=(const EigenBase&) + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Matrix(const EigenBase &other) + : Base(other.derived()) + { } + + EIGEN_DEVICE_FUNC inline Index innerStride() const { return 1; } + EIGEN_DEVICE_FUNC inline Index outerStride() const { return this->innerSize(); } + + /////////// Geometry module /////////// + + template + EIGEN_DEVICE_FUNC + explicit Matrix(const RotationBase& r); + template + EIGEN_DEVICE_FUNC + Matrix& operator=(const RotationBase& r); + + // allow to extend Matrix outside Eigen + #ifdef EIGEN_MATRIX_PLUGIN + #include EIGEN_MATRIX_PLUGIN + #endif + + protected: + template + friend struct internal::conservative_resize_like_impl; + + using Base::m_storage; +}; + +/** \defgroup matrixtypedefs Global matrix typedefs + * + * \ingroup Core_Module + * + * Eigen defines several typedef shortcuts for most common matrix and vector types. + * + * The general patterns are the following: + * + * \c MatrixSizeType where \c Size can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size, + * and where \c Type can be \c i for integer, \c f for float, \c d for double, \c cf for complex float, \c cd + * for complex double. + * + * For example, \c Matrix3d is a fixed-size 3x3 matrix type of doubles, and \c MatrixXf is a dynamic-size matrix of floats. + * + * There are also \c VectorSizeType and \c RowVectorSizeType which are self-explanatory. For example, \c Vector4cf is + * a fixed-size vector of 4 complex floats. + * + * \sa class Matrix + */ + +#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ +/** \ingroup matrixtypedefs */ \ +typedef Matrix Matrix##SizeSuffix##TypeSuffix; \ +/** \ingroup matrixtypedefs */ \ +typedef Matrix Vector##SizeSuffix##TypeSuffix; \ +/** \ingroup matrixtypedefs */ \ +typedef Matrix RowVector##SizeSuffix##TypeSuffix; + +#define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ +/** \ingroup matrixtypedefs */ \ +typedef Matrix Matrix##Size##X##TypeSuffix; \ +/** \ingroup matrixtypedefs */ \ +typedef Matrix Matrix##X##Size##TypeSuffix; + +#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ +EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \ +EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \ +EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \ +EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ +EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ +EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ +EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4) + +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(int, i) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(float, f) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cf) +EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cd) + +#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES +#undef EIGEN_MAKE_TYPEDEFS +#undef EIGEN_MAKE_FIXED_TYPEDEFS + +} // end namespace Eigen + +#endif // EIGEN_MATRIX_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/MatrixBase.h b/SudoDEM2D/lib/Eigen/src/Core/MatrixBase.h new file mode 100644 index 0000000..05db488 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/MatrixBase.h @@ -0,0 +1,521 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2009 Benoit Jacob +// Copyright (C) 2008 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_MATRIXBASE_H +#define EIGEN_MATRIXBASE_H + +namespace Eigen { + +/** \class MatrixBase + * \ingroup Core_Module + * + * \brief Base class for all dense matrices, vectors, and expressions + * + * This class is the base that is inherited by all matrix, vector, and related expression + * types. Most of the Eigen API is contained in this class, and its base classes. Other important + * classes for the Eigen API are Matrix, and VectorwiseOp. + * + * Note that some methods are defined in other modules such as the \ref LU_Module LU module + * for all functions related to matrix inversions. + * + * \tparam Derived is the derived type, e.g. a matrix type, or an expression, etc. + * + * When writing a function taking Eigen objects as argument, if you want your function + * to take as argument any matrix, vector, or expression, just let it take a + * MatrixBase argument. As an example, here is a function printFirstRow which, given + * a matrix, vector, or expression \a x, prints the first row of \a x. + * + * \code + template + void printFirstRow(const Eigen::MatrixBase& x) + { + cout << x.row(0) << endl; + } + * \endcode + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_MATRIXBASE_PLUGIN. + * + * \sa \blank \ref TopicClassHierarchy + */ +template class MatrixBase + : public DenseBase +{ + public: +#ifndef EIGEN_PARSED_BY_DOXYGEN + typedef MatrixBase StorageBaseType; + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::StorageIndex StorageIndex; + typedef typename internal::traits::Scalar Scalar; + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + + typedef DenseBase Base; + using Base::RowsAtCompileTime; + using Base::ColsAtCompileTime; + using Base::SizeAtCompileTime; + using Base::MaxRowsAtCompileTime; + using Base::MaxColsAtCompileTime; + using Base::MaxSizeAtCompileTime; + using Base::IsVectorAtCompileTime; + using Base::Flags; + + using Base::derived; + using Base::const_cast_derived; + using Base::rows; + using Base::cols; + using Base::size; + using Base::coeff; + using Base::coeffRef; + using Base::lazyAssign; + using Base::eval; + using Base::operator+=; + using Base::operator-=; + using Base::operator*=; + using Base::operator/=; + + typedef typename Base::CoeffReturnType CoeffReturnType; + typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType; + typedef typename Base::RowXpr RowXpr; + typedef typename Base::ColXpr ColXpr; +#endif // not EIGEN_PARSED_BY_DOXYGEN + + + +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** type of the equivalent square matrix */ + typedef Matrix SquareMatrixType; +#endif // not EIGEN_PARSED_BY_DOXYGEN + + /** \returns the size of the main diagonal, which is min(rows(),cols()). + * \sa rows(), cols(), SizeAtCompileTime. */ + EIGEN_DEVICE_FUNC + inline Index diagonalSize() const { return (numext::mini)(rows(),cols()); } + + typedef typename Base::PlainObject PlainObject; + +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal Represents a matrix with all coefficients equal to one another*/ + typedef CwiseNullaryOp,PlainObject> ConstantReturnType; + /** \internal the return type of MatrixBase::adjoint() */ + typedef typename internal::conditional::IsComplex, + CwiseUnaryOp, ConstTransposeReturnType>, + ConstTransposeReturnType + >::type AdjointReturnType; + /** \internal Return type of eigenvalues() */ + typedef Matrix, internal::traits::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType; + /** \internal the return type of identity */ + typedef CwiseNullaryOp,PlainObject> IdentityReturnType; + /** \internal the return type of unit vectors */ + typedef Block, SquareMatrixType>, + internal::traits::RowsAtCompileTime, + internal::traits::ColsAtCompileTime> BasisReturnType; +#endif // not EIGEN_PARSED_BY_DOXYGEN + +#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase +#define EIGEN_DOC_UNARY_ADDONS(X,Y) +# include "../plugins/CommonCwiseUnaryOps.h" +# include "../plugins/CommonCwiseBinaryOps.h" +# include "../plugins/MatrixCwiseUnaryOps.h" +# include "../plugins/MatrixCwiseBinaryOps.h" +# ifdef EIGEN_MATRIXBASE_PLUGIN +# include EIGEN_MATRIXBASE_PLUGIN +# endif +#undef EIGEN_CURRENT_STORAGE_BASE_CLASS +#undef EIGEN_DOC_UNARY_ADDONS + + /** Special case of the template operator=, in order to prevent the compiler + * from generating a default operator= (issue hit with g++ 4.1) + */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const MatrixBase& other); + + // We cannot inherit here via Base::operator= since it is causing + // trouble with MSVC. + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator=(const DenseBase& other); + + template + EIGEN_DEVICE_FUNC + Derived& operator=(const EigenBase& other); + + template + EIGEN_DEVICE_FUNC + Derived& operator=(const ReturnByValue& other); + + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator+=(const MatrixBase& other); + template + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Derived& operator-=(const MatrixBase& other); + + template + EIGEN_DEVICE_FUNC + const Product + operator*(const MatrixBase &other) const; + + template + EIGEN_DEVICE_FUNC + const Product + lazyProduct(const MatrixBase &other) const; + + template + Derived& operator*=(const EigenBase& other); + + template + void applyOnTheLeft(const EigenBase& other); + + template + void applyOnTheRight(const EigenBase& other); + + template + EIGEN_DEVICE_FUNC + const Product + operator*(const DiagonalBase &diagonal) const; + + template + EIGEN_DEVICE_FUNC + typename ScalarBinaryOpTraits::Scalar,typename internal::traits::Scalar>::ReturnType + dot(const MatrixBase& other) const; + + EIGEN_DEVICE_FUNC RealScalar squaredNorm() const; + EIGEN_DEVICE_FUNC RealScalar norm() const; + RealScalar stableNorm() const; + RealScalar blueNorm() const; + RealScalar hypotNorm() const; + EIGEN_DEVICE_FUNC const PlainObject normalized() const; + EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const; + EIGEN_DEVICE_FUNC void normalize(); + EIGEN_DEVICE_FUNC void stableNormalize(); + + EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const; + EIGEN_DEVICE_FUNC void adjointInPlace(); + + typedef Diagonal DiagonalReturnType; + EIGEN_DEVICE_FUNC + DiagonalReturnType diagonal(); + + typedef typename internal::add_const >::type ConstDiagonalReturnType; + EIGEN_DEVICE_FUNC + ConstDiagonalReturnType diagonal() const; + + template struct DiagonalIndexReturnType { typedef Diagonal Type; }; + template struct ConstDiagonalIndexReturnType { typedef const Diagonal Type; }; + + template + EIGEN_DEVICE_FUNC + typename DiagonalIndexReturnType::Type diagonal(); + + template + EIGEN_DEVICE_FUNC + typename ConstDiagonalIndexReturnType::Type diagonal() const; + + typedef Diagonal DiagonalDynamicIndexReturnType; + typedef typename internal::add_const >::type ConstDiagonalDynamicIndexReturnType; + + EIGEN_DEVICE_FUNC + DiagonalDynamicIndexReturnType diagonal(Index index); + EIGEN_DEVICE_FUNC + ConstDiagonalDynamicIndexReturnType diagonal(Index index) const; + + template struct TriangularViewReturnType { typedef TriangularView Type; }; + template struct ConstTriangularViewReturnType { typedef const TriangularView Type; }; + + template + EIGEN_DEVICE_FUNC + typename TriangularViewReturnType::Type triangularView(); + template + EIGEN_DEVICE_FUNC + typename ConstTriangularViewReturnType::Type triangularView() const; + + template struct SelfAdjointViewReturnType { typedef SelfAdjointView Type; }; + template struct ConstSelfAdjointViewReturnType { typedef const SelfAdjointView Type; }; + + template + EIGEN_DEVICE_FUNC + typename SelfAdjointViewReturnType::Type selfadjointView(); + template + EIGEN_DEVICE_FUNC + typename ConstSelfAdjointViewReturnType::Type selfadjointView() const; + + const SparseView sparseView(const Scalar& m_reference = Scalar(0), + const typename NumTraits::Real& m_epsilon = NumTraits::dummy_precision()) const; + EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(); + EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(Index rows, Index cols); + EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index size, Index i); + EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index i); + EIGEN_DEVICE_FUNC static const BasisReturnType UnitX(); + EIGEN_DEVICE_FUNC static const BasisReturnType UnitY(); + EIGEN_DEVICE_FUNC static const BasisReturnType UnitZ(); + EIGEN_DEVICE_FUNC static const BasisReturnType UnitW(); + + EIGEN_DEVICE_FUNC + const DiagonalWrapper asDiagonal() const; + const PermutationWrapper asPermutation() const; + + EIGEN_DEVICE_FUNC + Derived& setIdentity(); + EIGEN_DEVICE_FUNC + Derived& setIdentity(Index rows, Index cols); + + bool isIdentity(const RealScalar& prec = NumTraits::dummy_precision()) const; + bool isDiagonal(const RealScalar& prec = NumTraits::dummy_precision()) const; + + bool isUpperTriangular(const RealScalar& prec = NumTraits::dummy_precision()) const; + bool isLowerTriangular(const RealScalar& prec = NumTraits::dummy_precision()) const; + + template + bool isOrthogonal(const MatrixBase& other, + const RealScalar& prec = NumTraits::dummy_precision()) const; + bool isUnitary(const RealScalar& prec = NumTraits::dummy_precision()) const; + + /** \returns true if each coefficients of \c *this and \a other are all exactly equal. + * \warning When using floating point scalar values you probably should rather use a + * fuzzy comparison such as isApprox() + * \sa isApprox(), operator!= */ + template + EIGEN_DEVICE_FUNC inline bool operator==(const MatrixBase& other) const + { return cwiseEqual(other).all(); } + + /** \returns true if at least one pair of coefficients of \c *this and \a other are not exactly equal to each other. + * \warning When using floating point scalar values you probably should rather use a + * fuzzy comparison such as isApprox() + * \sa isApprox(), operator== */ + template + EIGEN_DEVICE_FUNC inline bool operator!=(const MatrixBase& other) const + { return cwiseNotEqual(other).any(); } + + NoAlias noalias(); + + // TODO forceAlignedAccess is temporarily disabled + // Need to find a nicer workaround. + inline const Derived& forceAlignedAccess() const { return derived(); } + inline Derived& forceAlignedAccess() { return derived(); } + template inline const Derived& forceAlignedAccessIf() const { return derived(); } + template inline Derived& forceAlignedAccessIf() { return derived(); } + + EIGEN_DEVICE_FUNC Scalar trace() const; + + template EIGEN_DEVICE_FUNC RealScalar lpNorm() const; + + EIGEN_DEVICE_FUNC MatrixBase& matrix() { return *this; } + EIGEN_DEVICE_FUNC const MatrixBase& matrix() const { return *this; } + + /** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix + * \sa ArrayBase::matrix() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper array() { return ArrayWrapper(derived()); } + /** \returns a const \link Eigen::ArrayBase Array \endlink expression of this matrix + * \sa ArrayBase::matrix() */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper array() const { return ArrayWrapper(derived()); } + +/////////// LU module /////////// + + inline const FullPivLU fullPivLu() const; + inline const PartialPivLU partialPivLu() const; + + inline const PartialPivLU lu() const; + + inline const Inverse inverse() const; + + template + inline void computeInverseAndDetWithCheck( + ResultType& inverse, + typename ResultType::Scalar& determinant, + bool& invertible, + const RealScalar& absDeterminantThreshold = NumTraits::dummy_precision() + ) const; + template + inline void computeInverseWithCheck( + ResultType& inverse, + bool& invertible, + const RealScalar& absDeterminantThreshold = NumTraits::dummy_precision() + ) const; + Scalar determinant() const; + +/////////// Cholesky module /////////// + + inline const LLT llt() const; + inline const LDLT ldlt() const; + +/////////// QR module /////////// + + inline const HouseholderQR householderQr() const; + inline const ColPivHouseholderQR colPivHouseholderQr() const; + inline const FullPivHouseholderQR fullPivHouseholderQr() const; + inline const CompleteOrthogonalDecomposition completeOrthogonalDecomposition() const; + +/////////// Eigenvalues module /////////// + + inline EigenvaluesReturnType eigenvalues() const; + inline RealScalar operatorNorm() const; + +/////////// SVD module /////////// + + inline JacobiSVD jacobiSvd(unsigned int computationOptions = 0) const; + inline BDCSVD bdcSvd(unsigned int computationOptions = 0) const; + +/////////// Geometry module /////////// + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /// \internal helper struct to form the return type of the cross product + template struct cross_product_return_type { + typedef typename ScalarBinaryOpTraits::Scalar,typename internal::traits::Scalar>::ReturnType Scalar; + typedef Matrix type; + }; + #endif // EIGEN_PARSED_BY_DOXYGEN + template + EIGEN_DEVICE_FUNC +#ifndef EIGEN_PARSED_BY_DOXYGEN + inline typename cross_product_return_type::type +#else + inline PlainObject +#endif + cross(const MatrixBase& other) const; + + template + EIGEN_DEVICE_FUNC + inline PlainObject cross3(const MatrixBase& other) const; + + EIGEN_DEVICE_FUNC + inline PlainObject unitOrthogonal(void) const; + + EIGEN_DEVICE_FUNC + inline Matrix eulerAngles(Index a0, Index a1, Index a2) const; + + // put this as separate enum value to work around possible GCC 4.3 bug (?) + enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1&&RowsAtCompileTime==1 ? ((internal::traits::Flags&RowMajorBit)==RowMajorBit ? Horizontal : Vertical) + : ColsAtCompileTime==1 ? Vertical : Horizontal }; + typedef Homogeneous HomogeneousReturnType; + EIGEN_DEVICE_FUNC + inline HomogeneousReturnType homogeneous() const; + + enum { + SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1 + }; + typedef Block::ColsAtCompileTime==1 ? SizeMinusOne : 1, + internal::traits::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne; + typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne,Scalar,quotient) HNormalizedReturnType; + EIGEN_DEVICE_FUNC + inline const HNormalizedReturnType hnormalized() const; + +////////// Householder module /////////// + + void makeHouseholderInPlace(Scalar& tau, RealScalar& beta); + template + void makeHouseholder(EssentialPart& essential, + Scalar& tau, RealScalar& beta) const; + template + void applyHouseholderOnTheLeft(const EssentialPart& essential, + const Scalar& tau, + Scalar* workspace); + template + void applyHouseholderOnTheRight(const EssentialPart& essential, + const Scalar& tau, + Scalar* workspace); + +///////// Jacobi module ///////// + + template + void applyOnTheLeft(Index p, Index q, const JacobiRotation& j); + template + void applyOnTheRight(Index p, Index q, const JacobiRotation& j); + +///////// SparseCore module ///////// + + template + EIGEN_STRONG_INLINE const typename SparseMatrixBase::template CwiseProductDenseReturnType::Type + cwiseProduct(const SparseMatrixBase &other) const + { + return other.cwiseProduct(derived()); + } + +///////// MatrixFunctions module ///////// + + typedef typename internal::stem_function::type StemFunction; + const MatrixExponentialReturnValue exp() const; + const MatrixFunctionReturnValue matrixFunction(StemFunction f) const; + const MatrixFunctionReturnValue cosh() const; + const MatrixFunctionReturnValue sinh() const; + const MatrixFunctionReturnValue cos() const; + const MatrixFunctionReturnValue sin() const; + const MatrixSquareRootReturnValue sqrt() const; + const MatrixLogarithmReturnValue log() const; + const MatrixPowerReturnValue pow(const RealScalar& p) const; + const MatrixComplexPowerReturnValue pow(const std::complex& p) const; + + protected: + EIGEN_DEVICE_FUNC MatrixBase() : Base() {} + + private: + EIGEN_DEVICE_FUNC explicit MatrixBase(int); + EIGEN_DEVICE_FUNC MatrixBase(int,int); + template EIGEN_DEVICE_FUNC explicit MatrixBase(const MatrixBase&); + protected: + // mixing arrays and matrices is not legal + template Derived& operator+=(const ArrayBase& ) + {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} + // mixing arrays and matrices is not legal + template Derived& operator-=(const ArrayBase& ) + {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} +}; + + +/*************************************************************************** +* Implementation of matrix base methods +***************************************************************************/ + +/** replaces \c *this by \c *this * \a other. + * + * \returns a reference to \c *this + * + * Example: \include MatrixBase_applyOnTheRight.cpp + * Output: \verbinclude MatrixBase_applyOnTheRight.out + */ +template +template +inline Derived& +MatrixBase::operator*=(const EigenBase &other) +{ + other.derived().applyThisOnTheRight(derived()); + return derived(); +} + +/** replaces \c *this by \c *this * \a other. It is equivalent to MatrixBase::operator*=(). + * + * Example: \include MatrixBase_applyOnTheRight.cpp + * Output: \verbinclude MatrixBase_applyOnTheRight.out + */ +template +template +inline void MatrixBase::applyOnTheRight(const EigenBase &other) +{ + other.derived().applyThisOnTheRight(derived()); +} + +/** replaces \c *this by \a other * \c *this. + * + * Example: \include MatrixBase_applyOnTheLeft.cpp + * Output: \verbinclude MatrixBase_applyOnTheLeft.out + */ +template +template +inline void MatrixBase::applyOnTheLeft(const EigenBase &other) +{ + other.derived().applyThisOnTheLeft(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_MATRIXBASE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/NestByValue.h b/SudoDEM2D/lib/Eigen/src/Core/NestByValue.h new file mode 100644 index 0000000..13adf07 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/NestByValue.h @@ -0,0 +1,110 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2008 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_NESTBYVALUE_H +#define EIGEN_NESTBYVALUE_H + +namespace Eigen { + +namespace internal { +template +struct traits > : public traits +{}; +} + +/** \class NestByValue + * \ingroup Core_Module + * + * \brief Expression which must be nested by value + * + * \tparam ExpressionType the type of the object of which we are requiring nesting-by-value + * + * This class is the return type of MatrixBase::nestByValue() + * and most of the time this is the only way it is used. + * + * \sa MatrixBase::nestByValue() + */ +template class NestByValue + : public internal::dense_xpr_base< NestByValue >::type +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue) + + EIGEN_DEVICE_FUNC explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {} + + EIGEN_DEVICE_FUNC inline Index rows() const { return m_expression.rows(); } + EIGEN_DEVICE_FUNC inline Index cols() const { return m_expression.cols(); } + EIGEN_DEVICE_FUNC inline Index outerStride() const { return m_expression.outerStride(); } + EIGEN_DEVICE_FUNC inline Index innerStride() const { return m_expression.innerStride(); } + + EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index row, Index col) const + { + return m_expression.coeff(row, col); + } + + EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index row, Index col) + { + return m_expression.const_cast_derived().coeffRef(row, col); + } + + EIGEN_DEVICE_FUNC inline const CoeffReturnType coeff(Index index) const + { + return m_expression.coeff(index); + } + + EIGEN_DEVICE_FUNC inline Scalar& coeffRef(Index index) + { + return m_expression.const_cast_derived().coeffRef(index); + } + + template + inline const PacketScalar packet(Index row, Index col) const + { + return m_expression.template packet(row, col); + } + + template + inline void writePacket(Index row, Index col, const PacketScalar& x) + { + m_expression.const_cast_derived().template writePacket(row, col, x); + } + + template + inline const PacketScalar packet(Index index) const + { + return m_expression.template packet(index); + } + + template + inline void writePacket(Index index, const PacketScalar& x) + { + m_expression.const_cast_derived().template writePacket(index, x); + } + + EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; } + + protected: + const ExpressionType m_expression; +}; + +/** \returns an expression of the temporary version of *this. + */ +template +inline const NestByValue +DenseBase::nestByValue() const +{ + return NestByValue(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_NESTBYVALUE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/NoAlias.h b/SudoDEM2D/lib/Eigen/src/Core/NoAlias.h new file mode 100644 index 0000000..3390801 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/NoAlias.h @@ -0,0 +1,108 @@ +// 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 EIGEN_NOALIAS_H +#define EIGEN_NOALIAS_H + +namespace Eigen { + +/** \class NoAlias + * \ingroup Core_Module + * + * \brief Pseudo expression providing an operator = assuming no aliasing + * + * \tparam ExpressionType the type of the object on which to do the lazy assignment + * + * This class represents an expression with special assignment operators + * assuming no aliasing between the target expression and the source expression. + * More precisely it alloas to bypass the EvalBeforeAssignBit flag of the source expression. + * It is the return type of MatrixBase::noalias() + * and most of the time this is the only way it is used. + * + * \sa MatrixBase::noalias() + */ +template class StorageBase> +class NoAlias +{ + public: + typedef typename ExpressionType::Scalar Scalar; + + explicit NoAlias(ExpressionType& expression) : m_expression(expression) {} + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase& other) + { + call_assignment_no_alias(m_expression, other.derived(), internal::assign_op()); + return m_expression; + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE ExpressionType& operator+=(const StorageBase& other) + { + call_assignment_no_alias(m_expression, other.derived(), internal::add_assign_op()); + return m_expression; + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE ExpressionType& operator-=(const StorageBase& other) + { + call_assignment_no_alias(m_expression, other.derived(), internal::sub_assign_op()); + return m_expression; + } + + EIGEN_DEVICE_FUNC + ExpressionType& expression() const + { + return m_expression; + } + + protected: + ExpressionType& m_expression; +}; + +/** \returns a pseudo expression of \c *this with an operator= assuming + * no aliasing between \c *this and the source expression. + * + * More precisely, noalias() allows to bypass the EvalBeforeAssignBit flag. + * Currently, even though several expressions may alias, only product + * expressions have this flag. Therefore, noalias() is only usefull when + * the source expression contains a matrix product. + * + * Here are some examples where noalias is usefull: + * \code + * D.noalias() = A * B; + * D.noalias() += A.transpose() * B; + * D.noalias() -= 2 * A * B.adjoint(); + * \endcode + * + * On the other hand the following example will lead to a \b wrong result: + * \code + * A.noalias() = A * B; + * \endcode + * because the result matrix A is also an operand of the matrix product. Therefore, + * there is no alternative than evaluating A * B in a temporary, that is the default + * behavior when you write: + * \code + * A = A * B; + * \endcode + * + * \sa class NoAlias + */ +template +NoAlias MatrixBase::noalias() +{ + return NoAlias(derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_NOALIAS_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/NumTraits.h b/SudoDEM2D/lib/Eigen/src/Core/NumTraits.h new file mode 100644 index 0000000..daf4898 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/NumTraits.h @@ -0,0 +1,248 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2010 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_NUMTRAITS_H +#define EIGEN_NUMTRAITS_H + +namespace Eigen { + +namespace internal { + +// default implementation of digits10(), based on numeric_limits if specialized, +// 0 for integer types, and log10(epsilon()) otherwise. +template< typename T, + bool use_numeric_limits = std::numeric_limits::is_specialized, + bool is_integer = NumTraits::IsInteger> +struct default_digits10_impl +{ + static int run() { return std::numeric_limits::digits10; } +}; + +template +struct default_digits10_impl // Floating point +{ + static int run() { + using std::log10; + using std::ceil; + typedef typename NumTraits::Real Real; + return int(ceil(-log10(NumTraits::epsilon()))); + } +}; + +template +struct default_digits10_impl // Integer +{ + static int run() { return 0; } +}; + +} // end namespace internal + +/** \class NumTraits + * \ingroup Core_Module + * + * \brief Holds information about the various numeric (i.e. scalar) types allowed by Eigen. + * + * \tparam T the numeric type at hand + * + * This class stores enums, typedefs and static methods giving information about a numeric type. + * + * The provided data consists of: + * \li A typedef \c Real, giving the "real part" type of \a T. If \a T is already real, + * then \c Real is just a typedef to \a T. If \a T is \c std::complex then \c Real + * is a typedef to \a U. + * \li A typedef \c NonInteger, giving the type that should be used for operations producing non-integral values, + * such as quotients, square roots, etc. If \a T is a floating-point type, then this typedef just gives + * \a T again. Note however that many Eigen functions such as internal::sqrt simply refuse to + * take integers. Outside of a few cases, Eigen doesn't do automatic type promotion. Thus, this typedef is + * only intended as a helper for code that needs to explicitly promote types. + * \li A typedef \c Literal giving the type to use for numeric literals such as "2" or "0.5". For instance, for \c std::complex, Literal is defined as \c U. + * Of course, this type must be fully compatible with \a T. In doubt, just use \a T here. + * \li A typedef \a Nested giving the type to use to nest a value inside of the expression tree. If you don't know what + * this means, just use \a T here. + * \li An enum value \a IsComplex. It is equal to 1 if \a T is a \c std::complex + * type, and to 0 otherwise. + * \li An enum value \a IsInteger. It is equal to \c 1 if \a T is an integer type such as \c int, + * and to \c 0 otherwise. + * \li Enum values ReadCost, AddCost and MulCost representing a rough estimate of the number of CPU cycles needed + * to by move / add / mul instructions respectively, assuming the data is already stored in CPU registers. + * Stay vague here. No need to do architecture-specific stuff. + * \li An enum value \a IsSigned. It is equal to \c 1 if \a T is a signed type and to 0 if \a T is unsigned. + * \li An enum value \a RequireInitialization. It is equal to \c 1 if the constructor of the numeric type \a T must + * be called, and to 0 if it is safe not to call it. Default is 0 if \a T is an arithmetic type, and 1 otherwise. + * \li An epsilon() function which, unlike std::numeric_limits::epsilon(), + * it returns a \a Real instead of a \a T. + * \li A dummy_precision() function returning a weak epsilon value. It is mainly used as a default + * value by the fuzzy comparison operators. + * \li highest() and lowest() functions returning the highest and lowest possible values respectively. + * \li digits10() function returning the number of decimal digits that can be represented without change. This is + * the analogue of std::numeric_limits::digits10 + * which is used as the default implementation if specialized. + */ + +template struct GenericNumTraits +{ + enum { + IsInteger = std::numeric_limits::is_integer, + IsSigned = std::numeric_limits::is_signed, + IsComplex = 0, + RequireInitialization = internal::is_arithmetic::value ? 0 : 1, + ReadCost = 1, + AddCost = 1, + MulCost = 1 + }; + + typedef T Real; + typedef typename internal::conditional< + IsInteger, + typename internal::conditional::type, + T + >::type NonInteger; + typedef T Nested; + typedef T Literal; + + EIGEN_DEVICE_FUNC + static inline Real epsilon() + { + return numext::numeric_limits::epsilon(); + } + + EIGEN_DEVICE_FUNC + static inline int digits10() + { + return internal::default_digits10_impl::run(); + } + + EIGEN_DEVICE_FUNC + static inline Real dummy_precision() + { + // make sure to override this for floating-point types + return Real(0); + } + + + EIGEN_DEVICE_FUNC + static inline T highest() { + return (numext::numeric_limits::max)(); + } + + EIGEN_DEVICE_FUNC + static inline T lowest() { + return IsInteger ? (numext::numeric_limits::min)() : (-(numext::numeric_limits::max)()); + } + + EIGEN_DEVICE_FUNC + static inline T infinity() { + return numext::numeric_limits::infinity(); + } + + EIGEN_DEVICE_FUNC + static inline T quiet_NaN() { + return numext::numeric_limits::quiet_NaN(); + } +}; + +template struct NumTraits : GenericNumTraits +{}; + +template<> struct NumTraits + : GenericNumTraits +{ + EIGEN_DEVICE_FUNC + static inline float dummy_precision() { return 1e-5f; } +}; + +template<> struct NumTraits : GenericNumTraits +{ + EIGEN_DEVICE_FUNC + static inline double dummy_precision() { return 1e-12; } +}; + +template<> struct NumTraits + : GenericNumTraits +{ + static inline long double dummy_precision() { return 1e-15l; } +}; + +template struct NumTraits > + : GenericNumTraits > +{ + typedef _Real Real; + typedef typename NumTraits<_Real>::Literal Literal; + enum { + IsComplex = 1, + RequireInitialization = NumTraits<_Real>::RequireInitialization, + ReadCost = 2 * NumTraits<_Real>::ReadCost, + AddCost = 2 * NumTraits::AddCost, + MulCost = 4 * NumTraits::MulCost + 2 * NumTraits::AddCost + }; + + EIGEN_DEVICE_FUNC + static inline Real epsilon() { return NumTraits::epsilon(); } + EIGEN_DEVICE_FUNC + static inline Real dummy_precision() { return NumTraits::dummy_precision(); } + EIGEN_DEVICE_FUNC + static inline int digits10() { return NumTraits::digits10(); } +}; + +template +struct NumTraits > +{ + typedef Array ArrayType; + typedef typename NumTraits::Real RealScalar; + typedef Array Real; + typedef typename NumTraits::NonInteger NonIntegerScalar; + typedef Array NonInteger; + typedef ArrayType & Nested; + typedef typename NumTraits::Literal Literal; + + enum { + IsComplex = NumTraits::IsComplex, + IsInteger = NumTraits::IsInteger, + IsSigned = NumTraits::IsSigned, + RequireInitialization = 1, + ReadCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * NumTraits::ReadCost, + AddCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * NumTraits::AddCost, + MulCost = ArrayType::SizeAtCompileTime==Dynamic ? HugeCost : ArrayType::SizeAtCompileTime * NumTraits::MulCost + }; + + EIGEN_DEVICE_FUNC + static inline RealScalar epsilon() { return NumTraits::epsilon(); } + EIGEN_DEVICE_FUNC + static inline RealScalar dummy_precision() { return NumTraits::dummy_precision(); } + + static inline int digits10() { return NumTraits::digits10(); } +}; + +template<> struct NumTraits + : GenericNumTraits +{ + enum { + RequireInitialization = 1, + ReadCost = HugeCost, + AddCost = HugeCost, + MulCost = HugeCost + }; + + static inline int digits10() { return 0; } + +private: + static inline std::string epsilon(); + static inline std::string dummy_precision(); + static inline std::string lowest(); + static inline std::string highest(); + static inline std::string infinity(); + static inline std::string quiet_NaN(); +}; + +// Empty specialization for void to allow template specialization based on NumTraits::Real with T==void and SFINAE. +template<> struct NumTraits {}; + +} // end namespace Eigen + +#endif // EIGEN_NUMTRAITS_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/PermutationMatrix.h b/SudoDEM2D/lib/Eigen/src/Core/PermutationMatrix.h new file mode 100644 index 0000000..b1fb455 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/PermutationMatrix.h @@ -0,0 +1,633 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009 Benoit Jacob +// Copyright (C) 2009-2015 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_PERMUTATIONMATRIX_H +#define EIGEN_PERMUTATIONMATRIX_H + +namespace Eigen { + +namespace internal { + +enum PermPermProduct_t {PermPermProduct}; + +} // end namespace internal + +/** \class PermutationBase + * \ingroup Core_Module + * + * \brief Base class for permutations + * + * \tparam Derived the derived class + * + * This class is the base class for all expressions representing a permutation matrix, + * internally stored as a vector of integers. + * The convention followed here is that if \f$ \sigma \f$ is a permutation, the corresponding permutation matrix + * \f$ P_\sigma \f$ is such that if \f$ (e_1,\ldots,e_p) \f$ is the canonical basis, we have: + * \f[ P_\sigma(e_i) = e_{\sigma(i)}. \f] + * This convention ensures that for any two permutations \f$ \sigma, \tau \f$, we have: + * \f[ P_{\sigma\circ\tau} = P_\sigma P_\tau. \f] + * + * Permutation matrices are square and invertible. + * + * Notice that in addition to the member functions and operators listed here, there also are non-member + * operator* to multiply any kind of permutation object with any kind of matrix expression (MatrixBase) + * on either side. + * + * \sa class PermutationMatrix, class PermutationWrapper + */ +template +class PermutationBase : public EigenBase +{ + typedef internal::traits Traits; + typedef EigenBase Base; + public: + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Traits::IndicesType IndicesType; + enum { + Flags = Traits::Flags, + RowsAtCompileTime = Traits::RowsAtCompileTime, + ColsAtCompileTime = Traits::ColsAtCompileTime, + MaxRowsAtCompileTime = Traits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = Traits::MaxColsAtCompileTime + }; + typedef typename Traits::StorageIndex StorageIndex; + typedef Matrix + DenseMatrixType; + typedef PermutationMatrix + PlainPermutationType; + typedef PlainPermutationType PlainObject; + using Base::derived; + typedef Inverse InverseReturnType; + typedef void Scalar; + #endif + + /** Copies the other permutation into *this */ + template + Derived& operator=(const PermutationBase& other) + { + indices() = other.indices(); + return derived(); + } + + /** Assignment from the Transpositions \a tr */ + template + Derived& operator=(const TranspositionsBase& tr) + { + setIdentity(tr.size()); + for(Index k=size()-1; k>=0; --k) + applyTranspositionOnTheRight(k,tr.coeff(k)); + return derived(); + } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + Derived& operator=(const PermutationBase& other) + { + indices() = other.indices(); + return derived(); + } + #endif + + /** \returns the number of rows */ + inline Index rows() const { return Index(indices().size()); } + + /** \returns the number of columns */ + inline Index cols() const { return Index(indices().size()); } + + /** \returns the size of a side of the respective square matrix, i.e., the number of indices */ + inline Index size() const { return Index(indices().size()); } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + void evalTo(MatrixBase& other) const + { + other.setZero(); + for (Index i=0; i=0 && j>=0 && i=0 && j>=0 && i + void assignTranspose(const PermutationBase& other) + { + for (Index i=0; i + void assignProduct(const Lhs& lhs, const Rhs& rhs) + { + eigen_assert(lhs.cols() == rhs.rows()); + for (Index i=0; i + inline PlainPermutationType operator*(const PermutationBase& other) const + { return PlainPermutationType(internal::PermPermProduct, derived(), other.derived()); } + + /** \returns the product of a permutation with another inverse permutation. + * + * \note \blank \note_try_to_help_rvo + */ + template + inline PlainPermutationType operator*(const InverseImpl& other) const + { return PlainPermutationType(internal::PermPermProduct, *this, other.eval()); } + + /** \returns the product of an inverse permutation with another permutation. + * + * \note \blank \note_try_to_help_rvo + */ + template friend + inline PlainPermutationType operator*(const InverseImpl& other, const PermutationBase& perm) + { return PlainPermutationType(internal::PermPermProduct, other.eval(), perm); } + + /** \returns the determinant of the permutation matrix, which is either 1 or -1 depending on the parity of the permutation. + * + * This function is O(\c n) procedure allocating a buffer of \c n booleans. + */ + Index determinant() const + { + Index res = 1; + Index n = size(); + Matrix mask(n); + mask.fill(false); + Index r = 0; + while(r < n) + { + // search for the next seed + while(r=n) + break; + // we got one, let's follow it until we are back to the seed + Index k0 = r++; + mask.coeffRef(k0) = true; + for(Index k=indices().coeff(k0); k!=k0; k=indices().coeff(k)) + { + mask.coeffRef(k) = true; + res = -res; + } + } + return res; + } + + protected: + +}; + +namespace internal { +template +struct traits > + : traits > +{ + typedef PermutationStorage StorageKind; + typedef Matrix<_StorageIndex, SizeAtCompileTime, 1, 0, MaxSizeAtCompileTime, 1> IndicesType; + typedef _StorageIndex StorageIndex; + typedef void Scalar; +}; +} + +/** \class PermutationMatrix + * \ingroup Core_Module + * + * \brief Permutation matrix + * + * \tparam SizeAtCompileTime the number of rows/cols, or Dynamic + * \tparam MaxSizeAtCompileTime the maximum number of rows/cols, or Dynamic. This optional parameter defaults to SizeAtCompileTime. Most of the time, you should not have to specify it. + * \tparam _StorageIndex the integer type of the indices + * + * This class represents a permutation matrix, internally stored as a vector of integers. + * + * \sa class PermutationBase, class PermutationWrapper, class DiagonalMatrix + */ +template +class PermutationMatrix : public PermutationBase > +{ + typedef PermutationBase Base; + typedef internal::traits Traits; + public: + + typedef const PermutationMatrix& Nested; + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Traits::IndicesType IndicesType; + typedef typename Traits::StorageIndex StorageIndex; + #endif + + inline PermutationMatrix() + {} + + /** Constructs an uninitialized permutation matrix of given size. + */ + explicit inline PermutationMatrix(Index size) : m_indices(size) + { + eigen_internal_assert(size <= NumTraits::highest()); + } + + /** Copy constructor. */ + template + inline PermutationMatrix(const PermutationBase& other) + : m_indices(other.indices()) {} + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** Standard copy constructor. Defined only to prevent a default copy constructor + * from hiding the other templated constructor */ + inline PermutationMatrix(const PermutationMatrix& other) : m_indices(other.indices()) {} + #endif + + /** Generic constructor from expression of the indices. The indices + * array has the meaning that the permutations sends each integer i to indices[i]. + * + * \warning It is your responsibility to check that the indices array that you passes actually + * describes a permutation, i.e., each value between 0 and n-1 occurs exactly once, where n is the + * array's size. + */ + template + explicit inline PermutationMatrix(const MatrixBase& indices) : m_indices(indices) + {} + + /** Convert the Transpositions \a tr to a permutation matrix */ + template + explicit PermutationMatrix(const TranspositionsBase& tr) + : m_indices(tr.size()) + { + *this = tr; + } + + /** Copies the other permutation into *this */ + template + PermutationMatrix& operator=(const PermutationBase& other) + { + m_indices = other.indices(); + return *this; + } + + /** Assignment from the Transpositions \a tr */ + template + PermutationMatrix& operator=(const TranspositionsBase& tr) + { + return Base::operator=(tr.derived()); + } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + PermutationMatrix& operator=(const PermutationMatrix& other) + { + m_indices = other.m_indices; + return *this; + } + #endif + + /** const version of indices(). */ + const IndicesType& indices() const { return m_indices; } + /** \returns a reference to the stored array representing the permutation. */ + IndicesType& indices() { return m_indices; } + + + /**** multiplication helpers to hopefully get RVO ****/ + +#ifndef EIGEN_PARSED_BY_DOXYGEN + template + PermutationMatrix(const InverseImpl& other) + : m_indices(other.derived().nestedExpression().size()) + { + eigen_internal_assert(m_indices.size() <= NumTraits::highest()); + StorageIndex end = StorageIndex(m_indices.size()); + for (StorageIndex i=0; i + PermutationMatrix(internal::PermPermProduct_t, const Lhs& lhs, const Rhs& rhs) + : m_indices(lhs.indices().size()) + { + Base::assignProduct(lhs,rhs); + } +#endif + + protected: + + IndicesType m_indices; +}; + + +namespace internal { +template +struct traits,_PacketAccess> > + : traits > +{ + typedef PermutationStorage StorageKind; + typedef Map, _PacketAccess> IndicesType; + typedef _StorageIndex StorageIndex; + typedef void Scalar; +}; +} + +template +class Map,_PacketAccess> + : public PermutationBase,_PacketAccess> > +{ + typedef PermutationBase Base; + typedef internal::traits Traits; + public: + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Traits::IndicesType IndicesType; + typedef typename IndicesType::Scalar StorageIndex; + #endif + + inline Map(const StorageIndex* indicesPtr) + : m_indices(indicesPtr) + {} + + inline Map(const StorageIndex* indicesPtr, Index size) + : m_indices(indicesPtr,size) + {} + + /** Copies the other permutation into *this */ + template + Map& operator=(const PermutationBase& other) + { return Base::operator=(other.derived()); } + + /** Assignment from the Transpositions \a tr */ + template + Map& operator=(const TranspositionsBase& tr) + { return Base::operator=(tr.derived()); } + + #ifndef EIGEN_PARSED_BY_DOXYGEN + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + Map& operator=(const Map& other) + { + m_indices = other.m_indices; + return *this; + } + #endif + + /** const version of indices(). */ + const IndicesType& indices() const { return m_indices; } + /** \returns a reference to the stored array representing the permutation. */ + IndicesType& indices() { return m_indices; } + + protected: + + IndicesType m_indices; +}; + +template class TranspositionsWrapper; +namespace internal { +template +struct traits > +{ + typedef PermutationStorage StorageKind; + typedef void Scalar; + typedef typename _IndicesType::Scalar StorageIndex; + typedef _IndicesType IndicesType; + enum { + RowsAtCompileTime = _IndicesType::SizeAtCompileTime, + ColsAtCompileTime = _IndicesType::SizeAtCompileTime, + MaxRowsAtCompileTime = IndicesType::MaxSizeAtCompileTime, + MaxColsAtCompileTime = IndicesType::MaxSizeAtCompileTime, + Flags = 0 + }; +}; +} + +/** \class PermutationWrapper + * \ingroup Core_Module + * + * \brief Class to view a vector of integers as a permutation matrix + * + * \tparam _IndicesType the type of the vector of integer (can be any compatible expression) + * + * This class allows to view any vector expression of integers as a permutation matrix. + * + * \sa class PermutationBase, class PermutationMatrix + */ +template +class PermutationWrapper : public PermutationBase > +{ + typedef PermutationBase Base; + typedef internal::traits Traits; + public: + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename Traits::IndicesType IndicesType; + #endif + + inline PermutationWrapper(const IndicesType& indices) + : m_indices(indices) + {} + + /** const version of indices(). */ + const typename internal::remove_all::type& + indices() const { return m_indices; } + + protected: + + typename IndicesType::Nested m_indices; +}; + + +/** \returns the matrix with the permutation applied to the columns. + */ +template +EIGEN_DEVICE_FUNC +const Product +operator*(const MatrixBase &matrix, + const PermutationBase& permutation) +{ + return Product + (matrix.derived(), permutation.derived()); +} + +/** \returns the matrix with the permutation applied to the rows. + */ +template +EIGEN_DEVICE_FUNC +const Product +operator*(const PermutationBase &permutation, + const MatrixBase& matrix) +{ + return Product + (permutation.derived(), matrix.derived()); +} + + +template +class InverseImpl + : public EigenBase > +{ + typedef typename PermutationType::PlainPermutationType PlainPermutationType; + typedef internal::traits PermTraits; + protected: + InverseImpl() {} + public: + typedef Inverse InverseType; + using EigenBase >::derived; + + #ifndef EIGEN_PARSED_BY_DOXYGEN + typedef typename PermutationType::DenseMatrixType DenseMatrixType; + enum { + RowsAtCompileTime = PermTraits::RowsAtCompileTime, + ColsAtCompileTime = PermTraits::ColsAtCompileTime, + MaxRowsAtCompileTime = PermTraits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = PermTraits::MaxColsAtCompileTime + }; + #endif + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + void evalTo(MatrixBase& other) const + { + other.setZero(); + for (Index i=0; i friend + const Product + operator*(const MatrixBase& matrix, const InverseType& trPerm) + { + return Product(matrix.derived(), trPerm.derived()); + } + + /** \returns the matrix with the inverse permutation applied to the rows. + */ + template + const Product + operator*(const MatrixBase& matrix) const + { + return Product(derived(), matrix.derived()); + } +}; + +template +const PermutationWrapper MatrixBase::asPermutation() const +{ + return derived(); +} + +namespace internal { + +template<> struct AssignmentKind { typedef EigenBase2EigenBase Kind; }; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_PERMUTATIONMATRIX_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/PlainObjectBase.h b/SudoDEM2D/lib/Eigen/src/Core/PlainObjectBase.h new file mode 100644 index 0000000..1dc7e22 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/PlainObjectBase.h @@ -0,0 +1,1035 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2009 Gael Guennebaud +// Copyright (C) 2006-2008 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_DENSESTORAGEBASE_H +#define EIGEN_DENSESTORAGEBASE_H + +#if defined(EIGEN_INITIALIZE_MATRICES_BY_ZERO) +# define EIGEN_INITIALIZE_COEFFS +# define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED for(int i=0;i::quiet_NaN(); +#else +# undef EIGEN_INITIALIZE_COEFFS +# define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED +#endif + +namespace Eigen { + +namespace internal { + +template struct check_rows_cols_for_overflow { + template + EIGEN_DEVICE_FUNC + static EIGEN_ALWAYS_INLINE void run(Index, Index) + { + } +}; + +template<> struct check_rows_cols_for_overflow { + template + EIGEN_DEVICE_FUNC + static EIGEN_ALWAYS_INLINE void run(Index rows, Index cols) + { + // http://hg.mozilla.org/mozilla-central/file/6c8a909977d3/xpcom/ds/CheckedInt.h#l242 + // we assume Index is signed + Index max_index = (std::size_t(1) << (8 * sizeof(Index) - 1)) - 1; // assume Index is signed + bool error = (rows == 0 || cols == 0) ? false + : (rows > max_index / cols); + if (error) + throw_std_bad_alloc(); + } +}; + +template +struct conservative_resize_like_impl; + +template struct matrix_swap_impl; + +} // end namespace internal + +#ifdef EIGEN_PARSED_BY_DOXYGEN +namespace doxygen { + +// This is a workaround to doxygen not being able to understand the inheritance logic +// when it is hidden by the dense_xpr_base helper struct. +// Moreover, doxygen fails to include members that are not documented in the declaration body of +// MatrixBase if we inherits MatrixBase >, +// this is why we simply inherits MatrixBase, though this does not make sense. + +/** This class is just a workaround for Doxygen and it does not not actually exist. */ +template struct dense_xpr_base_dispatcher; +/** This class is just a workaround for Doxygen and it does not not actually exist. */ +template +struct dense_xpr_base_dispatcher > + : public MatrixBase {}; +/** This class is just a workaround for Doxygen and it does not not actually exist. */ +template +struct dense_xpr_base_dispatcher > + : public ArrayBase {}; + +} // namespace doxygen + +/** \class PlainObjectBase + * \ingroup Core_Module + * \brief %Dense storage base class for matrices and arrays. + * + * This class can be extended with the help of the plugin mechanism described on the page + * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_PLAINOBJECTBASE_PLUGIN. + * + * \tparam Derived is the derived type, e.g., a Matrix or Array + * + * \sa \ref TopicClassHierarchy + */ +template +class PlainObjectBase : public doxygen::dense_xpr_base_dispatcher +#else +template +class PlainObjectBase : public internal::dense_xpr_base::type +#endif +{ + public: + enum { Options = internal::traits::Options }; + typedef typename internal::dense_xpr_base::type Base; + + typedef typename internal::traits::StorageKind StorageKind; + typedef typename internal::traits::Scalar Scalar; + + typedef typename internal::packet_traits::type PacketScalar; + typedef typename NumTraits::Real RealScalar; + typedef Derived DenseType; + + using Base::RowsAtCompileTime; + using Base::ColsAtCompileTime; + using Base::SizeAtCompileTime; + using Base::MaxRowsAtCompileTime; + using Base::MaxColsAtCompileTime; + using Base::MaxSizeAtCompileTime; + using Base::IsVectorAtCompileTime; + using Base::Flags; + + template friend class Eigen::Map; + friend class Eigen::Map; + typedef Eigen::Map MapType; + friend class Eigen::Map; + typedef const Eigen::Map ConstMapType; +#if EIGEN_MAX_ALIGN_BYTES>0 + // for EIGEN_MAX_ALIGN_BYTES==0, AlignedMax==Unaligned, and many compilers generate warnings for friend-ing a class twice. + friend class Eigen::Map; + friend class Eigen::Map; +#endif + typedef Eigen::Map AlignedMapType; + typedef const Eigen::Map ConstAlignedMapType; + template struct StridedMapType { typedef Eigen::Map type; }; + template struct StridedConstMapType { typedef Eigen::Map type; }; + template struct StridedAlignedMapType { typedef Eigen::Map type; }; + template struct StridedConstAlignedMapType { typedef Eigen::Map type; }; + + protected: + DenseStorage m_storage; + + public: + enum { NeedsToAlign = (SizeAtCompileTime != Dynamic) && (internal::traits::Alignment>0) }; + EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) + + EIGEN_DEVICE_FUNC + Base& base() { return *static_cast(this); } + EIGEN_DEVICE_FUNC + const Base& base() const { return *static_cast(this); } + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index rows() const { return m_storage.rows(); } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Index cols() const { return m_storage.cols(); } + + /** This is an overloaded version of DenseCoeffsBase::coeff(Index,Index) const + * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. + * + * See DenseCoeffsBase::coeff(Index) const for details. */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const Scalar& coeff(Index rowId, Index colId) const + { + if(Flags & RowMajorBit) + return m_storage.data()[colId + rowId * m_storage.cols()]; + else // column-major + return m_storage.data()[rowId + colId * m_storage.rows()]; + } + + /** This is an overloaded version of DenseCoeffsBase::coeff(Index) const + * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. + * + * See DenseCoeffsBase::coeff(Index) const for details. */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const Scalar& coeff(Index index) const + { + return m_storage.data()[index]; + } + + /** This is an overloaded version of DenseCoeffsBase::coeffRef(Index,Index) const + * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. + * + * See DenseCoeffsBase::coeffRef(Index,Index) const for details. */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& coeffRef(Index rowId, Index colId) + { + if(Flags & RowMajorBit) + return m_storage.data()[colId + rowId * m_storage.cols()]; + else // column-major + return m_storage.data()[rowId + colId * m_storage.rows()]; + } + + /** This is an overloaded version of DenseCoeffsBase::coeffRef(Index) const + * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. + * + * See DenseCoeffsBase::coeffRef(Index) const for details. */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) + { + return m_storage.data()[index]; + } + + /** This is the const version of coeffRef(Index,Index) which is thus synonym of coeff(Index,Index). + * It is provided for convenience. */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const Scalar& coeffRef(Index rowId, Index colId) const + { + if(Flags & RowMajorBit) + return m_storage.data()[colId + rowId * m_storage.cols()]; + else // column-major + return m_storage.data()[rowId + colId * m_storage.rows()]; + } + + /** This is the const version of coeffRef(Index) which is thus synonym of coeff(Index). + * It is provided for convenience. */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const Scalar& coeffRef(Index index) const + { + return m_storage.data()[index]; + } + + /** \internal */ + template + EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const + { + return internal::ploadt + (m_storage.data() + (Flags & RowMajorBit + ? colId + rowId * m_storage.cols() + : rowId + colId * m_storage.rows())); + } + + /** \internal */ + template + EIGEN_STRONG_INLINE PacketScalar packet(Index index) const + { + return internal::ploadt(m_storage.data() + index); + } + + /** \internal */ + template + EIGEN_STRONG_INLINE void writePacket(Index rowId, Index colId, const PacketScalar& val) + { + internal::pstoret + (m_storage.data() + (Flags & RowMajorBit + ? colId + rowId * m_storage.cols() + : rowId + colId * m_storage.rows()), val); + } + + /** \internal */ + template + EIGEN_STRONG_INLINE void writePacket(Index index, const PacketScalar& val) + { + internal::pstoret(m_storage.data() + index, val); + } + + /** \returns a const pointer to the data array of this matrix */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar *data() const + { return m_storage.data(); } + + /** \returns a pointer to the data array of this matrix */ + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar *data() + { return m_storage.data(); } + + /** Resizes \c *this to a \a rows x \a cols matrix. + * + * This method is intended for dynamic-size matrices, although it is legal to call it on any + * matrix as long as fixed dimensions are left unchanged. If you only want to change the number + * of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t). + * + * If the current number of coefficients of \c *this exactly matches the + * product \a rows * \a cols, then no memory allocation is performed and + * the current values are left unchanged. In all other cases, including + * shrinking, the data is reallocated and all previous values are lost. + * + * Example: \include Matrix_resize_int_int.cpp + * Output: \verbinclude Matrix_resize_int_int.out + * + * \sa resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t) + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void resize(Index rows, Index cols) + { + eigen_assert( EIGEN_IMPLIES(RowsAtCompileTime!=Dynamic,rows==RowsAtCompileTime) + && EIGEN_IMPLIES(ColsAtCompileTime!=Dynamic,cols==ColsAtCompileTime) + && EIGEN_IMPLIES(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic,rows<=MaxRowsAtCompileTime) + && EIGEN_IMPLIES(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic,cols<=MaxColsAtCompileTime) + && rows>=0 && cols>=0 && "Invalid sizes when resizing a matrix or array."); + internal::check_rows_cols_for_overflow::run(rows, cols); + #ifdef EIGEN_INITIALIZE_COEFFS + Index size = rows*cols; + bool size_changed = size != this->size(); + m_storage.resize(size, rows, cols); + if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + #else + m_storage.resize(rows*cols, rows, cols); + #endif + } + + /** Resizes \c *this to a vector of length \a size + * + * \only_for_vectors. This method does not work for + * partially dynamic matrices when the static dimension is anything other + * than 1. For example it will not work with Matrix. + * + * Example: \include Matrix_resize_int.cpp + * Output: \verbinclude Matrix_resize_int.out + * + * \sa resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t) + */ + EIGEN_DEVICE_FUNC + inline void resize(Index size) + { + EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase) + eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime==Dynamic || size<=MaxSizeAtCompileTime)) || SizeAtCompileTime == size) && size>=0); + #ifdef EIGEN_INITIALIZE_COEFFS + bool size_changed = size != this->size(); + #endif + if(RowsAtCompileTime == 1) + m_storage.resize(size, 1, size); + else + m_storage.resize(size, size, 1); + #ifdef EIGEN_INITIALIZE_COEFFS + if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + #endif + } + + /** Resizes the matrix, changing only the number of columns. For the parameter of type NoChange_t, just pass the special value \c NoChange + * as in the example below. + * + * Example: \include Matrix_resize_NoChange_int.cpp + * Output: \verbinclude Matrix_resize_NoChange_int.out + * + * \sa resize(Index,Index) + */ + EIGEN_DEVICE_FUNC + inline void resize(NoChange_t, Index cols) + { + resize(rows(), cols); + } + + /** Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special value \c NoChange + * as in the example below. + * + * Example: \include Matrix_resize_int_NoChange.cpp + * Output: \verbinclude Matrix_resize_int_NoChange.out + * + * \sa resize(Index,Index) + */ + EIGEN_DEVICE_FUNC + inline void resize(Index rows, NoChange_t) + { + resize(rows, cols()); + } + + /** Resizes \c *this to have the same dimensions as \a other. + * Takes care of doing all the checking that's needed. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void resizeLike(const EigenBase& _other) + { + const OtherDerived& other = _other.derived(); + internal::check_rows_cols_for_overflow::run(other.rows(), other.cols()); + const Index othersize = other.rows()*other.cols(); + if(RowsAtCompileTime == 1) + { + eigen_assert(other.rows() == 1 || other.cols() == 1); + resize(1, othersize); + } + else if(ColsAtCompileTime == 1) + { + eigen_assert(other.rows() == 1 || other.cols() == 1); + resize(othersize, 1); + } + else resize(other.rows(), other.cols()); + } + + /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. + * + * The method is intended for matrices of dynamic size. If you only want to change the number + * of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or + * conservativeResize(Index, NoChange_t). + * + * Matrices are resized relative to the top-left element. In case values need to be + * appended to the matrix they will be uninitialized. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResize(Index rows, Index cols) + { + internal::conservative_resize_like_impl::run(*this, rows, cols); + } + + /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. + * + * As opposed to conservativeResize(Index rows, Index cols), this version leaves + * the number of columns unchanged. + * + * In case the matrix is growing, new rows will be uninitialized. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResize(Index rows, NoChange_t) + { + // Note: see the comment in conservativeResize(Index,Index) + conservativeResize(rows, cols()); + } + + /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. + * + * As opposed to conservativeResize(Index rows, Index cols), this version leaves + * the number of rows unchanged. + * + * In case the matrix is growing, new columns will be uninitialized. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResize(NoChange_t, Index cols) + { + // Note: see the comment in conservativeResize(Index,Index) + conservativeResize(rows(), cols); + } + + /** Resizes the vector to \a size while retaining old values. + * + * \only_for_vectors. This method does not work for + * partially dynamic matrices when the static dimension is anything other + * than 1. For example it will not work with Matrix. + * + * When values are appended, they will be uninitialized. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResize(Index size) + { + internal::conservative_resize_like_impl::run(*this, size); + } + + /** Resizes the matrix to \a rows x \a cols of \c other, while leaving old values untouched. + * + * The method is intended for matrices of dynamic size. If you only want to change the number + * of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or + * conservativeResize(Index, NoChange_t). + * + * Matrices are resized relative to the top-left element. In case values need to be + * appended to the matrix they will copied from \c other. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void conservativeResizeLike(const DenseBase& other) + { + internal::conservative_resize_like_impl::run(*this, other); + } + + /** This is a special case of the templated operator=. Its purpose is to + * prevent a default operator= from hiding the templated operator=. + */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& operator=(const PlainObjectBase& other) + { + return _set(other); + } + + /** \sa MatrixBase::lazyAssign() */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& lazyAssign(const DenseBase& other) + { + _resize_to_match(other); + return Base::lazyAssign(other.derived()); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& operator=(const ReturnByValue& func) + { + resize(func.rows(), func.cols()); + return Base::operator=(func); + } + + // Prevent user from trying to instantiate PlainObjectBase objects + // by making all its constructor protected. See bug 1074. + protected: + + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase() : m_storage() + { +// _check_template_params(); +// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } + +#ifndef EIGEN_PARSED_BY_DOXYGEN + // FIXME is it still needed ? + /** \internal */ + EIGEN_DEVICE_FUNC + explicit PlainObjectBase(internal::constructor_without_unaligned_array_assert) + : m_storage(internal::constructor_without_unaligned_array_assert()) + { +// _check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } +#endif + +#if EIGEN_HAS_RVALUE_REFERENCES + EIGEN_DEVICE_FUNC + PlainObjectBase(PlainObjectBase&& other) EIGEN_NOEXCEPT + : m_storage( std::move(other.m_storage) ) + { + } + + EIGEN_DEVICE_FUNC + PlainObjectBase& operator=(PlainObjectBase&& other) EIGEN_NOEXCEPT + { + using std::swap; + swap(m_storage, other.m_storage); + return *this; + } +#endif + + /** Copy constructor */ + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(const PlainObjectBase& other) + : Base(), m_storage(other.m_storage) { } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(Index size, Index rows, Index cols) + : m_storage(size, rows, cols) + { +// _check_template_params(); +// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED + } + + /** \sa PlainObjectBase::operator=(const EigenBase&) */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(const DenseBase &other) + : m_storage() + { + _check_template_params(); + resizeLike(other); + _set_noalias(other); + } + + /** \sa PlainObjectBase::operator=(const EigenBase&) */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(const EigenBase &other) + : m_storage() + { + _check_template_params(); + resizeLike(other); + *this = other.derived(); + } + /** \brief Copy constructor with in-place evaluation */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE PlainObjectBase(const ReturnByValue& other) + { + _check_template_params(); + // FIXME this does not automatically transpose vectors if necessary + resize(other.rows(), other.cols()); + other.evalTo(this->derived()); + } + + public: + + /** \brief Copies the generic expression \a other into *this. + * \copydetails DenseBase::operator=(const EigenBase &other) + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& operator=(const EigenBase &other) + { + _resize_to_match(other); + Base::operator=(other.derived()); + return this->derived(); + } + + /** \name Map + * These are convenience functions returning Map objects. The Map() static functions return unaligned Map objects, + * while the AlignedMap() functions return aligned Map objects and thus should be called only with 16-byte-aligned + * \a data pointers. + * + * Here is an example using strides: + * \include Matrix_Map_stride.cpp + * Output: \verbinclude Matrix_Map_stride.out + * + * \see class Map + */ + //@{ + static inline ConstMapType Map(const Scalar* data) + { return ConstMapType(data); } + static inline MapType Map(Scalar* data) + { return MapType(data); } + static inline ConstMapType Map(const Scalar* data, Index size) + { return ConstMapType(data, size); } + static inline MapType Map(Scalar* data, Index size) + { return MapType(data, size); } + static inline ConstMapType Map(const Scalar* data, Index rows, Index cols) + { return ConstMapType(data, rows, cols); } + static inline MapType Map(Scalar* data, Index rows, Index cols) + { return MapType(data, rows, cols); } + + static inline ConstAlignedMapType MapAligned(const Scalar* data) + { return ConstAlignedMapType(data); } + static inline AlignedMapType MapAligned(Scalar* data) + { return AlignedMapType(data); } + static inline ConstAlignedMapType MapAligned(const Scalar* data, Index size) + { return ConstAlignedMapType(data, size); } + static inline AlignedMapType MapAligned(Scalar* data, Index size) + { return AlignedMapType(data, size); } + static inline ConstAlignedMapType MapAligned(const Scalar* data, Index rows, Index cols) + { return ConstAlignedMapType(data, rows, cols); } + static inline AlignedMapType MapAligned(Scalar* data, Index rows, Index cols) + { return AlignedMapType(data, rows, cols); } + + template + static inline typename StridedConstMapType >::type Map(const Scalar* data, const Stride& stride) + { return typename StridedConstMapType >::type(data, stride); } + template + static inline typename StridedMapType >::type Map(Scalar* data, const Stride& stride) + { return typename StridedMapType >::type(data, stride); } + template + static inline typename StridedConstMapType >::type Map(const Scalar* data, Index size, const Stride& stride) + { return typename StridedConstMapType >::type(data, size, stride); } + template + static inline typename StridedMapType >::type Map(Scalar* data, Index size, const Stride& stride) + { return typename StridedMapType >::type(data, size, stride); } + template + static inline typename StridedConstMapType >::type Map(const Scalar* data, Index rows, Index cols, const Stride& stride) + { return typename StridedConstMapType >::type(data, rows, cols, stride); } + template + static inline typename StridedMapType >::type Map(Scalar* data, Index rows, Index cols, const Stride& stride) + { return typename StridedMapType >::type(data, rows, cols, stride); } + + template + static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, const Stride& stride) + { return typename StridedConstAlignedMapType >::type(data, stride); } + template + static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, const Stride& stride) + { return typename StridedAlignedMapType >::type(data, stride); } + template + static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, Index size, const Stride& stride) + { return typename StridedConstAlignedMapType >::type(data, size, stride); } + template + static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, Index size, const Stride& stride) + { return typename StridedAlignedMapType >::type(data, size, stride); } + template + static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, Index rows, Index cols, const Stride& stride) + { return typename StridedConstAlignedMapType >::type(data, rows, cols, stride); } + template + static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, Index rows, Index cols, const Stride& stride) + { return typename StridedAlignedMapType >::type(data, rows, cols, stride); } + //@} + + using Base::setConstant; + EIGEN_DEVICE_FUNC Derived& setConstant(Index size, const Scalar& val); + EIGEN_DEVICE_FUNC Derived& setConstant(Index rows, Index cols, const Scalar& val); + + using Base::setZero; + EIGEN_DEVICE_FUNC Derived& setZero(Index size); + EIGEN_DEVICE_FUNC Derived& setZero(Index rows, Index cols); + + using Base::setOnes; + EIGEN_DEVICE_FUNC Derived& setOnes(Index size); + EIGEN_DEVICE_FUNC Derived& setOnes(Index rows, Index cols); + + using Base::setRandom; + Derived& setRandom(Index size); + Derived& setRandom(Index rows, Index cols); + + #ifdef EIGEN_PLAINOBJECTBASE_PLUGIN + #include EIGEN_PLAINOBJECTBASE_PLUGIN + #endif + + protected: + /** \internal Resizes *this in preparation for assigning \a other to it. + * Takes care of doing all the checking that's needed. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _resize_to_match(const EigenBase& other) + { + #ifdef EIGEN_NO_AUTOMATIC_RESIZING + eigen_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size()) + : (rows() == other.rows() && cols() == other.cols()))) + && "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined"); + EIGEN_ONLY_USED_FOR_DEBUG(other); + #else + resizeLike(other); + #endif + } + + /** + * \brief Copies the value of the expression \a other into \c *this with automatic resizing. + * + * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), + * it will be initialized. + * + * Note that copying a row-vector into a vector (and conversely) is allowed. + * The resizing, if any, is then done in the appropriate way so that row-vectors + * remain row-vectors and vectors remain vectors. + * + * \sa operator=(const MatrixBase&), _set_noalias() + * + * \internal + */ + // aliasing is dealt once in internall::call_assignment + // so at this stage we have to assume aliasing... and resising has to be done later. + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& _set(const DenseBase& other) + { + internal::call_assignment(this->derived(), other.derived()); + return this->derived(); + } + + /** \internal Like _set() but additionally makes the assumption that no aliasing effect can happen (which + * is the case when creating a new matrix) so one can enforce lazy evaluation. + * + * \sa operator=(const MatrixBase&), _set() + */ + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE Derived& _set_noalias(const DenseBase& other) + { + // I don't think we need this resize call since the lazyAssign will anyways resize + // and lazyAssign will be called by the assign selector. + //_resize_to_match(other); + // the 'false' below means to enforce lazy evaluation. We don't use lazyAssign() because + // it wouldn't allow to copy a row-vector into a column-vector. + internal::call_assignment_no_alias(this->derived(), other.derived(), internal::assign_op()); + return this->derived(); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init2(Index rows, Index cols, typename internal::enable_if::type* = 0) + { + EIGEN_STATIC_ASSERT(bool(NumTraits::IsInteger) && + bool(NumTraits::IsInteger), + FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED) + resize(rows,cols); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init2(const T0& val0, const T1& val1, typename internal::enable_if::type* = 0) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2) + m_storage.data()[0] = Scalar(val0); + m_storage.data()[1] = Scalar(val1); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init2(const Index& val0, const Index& val1, + typename internal::enable_if< (!internal::is_same::value) + && (internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime==2,T1>::type* = 0) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2) + m_storage.data()[0] = Scalar(val0); + m_storage.data()[1] = Scalar(val1); + } + + // The argument is convertible to the Index type and we either have a non 1x1 Matrix, or a dynamic-sized Array, + // then the argument is meant to be the size of the object. + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(Index size, typename internal::enable_if< (Base::SizeAtCompileTime!=1 || !internal::is_convertible::value) + && ((!internal::is_same::XprKind,ArrayXpr>::value || Base::SizeAtCompileTime==Dynamic)),T>::type* = 0) + { + // NOTE MSVC 2008 complains if we directly put bool(NumTraits::IsInteger) as the EIGEN_STATIC_ASSERT argument. + const bool is_integer = NumTraits::IsInteger; + EIGEN_UNUSED_VARIABLE(is_integer); + EIGEN_STATIC_ASSERT(is_integer, + FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED) + resize(size); + } + + // We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar type can be implicitely converted) + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Scalar& val0, typename internal::enable_if::value,T>::type* = 0) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1) + m_storage.data()[0] = val0; + } + + // We have a 1x1 matrix/array => the argument is interpreted as the value of the unique coefficient (case where scalar type match the index type) + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Index& val0, + typename internal::enable_if< (!internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime==1 + && internal::is_convertible::value,T*>::type* = 0) + { + EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 1) + m_storage.data()[0] = Scalar(val0); + } + + // Initialize a fixed size matrix from a pointer to raw data + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Scalar* data){ + this->_set_noalias(ConstMapType(data)); + } + + // Initialize an arbitrary matrix from a dense expression + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const DenseBase& other){ + this->_set_noalias(other); + } + + // Initialize an arbitrary matrix from an object convertible to the Derived type. + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Derived& other){ + this->_set_noalias(other); + } + + // Initialize an arbitrary matrix from a generic Eigen expression + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const EigenBase& other){ + this->derived() = other; + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const ReturnByValue& other) + { + resize(other.rows(), other.cols()); + other.evalTo(this->derived()); + } + + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const RotationBase& r) + { + this->derived() = r; + } + + // For fixed-size Array + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Scalar& val0, + typename internal::enable_if< Base::SizeAtCompileTime!=Dynamic + && Base::SizeAtCompileTime!=1 + && internal::is_convertible::value + && internal::is_same::XprKind,ArrayXpr>::value,T>::type* = 0) + { + Base::setConstant(val0); + } + + // For fixed-size Array + template + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE void _init1(const Index& val0, + typename internal::enable_if< (!internal::is_same::value) + && (internal::is_same::value) + && Base::SizeAtCompileTime!=Dynamic + && Base::SizeAtCompileTime!=1 + && internal::is_convertible::value + && internal::is_same::XprKind,ArrayXpr>::value,T*>::type* = 0) + { + Base::setConstant(val0); + } + + template + friend struct internal::matrix_swap_impl; + + public: + +#ifndef EIGEN_PARSED_BY_DOXYGEN + /** \internal + * \brief Override DenseBase::swap() since for dynamic-sized matrices + * of same type it is enough to swap the data pointers. + */ + template + EIGEN_DEVICE_FUNC + void swap(DenseBase & other) + { + enum { SwapPointers = internal::is_same::value && Base::SizeAtCompileTime==Dynamic }; + internal::matrix_swap_impl::run(this->derived(), other.derived()); + } + + /** \internal + * \brief const version forwarded to DenseBase::swap + */ + template + EIGEN_DEVICE_FUNC + void swap(DenseBase const & other) + { Base::swap(other.derived()); } + + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE void _check_template_params() + { + EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, (Options&RowMajor)==RowMajor) + && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, (Options&RowMajor)==0) + && ((RowsAtCompileTime == Dynamic) || (RowsAtCompileTime >= 0)) + && ((ColsAtCompileTime == Dynamic) || (ColsAtCompileTime >= 0)) + && ((MaxRowsAtCompileTime == Dynamic) || (MaxRowsAtCompileTime >= 0)) + && ((MaxColsAtCompileTime == Dynamic) || (MaxColsAtCompileTime >= 0)) + && (MaxRowsAtCompileTime == RowsAtCompileTime || RowsAtCompileTime==Dynamic) + && (MaxColsAtCompileTime == ColsAtCompileTime || ColsAtCompileTime==Dynamic) + && (Options & (DontAlign|RowMajor)) == Options), + INVALID_MATRIX_TEMPLATE_PARAMETERS) + } + + enum { IsPlainObjectBase = 1 }; +#endif +}; + +namespace internal { + +template +struct conservative_resize_like_impl +{ + static void run(DenseBase& _this, Index rows, Index cols) + { + if (_this.rows() == rows && _this.cols() == cols) return; + EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived) + + if ( ( Derived::IsRowMajor && _this.cols() == cols) || // row-major and we change only the number of rows + (!Derived::IsRowMajor && _this.rows() == rows) ) // column-major and we change only the number of columns + { + internal::check_rows_cols_for_overflow::run(rows, cols); + _this.derived().m_storage.conservativeResize(rows*cols,rows,cols); + } + else + { + // The storage order does not allow us to use reallocation. + typename Derived::PlainObject tmp(rows,cols); + const Index common_rows = numext::mini(rows, _this.rows()); + const Index common_cols = numext::mini(cols, _this.cols()); + tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols); + _this.derived().swap(tmp); + } + } + + static void run(DenseBase& _this, const DenseBase& other) + { + if (_this.rows() == other.rows() && _this.cols() == other.cols()) return; + + // Note: Here is space for improvement. Basically, for conservativeResize(Index,Index), + // neither RowsAtCompileTime or ColsAtCompileTime must be Dynamic. If only one of the + // dimensions is dynamic, one could use either conservativeResize(Index rows, NoChange_t) or + // conservativeResize(NoChange_t, Index cols). For these methods new static asserts like + // EIGEN_STATIC_ASSERT_DYNAMIC_ROWS and EIGEN_STATIC_ASSERT_DYNAMIC_COLS would be good. + EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived) + EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(OtherDerived) + + if ( ( Derived::IsRowMajor && _this.cols() == other.cols()) || // row-major and we change only the number of rows + (!Derived::IsRowMajor && _this.rows() == other.rows()) ) // column-major and we change only the number of columns + { + const Index new_rows = other.rows() - _this.rows(); + const Index new_cols = other.cols() - _this.cols(); + _this.derived().m_storage.conservativeResize(other.size(),other.rows(),other.cols()); + if (new_rows>0) + _this.bottomRightCorner(new_rows, other.cols()) = other.bottomRows(new_rows); + else if (new_cols>0) + _this.bottomRightCorner(other.rows(), new_cols) = other.rightCols(new_cols); + } + else + { + // The storage order does not allow us to use reallocation. + typename Derived::PlainObject tmp(other); + const Index common_rows = numext::mini(tmp.rows(), _this.rows()); + const Index common_cols = numext::mini(tmp.cols(), _this.cols()); + tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols); + _this.derived().swap(tmp); + } + } +}; + +// Here, the specialization for vectors inherits from the general matrix case +// to allow calling .conservativeResize(rows,cols) on vectors. +template +struct conservative_resize_like_impl + : conservative_resize_like_impl +{ + using conservative_resize_like_impl::run; + + static void run(DenseBase& _this, Index size) + { + const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : size; + const Index new_cols = Derived::RowsAtCompileTime==1 ? size : 1; + _this.derived().m_storage.conservativeResize(size,new_rows,new_cols); + } + + static void run(DenseBase& _this, const DenseBase& other) + { + if (_this.rows() == other.rows() && _this.cols() == other.cols()) return; + + const Index num_new_elements = other.size() - _this.size(); + + const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : other.rows(); + const Index new_cols = Derived::RowsAtCompileTime==1 ? other.cols() : 1; + _this.derived().m_storage.conservativeResize(other.size(),new_rows,new_cols); + + if (num_new_elements > 0) + _this.tail(num_new_elements) = other.tail(num_new_elements); + } +}; + +template +struct matrix_swap_impl +{ + EIGEN_DEVICE_FUNC + static inline void run(MatrixTypeA& a, MatrixTypeB& b) + { + a.base().swap(b); + } +}; + +template +struct matrix_swap_impl +{ + EIGEN_DEVICE_FUNC + static inline void run(MatrixTypeA& a, MatrixTypeB& b) + { + static_cast(a).m_storage.swap(static_cast(b).m_storage); + } +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_DENSESTORAGEBASE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Product.h b/SudoDEM2D/lib/Eigen/src/Core/Product.h new file mode 100644 index 0000000..676c480 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Product.h @@ -0,0 +1,186 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2011 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_PRODUCT_H +#define EIGEN_PRODUCT_H + +namespace Eigen { + +template class ProductImpl; + +namespace internal { + +template +struct traits > +{ + typedef typename remove_all::type LhsCleaned; + typedef typename remove_all::type RhsCleaned; + typedef traits LhsTraits; + typedef traits RhsTraits; + + typedef MatrixXpr XprKind; + + typedef typename ScalarBinaryOpTraits::Scalar, typename traits::Scalar>::ReturnType Scalar; + typedef typename product_promote_storage_type::ret>::ret StorageKind; + typedef typename promote_index_type::type StorageIndex; + + enum { + RowsAtCompileTime = LhsTraits::RowsAtCompileTime, + ColsAtCompileTime = RhsTraits::ColsAtCompileTime, + MaxRowsAtCompileTime = LhsTraits::MaxRowsAtCompileTime, + MaxColsAtCompileTime = RhsTraits::MaxColsAtCompileTime, + + // FIXME: only needed by GeneralMatrixMatrixTriangular + InnerSize = EIGEN_SIZE_MIN_PREFER_FIXED(LhsTraits::ColsAtCompileTime, RhsTraits::RowsAtCompileTime), + + // The storage order is somewhat arbitrary here. The correct one will be determined through the evaluator. + Flags = (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1) ? RowMajorBit + : (MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1) ? 0 + : ( ((LhsTraits::Flags&NoPreferredStorageOrderBit) && (RhsTraits::Flags&RowMajorBit)) + || ((RhsTraits::Flags&NoPreferredStorageOrderBit) && (LhsTraits::Flags&RowMajorBit)) ) ? RowMajorBit + : NoPreferredStorageOrderBit + }; +}; + +} // end namespace internal + +/** \class Product + * \ingroup Core_Module + * + * \brief Expression of the product of two arbitrary matrices or vectors + * + * \tparam _Lhs the type of the left-hand side expression + * \tparam _Rhs the type of the right-hand side expression + * + * This class represents an expression of the product of two arbitrary matrices. + * + * The other template parameters are: + * \tparam Option can be DefaultProduct, AliasFreeProduct, or LazyProduct + * + */ +template +class Product : public ProductImpl<_Lhs,_Rhs,Option, + typename internal::product_promote_storage_type::StorageKind, + typename internal::traits<_Rhs>::StorageKind, + internal::product_type<_Lhs,_Rhs>::ret>::ret> +{ + public: + + typedef _Lhs Lhs; + typedef _Rhs Rhs; + + typedef typename ProductImpl< + Lhs, Rhs, Option, + typename internal::product_promote_storage_type::StorageKind, + typename internal::traits::StorageKind, + internal::product_type::ret>::ret>::Base Base; + EIGEN_GENERIC_PUBLIC_INTERFACE(Product) + + typedef typename internal::ref_selector::type LhsNested; + typedef typename internal::ref_selector::type RhsNested; + typedef typename internal::remove_all::type LhsNestedCleaned; + typedef typename internal::remove_all::type RhsNestedCleaned; + + EIGEN_DEVICE_FUNC Product(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) + { + eigen_assert(lhs.cols() == rhs.rows() + && "invalid matrix product" + && "if you wanted a coeff-wise or a dot product use the respective explicit functions"); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const { return m_lhs.rows(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const { return m_rhs.cols(); } + + EIGEN_DEVICE_FUNC const LhsNestedCleaned& lhs() const { return m_lhs; } + EIGEN_DEVICE_FUNC const RhsNestedCleaned& rhs() const { return m_rhs; } + + protected: + + LhsNested m_lhs; + RhsNested m_rhs; +}; + +namespace internal { + +template::ret> +class dense_product_base + : public internal::dense_xpr_base >::type +{}; + +/** Convertion to scalar for inner-products */ +template +class dense_product_base + : public internal::dense_xpr_base >::type +{ + typedef Product ProductXpr; + typedef typename internal::dense_xpr_base::type Base; +public: + using Base::derived; + typedef typename Base::Scalar Scalar; + + EIGEN_STRONG_INLINE operator const Scalar() const + { + return internal::evaluator(derived()).coeff(0,0); + } +}; + +} // namespace internal + +// Generic API dispatcher +template +class ProductImpl : public internal::generic_xpr_base, MatrixXpr, StorageKind>::type +{ + public: + typedef typename internal::generic_xpr_base, MatrixXpr, StorageKind>::type Base; +}; + +template +class ProductImpl + : public internal::dense_product_base +{ + typedef Product Derived; + + public: + + typedef typename internal::dense_product_base Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Derived) + protected: + enum { + IsOneByOne = (RowsAtCompileTime == 1 || RowsAtCompileTime == Dynamic) && + (ColsAtCompileTime == 1 || ColsAtCompileTime == Dynamic), + EnableCoeff = IsOneByOne || Option==LazyProduct + }; + + public: + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(Index row, Index col) const + { + EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS); + eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) ); + + return internal::evaluator(derived()).coeff(row,col); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar coeff(Index i) const + { + EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS); + eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) ); + + return internal::evaluator(derived()).coeff(i); + } + + +}; + +} // end namespace Eigen + +#endif // EIGEN_PRODUCT_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/ProductEvaluators.h b/SudoDEM2D/lib/Eigen/src/Core/ProductEvaluators.h new file mode 100644 index 0000000..9b99bd7 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/ProductEvaluators.h @@ -0,0 +1,1112 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2008-2010 Gael Guennebaud +// Copyright (C) 2011 Jitse Niesen +// +// 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_PRODUCTEVALUATORS_H +#define EIGEN_PRODUCTEVALUATORS_H + +namespace Eigen { + +namespace internal { + +/** \internal + * Evaluator of a product expression. + * Since products require special treatments to handle all possible cases, + * we simply deffer the evaluation logic to a product_evaluator class + * which offers more partial specialization possibilities. + * + * \sa class product_evaluator + */ +template +struct evaluator > + : public product_evaluator > +{ + typedef Product XprType; + typedef product_evaluator Base; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& xpr) : Base(xpr) {} +}; + +// Catch "scalar * ( A * B )" and transform it to "(A*scalar) * B" +// TODO we should apply that rule only if that's really helpful +template +struct evaluator_assume_aliasing, + const CwiseNullaryOp, Plain1>, + const Product > > +{ + static const bool value = true; +}; +template +struct evaluator, + const CwiseNullaryOp, Plain1>, + const Product > > + : public evaluator > +{ + typedef CwiseBinaryOp, + const CwiseNullaryOp, Plain1>, + const Product > XprType; + typedef evaluator > Base; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& xpr) + : Base(xpr.lhs().functor().m_other * xpr.rhs().lhs() * xpr.rhs().rhs()) + {} +}; + + +template +struct evaluator, DiagIndex> > + : public evaluator, DiagIndex> > +{ + typedef Diagonal, DiagIndex> XprType; + typedef evaluator, DiagIndex> > Base; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit evaluator(const XprType& xpr) + : Base(Diagonal, DiagIndex>( + Product(xpr.nestedExpression().lhs(), xpr.nestedExpression().rhs()), + xpr.index() )) + {} +}; + + +// Helper class to perform a matrix product with the destination at hand. +// Depending on the sizes of the factors, there are different evaluation strategies +// as controlled by internal::product_type. +template< typename Lhs, typename Rhs, + typename LhsShape = typename evaluator_traits::Shape, + typename RhsShape = typename evaluator_traits::Shape, + int ProductType = internal::product_type::value> +struct generic_product_impl; + +template +struct evaluator_assume_aliasing > { + static const bool value = true; +}; + +// This is the default evaluator implementation for products: +// It creates a temporary and call generic_product_impl +template +struct product_evaluator, ProductTag, LhsShape, RhsShape> + : public evaluator::PlainObject> +{ + typedef Product XprType; + typedef typename XprType::PlainObject PlainObject; + typedef evaluator Base; + enum { + Flags = Base::Flags | EvalBeforeNestingBit + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit product_evaluator(const XprType& xpr) + : m_result(xpr.rows(), xpr.cols()) + { + ::new (static_cast(this)) Base(m_result); + +// FIXME shall we handle nested_eval here?, +// if so, then we must take care at removing the call to nested_eval in the specializations (e.g., in permutation_matrix_product, transposition_matrix_product, etc.) +// typedef typename internal::nested_eval::type LhsNested; +// typedef typename internal::nested_eval::type RhsNested; +// typedef typename internal::remove_all::type LhsNestedCleaned; +// typedef typename internal::remove_all::type RhsNestedCleaned; +// +// const LhsNested lhs(xpr.lhs()); +// const RhsNested rhs(xpr.rhs()); +// +// generic_product_impl::evalTo(m_result, lhs, rhs); + + generic_product_impl::evalTo(m_result, xpr.lhs(), xpr.rhs()); + } + +protected: + PlainObject m_result; +}; + +// The following three shortcuts are enabled only if the scalar types match excatly. +// TODO: we could enable them for different scalar types when the product is not vectorized. + +// Dense = Product +template< typename DstXprType, typename Lhs, typename Rhs, int Options, typename Scalar> +struct Assignment, internal::assign_op, Dense2Dense, + typename enable_if<(Options==DefaultProduct || Options==AliasFreeProduct)>::type> +{ + typedef Product SrcXprType; + static EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &) + { + Index dstRows = src.rows(); + Index dstCols = src.cols(); + if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) + dst.resize(dstRows, dstCols); + // FIXME shall we handle nested_eval here? + generic_product_impl::evalTo(dst, src.lhs(), src.rhs()); + } +}; + +// Dense += Product +template< typename DstXprType, typename Lhs, typename Rhs, int Options, typename Scalar> +struct Assignment, internal::add_assign_op, Dense2Dense, + typename enable_if<(Options==DefaultProduct || Options==AliasFreeProduct)>::type> +{ + typedef Product SrcXprType; + static EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op &) + { + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + // FIXME shall we handle nested_eval here? + generic_product_impl::addTo(dst, src.lhs(), src.rhs()); + } +}; + +// Dense -= Product +template< typename DstXprType, typename Lhs, typename Rhs, int Options, typename Scalar> +struct Assignment, internal::sub_assign_op, Dense2Dense, + typename enable_if<(Options==DefaultProduct || Options==AliasFreeProduct)>::type> +{ + typedef Product SrcXprType; + static EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op &) + { + eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); + // FIXME shall we handle nested_eval here? + generic_product_impl::subTo(dst, src.lhs(), src.rhs()); + } +}; + + +// Dense ?= scalar * Product +// TODO we should apply that rule if that's really helpful +// for instance, this is not good for inner products +template< typename DstXprType, typename Lhs, typename Rhs, typename AssignFunc, typename Scalar, typename ScalarBis, typename Plain> +struct Assignment, const CwiseNullaryOp,Plain>, + const Product >, AssignFunc, Dense2Dense> +{ + typedef CwiseBinaryOp, + const CwiseNullaryOp,Plain>, + const Product > SrcXprType; + static EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const AssignFunc& func) + { + call_assignment_no_alias(dst, (src.lhs().functor().m_other * src.rhs().lhs())*src.rhs().rhs(), func); + } +}; + +//---------------------------------------- +// Catch "Dense ?= xpr + Product<>" expression to save one temporary +// FIXME we could probably enable these rules for any product, i.e., not only Dense and DefaultProduct + +template +struct evaluator_assume_aliasing::Scalar>, const OtherXpr, + const Product >, DenseShape > { + static const bool value = true; +}; + +template +struct evaluator_assume_aliasing::Scalar>, const OtherXpr, + const Product >, DenseShape > { + static const bool value = true; +}; + +template +struct assignment_from_xpr_op_product +{ + template + static EIGEN_STRONG_INLINE + void run(DstXprType &dst, const SrcXprType &src, const InitialFunc& /*func*/) + { + call_assignment_no_alias(dst, src.lhs(), Func1()); + call_assignment_no_alias(dst, src.rhs(), Func2()); + } +}; + +#define EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(ASSIGN_OP,BINOP,ASSIGN_OP2) \ + template< typename DstXprType, typename OtherXpr, typename Lhs, typename Rhs, typename DstScalar, typename SrcScalar, typename OtherScalar,typename ProdScalar> \ + struct Assignment, const OtherXpr, \ + const Product >, internal::ASSIGN_OP, Dense2Dense> \ + : assignment_from_xpr_op_product, internal::ASSIGN_OP, internal::ASSIGN_OP2 > \ + {} + +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(assign_op, scalar_sum_op,add_assign_op); +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(add_assign_op,scalar_sum_op,add_assign_op); +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(sub_assign_op,scalar_sum_op,sub_assign_op); + +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(assign_op, scalar_difference_op,sub_assign_op); +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(add_assign_op,scalar_difference_op,sub_assign_op); +EIGEN_CATCH_ASSIGN_XPR_OP_PRODUCT(sub_assign_op,scalar_difference_op,add_assign_op); + +//---------------------------------------- + +template +struct generic_product_impl +{ + template + static EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + dst.coeffRef(0,0) = (lhs.transpose().cwiseProduct(rhs)).sum(); + } + + template + static EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + dst.coeffRef(0,0) += (lhs.transpose().cwiseProduct(rhs)).sum(); + } + + template + static EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { dst.coeffRef(0,0) -= (lhs.transpose().cwiseProduct(rhs)).sum(); } +}; + + +/*********************************************************************** +* Implementation of outer dense * dense vector product +***********************************************************************/ + +// Column major result +template +void outer_product_selector_run(Dst& dst, const Lhs &lhs, const Rhs &rhs, const Func& func, const false_type&) +{ + evaluator rhsEval(rhs); + typename nested_eval::type actual_lhs(lhs); + // FIXME if cols is large enough, then it might be useful to make sure that lhs is sequentially stored + // FIXME not very good if rhs is real and lhs complex while alpha is real too + const Index cols = dst.cols(); + for (Index j=0; j +void outer_product_selector_run(Dst& dst, const Lhs &lhs, const Rhs &rhs, const Func& func, const true_type&) +{ + evaluator lhsEval(lhs); + typename nested_eval::type actual_rhs(rhs); + // FIXME if rows is large enough, then it might be useful to make sure that rhs is sequentially stored + // FIXME not very good if lhs is real and rhs complex while alpha is real too + const Index rows = dst.rows(); + for (Index i=0; i +struct generic_product_impl +{ + template struct is_row_major : internal::conditional<(int(T::Flags)&RowMajorBit), internal::true_type, internal::false_type>::type {}; + typedef typename Product::Scalar Scalar; + + // TODO it would be nice to be able to exploit our *_assign_op functors for that purpose + struct set { template void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() = src; } }; + struct add { template void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() += src; } }; + struct sub { template void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() -= src; } }; + struct adds { + Scalar m_scale; + explicit adds(const Scalar& s) : m_scale(s) {} + template void operator()(const Dst& dst, const Src& src) const { + dst.const_cast_derived() += m_scale * src; + } + }; + + template + static EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + internal::outer_product_selector_run(dst, lhs, rhs, set(), is_row_major()); + } + + template + static EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + internal::outer_product_selector_run(dst, lhs, rhs, add(), is_row_major()); + } + + template + static EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + internal::outer_product_selector_run(dst, lhs, rhs, sub(), is_row_major()); + } + + template + static EIGEN_STRONG_INLINE void scaleAndAddTo(Dst& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + internal::outer_product_selector_run(dst, lhs, rhs, adds(alpha), is_row_major()); + } + +}; + + +// This base class provides default implementations for evalTo, addTo, subTo, in terms of scaleAndAddTo +template +struct generic_product_impl_base +{ + typedef typename Product::Scalar Scalar; + + template + static EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { dst.setZero(); scaleAndAddTo(dst, lhs, rhs, Scalar(1)); } + + template + static EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { scaleAndAddTo(dst,lhs, rhs, Scalar(1)); } + + template + static EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { scaleAndAddTo(dst, lhs, rhs, Scalar(-1)); } + + template + static EIGEN_STRONG_INLINE void scaleAndAddTo(Dst& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { Derived::scaleAndAddTo(dst,lhs,rhs,alpha); } + +}; + +template +struct generic_product_impl + : generic_product_impl_base > +{ + typedef typename nested_eval::type LhsNested; + typedef typename nested_eval::type RhsNested; + typedef typename Product::Scalar Scalar; + enum { Side = Lhs::IsVectorAtCompileTime ? OnTheLeft : OnTheRight }; + typedef typename internal::remove_all::type>::type MatrixType; + + template + static EIGEN_STRONG_INLINE void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + LhsNested actual_lhs(lhs); + RhsNested actual_rhs(rhs); + internal::gemv_dense_selector::HasUsableDirectAccess) + >::run(actual_lhs, actual_rhs, dst, alpha); + } +}; + +template +struct generic_product_impl +{ + typedef typename Product::Scalar Scalar; + + template + static EIGEN_STRONG_INLINE void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // Same as: dst.noalias() = lhs.lazyProduct(rhs); + // but easier on the compiler side + call_assignment_no_alias(dst, lhs.lazyProduct(rhs), internal::assign_op()); + } + + template + static EIGEN_STRONG_INLINE void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // dst.noalias() += lhs.lazyProduct(rhs); + call_assignment_no_alias(dst, lhs.lazyProduct(rhs), internal::add_assign_op()); + } + + template + static EIGEN_STRONG_INLINE void subTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) + { + // dst.noalias() -= lhs.lazyProduct(rhs); + call_assignment_no_alias(dst, lhs.lazyProduct(rhs), internal::sub_assign_op()); + } + +// template +// static inline void scaleAndAddTo(Dst& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) +// { dst.noalias() += alpha * lhs.lazyProduct(rhs); } +}; + +// This specialization enforces the use of a coefficient-based evaluation strategy +template +struct generic_product_impl + : generic_product_impl {}; + +// Case 2: Evaluate coeff by coeff +// +// This is mostly taken from CoeffBasedProduct.h +// The main difference is that we add an extra argument to the etor_product_*_impl::run() function +// for the inner dimension of the product, because evaluator object do not know their size. + +template +struct etor_product_coeff_impl; + +template +struct etor_product_packet_impl; + +template +struct product_evaluator, ProductTag, DenseShape, DenseShape> + : evaluator_base > +{ + typedef Product XprType; + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + explicit product_evaluator(const XprType& xpr) + : m_lhs(xpr.lhs()), + m_rhs(xpr.rhs()), + m_lhsImpl(m_lhs), // FIXME the creation of the evaluator objects should result in a no-op, but check that! + m_rhsImpl(m_rhs), // Moreover, they are only useful for the packet path, so we could completely disable them when not needed, + // or perhaps declare them on the fly on the packet method... We have experiment to check what's best. + m_innerDim(xpr.lhs().cols()) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(NumTraits::MulCost); + EIGEN_INTERNAL_CHECK_COST_VALUE(NumTraits::AddCost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); +#if 0 + std::cerr << "LhsOuterStrideBytes= " << LhsOuterStrideBytes << "\n"; + std::cerr << "RhsOuterStrideBytes= " << RhsOuterStrideBytes << "\n"; + std::cerr << "LhsAlignment= " << LhsAlignment << "\n"; + std::cerr << "RhsAlignment= " << RhsAlignment << "\n"; + std::cerr << "CanVectorizeLhs= " << CanVectorizeLhs << "\n"; + std::cerr << "CanVectorizeRhs= " << CanVectorizeRhs << "\n"; + std::cerr << "CanVectorizeInner= " << CanVectorizeInner << "\n"; + std::cerr << "EvalToRowMajor= " << EvalToRowMajor << "\n"; + std::cerr << "Alignment= " << Alignment << "\n"; + std::cerr << "Flags= " << Flags << "\n"; +#endif + } + + // Everything below here is taken from CoeffBasedProduct.h + + typedef typename internal::nested_eval::type LhsNested; + typedef typename internal::nested_eval::type RhsNested; + + typedef typename internal::remove_all::type LhsNestedCleaned; + typedef typename internal::remove_all::type RhsNestedCleaned; + + typedef evaluator LhsEtorType; + typedef evaluator RhsEtorType; + + enum { + RowsAtCompileTime = LhsNestedCleaned::RowsAtCompileTime, + ColsAtCompileTime = RhsNestedCleaned::ColsAtCompileTime, + InnerSize = EIGEN_SIZE_MIN_PREFER_FIXED(LhsNestedCleaned::ColsAtCompileTime, RhsNestedCleaned::RowsAtCompileTime), + MaxRowsAtCompileTime = LhsNestedCleaned::MaxRowsAtCompileTime, + MaxColsAtCompileTime = RhsNestedCleaned::MaxColsAtCompileTime + }; + + typedef typename find_best_packet::type LhsVecPacketType; + typedef typename find_best_packet::type RhsVecPacketType; + + enum { + + LhsCoeffReadCost = LhsEtorType::CoeffReadCost, + RhsCoeffReadCost = RhsEtorType::CoeffReadCost, + CoeffReadCost = InnerSize==0 ? NumTraits::ReadCost + : InnerSize == Dynamic ? HugeCost + : InnerSize * (NumTraits::MulCost + LhsCoeffReadCost + RhsCoeffReadCost) + + (InnerSize - 1) * NumTraits::AddCost, + + Unroll = CoeffReadCost <= EIGEN_UNROLLING_LIMIT, + + LhsFlags = LhsEtorType::Flags, + RhsFlags = RhsEtorType::Flags, + + LhsRowMajor = LhsFlags & RowMajorBit, + RhsRowMajor = RhsFlags & RowMajorBit, + + LhsVecPacketSize = unpacket_traits::size, + RhsVecPacketSize = unpacket_traits::size, + + // Here, we don't care about alignment larger than the usable packet size. + LhsAlignment = EIGEN_PLAIN_ENUM_MIN(LhsEtorType::Alignment,LhsVecPacketSize*int(sizeof(typename LhsNestedCleaned::Scalar))), + RhsAlignment = EIGEN_PLAIN_ENUM_MIN(RhsEtorType::Alignment,RhsVecPacketSize*int(sizeof(typename RhsNestedCleaned::Scalar))), + + SameType = is_same::value, + + CanVectorizeRhs = bool(RhsRowMajor) && (RhsFlags & PacketAccessBit) && (ColsAtCompileTime!=1), + CanVectorizeLhs = (!LhsRowMajor) && (LhsFlags & PacketAccessBit) && (RowsAtCompileTime!=1), + + EvalToRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1 + : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0 + : (bool(RhsRowMajor) && !CanVectorizeLhs), + + Flags = ((unsigned int)(LhsFlags | RhsFlags) & HereditaryBits & ~RowMajorBit) + | (EvalToRowMajor ? RowMajorBit : 0) + // TODO enable vectorization for mixed types + | (SameType && (CanVectorizeLhs || CanVectorizeRhs) ? PacketAccessBit : 0) + | (XprType::IsVectorAtCompileTime ? LinearAccessBit : 0), + + LhsOuterStrideBytes = int(LhsNestedCleaned::OuterStrideAtCompileTime) * int(sizeof(typename LhsNestedCleaned::Scalar)), + RhsOuterStrideBytes = int(RhsNestedCleaned::OuterStrideAtCompileTime) * int(sizeof(typename RhsNestedCleaned::Scalar)), + + Alignment = bool(CanVectorizeLhs) ? (LhsOuterStrideBytes<=0 || (int(LhsOuterStrideBytes) % EIGEN_PLAIN_ENUM_MAX(1,LhsAlignment))!=0 ? 0 : LhsAlignment) + : bool(CanVectorizeRhs) ? (RhsOuterStrideBytes<=0 || (int(RhsOuterStrideBytes) % EIGEN_PLAIN_ENUM_MAX(1,RhsAlignment))!=0 ? 0 : RhsAlignment) + : 0, + + /* CanVectorizeInner deserves special explanation. It does not affect the product flags. It is not used outside + * of Product. If the Product itself is not a packet-access expression, there is still a chance that the inner + * loop of the product might be vectorized. This is the meaning of CanVectorizeInner. Since it doesn't affect + * the Flags, it is safe to make this value depend on ActualPacketAccessBit, that doesn't affect the ABI. + */ + CanVectorizeInner = SameType + && LhsRowMajor + && (!RhsRowMajor) + && (LhsFlags & RhsFlags & ActualPacketAccessBit) + && (InnerSize % packet_traits::size == 0) + }; + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index row, Index col) const + { + return (m_lhs.row(row).transpose().cwiseProduct( m_rhs.col(col) )).sum(); + } + + /* Allow index-based non-packet access. It is impossible though to allow index-based packed access, + * which is why we don't set the LinearAccessBit. + * TODO: this seems possible when the result is a vector + */ + EIGEN_DEVICE_FUNC const CoeffReturnType coeff(Index index) const + { + const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index; + const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0; + return (m_lhs.row(row).transpose().cwiseProduct( m_rhs.col(col) )).sum(); + } + + template + const PacketType packet(Index row, Index col) const + { + PacketType res; + typedef etor_product_packet_impl PacketImpl; + PacketImpl::run(row, col, m_lhsImpl, m_rhsImpl, m_innerDim, res); + return res; + } + + template + const PacketType packet(Index index) const + { + const Index row = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? 0 : index; + const Index col = (RowsAtCompileTime == 1 || MaxRowsAtCompileTime==1) ? index : 0; + return packet(row,col); + } + +protected: + typename internal::add_const_on_value_type::type m_lhs; + typename internal::add_const_on_value_type::type m_rhs; + + LhsEtorType m_lhsImpl; + RhsEtorType m_rhsImpl; + + // TODO: Get rid of m_innerDim if known at compile time + Index m_innerDim; +}; + +template +struct product_evaluator, LazyCoeffBasedProductMode, DenseShape, DenseShape> + : product_evaluator, CoeffBasedProductMode, DenseShape, DenseShape> +{ + typedef Product XprType; + typedef Product BaseProduct; + typedef product_evaluator Base; + enum { + Flags = Base::Flags | EvalBeforeNestingBit + }; + EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) + : Base(BaseProduct(xpr.lhs(),xpr.rhs())) + {} +}; + +/**************************************** +*** Coeff based product, Packet path *** +****************************************/ + +template +struct etor_product_packet_impl +{ + static EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index innerDim, Packet &res) + { + etor_product_packet_impl::run(row, col, lhs, rhs, innerDim, res); + res = pmadd(pset1(lhs.coeff(row, Index(UnrollingIndex-1))), rhs.template packet(Index(UnrollingIndex-1), col), res); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index innerDim, Packet &res) + { + etor_product_packet_impl::run(row, col, lhs, rhs, innerDim, res); + res = pmadd(lhs.template packet(row, Index(UnrollingIndex-1)), pset1(rhs.coeff(Index(UnrollingIndex-1), col)), res); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index /*innerDim*/, Packet &res) + { + res = pmul(pset1(lhs.coeff(row, Index(0))),rhs.template packet(Index(0), col)); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index /*innerDim*/, Packet &res) + { + res = pmul(lhs.template packet(row, Index(0)), pset1(rhs.coeff(Index(0), col))); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_STRONG_INLINE void run(Index /*row*/, Index /*col*/, const Lhs& /*lhs*/, const Rhs& /*rhs*/, Index /*innerDim*/, Packet &res) + { + res = pset1(typename unpacket_traits::type(0)); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_STRONG_INLINE void run(Index /*row*/, Index /*col*/, const Lhs& /*lhs*/, const Rhs& /*rhs*/, Index /*innerDim*/, Packet &res) + { + res = pset1(typename unpacket_traits::type(0)); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index innerDim, Packet& res) + { + res = pset1(typename unpacket_traits::type(0)); + for(Index i = 0; i < innerDim; ++i) + res = pmadd(pset1(lhs.coeff(row, i)), rhs.template packet(i, col), res); + } +}; + +template +struct etor_product_packet_impl +{ + static EIGEN_STRONG_INLINE void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, Index innerDim, Packet& res) + { + res = pset1(typename unpacket_traits::type(0)); + for(Index i = 0; i < innerDim; ++i) + res = pmadd(lhs.template packet(row, i), pset1(rhs.coeff(i, col)), res); + } +}; + + +/*************************************************************************** +* Triangular products +***************************************************************************/ +template +struct triangular_product_impl; + +template +struct generic_product_impl + : generic_product_impl_base > +{ + typedef typename Product::Scalar Scalar; + + template + static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + triangular_product_impl + ::run(dst, lhs.nestedExpression(), rhs, alpha); + } +}; + +template +struct generic_product_impl +: generic_product_impl_base > +{ + typedef typename Product::Scalar Scalar; + + template + static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + triangular_product_impl::run(dst, lhs, rhs.nestedExpression(), alpha); + } +}; + + +/*************************************************************************** +* SelfAdjoint products +***************************************************************************/ +template +struct selfadjoint_product_impl; + +template +struct generic_product_impl + : generic_product_impl_base > +{ + typedef typename Product::Scalar Scalar; + + template + static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + selfadjoint_product_impl::run(dst, lhs.nestedExpression(), rhs, alpha); + } +}; + +template +struct generic_product_impl +: generic_product_impl_base > +{ + typedef typename Product::Scalar Scalar; + + template + static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) + { + selfadjoint_product_impl::run(dst, lhs, rhs.nestedExpression(), alpha); + } +}; + + +/*************************************************************************** +* Diagonal products +***************************************************************************/ + +template +struct diagonal_product_evaluator_base + : evaluator_base +{ + typedef typename ScalarBinaryOpTraits::ReturnType Scalar; +public: + enum { + CoeffReadCost = NumTraits::MulCost + evaluator::CoeffReadCost + evaluator::CoeffReadCost, + + MatrixFlags = evaluator::Flags, + DiagFlags = evaluator::Flags, + _StorageOrder = MatrixFlags & RowMajorBit ? RowMajor : ColMajor, + _ScalarAccessOnDiag = !((int(_StorageOrder) == ColMajor && int(ProductOrder) == OnTheLeft) + ||(int(_StorageOrder) == RowMajor && int(ProductOrder) == OnTheRight)), + _SameTypes = is_same::value, + // FIXME currently we need same types, but in the future the next rule should be the one + //_Vectorizable = bool(int(MatrixFlags)&PacketAccessBit) && ((!_PacketOnDiag) || (_SameTypes && bool(int(DiagFlags)&PacketAccessBit))), + _Vectorizable = bool(int(MatrixFlags)&PacketAccessBit) && _SameTypes && (_ScalarAccessOnDiag || (bool(int(DiagFlags)&PacketAccessBit))), + _LinearAccessMask = (MatrixType::RowsAtCompileTime==1 || MatrixType::ColsAtCompileTime==1) ? LinearAccessBit : 0, + Flags = ((HereditaryBits|_LinearAccessMask) & (unsigned int)(MatrixFlags)) | (_Vectorizable ? PacketAccessBit : 0), + Alignment = evaluator::Alignment, + + AsScalarProduct = (DiagonalType::SizeAtCompileTime==1) + || (DiagonalType::SizeAtCompileTime==Dynamic && MatrixType::RowsAtCompileTime==1 && ProductOrder==OnTheLeft) + || (DiagonalType::SizeAtCompileTime==Dynamic && MatrixType::ColsAtCompileTime==1 && ProductOrder==OnTheRight) + }; + + diagonal_product_evaluator_base(const MatrixType &mat, const DiagonalType &diag) + : m_diagImpl(diag), m_matImpl(mat) + { + EIGEN_INTERNAL_CHECK_COST_VALUE(NumTraits::MulCost); + EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index idx) const + { + if(AsScalarProduct) + return m_diagImpl.coeff(0) * m_matImpl.coeff(idx); + else + return m_diagImpl.coeff(idx) * m_matImpl.coeff(idx); + } + +protected: + template + EIGEN_STRONG_INLINE PacketType packet_impl(Index row, Index col, Index id, internal::true_type) const + { + return internal::pmul(m_matImpl.template packet(row, col), + internal::pset1(m_diagImpl.coeff(id))); + } + + template + EIGEN_STRONG_INLINE PacketType packet_impl(Index row, Index col, Index id, internal::false_type) const + { + enum { + InnerSize = (MatrixType::Flags & RowMajorBit) ? MatrixType::ColsAtCompileTime : MatrixType::RowsAtCompileTime, + DiagonalPacketLoadMode = EIGEN_PLAIN_ENUM_MIN(LoadMode,((InnerSize%16) == 0) ? int(Aligned16) : int(evaluator::Alignment)) // FIXME hardcoded 16!! + }; + return internal::pmul(m_matImpl.template packet(row, col), + m_diagImpl.template packet(id)); + } + + evaluator m_diagImpl; + evaluator m_matImpl; +}; + +// diagonal * dense +template +struct product_evaluator, ProductTag, DiagonalShape, DenseShape> + : diagonal_product_evaluator_base, OnTheLeft> +{ + typedef diagonal_product_evaluator_base, OnTheLeft> Base; + using Base::m_diagImpl; + using Base::m_matImpl; + using Base::coeff; + typedef typename Base::Scalar Scalar; + + typedef Product XprType; + typedef typename XprType::PlainObject PlainObject; + + enum { + StorageOrder = int(Rhs::Flags) & RowMajorBit ? RowMajor : ColMajor + }; + + EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) + : Base(xpr.rhs(), xpr.lhs().diagonal()) + { + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const + { + return m_diagImpl.coeff(row) * m_matImpl.coeff(row, col); + } + +#ifndef __CUDACC__ + template + EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const + { + // FIXME: NVCC used to complain about the template keyword, but we have to check whether this is still the case. + // See also similar calls below. + return this->template packet_impl(row,col, row, + typename internal::conditional::type()); + } + + template + EIGEN_STRONG_INLINE PacketType packet(Index idx) const + { + return packet(int(StorageOrder)==ColMajor?idx:0,int(StorageOrder)==ColMajor?0:idx); + } +#endif +}; + +// dense * diagonal +template +struct product_evaluator, ProductTag, DenseShape, DiagonalShape> + : diagonal_product_evaluator_base, OnTheRight> +{ + typedef diagonal_product_evaluator_base, OnTheRight> Base; + using Base::m_diagImpl; + using Base::m_matImpl; + using Base::coeff; + typedef typename Base::Scalar Scalar; + + typedef Product XprType; + typedef typename XprType::PlainObject PlainObject; + + enum { StorageOrder = int(Lhs::Flags) & RowMajorBit ? RowMajor : ColMajor }; + + EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) + : Base(xpr.lhs(), xpr.rhs().diagonal()) + { + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const + { + return m_matImpl.coeff(row, col) * m_diagImpl.coeff(col); + } + +#ifndef __CUDACC__ + template + EIGEN_STRONG_INLINE PacketType packet(Index row, Index col) const + { + return this->template packet_impl(row,col, col, + typename internal::conditional::type()); + } + + template + EIGEN_STRONG_INLINE PacketType packet(Index idx) const + { + return packet(int(StorageOrder)==ColMajor?idx:0,int(StorageOrder)==ColMajor?0:idx); + } +#endif +}; + +/*************************************************************************** +* Products with permutation matrices +***************************************************************************/ + +/** \internal + * \class permutation_matrix_product + * Internal helper class implementing the product between a permutation matrix and a matrix. + * This class is specialized for DenseShape below and for SparseShape in SparseCore/SparsePermutation.h + */ +template +struct permutation_matrix_product; + +template +struct permutation_matrix_product +{ + typedef typename nested_eval::type MatrixType; + typedef typename remove_all::type MatrixTypeCleaned; + + template + static inline void run(Dest& dst, const PermutationType& perm, const ExpressionType& xpr) + { + MatrixType mat(xpr); + const Index n = Side==OnTheLeft ? mat.rows() : mat.cols(); + // FIXME we need an is_same for expression that is not sensitive to constness. For instance + // is_same_xpr, Block >::value should be true. + //if(is_same::value && extract_data(dst) == extract_data(mat)) + if(is_same_dense(dst, mat)) + { + // apply the permutation inplace + Matrix mask(perm.size()); + mask.fill(false); + Index r = 0; + while(r < perm.size()) + { + // search for the next seed + while(r=perm.size()) + break; + // we got one, let's follow it until we are back to the seed + Index k0 = r++; + Index kPrev = k0; + mask.coeffRef(k0) = true; + for(Index k=perm.indices().coeff(k0); k!=k0; k=perm.indices().coeff(k)) + { + Block(dst, k) + .swap(Block + (dst,((Side==OnTheLeft) ^ Transposed) ? k0 : kPrev)); + + mask.coeffRef(k) = true; + kPrev = k; + } + } + } + else + { + for(Index i = 0; i < n; ++i) + { + Block + (dst, ((Side==OnTheLeft) ^ Transposed) ? perm.indices().coeff(i) : i) + + = + + Block + (mat, ((Side==OnTheRight) ^ Transposed) ? perm.indices().coeff(i) : i); + } + } + } +}; + +template +struct generic_product_impl +{ + template + static void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + permutation_matrix_product::run(dst, lhs, rhs); + } +}; + +template +struct generic_product_impl +{ + template + static void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + permutation_matrix_product::run(dst, rhs, lhs); + } +}; + +template +struct generic_product_impl, Rhs, PermutationShape, MatrixShape, ProductTag> +{ + template + static void evalTo(Dest& dst, const Inverse& lhs, const Rhs& rhs) + { + permutation_matrix_product::run(dst, lhs.nestedExpression(), rhs); + } +}; + +template +struct generic_product_impl, MatrixShape, PermutationShape, ProductTag> +{ + template + static void evalTo(Dest& dst, const Lhs& lhs, const Inverse& rhs) + { + permutation_matrix_product::run(dst, rhs.nestedExpression(), lhs); + } +}; + + +/*************************************************************************** +* Products with transpositions matrices +***************************************************************************/ + +// FIXME could we unify Transpositions and Permutation into a single "shape"?? + +/** \internal + * \class transposition_matrix_product + * Internal helper class implementing the product between a permutation matrix and a matrix. + */ +template +struct transposition_matrix_product +{ + typedef typename nested_eval::type MatrixType; + typedef typename remove_all::type MatrixTypeCleaned; + + template + static inline void run(Dest& dst, const TranspositionType& tr, const ExpressionType& xpr) + { + MatrixType mat(xpr); + typedef typename TranspositionType::StorageIndex StorageIndex; + const Index size = tr.size(); + StorageIndex j = 0; + + if(!is_same_dense(dst,mat)) + dst = mat; + + for(Index k=(Transposed?size-1:0) ; Transposed?k>=0:k +struct generic_product_impl +{ + template + static void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + transposition_matrix_product::run(dst, lhs, rhs); + } +}; + +template +struct generic_product_impl +{ + template + static void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) + { + transposition_matrix_product::run(dst, rhs, lhs); + } +}; + + +template +struct generic_product_impl, Rhs, TranspositionsShape, MatrixShape, ProductTag> +{ + template + static void evalTo(Dest& dst, const Transpose& lhs, const Rhs& rhs) + { + transposition_matrix_product::run(dst, lhs.nestedExpression(), rhs); + } +}; + +template +struct generic_product_impl, MatrixShape, TranspositionsShape, ProductTag> +{ + template + static void evalTo(Dest& dst, const Lhs& lhs, const Transpose& rhs) + { + transposition_matrix_product::run(dst, rhs.nestedExpression(), lhs); + } +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_PRODUCT_EVALUATORS_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Random.h b/SudoDEM2D/lib/Eigen/src/Core/Random.h new file mode 100644 index 0000000..6faf789 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Random.h @@ -0,0 +1,182 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 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_RANDOM_H +#define EIGEN_RANDOM_H + +namespace Eigen { + +namespace internal { + +template struct scalar_random_op { + EIGEN_EMPTY_STRUCT_CTOR(scalar_random_op) + inline const Scalar operator() () const { return random(); } +}; + +template +struct functor_traits > +{ enum { Cost = 5 * NumTraits::MulCost, PacketAccess = false, IsRepeatable = false }; }; + +} // end namespace internal + +/** \returns a random matrix expression + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * The parameters \a rows and \a cols are the number of rows and of columns of + * the returned matrix. Must be compatible with this MatrixBase type. + * + * \not_reentrant + * + * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, + * it is redundant to pass \a rows and \a cols as arguments, so Random() should be used + * instead. + * + * + * Example: \include MatrixBase_random_int_int.cpp + * Output: \verbinclude MatrixBase_random_int_int.out + * + * This expression has the "evaluate before nesting" flag so that it will be evaluated into + * a temporary matrix whenever it is nested in a larger expression. This prevents unexpected + * behavior with expressions involving random matrices. + * + * See DenseBase::NullaryExpr(Index, const CustomNullaryOp&) for an example using C++11 random generators. + * + * \sa DenseBase::setRandom(), DenseBase::Random(Index), DenseBase::Random() + */ +template +inline const typename DenseBase::RandomReturnType +DenseBase::Random(Index rows, Index cols) +{ + return NullaryExpr(rows, cols, internal::scalar_random_op()); +} + +/** \returns a random vector expression + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * The parameter \a size is the size of the returned vector. + * Must be compatible with this MatrixBase type. + * + * \only_for_vectors + * \not_reentrant + * + * This variant is meant to be used for dynamic-size vector types. For fixed-size types, + * it is redundant to pass \a size as argument, so Random() should be used + * instead. + * + * Example: \include MatrixBase_random_int.cpp + * Output: \verbinclude MatrixBase_random_int.out + * + * This expression has the "evaluate before nesting" flag so that it will be evaluated into + * a temporary vector whenever it is nested in a larger expression. This prevents unexpected + * behavior with expressions involving random matrices. + * + * \sa DenseBase::setRandom(), DenseBase::Random(Index,Index), DenseBase::Random() + */ +template +inline const typename DenseBase::RandomReturnType +DenseBase::Random(Index size) +{ + return NullaryExpr(size, internal::scalar_random_op()); +} + +/** \returns a fixed-size random matrix or vector expression + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you + * need to use the variants taking size arguments. + * + * Example: \include MatrixBase_random.cpp + * Output: \verbinclude MatrixBase_random.out + * + * This expression has the "evaluate before nesting" flag so that it will be evaluated into + * a temporary matrix whenever it is nested in a larger expression. This prevents unexpected + * behavior with expressions involving random matrices. + * + * \not_reentrant + * + * \sa DenseBase::setRandom(), DenseBase::Random(Index,Index), DenseBase::Random(Index) + */ +template +inline const typename DenseBase::RandomReturnType +DenseBase::Random() +{ + return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_random_op()); +} + +/** Sets all coefficients in this expression to random values. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \not_reentrant + * + * Example: \include MatrixBase_setRandom.cpp + * Output: \verbinclude MatrixBase_setRandom.out + * + * \sa class CwiseNullaryOp, setRandom(Index), setRandom(Index,Index) + */ +template +inline Derived& DenseBase::setRandom() +{ + return *this = Random(rows(), cols()); +} + +/** Resizes to the given \a newSize, and sets all coefficients in this expression to random values. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \only_for_vectors + * \not_reentrant + * + * Example: \include Matrix_setRandom_int.cpp + * Output: \verbinclude Matrix_setRandom_int.out + * + * \sa DenseBase::setRandom(), setRandom(Index,Index), class CwiseNullaryOp, DenseBase::Random() + */ +template +EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setRandom(Index newSize) +{ + resize(newSize); + return setRandom(); +} + +/** Resizes to the given size, and sets all coefficients in this expression to random values. + * + * Numbers are uniformly spread through their whole definition range for integer types, + * and in the [-1:1] range for floating point scalar types. + * + * \not_reentrant + * + * \param rows the new number of rows + * \param cols the new number of columns + * + * Example: \include Matrix_setRandom_int_int.cpp + * Output: \verbinclude Matrix_setRandom_int_int.out + * + * \sa DenseBase::setRandom(), setRandom(Index), class CwiseNullaryOp, DenseBase::Random() + */ +template +EIGEN_STRONG_INLINE Derived& +PlainObjectBase::setRandom(Index rows, Index cols) +{ + resize(rows, cols); + return setRandom(); +} + +} // end namespace Eigen + +#endif // EIGEN_RANDOM_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Redux.h b/SudoDEM2D/lib/Eigen/src/Core/Redux.h new file mode 100644 index 0000000..760e9f8 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Redux.h @@ -0,0 +1,505 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008 Gael Guennebaud +// Copyright (C) 2006-2008 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_REDUX_H +#define EIGEN_REDUX_H + +namespace Eigen { + +namespace internal { + +// TODO +// * implement other kind of vectorization +// * factorize code + +/*************************************************************************** +* Part 1 : the logic deciding a strategy for vectorization and unrolling +***************************************************************************/ + +template +struct redux_traits +{ +public: + typedef typename find_best_packet::type PacketType; + enum { + PacketSize = unpacket_traits::size, + InnerMaxSize = int(Derived::IsRowMajor) + ? Derived::MaxColsAtCompileTime + : Derived::MaxRowsAtCompileTime + }; + + enum { + MightVectorize = (int(Derived::Flags)&ActualPacketAccessBit) + && (functor_traits::PacketAccess), + MayLinearVectorize = bool(MightVectorize) && (int(Derived::Flags)&LinearAccessBit), + MaySliceVectorize = bool(MightVectorize) && int(InnerMaxSize)>=3*PacketSize + }; + +public: + enum { + Traversal = int(MayLinearVectorize) ? int(LinearVectorizedTraversal) + : int(MaySliceVectorize) ? int(SliceVectorizedTraversal) + : int(DefaultTraversal) + }; + +public: + enum { + Cost = Derived::SizeAtCompileTime == Dynamic ? HugeCost + : Derived::SizeAtCompileTime * Derived::CoeffReadCost + (Derived::SizeAtCompileTime-1) * functor_traits::Cost, + UnrollingLimit = EIGEN_UNROLLING_LIMIT * (int(Traversal) == int(DefaultTraversal) ? 1 : int(PacketSize)) + }; + +public: + enum { + Unrolling = Cost <= UnrollingLimit ? CompleteUnrolling : NoUnrolling + }; + +#ifdef EIGEN_DEBUG_ASSIGN + static void debug() + { + std::cerr << "Xpr: " << typeid(typename Derived::XprType).name() << std::endl; + std::cerr.setf(std::ios::hex, std::ios::basefield); + EIGEN_DEBUG_VAR(Derived::Flags) + std::cerr.unsetf(std::ios::hex); + EIGEN_DEBUG_VAR(InnerMaxSize) + EIGEN_DEBUG_VAR(PacketSize) + EIGEN_DEBUG_VAR(MightVectorize) + EIGEN_DEBUG_VAR(MayLinearVectorize) + EIGEN_DEBUG_VAR(MaySliceVectorize) + EIGEN_DEBUG_VAR(Traversal) + EIGEN_DEBUG_VAR(UnrollingLimit) + EIGEN_DEBUG_VAR(Unrolling) + std::cerr << std::endl; + } +#endif +}; + +/*************************************************************************** +* Part 2 : unrollers +***************************************************************************/ + +/*** no vectorization ***/ + +template +struct redux_novec_unroller +{ + enum { + HalfLength = Length/2 + }; + + typedef typename Derived::Scalar Scalar; + + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Derived &mat, const Func& func) + { + return func(redux_novec_unroller::run(mat,func), + redux_novec_unroller::run(mat,func)); + } +}; + +template +struct redux_novec_unroller +{ + enum { + outer = Start / Derived::InnerSizeAtCompileTime, + inner = Start % Derived::InnerSizeAtCompileTime + }; + + typedef typename Derived::Scalar Scalar; + + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Derived &mat, const Func&) + { + return mat.coeffByOuterInner(outer, inner); + } +}; + +// This is actually dead code and will never be called. It is required +// to prevent false warnings regarding failed inlining though +// for 0 length run() will never be called at all. +template +struct redux_novec_unroller +{ + typedef typename Derived::Scalar Scalar; + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Derived&, const Func&) { return Scalar(); } +}; + +/*** vectorization ***/ + +template +struct redux_vec_unroller +{ + enum { + PacketSize = redux_traits::PacketSize, + HalfLength = Length/2 + }; + + typedef typename Derived::Scalar Scalar; + typedef typename redux_traits::PacketType PacketScalar; + + static EIGEN_STRONG_INLINE PacketScalar run(const Derived &mat, const Func& func) + { + return func.packetOp( + redux_vec_unroller::run(mat,func), + redux_vec_unroller::run(mat,func) ); + } +}; + +template +struct redux_vec_unroller +{ + enum { + index = Start * redux_traits::PacketSize, + outer = index / int(Derived::InnerSizeAtCompileTime), + inner = index % int(Derived::InnerSizeAtCompileTime), + alignment = Derived::Alignment + }; + + typedef typename Derived::Scalar Scalar; + typedef typename redux_traits::PacketType PacketScalar; + + static EIGEN_STRONG_INLINE PacketScalar run(const Derived &mat, const Func&) + { + return mat.template packetByOuterInner(outer, inner); + } +}; + +/*************************************************************************** +* Part 3 : implementation of all cases +***************************************************************************/ + +template::Traversal, + int Unrolling = redux_traits::Unrolling +> +struct redux_impl; + +template +struct redux_impl +{ + typedef typename Derived::Scalar Scalar; + EIGEN_DEVICE_FUNC + static EIGEN_STRONG_INLINE Scalar run(const Derived &mat, const Func& func) + { + eigen_assert(mat.rows()>0 && mat.cols()>0 && "you are using an empty matrix"); + Scalar res; + res = mat.coeffByOuterInner(0, 0); + for(Index i = 1; i < mat.innerSize(); ++i) + res = func(res, mat.coeffByOuterInner(0, i)); + for(Index i = 1; i < mat.outerSize(); ++i) + for(Index j = 0; j < mat.innerSize(); ++j) + res = func(res, mat.coeffByOuterInner(i, j)); + return res; + } +}; + +template +struct redux_impl + : public redux_novec_unroller +{}; + +template +struct redux_impl +{ + typedef typename Derived::Scalar Scalar; + typedef typename redux_traits::PacketType PacketScalar; + + static Scalar run(const Derived &mat, const Func& func) + { + const Index size = mat.size(); + + const Index packetSize = redux_traits::PacketSize; + const int packetAlignment = unpacket_traits::alignment; + enum { + alignment0 = (bool(Derived::Flags & DirectAccessBit) && bool(packet_traits::AlignedOnScalar)) ? int(packetAlignment) : int(Unaligned), + alignment = EIGEN_PLAIN_ENUM_MAX(alignment0, Derived::Alignment) + }; + const Index alignedStart = internal::first_default_aligned(mat.nestedExpression()); + const Index alignedSize2 = ((size-alignedStart)/(2*packetSize))*(2*packetSize); + const Index alignedSize = ((size-alignedStart)/(packetSize))*(packetSize); + const Index alignedEnd2 = alignedStart + alignedSize2; + const Index alignedEnd = alignedStart + alignedSize; + Scalar res; + if(alignedSize) + { + PacketScalar packet_res0 = mat.template packet(alignedStart); + if(alignedSize>packetSize) // we have at least two packets to partly unroll the loop + { + PacketScalar packet_res1 = mat.template packet(alignedStart+packetSize); + for(Index index = alignedStart + 2*packetSize; index < alignedEnd2; index += 2*packetSize) + { + packet_res0 = func.packetOp(packet_res0, mat.template packet(index)); + packet_res1 = func.packetOp(packet_res1, mat.template packet(index+packetSize)); + } + + packet_res0 = func.packetOp(packet_res0,packet_res1); + if(alignedEnd>alignedEnd2) + packet_res0 = func.packetOp(packet_res0, mat.template packet(alignedEnd2)); + } + res = func.predux(packet_res0); + + for(Index index = 0; index < alignedStart; ++index) + res = func(res,mat.coeff(index)); + + for(Index index = alignedEnd; index < size; ++index) + res = func(res,mat.coeff(index)); + } + else // too small to vectorize anything. + // since this is dynamic-size hence inefficient anyway for such small sizes, don't try to optimize. + { + res = mat.coeff(0); + for(Index index = 1; index < size; ++index) + res = func(res,mat.coeff(index)); + } + + return res; + } +}; + +// NOTE: for SliceVectorizedTraversal we simply bypass unrolling +template +struct redux_impl +{ + typedef typename Derived::Scalar Scalar; + typedef typename redux_traits::PacketType PacketType; + + EIGEN_DEVICE_FUNC static Scalar run(const Derived &mat, const Func& func) + { + eigen_assert(mat.rows()>0 && mat.cols()>0 && "you are using an empty matrix"); + const Index innerSize = mat.innerSize(); + const Index outerSize = mat.outerSize(); + enum { + packetSize = redux_traits::PacketSize + }; + const Index packetedInnerSize = ((innerSize)/packetSize)*packetSize; + Scalar res; + if(packetedInnerSize) + { + PacketType packet_res = mat.template packet(0,0); + for(Index j=0; j(j,i)); + + res = func.predux(packet_res); + for(Index j=0; j::run(mat, func); + } + + return res; + } +}; + +template +struct redux_impl +{ + typedef typename Derived::Scalar Scalar; + + typedef typename redux_traits::PacketType PacketScalar; + enum { + PacketSize = redux_traits::PacketSize, + Size = Derived::SizeAtCompileTime, + VectorizedSize = (Size / PacketSize) * PacketSize + }; + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Scalar run(const Derived &mat, const Func& func) + { + eigen_assert(mat.rows()>0 && mat.cols()>0 && "you are using an empty matrix"); + if (VectorizedSize > 0) { + Scalar res = func.predux(redux_vec_unroller::run(mat,func)); + if (VectorizedSize != Size) + res = func(res,redux_novec_unroller::run(mat,func)); + return res; + } + else { + return redux_novec_unroller::run(mat,func); + } + } +}; + +// evaluator adaptor +template +class redux_evaluator +{ +public: + typedef _XprType XprType; + EIGEN_DEVICE_FUNC explicit redux_evaluator(const XprType &xpr) : m_evaluator(xpr), m_xpr(xpr) {} + + typedef typename XprType::Scalar Scalar; + typedef typename XprType::CoeffReturnType CoeffReturnType; + typedef typename XprType::PacketScalar PacketScalar; + typedef typename XprType::PacketReturnType PacketReturnType; + + enum { + MaxRowsAtCompileTime = XprType::MaxRowsAtCompileTime, + MaxColsAtCompileTime = XprType::MaxColsAtCompileTime, + // TODO we should not remove DirectAccessBit and rather find an elegant way to query the alignment offset at runtime from the evaluator + Flags = evaluator::Flags & ~DirectAccessBit, + IsRowMajor = XprType::IsRowMajor, + SizeAtCompileTime = XprType::SizeAtCompileTime, + InnerSizeAtCompileTime = XprType::InnerSizeAtCompileTime, + CoeffReadCost = evaluator::CoeffReadCost, + Alignment = evaluator::Alignment + }; + + EIGEN_DEVICE_FUNC Index rows() const { return m_xpr.rows(); } + EIGEN_DEVICE_FUNC Index cols() const { return m_xpr.cols(); } + EIGEN_DEVICE_FUNC Index size() const { return m_xpr.size(); } + EIGEN_DEVICE_FUNC Index innerSize() const { return m_xpr.innerSize(); } + EIGEN_DEVICE_FUNC Index outerSize() const { return m_xpr.outerSize(); } + + EIGEN_DEVICE_FUNC + CoeffReturnType coeff(Index row, Index col) const + { return m_evaluator.coeff(row, col); } + + EIGEN_DEVICE_FUNC + CoeffReturnType coeff(Index index) const + { return m_evaluator.coeff(index); } + + template + PacketType packet(Index row, Index col) const + { return m_evaluator.template packet(row, col); } + + template + PacketType packet(Index index) const + { return m_evaluator.template packet(index); } + + EIGEN_DEVICE_FUNC + CoeffReturnType coeffByOuterInner(Index outer, Index inner) const + { return m_evaluator.coeff(IsRowMajor ? outer : inner, IsRowMajor ? inner : outer); } + + template + PacketType packetByOuterInner(Index outer, Index inner) const + { return m_evaluator.template packet(IsRowMajor ? outer : inner, IsRowMajor ? inner : outer); } + + const XprType & nestedExpression() const { return m_xpr; } + +protected: + internal::evaluator m_evaluator; + const XprType &m_xpr; +}; + +} // end namespace internal + +/*************************************************************************** +* Part 4 : public API +***************************************************************************/ + + +/** \returns the result of a full redux operation on the whole matrix or vector using \a func + * + * The template parameter \a BinaryOp is the type of the functor \a func which must be + * an associative operator. Both current C++98 and C++11 functor styles are handled. + * + * \sa DenseBase::sum(), DenseBase::minCoeff(), DenseBase::maxCoeff(), MatrixBase::colwise(), MatrixBase::rowwise() + */ +template +template +EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::redux(const Func& func) const +{ + eigen_assert(this->rows()>0 && this->cols()>0 && "you are using an empty matrix"); + + typedef typename internal::redux_evaluator ThisEvaluator; + ThisEvaluator thisEval(derived()); + + return internal::redux_impl::run(thisEval, func); +} + +/** \returns the minimum of all coefficients of \c *this. + * \warning the result is undefined if \c *this contains NaN. + */ +template +EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::minCoeff() const +{ + return derived().redux(Eigen::internal::scalar_min_op()); +} + +/** \returns the maximum of all coefficients of \c *this. + * \warning the result is undefined if \c *this contains NaN. + */ +template +EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::maxCoeff() const +{ + return derived().redux(Eigen::internal::scalar_max_op()); +} + +/** \returns the sum of all coefficients of \c *this + * + * If \c *this is empty, then the value 0 is returned. + * + * \sa trace(), prod(), mean() + */ +template +EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::sum() const +{ + if(SizeAtCompileTime==0 || (SizeAtCompileTime==Dynamic && size()==0)) + return Scalar(0); + return derived().redux(Eigen::internal::scalar_sum_op()); +} + +/** \returns the mean of all coefficients of *this +* +* \sa trace(), prod(), sum() +*/ +template +EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::mean() const +{ +#ifdef __INTEL_COMPILER + #pragma warning push + #pragma warning ( disable : 2259 ) +#endif + return Scalar(derived().redux(Eigen::internal::scalar_sum_op())) / Scalar(this->size()); +#ifdef __INTEL_COMPILER + #pragma warning pop +#endif +} + +/** \returns the product of all coefficients of *this + * + * Example: \include MatrixBase_prod.cpp + * Output: \verbinclude MatrixBase_prod.out + * + * \sa sum(), mean(), trace() + */ +template +EIGEN_STRONG_INLINE typename internal::traits::Scalar +DenseBase::prod() const +{ + if(SizeAtCompileTime==0 || (SizeAtCompileTime==Dynamic && size()==0)) + return Scalar(1); + return derived().redux(Eigen::internal::scalar_product_op()); +} + +/** \returns the trace of \c *this, i.e. the sum of the coefficients on the main diagonal. + * + * \c *this can be any matrix, not necessarily square. + * + * \sa diagonal(), sum() + */ +template +EIGEN_STRONG_INLINE typename internal::traits::Scalar +MatrixBase::trace() const +{ + return derived().diagonal().sum(); +} + +} // end namespace Eigen + +#endif // EIGEN_REDUX_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Ref.h b/SudoDEM2D/lib/Eigen/src/Core/Ref.h new file mode 100644 index 0000000..9c6e3c5 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Ref.h @@ -0,0 +1,283 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2012 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_REF_H +#define EIGEN_REF_H + +namespace Eigen { + +namespace internal { + +template +struct traits > + : public traits > +{ + typedef _PlainObjectType PlainObjectType; + typedef _StrideType StrideType; + enum { + Options = _Options, + Flags = traits >::Flags | NestByRefBit, + Alignment = traits >::Alignment + }; + + template struct match { + enum { + HasDirectAccess = internal::has_direct_access::ret, + StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || Derived::IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)), + InnerStrideMatch = int(StrideType::InnerStrideAtCompileTime)==int(Dynamic) + || int(StrideType::InnerStrideAtCompileTime)==int(Derived::InnerStrideAtCompileTime) + || (int(StrideType::InnerStrideAtCompileTime)==0 && int(Derived::InnerStrideAtCompileTime)==1), + OuterStrideMatch = Derived::IsVectorAtCompileTime + || int(StrideType::OuterStrideAtCompileTime)==int(Dynamic) || int(StrideType::OuterStrideAtCompileTime)==int(Derived::OuterStrideAtCompileTime), + // NOTE, this indirection of evaluator::Alignment is needed + // to workaround a very strange bug in MSVC related to the instantiation + // of has_*ary_operator in evaluator. + // This line is surprisingly very sensitive. For instance, simply adding parenthesis + // as "DerivedAlignment = (int(evaluator::Alignment))," will make MSVC fail... + DerivedAlignment = int(evaluator::Alignment), + AlignmentMatch = (int(traits::Alignment)==int(Unaligned)) || (DerivedAlignment >= int(Alignment)), // FIXME the first condition is not very clear, it should be replaced by the required alignment + ScalarTypeMatch = internal::is_same::value, + MatchAtCompileTime = HasDirectAccess && StorageOrderMatch && InnerStrideMatch && OuterStrideMatch && AlignmentMatch && ScalarTypeMatch + }; + typedef typename internal::conditional::type type; + }; + +}; + +template +struct traits > : public traits {}; + +} + +template class RefBase + : public MapBase +{ + typedef typename internal::traits::PlainObjectType PlainObjectType; + typedef typename internal::traits::StrideType StrideType; + +public: + + typedef MapBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(RefBase) + + EIGEN_DEVICE_FUNC inline Index innerStride() const + { + return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; + } + + EIGEN_DEVICE_FUNC inline Index outerStride() const + { + return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer() + : IsVectorAtCompileTime ? this->size() + : int(Flags)&RowMajorBit ? this->cols() + : this->rows(); + } + + EIGEN_DEVICE_FUNC RefBase() + : Base(0,RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime), + // Stride<> does not allow default ctor for Dynamic strides, so let' initialize it with dummy values: + m_stride(StrideType::OuterStrideAtCompileTime==Dynamic?0:StrideType::OuterStrideAtCompileTime, + StrideType::InnerStrideAtCompileTime==Dynamic?0:StrideType::InnerStrideAtCompileTime) + {} + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(RefBase) + +protected: + + typedef Stride StrideBase; + + template + EIGEN_DEVICE_FUNC void construct(Expression& expr) + { + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(PlainObjectType,Expression); + + if(PlainObjectType::RowsAtCompileTime==1) + { + eigen_assert(expr.rows()==1 || expr.cols()==1); + ::new (static_cast(this)) Base(expr.data(), 1, expr.size()); + } + else if(PlainObjectType::ColsAtCompileTime==1) + { + eigen_assert(expr.rows()==1 || expr.cols()==1); + ::new (static_cast(this)) Base(expr.data(), expr.size(), 1); + } + else + ::new (static_cast(this)) Base(expr.data(), expr.rows(), expr.cols()); + + if(Expression::IsVectorAtCompileTime && (!PlainObjectType::IsVectorAtCompileTime) && ((Expression::Flags&RowMajorBit)!=(PlainObjectType::Flags&RowMajorBit))) + ::new (&m_stride) StrideBase(expr.innerStride(), StrideType::InnerStrideAtCompileTime==0?0:1); + else + ::new (&m_stride) StrideBase(StrideType::OuterStrideAtCompileTime==0?0:expr.outerStride(), + StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride()); + } + + StrideBase m_stride; +}; + +/** \class Ref + * \ingroup Core_Module + * + * \brief A matrix or vector expression mapping an existing expression + * + * \tparam PlainObjectType the equivalent matrix type of the mapped data + * \tparam Options specifies the pointer alignment in bytes. It can be: \c #Aligned128, , \c #Aligned64, \c #Aligned32, \c #Aligned16, \c #Aligned8 or \c #Unaligned. + * The default is \c #Unaligned. + * \tparam StrideType optionally specifies strides. By default, Ref implies a contiguous storage along the inner dimension (inner stride==1), + * but accepts a variable outer stride (leading dimension). + * This can be overridden by specifying strides. + * The type passed here must be a specialization of the Stride template, see examples below. + * + * This class provides a way to write non-template functions taking Eigen objects as parameters while limiting the number of copies. + * A Ref<> object can represent either a const expression or a l-value: + * \code + * // in-out argument: + * void foo1(Ref x); + * + * // read-only const argument: + * void foo2(const Ref& x); + * \endcode + * + * In the in-out case, the input argument must satisfy the constraints of the actual Ref<> type, otherwise a compilation issue will be triggered. + * By default, a Ref can reference any dense vector expression of float having a contiguous memory layout. + * Likewise, a Ref can reference any column-major dense matrix expression of float whose column's elements are contiguously stored with + * the possibility to have a constant space in-between each column, i.e. the inner stride must be equal to 1, but the outer stride (or leading dimension) + * can be greater than the number of rows. + * + * In the const case, if the input expression does not match the above requirement, then it is evaluated into a temporary before being passed to the function. + * Here are some examples: + * \code + * MatrixXf A; + * VectorXf a; + * foo1(a.head()); // OK + * foo1(A.col()); // OK + * foo1(A.row()); // Compilation error because here innerstride!=1 + * foo2(A.row()); // Compilation error because A.row() is a 1xN object while foo2 is expecting a Nx1 object + * foo2(A.row().transpose()); // The row is copied into a contiguous temporary + * foo2(2*a); // The expression is evaluated into a temporary + * foo2(A.col().segment(2,4)); // No temporary + * \endcode + * + * The range of inputs that can be referenced without temporary can be enlarged using the last two template parameters. + * Here is an example accepting an innerstride!=1: + * \code + * // in-out argument: + * void foo3(Ref > x); + * foo3(A.row()); // OK + * \endcode + * The downside here is that the function foo3 might be significantly slower than foo1 because it won't be able to exploit vectorization, and will involve more + * expensive address computations even if the input is contiguously stored in memory. To overcome this issue, one might propose to overload internally calling a + * template function, e.g.: + * \code + * // in the .h: + * void foo(const Ref& A); + * void foo(const Ref >& A); + * + * // in the .cpp: + * template void foo_impl(const TypeOfA& A) { + * ... // crazy code goes here + * } + * void foo(const Ref& A) { foo_impl(A); } + * void foo(const Ref >& A) { foo_impl(A); } + * \endcode + * + * + * \sa PlainObjectBase::Map(), \ref TopicStorageOrders + */ +template class Ref + : public RefBase > +{ + private: + typedef internal::traits Traits; + template + EIGEN_DEVICE_FUNC inline Ref(const PlainObjectBase& expr, + typename internal::enable_if::MatchAtCompileTime),Derived>::type* = 0); + public: + + typedef RefBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Ref) + + + #ifndef EIGEN_PARSED_BY_DOXYGEN + template + EIGEN_DEVICE_FUNC inline Ref(PlainObjectBase& expr, + typename internal::enable_if::MatchAtCompileTime),Derived>::type* = 0) + { + EIGEN_STATIC_ASSERT(bool(Traits::template match::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); + Base::construct(expr.derived()); + } + template + EIGEN_DEVICE_FUNC inline Ref(const DenseBase& expr, + typename internal::enable_if::MatchAtCompileTime),Derived>::type* = 0) + #else + /** Implicit constructor from any dense expression */ + template + inline Ref(DenseBase& expr) + #endif + { + EIGEN_STATIC_ASSERT(bool(internal::is_lvalue::value), THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY); + EIGEN_STATIC_ASSERT(bool(Traits::template match::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); + EIGEN_STATIC_ASSERT(!Derived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY); + Base::construct(expr.const_cast_derived()); + } + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref) + +}; + +// this is the const ref version +template class Ref + : public RefBase > +{ + typedef internal::traits Traits; + public: + + typedef RefBase Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Ref) + + template + EIGEN_DEVICE_FUNC inline Ref(const DenseBase& expr, + typename internal::enable_if::ScalarTypeMatch),Derived>::type* = 0) + { +// std::cout << match_helper::HasDirectAccess << "," << match_helper::OuterStrideMatch << "," << match_helper::InnerStrideMatch << "\n"; +// std::cout << int(StrideType::OuterStrideAtCompileTime) << " - " << int(Derived::OuterStrideAtCompileTime) << "\n"; +// std::cout << int(StrideType::InnerStrideAtCompileTime) << " - " << int(Derived::InnerStrideAtCompileTime) << "\n"; + construct(expr.derived(), typename Traits::template match::type()); + } + + EIGEN_DEVICE_FUNC inline Ref(const Ref& other) : Base(other) { + // copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy + } + + template + EIGEN_DEVICE_FUNC inline Ref(const RefBase& other) { + construct(other.derived(), typename Traits::template match::type()); + } + + protected: + + template + EIGEN_DEVICE_FUNC void construct(const Expression& expr,internal::true_type) + { + Base::construct(expr); + } + + template + EIGEN_DEVICE_FUNC void construct(const Expression& expr, internal::false_type) + { + internal::call_assignment_no_alias(m_object,expr,internal::assign_op()); + Base::construct(m_object); + } + + protected: + TPlainObjectType m_object; +}; + +} // end namespace Eigen + +#endif // EIGEN_REF_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Replicate.h b/SudoDEM2D/lib/Eigen/src/Core/Replicate.h new file mode 100644 index 0000000..9960ef8 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Replicate.h @@ -0,0 +1,142 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 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_REPLICATE_H +#define EIGEN_REPLICATE_H + +namespace Eigen { + +namespace internal { +template +struct traits > + : traits +{ + typedef typename MatrixType::Scalar Scalar; + typedef typename traits::StorageKind StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename ref_selector::type MatrixTypeNested; + typedef typename remove_reference::type _MatrixTypeNested; + enum { + RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic + ? Dynamic + : RowFactor * MatrixType::RowsAtCompileTime, + ColsAtCompileTime = ColFactor==Dynamic || int(MatrixType::ColsAtCompileTime)==Dynamic + ? Dynamic + : ColFactor * MatrixType::ColsAtCompileTime, + //FIXME we don't propagate the max sizes !!! + MaxRowsAtCompileTime = RowsAtCompileTime, + MaxColsAtCompileTime = ColsAtCompileTime, + IsRowMajor = MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1 ? 1 + : MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1 ? 0 + : (MatrixType::Flags & RowMajorBit) ? 1 : 0, + + // FIXME enable DirectAccess with negative strides? + Flags = IsRowMajor ? RowMajorBit : 0 + }; +}; +} + +/** + * \class Replicate + * \ingroup Core_Module + * + * \brief Expression of the multiple replication of a matrix or vector + * + * \tparam MatrixType the type of the object we are replicating + * \tparam RowFactor number of repetitions at compile time along the vertical direction, can be Dynamic. + * \tparam ColFactor number of repetitions at compile time along the horizontal direction, can be Dynamic. + * + * This class represents an expression of the multiple replication of a matrix or vector. + * It is the return type of DenseBase::replicate() and most of the time + * this is the only way it is used. + * + * \sa DenseBase::replicate() + */ +template class Replicate + : public internal::dense_xpr_base< Replicate >::type +{ + typedef typename internal::traits::MatrixTypeNested MatrixTypeNested; + typedef typename internal::traits::_MatrixTypeNested _MatrixTypeNested; + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Replicate) + typedef typename internal::remove_all::type NestedExpression; + + template + EIGEN_DEVICE_FUNC + inline explicit Replicate(const OriginalMatrixType& matrix) + : m_matrix(matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor) + { + EIGEN_STATIC_ASSERT((internal::is_same::type,OriginalMatrixType>::value), + THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) + eigen_assert(RowFactor!=Dynamic && ColFactor!=Dynamic); + } + + template + EIGEN_DEVICE_FUNC + inline Replicate(const OriginalMatrixType& matrix, Index rowFactor, Index colFactor) + : m_matrix(matrix), m_rowFactor(rowFactor), m_colFactor(colFactor) + { + EIGEN_STATIC_ASSERT((internal::is_same::type,OriginalMatrixType>::value), + THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) + } + + EIGEN_DEVICE_FUNC + inline Index rows() const { return m_matrix.rows() * m_rowFactor.value(); } + EIGEN_DEVICE_FUNC + inline Index cols() const { return m_matrix.cols() * m_colFactor.value(); } + + EIGEN_DEVICE_FUNC + const _MatrixTypeNested& nestedExpression() const + { + return m_matrix; + } + + protected: + MatrixTypeNested m_matrix; + const internal::variable_if_dynamic m_rowFactor; + const internal::variable_if_dynamic m_colFactor; +}; + +/** + * \return an expression of the replication of \c *this + * + * Example: \include MatrixBase_replicate.cpp + * Output: \verbinclude MatrixBase_replicate.out + * + * \sa VectorwiseOp::replicate(), DenseBase::replicate(Index,Index), class Replicate + */ +template +template +const Replicate +DenseBase::replicate() const +{ + return Replicate(derived()); +} + +/** + * \return an expression of the replication of each column (or row) of \c *this + * + * Example: \include DirectionWise_replicate_int.cpp + * Output: \verbinclude DirectionWise_replicate_int.out + * + * \sa VectorwiseOp::replicate(), DenseBase::replicate(), class Replicate + */ +template +const typename VectorwiseOp::ReplicateReturnType +VectorwiseOp::replicate(Index factor) const +{ + return typename VectorwiseOp::ReplicateReturnType + (_expression(),Direction==Vertical?factor:1,Direction==Horizontal?factor:1); +} + +} // end namespace Eigen + +#endif // EIGEN_REPLICATE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/ReturnByValue.h b/SudoDEM2D/lib/Eigen/src/Core/ReturnByValue.h new file mode 100644 index 0000000..c44b767 --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/ReturnByValue.h @@ -0,0 +1,117 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2009-2010 Gael Guennebaud +// Copyright (C) 2009-2010 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_RETURNBYVALUE_H +#define EIGEN_RETURNBYVALUE_H + +namespace Eigen { + +namespace internal { + +template +struct traits > + : public traits::ReturnType> +{ + enum { + // We're disabling the DirectAccess because e.g. the constructor of + // the Block-with-DirectAccess expression requires to have a coeffRef method. + // Also, we don't want to have to implement the stride stuff. + Flags = (traits::ReturnType>::Flags + | EvalBeforeNestingBit) & ~DirectAccessBit + }; +}; + +/* The ReturnByValue object doesn't even have a coeff() method. + * So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix. + * So internal::nested always gives the plain return matrix type. + * + * FIXME: I don't understand why we need this specialization: isn't this taken care of by the EvalBeforeNestingBit ?? + * Answer: EvalBeforeNestingBit should be deprecated since we have the evaluators + */ +template +struct nested_eval, n, PlainObject> +{ + typedef typename traits::ReturnType type; +}; + +} // end namespace internal + +/** \class ReturnByValue + * \ingroup Core_Module + * + */ +template class ReturnByValue + : public internal::dense_xpr_base< ReturnByValue >::type, internal::no_assignment_operator +{ + public: + typedef typename internal::traits::ReturnType ReturnType; + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(ReturnByValue) + + template + EIGEN_DEVICE_FUNC + inline void evalTo(Dest& dst) const + { static_cast(this)->evalTo(dst); } + EIGEN_DEVICE_FUNC inline Index rows() const { return static_cast(this)->rows(); } + EIGEN_DEVICE_FUNC inline Index cols() const { return static_cast(this)->cols(); } + +#ifndef EIGEN_PARSED_BY_DOXYGEN +#define Unusable YOU_ARE_TRYING_TO_ACCESS_A_SINGLE_COEFFICIENT_IN_A_SPECIAL_EXPRESSION_WHERE_THAT_IS_NOT_ALLOWED_BECAUSE_THAT_WOULD_BE_INEFFICIENT + class Unusable{ + Unusable(const Unusable&) {} + Unusable& operator=(const Unusable&) {return *this;} + }; + const Unusable& coeff(Index) const { return *reinterpret_cast(this); } + const Unusable& coeff(Index,Index) const { return *reinterpret_cast(this); } + Unusable& coeffRef(Index) { return *reinterpret_cast(this); } + Unusable& coeffRef(Index,Index) { return *reinterpret_cast(this); } +#undef Unusable +#endif +}; + +template +template +Derived& DenseBase::operator=(const ReturnByValue& other) +{ + other.evalTo(derived()); + return derived(); +} + +namespace internal { + +// Expression is evaluated in a temporary; default implementation of Assignment is bypassed so that +// when a ReturnByValue expression is assigned, the evaluator is not constructed. +// TODO: Finalize port to new regime; ReturnByValue should not exist in the expression world + +template +struct evaluator > + : public evaluator::ReturnType> +{ + typedef ReturnByValue XprType; + typedef typename internal::traits::ReturnType PlainObject; + typedef evaluator Base; + + EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) + : m_result(xpr.rows(), xpr.cols()) + { + ::new (static_cast(this)) Base(m_result); + xpr.evalTo(m_result); + } + +protected: + PlainObject m_result; +}; + +} // end namespace internal + +} // end namespace Eigen + +#endif // EIGEN_RETURNBYVALUE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Reverse.h b/SudoDEM2D/lib/Eigen/src/Core/Reverse.h new file mode 100644 index 0000000..0640cda --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Reverse.h @@ -0,0 +1,211 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2006-2008 Benoit Jacob +// Copyright (C) 2009 Ricard Marxer +// Copyright (C) 2009-2010 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_REVERSE_H +#define EIGEN_REVERSE_H + +namespace Eigen { + +namespace internal { + +template +struct traits > + : traits +{ + typedef typename MatrixType::Scalar Scalar; + typedef typename traits::StorageKind StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename ref_selector::type MatrixTypeNested; + typedef typename remove_reference::type _MatrixTypeNested; + enum { + RowsAtCompileTime = MatrixType::RowsAtCompileTime, + ColsAtCompileTime = MatrixType::ColsAtCompileTime, + MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, + MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, + Flags = _MatrixTypeNested::Flags & (RowMajorBit | LvalueBit) + }; +}; + +template struct reverse_packet_cond +{ + static inline PacketType run(const PacketType& x) { return preverse(x); } +}; + +template struct reverse_packet_cond +{ + static inline PacketType run(const PacketType& x) { return x; } +}; + +} // end namespace internal + +/** \class Reverse + * \ingroup Core_Module + * + * \brief Expression of the reverse of a vector or matrix + * + * \tparam MatrixType the type of the object of which we are taking the reverse + * \tparam Direction defines the direction of the reverse operation, can be Vertical, Horizontal, or BothDirections + * + * This class represents an expression of the reverse of a vector. + * It is the return type of MatrixBase::reverse() and VectorwiseOp::reverse() + * and most of the time this is the only way it is used. + * + * \sa MatrixBase::reverse(), VectorwiseOp::reverse() + */ +template class Reverse + : public internal::dense_xpr_base< Reverse >::type +{ + public: + + typedef typename internal::dense_xpr_base::type Base; + EIGEN_DENSE_PUBLIC_INTERFACE(Reverse) + typedef typename internal::remove_all::type NestedExpression; + using Base::IsRowMajor; + + protected: + enum { + PacketSize = internal::packet_traits::size, + IsColMajor = !IsRowMajor, + ReverseRow = (Direction == Vertical) || (Direction == BothDirections), + ReverseCol = (Direction == Horizontal) || (Direction == BothDirections), + OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1, + OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1, + ReversePacket = (Direction == BothDirections) + || ((Direction == Vertical) && IsColMajor) + || ((Direction == Horizontal) && IsRowMajor) + }; + typedef internal::reverse_packet_cond reverse_packet; + public: + + EIGEN_DEVICE_FUNC explicit inline Reverse(const MatrixType& matrix) : m_matrix(matrix) { } + + EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Reverse) + + EIGEN_DEVICE_FUNC inline Index rows() const { return m_matrix.rows(); } + EIGEN_DEVICE_FUNC inline Index cols() const { return m_matrix.cols(); } + + EIGEN_DEVICE_FUNC inline Index innerStride() const + { + return -m_matrix.innerStride(); + } + + EIGEN_DEVICE_FUNC const typename internal::remove_all::type& + nestedExpression() const + { + return m_matrix; + } + + protected: + typename MatrixType::Nested m_matrix; +}; + +/** \returns an expression of the reverse of *this. + * + * Example: \include MatrixBase_reverse.cpp + * Output: \verbinclude MatrixBase_reverse.out + * + */ +template +inline typename DenseBase::ReverseReturnType +DenseBase::reverse() +{ + return ReverseReturnType(derived()); +} + + +//reverse const overload moved DenseBase.h due to a CUDA compiler bug + +/** This is the "in place" version of reverse: it reverses \c *this. + * + * In most cases it is probably better to simply use the reversed expression + * of a matrix. However, when reversing the matrix data itself is really needed, + * then this "in-place" version is probably the right choice because it provides + * the following additional benefits: + * - less error prone: doing the same operation with .reverse() requires special care: + * \code m = m.reverse().eval(); \endcode + * - this API enables reverse operations without the need for a temporary + * - it allows future optimizations (cache friendliness, etc.) + * + * \sa VectorwiseOp::reverseInPlace(), reverse() */ +template +inline void DenseBase::reverseInPlace() +{ + if(cols()>rows()) + { + Index half = cols()/2; + leftCols(half).swap(rightCols(half).reverse()); + if((cols()%2)==1) + { + Index half2 = rows()/2; + col(half).head(half2).swap(col(half).tail(half2).reverse()); + } + } + else + { + Index half = rows()/2; + topRows(half).swap(bottomRows(half).reverse()); + if((rows()%2)==1) + { + Index half2 = cols()/2; + row(half).head(half2).swap(row(half).tail(half2).reverse()); + } + } +} + +namespace internal { + +template +struct vectorwise_reverse_inplace_impl; + +template<> +struct vectorwise_reverse_inplace_impl +{ + template + static void run(ExpressionType &xpr) + { + Index half = xpr.rows()/2; + xpr.topRows(half).swap(xpr.bottomRows(half).colwise().reverse()); + } +}; + +template<> +struct vectorwise_reverse_inplace_impl +{ + template + static void run(ExpressionType &xpr) + { + Index half = xpr.cols()/2; + xpr.leftCols(half).swap(xpr.rightCols(half).rowwise().reverse()); + } +}; + +} // end namespace internal + +/** This is the "in place" version of VectorwiseOp::reverse: it reverses each column or row of \c *this. + * + * In most cases it is probably better to simply use the reversed expression + * of a matrix. However, when reversing the matrix data itself is really needed, + * then this "in-place" version is probably the right choice because it provides + * the following additional benefits: + * - less error prone: doing the same operation with .reverse() requires special care: + * \code m = m.reverse().eval(); \endcode + * - this API enables reverse operations without the need for a temporary + * + * \sa DenseBase::reverseInPlace(), reverse() */ +template +void VectorwiseOp::reverseInPlace() +{ + internal::vectorwise_reverse_inplace_impl::run(_expression().const_cast_derived()); +} + +} // end namespace Eigen + +#endif // EIGEN_REVERSE_H diff --git a/SudoDEM2D/lib/Eigen/src/Core/Select.h b/SudoDEM2D/lib/Eigen/src/Core/Select.h new file mode 100644 index 0000000..79eec1b --- /dev/null +++ b/SudoDEM2D/lib/Eigen/src/Core/Select.h @@ -0,0 +1,162 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2008-2010 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_SELECT_H +#define EIGEN_SELECT_H + +namespace Eigen { + +/** \class Select + * \ingroup Core_Module + * + * \brief Expression of a coefficient wise version of the C++ ternary operator ?: + * + * \param ConditionMatrixType the type of the \em condition expression which must be a boolean matrix + * \param ThenMatrixType the type of the \em then expression + * \param ElseMatrixType the type of the \em else expression + * + * This class represents an expression of a coefficient wise version of the C++ ternary operator ?:. + * It is the return type of DenseBase::select() and most of the time this is the only way it is used. + * + * \sa DenseBase::select(const DenseBase&, const DenseBase&) const + */ + +namespace internal { +template +struct traits > + : traits +{ + typedef typename traits::Scalar Scalar; + typedef Dense StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename ConditionMatrixType::Nested ConditionMatrixNested; + typedef typename ThenMatrixType::Nested ThenMatrixNested; + typedef typename ElseMatrixType::Nested ElseMatrixNested; + enum { + RowsAtCompileTime = ConditionMatrixType::RowsAtCompileTime, + ColsAtCompileTime = ConditionMatrixType::ColsAtCompileTime, + MaxRowsAtCompileTime = ConditionMatrixType::MaxRowsAtCompileTime, + MaxColsAtCompileTime = ConditionMatrixType::MaxColsAtCompileTime, + Flags = (unsigned int)ThenMatrixType::Flags & ElseMatrixType::Flags & RowMajorBit + }; +}; +} + +template +class Select : public internal::dense_xpr_base< Select >::type, + internal::no_assignment_operator +{ + public: + + typedef typename internal::dense_xpr_base