├── .gitignore ├── CMakeLists.txt ├── CommonDefs.mk ├── Makefile ├── README.md ├── cmake ├── Common.cmake ├── DetectCXX11.cmake ├── DetectOpenCV.cmake ├── FindCUDA.cmake ├── FindCUDA │ ├── make2cmake.cmake │ ├── parse_cubin.cmake │ └── run_nvcc.cmake ├── IncludeGuard.cmake ├── Option.cmake ├── TargetArch.cmake ├── Utils.cmake └── templates │ ├── build.info.in │ ├── exe.bat.in │ └── pkginfo.sh.in ├── demo ├── CMakeLists.txt ├── build-demo.bat ├── get_depth.cpp ├── get_depth_with_region.cpp ├── get_detector.cpp ├── get_device_info.cpp ├── get_disparity.cpp ├── get_disparity_with_high_accuracy.cpp ├── get_disparity_with_lr_check.cpp ├── get_image.cpp ├── get_imu.cpp ├── get_points.cpp ├── get_rectified_img.cpp ├── record_imu.cpp ├── util_pcl.cpp └── util_pcl.h ├── include ├── imrdata.h ├── imrsdk.h ├── logging.h ├── svc_config.h ├── times.h └── types.h ├── lib ├── aarch64 │ └── libindemind.so ├── others │ ├── tx2-opencv3.4.3 │ │ └── libindemind.so │ ├── win10-x64-vs15-opencv3.4.3 │ │ ├── Readme.txt │ │ ├── indemind.dll │ │ └── indemind.lib │ └── x64-opencv3.4.3 │ │ └── libindemind.so ├── win10-x64 │ ├── Readme.txt │ ├── indemind.dll │ └── indemind.lib └── x86-64 │ └── libindemind.so ├── ros └── src │ └── imsee_ros_wrapper │ ├── CMakeLists.txt │ ├── config │ └── settings.yaml │ ├── launch │ ├── display.launch │ └── start.launch │ ├── nodelet_plugins.xml │ ├── package.xml │ ├── rviz │ └── imsee.rviz │ └── src │ ├── wrapper_node.cc │ └── wrapper_nodelet.cc ├── scripts ├── common │ ├── detect.sh │ ├── echo.sh │ ├── host.sh │ ├── mkdir.sh │ └── string.sh ├── cp_files.sh ├── cp_files_ros.sh ├── cpplint.sh ├── getfind.sh ├── init.sh ├── init_tools.sh ├── open.sh ├── version.sh └── win │ ├── cmake │ ├── indemind-targets-release.cmake │ └── indemind-targets.cmake │ ├── generate.bat │ ├── nsis │ ├── Include │ │ └── EnvVarUpdate.nsh │ ├── indemind.ico │ └── winpack.nsi.in │ └── winpack.sh ├── src ├── detector │ ├── config │ │ ├── blazeface.mnn │ │ └── default.yml │ └── lib │ │ ├── aarch64 │ │ └── libMNN.so │ │ ├── win10-x64 │ │ ├── MNN.dll │ │ └── MNN.lib │ │ └── x86-64 │ │ └── libMNN.so └── driver │ ├── DriverInterface.h │ └── lib │ ├── aarch64 │ └── libusbdriver.so │ ├── win64 │ ├── usbdriver.dll │ ├── usbdriver.lib │ └── windriver.dll │ └── x86-64 │ └── libusbdriver.so └── third_party └── Eigen3 ├── include └── eigen3 │ ├── Eigen │ ├── Cholesky │ ├── CholmodSupport │ ├── Core │ ├── Dense │ ├── Eigen │ ├── Eigenvalues │ ├── Geometry │ ├── Householder │ ├── IterativeLinearSolvers │ ├── Jacobi │ ├── LU │ ├── MetisSupport │ ├── OrderingMethods │ ├── PaStiXSupport │ ├── PardisoSupport │ ├── QR │ ├── QtAlignedMalloc │ ├── SPQRSupport │ ├── SVD │ ├── Sparse │ ├── SparseCholesky │ ├── SparseCore │ ├── SparseLU │ ├── SparseQR │ ├── StdDeque │ ├── StdList │ ├── StdVector │ ├── SuperLUSupport │ ├── UmfPackSupport │ └── src │ │ ├── Cholesky │ │ ├── LDLT.h │ │ ├── LLT.h │ │ └── LLT_LAPACKE.h │ │ ├── CholmodSupport │ │ └── CholmodSupport.h │ │ ├── Core │ │ ├── Array.h │ │ ├── ArrayBase.h │ │ ├── ArrayWrapper.h │ │ ├── Assign.h │ │ ├── AssignEvaluator.h │ │ ├── Assign_MKL.h │ │ ├── BandMatrix.h │ │ ├── Block.h │ │ ├── BooleanRedux.h │ │ ├── CommaInitializer.h │ │ ├── ConditionEstimator.h │ │ ├── CoreEvaluators.h │ │ ├── CoreIterators.h │ │ ├── CwiseBinaryOp.h │ │ ├── CwiseNullaryOp.h │ │ ├── CwiseTernaryOp.h │ │ ├── CwiseUnaryOp.h │ │ ├── CwiseUnaryView.h │ │ ├── DenseBase.h │ │ ├── DenseCoeffsBase.h │ │ ├── DenseStorage.h │ │ ├── Diagonal.h │ │ ├── DiagonalMatrix.h │ │ ├── DiagonalProduct.h │ │ ├── Dot.h │ │ ├── EigenBase.h │ │ ├── ForceAlignedAccess.h │ │ ├── Fuzzy.h │ │ ├── GeneralProduct.h │ │ ├── GenericPacketMath.h │ │ ├── GlobalFunctions.h │ │ ├── IO.h │ │ ├── Inverse.h │ │ ├── Map.h │ │ ├── MapBase.h │ │ ├── MathFunctions.h │ │ ├── MathFunctionsImpl.h │ │ ├── Matrix.h │ │ ├── MatrixBase.h │ │ ├── NestByValue.h │ │ ├── NoAlias.h │ │ ├── NumTraits.h │ │ ├── PermutationMatrix.h │ │ ├── PlainObjectBase.h │ │ ├── Product.h │ │ ├── ProductEvaluators.h │ │ ├── Random.h │ │ ├── Redux.h │ │ ├── Ref.h │ │ ├── Replicate.h │ │ ├── ReturnByValue.h │ │ ├── Reverse.h │ │ ├── Select.h │ │ ├── SelfAdjointView.h │ │ ├── SelfCwiseBinaryOp.h │ │ ├── Solve.h │ │ ├── SolveTriangular.h │ │ ├── SolverBase.h │ │ ├── StableNorm.h │ │ ├── Stride.h │ │ ├── Swap.h │ │ ├── Transpose.h │ │ ├── Transpositions.h │ │ ├── TriangularMatrix.h │ │ ├── VectorBlock.h │ │ ├── VectorwiseOp.h │ │ ├── Visitor.h │ │ ├── arch │ │ │ ├── AVX │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ ├── PacketMath.h │ │ │ │ └── TypeCasting.h │ │ │ ├── AVX512 │ │ │ │ ├── MathFunctions.h │ │ │ │ └── PacketMath.h │ │ │ ├── AltiVec │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ └── PacketMath.h │ │ │ ├── CUDA │ │ │ │ ├── Complex.h │ │ │ │ ├── Half.h │ │ │ │ ├── MathFunctions.h │ │ │ │ ├── PacketMath.h │ │ │ │ ├── PacketMathHalf.h │ │ │ │ └── TypeCasting.h │ │ │ ├── Default │ │ │ │ └── Settings.h │ │ │ ├── NEON │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ └── PacketMath.h │ │ │ ├── SSE │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ ├── PacketMath.h │ │ │ │ └── TypeCasting.h │ │ │ └── ZVector │ │ │ │ ├── Complex.h │ │ │ │ ├── MathFunctions.h │ │ │ │ └── PacketMath.h │ │ ├── functors │ │ │ ├── AssignmentFunctors.h │ │ │ ├── BinaryFunctors.h │ │ │ ├── NullaryFunctors.h │ │ │ ├── StlFunctors.h │ │ │ ├── TernaryFunctors.h │ │ │ └── UnaryFunctors.h │ │ ├── products │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ ├── GeneralMatrixMatrix.h │ │ │ ├── GeneralMatrixMatrixTriangular.h │ │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h │ │ │ ├── GeneralMatrixMatrix_BLAS.h │ │ │ ├── GeneralMatrixVector.h │ │ │ ├── GeneralMatrixVector_BLAS.h │ │ │ ├── Parallelizer.h │ │ │ ├── SelfadjointMatrixMatrix.h │ │ │ ├── SelfadjointMatrixMatrix_BLAS.h │ │ │ ├── SelfadjointMatrixVector.h │ │ │ ├── SelfadjointMatrixVector_BLAS.h │ │ │ ├── SelfadjointProduct.h │ │ │ ├── SelfadjointRank2Update.h │ │ │ ├── TriangularMatrixMatrix.h │ │ │ ├── TriangularMatrixMatrix_BLAS.h │ │ │ ├── TriangularMatrixVector.h │ │ │ ├── TriangularMatrixVector_BLAS.h │ │ │ ├── TriangularSolverMatrix.h │ │ │ ├── TriangularSolverMatrix_BLAS.h │ │ │ └── TriangularSolverVector.h │ │ └── util │ │ │ ├── BlasUtil.h │ │ │ ├── Constants.h │ │ │ ├── DisableStupidWarnings.h │ │ │ ├── ForwardDeclarations.h │ │ │ ├── MKL_support.h │ │ │ ├── Macros.h │ │ │ ├── Memory.h │ │ │ ├── Meta.h │ │ │ ├── NonMPL2.h │ │ │ ├── ReenableStupidWarnings.h │ │ │ ├── StaticAssert.h │ │ │ └── XprHelper.h │ │ ├── Eigenvalues │ │ ├── ComplexEigenSolver.h │ │ ├── ComplexSchur.h │ │ ├── ComplexSchur_LAPACKE.h │ │ ├── EigenSolver.h │ │ ├── GeneralizedEigenSolver.h │ │ ├── GeneralizedSelfAdjointEigenSolver.h │ │ ├── HessenbergDecomposition.h │ │ ├── MatrixBaseEigenvalues.h │ │ ├── RealQZ.h │ │ ├── RealSchur.h │ │ ├── RealSchur_LAPACKE.h │ │ ├── SelfAdjointEigenSolver.h │ │ ├── SelfAdjointEigenSolver_LAPACKE.h │ │ └── Tridiagonalization.h │ │ ├── Geometry │ │ ├── AlignedBox.h │ │ ├── AngleAxis.h │ │ ├── EulerAngles.h │ │ ├── Homogeneous.h │ │ ├── Hyperplane.h │ │ ├── OrthoMethods.h │ │ ├── ParametrizedLine.h │ │ ├── Quaternion.h │ │ ├── Rotation2D.h │ │ ├── RotationBase.h │ │ ├── Scaling.h │ │ ├── Transform.h │ │ ├── Translation.h │ │ ├── Umeyama.h │ │ └── arch │ │ │ └── Geometry_SSE.h │ │ ├── Householder │ │ ├── BlockHouseholder.h │ │ ├── Householder.h │ │ └── HouseholderSequence.h │ │ ├── IterativeLinearSolvers │ │ ├── BasicPreconditioners.h │ │ ├── BiCGSTAB.h │ │ ├── ConjugateGradient.h │ │ ├── IncompleteCholesky.h │ │ ├── IncompleteLUT.h │ │ ├── IterativeSolverBase.h │ │ ├── LeastSquareConjugateGradient.h │ │ └── SolveWithGuess.h │ │ ├── Jacobi │ │ └── Jacobi.h │ │ ├── LU │ │ ├── Determinant.h │ │ ├── FullPivLU.h │ │ ├── InverseImpl.h │ │ ├── PartialPivLU.h │ │ ├── PartialPivLU_LAPACKE.h │ │ └── arch │ │ │ └── Inverse_SSE.h │ │ ├── MetisSupport │ │ └── MetisSupport.h │ │ ├── OrderingMethods │ │ ├── Amd.h │ │ ├── Eigen_Colamd.h │ │ └── Ordering.h │ │ ├── PaStiXSupport │ │ └── PaStiXSupport.h │ │ ├── PardisoSupport │ │ └── PardisoSupport.h │ │ ├── QR │ │ ├── ColPivHouseholderQR.h │ │ ├── ColPivHouseholderQR_LAPACKE.h │ │ ├── CompleteOrthogonalDecomposition.h │ │ ├── FullPivHouseholderQR.h │ │ ├── HouseholderQR.h │ │ └── HouseholderQR_LAPACKE.h │ │ ├── SPQRSupport │ │ └── SuiteSparseQRSupport.h │ │ ├── SVD │ │ ├── BDCSVD.h │ │ ├── JacobiSVD.h │ │ ├── JacobiSVD_LAPACKE.h │ │ ├── SVDBase.h │ │ └── UpperBidiagonalization.h │ │ ├── SparseCholesky │ │ ├── SimplicialCholesky.h │ │ └── SimplicialCholesky_impl.h │ │ ├── SparseCore │ │ ├── AmbiVector.h │ │ ├── CompressedStorage.h │ │ ├── ConservativeSparseSparseProduct.h │ │ ├── MappedSparseMatrix.h │ │ ├── SparseAssign.h │ │ ├── SparseBlock.h │ │ ├── SparseColEtree.h │ │ ├── SparseCompressedBase.h │ │ ├── SparseCwiseBinaryOp.h │ │ ├── SparseCwiseUnaryOp.h │ │ ├── SparseDenseProduct.h │ │ ├── SparseDiagonalProduct.h │ │ ├── SparseDot.h │ │ ├── SparseFuzzy.h │ │ ├── SparseMap.h │ │ ├── SparseMatrix.h │ │ ├── SparseMatrixBase.h │ │ ├── SparsePermutation.h │ │ ├── SparseProduct.h │ │ ├── SparseRedux.h │ │ ├── SparseRef.h │ │ ├── SparseSelfAdjointView.h │ │ ├── SparseSolverBase.h │ │ ├── SparseSparseProductWithPruning.h │ │ ├── SparseTranspose.h │ │ ├── SparseTriangularView.h │ │ ├── SparseUtil.h │ │ ├── SparseVector.h │ │ ├── SparseView.h │ │ └── TriangularSolver.h │ │ ├── SparseLU │ │ ├── SparseLU.h │ │ ├── SparseLUImpl.h │ │ ├── SparseLU_Memory.h │ │ ├── SparseLU_Structs.h │ │ ├── SparseLU_SupernodalMatrix.h │ │ ├── SparseLU_Utils.h │ │ ├── SparseLU_column_bmod.h │ │ ├── SparseLU_column_dfs.h │ │ ├── SparseLU_copy_to_ucol.h │ │ ├── SparseLU_gemm_kernel.h │ │ ├── SparseLU_heap_relax_snode.h │ │ ├── SparseLU_kernel_bmod.h │ │ ├── SparseLU_panel_bmod.h │ │ ├── SparseLU_panel_dfs.h │ │ ├── SparseLU_pivotL.h │ │ ├── SparseLU_pruneL.h │ │ └── SparseLU_relax_snode.h │ │ ├── SparseQR │ │ └── SparseQR.h │ │ ├── StlSupport │ │ ├── StdDeque.h │ │ ├── StdList.h │ │ ├── StdVector.h │ │ └── details.h │ │ ├── SuperLUSupport │ │ └── SuperLUSupport.h │ │ ├── UmfPackSupport │ │ └── UmfPackSupport.h │ │ ├── misc │ │ ├── Image.h │ │ ├── Kernel.h │ │ ├── RealSvd2x2.h │ │ ├── blas.h │ │ ├── lapack.h │ │ ├── lapacke.h │ │ └── lapacke_mangling.h │ │ └── plugins │ │ ├── ArrayCwiseBinaryOps.h │ │ ├── ArrayCwiseUnaryOps.h │ │ ├── BlockMethods.h │ │ ├── CommonCwiseBinaryOps.h │ │ ├── CommonCwiseUnaryOps.h │ │ ├── MatrixCwiseBinaryOps.h │ │ └── MatrixCwiseUnaryOps.h │ ├── signature_of_eigen3_matrix_library │ └── unsupported │ └── Eigen │ ├── AdolcForward │ ├── AlignedVector3 │ ├── ArpackSupport │ ├── AutoDiff │ ├── BVH │ ├── CXX11 │ ├── Tensor │ ├── TensorSymmetry │ ├── ThreadPool │ └── src │ │ ├── Tensor │ │ ├── Tensor.h │ │ ├── TensorArgMax.h │ │ ├── TensorAssign.h │ │ ├── TensorBase.h │ │ ├── TensorBroadcasting.h │ │ ├── TensorChipping.h │ │ ├── TensorConcatenation.h │ │ ├── TensorContraction.h │ │ ├── TensorContractionBlocking.h │ │ ├── TensorContractionCuda.h │ │ ├── TensorContractionMapper.h │ │ ├── TensorContractionThreadPool.h │ │ ├── TensorConversion.h │ │ ├── TensorConvolution.h │ │ ├── TensorCostModel.h │ │ ├── TensorCustomOp.h │ │ ├── TensorDevice.h │ │ ├── TensorDeviceCuda.h │ │ ├── TensorDeviceDefault.h │ │ ├── TensorDeviceSycl.h │ │ ├── TensorDeviceThreadPool.h │ │ ├── TensorDimensionList.h │ │ ├── TensorDimensions.h │ │ ├── TensorEvalTo.h │ │ ├── TensorEvaluator.h │ │ ├── TensorExecutor.h │ │ ├── TensorExpr.h │ │ ├── TensorFFT.h │ │ ├── TensorFixedSize.h │ │ ├── TensorForcedEval.h │ │ ├── TensorForwardDeclarations.h │ │ ├── TensorFunctors.h │ │ ├── TensorGenerator.h │ │ ├── TensorGlobalFunctions.h │ │ ├── TensorIO.h │ │ ├── TensorImagePatch.h │ │ ├── TensorIndexList.h │ │ ├── TensorInflation.h │ │ ├── TensorInitializer.h │ │ ├── TensorIntDiv.h │ │ ├── TensorLayoutSwap.h │ │ ├── TensorMacros.h │ │ ├── TensorMap.h │ │ ├── TensorMeta.h │ │ ├── TensorMorphing.h │ │ ├── TensorPadding.h │ │ ├── TensorPatch.h │ │ ├── TensorRandom.h │ │ ├── TensorReduction.h │ │ ├── TensorReductionCuda.h │ │ ├── TensorReductionSycl.h │ │ ├── TensorRef.h │ │ ├── TensorReverse.h │ │ ├── TensorScan.h │ │ ├── TensorShuffling.h │ │ ├── TensorStorage.h │ │ ├── TensorStriding.h │ │ ├── TensorSycl.h │ │ ├── TensorSyclConvertToDeviceExpression.h │ │ ├── TensorSyclExprConstructor.h │ │ ├── TensorSyclExtractAccessor.h │ │ ├── TensorSyclExtractFunctors.h │ │ ├── TensorSyclLeafCount.h │ │ ├── TensorSyclPlaceHolderExpr.h │ │ ├── TensorSyclRun.h │ │ ├── TensorSyclTuple.h │ │ ├── TensorTraits.h │ │ ├── TensorUInt128.h │ │ └── TensorVolumePatch.h │ │ ├── TensorSymmetry │ │ ├── DynamicSymmetry.h │ │ ├── StaticSymmetry.h │ │ ├── Symmetry.h │ │ └── util │ │ │ └── TemplateGroupTheory.h │ │ ├── ThreadPool │ │ ├── EventCount.h │ │ ├── NonBlockingThreadPool.h │ │ ├── RunQueue.h │ │ ├── SimpleThreadPool.h │ │ ├── ThreadEnvironment.h │ │ ├── ThreadLocal.h │ │ ├── ThreadPoolInterface.h │ │ └── ThreadYield.h │ │ └── util │ │ ├── CXX11Meta.h │ │ ├── CXX11Workarounds.h │ │ ├── EmulateArray.h │ │ ├── EmulateCXX11Meta.h │ │ └── MaxSizeVector.h │ ├── EulerAngles │ ├── FFT │ ├── IterativeSolvers │ ├── KroneckerProduct │ ├── LevenbergMarquardt │ ├── MPRealSupport │ ├── MatrixFunctions │ ├── MoreVectorization │ ├── NonLinearOptimization │ ├── NumericalDiff │ ├── OpenGLSupport │ ├── Polynomials │ ├── Skyline │ ├── SparseExtra │ ├── SpecialFunctions │ ├── Splines │ └── src │ ├── AutoDiff │ ├── AutoDiffJacobian.h │ ├── AutoDiffScalar.h │ └── AutoDiffVector.h │ ├── BVH │ ├── BVAlgorithms.h │ └── KdBVH.h │ ├── Eigenvalues │ └── ArpackSelfAdjointEigenSolver.h │ ├── EulerAngles │ ├── EulerAngles.h │ └── EulerSystem.h │ ├── FFT │ ├── ei_fftw_impl.h │ └── ei_kissfft_impl.h │ ├── IterativeSolvers │ ├── ConstrainedConjGrad.h │ ├── DGMRES.h │ ├── GMRES.h │ ├── IncompleteLU.h │ ├── IterationController.h │ ├── MINRES.h │ └── Scaling.h │ ├── KroneckerProduct │ └── KroneckerTensorProduct.h │ ├── LevenbergMarquardt │ ├── LMcovar.h │ ├── LMonestep.h │ ├── LMpar.h │ ├── LMqrsolv.h │ └── LevenbergMarquardt.h │ ├── MatrixFunctions │ ├── MatrixExponential.h │ ├── MatrixFunction.h │ ├── MatrixLogarithm.h │ ├── MatrixPower.h │ ├── MatrixSquareRoot.h │ └── StemFunction.h │ ├── MoreVectorization │ └── MathFunctions.h │ ├── NonLinearOptimization │ ├── HybridNonLinearSolver.h │ ├── LevenbergMarquardt.h │ ├── chkder.h │ ├── covar.h │ ├── dogleg.h │ ├── fdjac1.h │ ├── lmpar.h │ ├── qrsolv.h │ ├── r1mpyq.h │ ├── r1updt.h │ └── rwupdt.h │ ├── NumericalDiff │ └── NumericalDiff.h │ ├── Polynomials │ ├── Companion.h │ ├── PolynomialSolver.h │ └── PolynomialUtils.h │ ├── Skyline │ ├── SkylineInplaceLU.h │ ├── SkylineMatrix.h │ ├── SkylineMatrixBase.h │ ├── SkylineProduct.h │ ├── SkylineStorage.h │ └── SkylineUtil.h │ ├── SparseExtra │ ├── BlockOfDynamicSparseMatrix.h │ ├── BlockSparseMatrix.h │ ├── DynamicSparseMatrix.h │ ├── MarketIO.h │ ├── MatrixMarketIterator.h │ └── RandomSetter.h │ ├── SpecialFunctions │ ├── SpecialFunctionsArrayAPI.h │ ├── SpecialFunctionsFunctors.h │ ├── SpecialFunctionsHalf.h │ ├── SpecialFunctionsImpl.h │ ├── SpecialFunctionsPacketMath.h │ └── arch │ │ └── CUDA │ │ └── CudaSpecialFunctions.h │ └── Splines │ ├── Spline.h │ ├── SplineFitting.h │ └── SplineFwd.h └── share └── eigen3 └── cmake ├── Eigen3Config.cmake ├── Eigen3ConfigVersion.cmake ├── Eigen3Targets.cmake └── UseEigen3.cmake /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[cod] 2 | *.egg 3 | *.egg-info 4 | # *.dll 5 | *.exe 6 | *.png 7 | *.jpg 8 | *.bmp 9 | *.db 10 | # *.lib 11 | *.pdb 12 | *.ilk 13 | .vscode 14 | dist 15 | 16 | #build 17 | build 18 | output 19 | 20 | #ros 21 | devel 22 | .catkin_workspace 23 | ros/src/CMakeLists.txt 24 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # empty CMakeLists.txt 16 | 17 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | include CommonDefs.mk 15 | 16 | MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) 17 | MKFILE_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH))) 18 | 19 | # CMAKE_INSTALL_PREFIX: 20 | # https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html 21 | # 22 | # UNIX: /usr/local 23 | # Windows: c:/Program Files/${PROJECT_NAME} 24 | 25 | # Options 26 | # 27 | # SUDO: sudo command 28 | # 29 | # e.g. make [TARGET] SUDO= 30 | 31 | SUDO ?= sudo 32 | CMAKE_BUILD_EXTRA_OPTIONS ?= 33 | 34 | .DEFAULT_GOAL := all 35 | 36 | help: 37 | @echo "Usage:" 38 | @echo " make help show help message" 39 | @echo " make init init project" 40 | @echo " make demo build demo" 41 | @echo " make clean clean generated or useless things" 42 | 43 | .PHONY: help 44 | 45 | all: init demo ros 46 | 47 | .PHONY: all 48 | 49 | # init 50 | 51 | init: 52 | @$(call echo,Make $@) 53 | @$(SH) ./scripts/init.sh $(INIT_OPTIONS) 54 | 55 | .PHONY: init 56 | 57 | # demo 58 | 59 | demo: 60 | @$(call echo,Make $@) 61 | @$(call cmake_build,./demo/build) 62 | sh ./scripts/cp_files.sh 63 | .PHONY: demo 64 | 65 | # ros 66 | 67 | ros: 68 | @$(call echo,Make $@) 69 | ifeq ($(HOST_OS),Linux) 70 | @cd ./ros && catkin_make -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) 71 | sh ./scripts/cp_files_ros.sh 72 | else 73 | $(error "Can't make ros on $(HOST_OS)") 74 | endif 75 | 76 | .PHONY: ros 77 | 78 | cleanros: 79 | @$(call echo,Make $@) 80 | @$(call rm,./ros/build/) 81 | @$(call rm,./ros/devel/) 82 | @$(call rm,./ros/install/) 83 | @$(call rm,./ros/.catkin_workspace) 84 | @$(call rm,./ros/src/CMakeLists.txt) 85 | @$(call rm_f,*INFO*,$(HOME)/.ros/) 86 | @$(call rm_f,*WARNING*,$(HOME)/.ros/) 87 | @$(call rm_f,*ERROR*,$(HOME)/.ros/) 88 | @$(call rm_f,*FATAL*,$(HOME)/.ros/) 89 | 90 | .PHONY: cleanros 91 | 92 | # clean 93 | 94 | clean: 95 | @$(call echo,Make $@) 96 | @$(call rm,./demo/build/) 97 | @$(call rm,./demo/output/) 98 | ifeq ($(HOST_OS),Linux) 99 | @$(MAKE) cleanros 100 | endif 101 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IMSEE-SDK 2 | 3 | ## 概述 4 | 5 | IMSEE-SDK是indemind双目惯性模组的软件开发工具包。模组采用“双目摄像头+IMU”多传感器融合架构与微秒级时间同步机制,为视觉SLAM研究提供精准稳定数据源。模组运用摄像头+IMU多传感器融合架构,使摄像头与IMU传感器优势互补,实现位姿精度更高、环境适应性更强、动态性能更稳定、成本更低的双目立体视觉硬件方案 。 6 | 7 | 以下平台已经经过测试: 8 | 9 | * Windows 10 10 | * Ubuntu 16.04 / 14.04 11 | * Jetson TX2 12 | * RK3399 / 3328 13 | 14 | 详细信息请参照以下文档 15 | 16 | ## 文档 17 | 18 | * [API Doc](https://github.com/indemind/IMSEE-SDK/releases): API reference, some guides and data spec. 19 | * zh-Hans: [![](https://img.shields.io/badge/Online-HTML-blue.svg?style=flat)](https://imsee-sdk-docs-new.readthedocs.io/zh-cn/latest/) 20 | 21 | 22 | 23 | ## License 24 | 25 | This project is licensed under the [Apache License, Version 2.0](LICENSE). Copyright 2020 Indemind Co., Ltd. 26 | 27 | -------------------------------------------------------------------------------- /cmake/DetectCXX11.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | include(${CMAKE_CURRENT_LIST_DIR}/IncludeGuard.cmake) 16 | cmake_include_guard() 17 | 18 | if(MSVC) 19 | 20 | # Support For C++11/14/17 Features (Modern C++) 21 | # https://msdn.microsoft.com/en-us/library/hh567368.aspx 22 | # MSVC_VERSION: 23 | # https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html 24 | 25 | if(NOT (MSVC_VERSION LESS 1600)) 26 | message(STATUS "Visual Studio >= 2010, MSVC >= 10.0") 27 | else() 28 | message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") 29 | endif() 30 | 31 | else() 32 | 33 | set(CXX_FLAGS_EXTRA "") 34 | 35 | include(CheckCXXCompilerFlag) 36 | check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11) 37 | check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X) 38 | if(COMPILER_SUPPORTS_CXX11) 39 | set(CXX_FLAGS_EXTRA "-std=c++11") 40 | message(STATUS "Using flag -std=c++11") 41 | elseif(COMPILER_SUPPORTS_CXX0X) 42 | set(CXX_FLAGS_EXTRA "-std=c++0x") 43 | message(STATUS "Using flag -std=c++0x") 44 | else() 45 | message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") 46 | endif() 47 | 48 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_EXTRA}") 49 | 50 | # Ensure access this in sub directories 51 | set(CXX_FLAGS_EXTRA "${CXX_FLAGS_EXTRA}" CACHE STRING "Value of the extra cxx flags.") 52 | 53 | endif() 54 | -------------------------------------------------------------------------------- /cmake/DetectOpenCV.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | include(${CMAKE_CURRENT_LIST_DIR}/IncludeGuard.cmake) 16 | cmake_include_guard() 17 | 18 | if(OpenCV_FIND_QUIET) 19 | find_package(OpenCV QUIET) 20 | else() 21 | find_package(OpenCV REQUIRED) 22 | endif() 23 | 24 | if(OpenCV_FOUND) 25 | 26 | #message(STATUS "Found OpenCV: ${OpenCV_VERSION}") 27 | 28 | set(WITH_OPENCV TRUE) 29 | 30 | if(OpenCV_VERSION VERSION_LESS 3.0) 31 | set(WITH_OPENCV2 TRUE) 32 | elseif(OpenCV_VERSION VERSION_LESS 4.0) 33 | set(WITH_OPENCV3 TRUE) 34 | else() 35 | set(WITH_OPENCV4 TRUE) 36 | endif() 37 | 38 | list(FIND OpenCV_LIBS "opencv_world" __index) 39 | if(${__index} GREATER -1) 40 | set(WITH_OPENCV_WORLD TRUE) 41 | endif() 42 | 43 | if(NOT OpenCV_LIB_PATH) 44 | list(LENGTH OpenCV_INCLUDE_DIRS __length) 45 | if(${__length} GREATER 0) 46 | list(GET OpenCV_INCLUDE_DIRS 0 __include_dir) 47 | string(REGEX REPLACE "include.*$" "lib" __lib_dir "${__include_dir}") 48 | find_library(__opencv_lib 49 | NAMES opencv_core3 opencv_core opencv_world 50 | PATHS "${__lib_dir}" "${__lib_dir}/x86_64-linux-gnu" 51 | NO_DEFAULT_PATH) 52 | #message(STATUS "__opencv_lib: ${__opencv_lib}") 53 | if(__opencv_lib) 54 | get_filename_component(OpenCV_LIB_PATH "${__opencv_lib}" DIRECTORY) 55 | else() 56 | set(OpenCV_LIB_PATH "${__lib_dir}") 57 | endif() 58 | #message(STATUS "OpenCV_LIB_PATH: ${OpenCV_LIB_PATH}") 59 | endif() 60 | endif() 61 | 62 | if(MSVC OR MSYS OR MINGW) 63 | get_filename_component(OpenCV_LIB_SEARCH_PATH "${OpenCV_LIB_PATH}/../bin" ABSOLUTE) 64 | else() 65 | set(OpenCV_LIB_SEARCH_PATH "${OpenCV_LIB_PATH}") 66 | endif() 67 | 68 | include_directories( 69 | ${OpenCV_INCLUDE_DIRS} 70 | ) 71 | 72 | else() 73 | 74 | set(WITH_OPENCV FALSE) 75 | 76 | endif() 77 | -------------------------------------------------------------------------------- /cmake/IncludeGuard.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # include_guard: https://cmake.org/cmake/help/latest/command/include_guard.html 16 | 17 | macro(cmake_include_guard) 18 | get_property(INCLUDE_GUARD GLOBAL PROPERTY "_INCLUDE_GUARD_${CMAKE_CURRENT_LIST_FILE}") 19 | if(INCLUDE_GUARD) 20 | return() 21 | endif() 22 | set_property(GLOBAL PROPERTY "_INCLUDE_GUARD_${CMAKE_CURRENT_LIST_FILE}" TRUE) 23 | endmacro() 24 | -------------------------------------------------------------------------------- /cmake/templates/build.info.in: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | --- 3 | HOST_OS: "@HOST_OS@" 4 | HOST_NAME: "@HOST_NAME@" 5 | HOST_ARCH: "@HOST_ARCH@" 6 | HOST_COMPILER: "@CMAKE_CXX_COMPILER_ID@" 7 | COMPILER_VERSION: "@CMAKE_CXX_COMPILER_VERSION@" 8 | COMPILER_VERSION_MAJOR: @CMAKE_CXX_COMPILER_VERSION_MAJOR@ 9 | COMPILER_VERSION_MINOR: @CMAKE_CXX_COMPILER_VERSION_MINOR@ 10 | COMPILER_VERSION_PATCH: @CMAKE_CXX_COMPILER_VERSION_PATCH@ 11 | COMPILER_VERSION_TWEAK: @CMAKE_CXX_COMPILER_VERSION_TWEAK@ 12 | CUDA_VERSION: "@CUDA_VERSION@" 13 | CUDA_VERSION_MAJOR: @CUDA_VERSION_MAJOR@ 14 | CUDA_VERSION_MINOR: @CUDA_VERSION_MINOR@ 15 | CUDA_VERSION_STRING: "@CUDA_VERSION_STRING@" 16 | OpenCV_VERSION: "@OpenCV_VERSION@" 17 | OpenCV_VERSION_MAJOR: @OpenCV_VERSION_MAJOR@ 18 | OpenCV_VERSION_MINOR: @OpenCV_VERSION_MINOR@ 19 | OpenCV_VERSION_PATCH: @OpenCV_VERSION_PATCH@ 20 | OpenCV_VERSION_TWEAK: @OpenCV_VERSION_TWEAK@ 21 | OpenCV_VERSION_STATUS: "@OpenCV_VERSION_STATUS@" 22 | OpenCV_WITH_WORLD: "@WITH_OPENCV_WORLD@" 23 | INDEMIND_VERSION: "@indemind_VERSION@" 24 | INDEMIND_VERSION_MAJOR: @indemind_VERSION_MAJOR@ 25 | INDEMIND_VERSION_MINOR: @indemind_VERSION_MINOR@ 26 | INDEMIND_VERSION_PATCH: @indemind_VERSION_PATCH@ 27 | INDEMIND_VERSION_TWEAK: @indemind_VERSION_TWEAK@ 28 | -------------------------------------------------------------------------------- /cmake/templates/exe.bat.in: -------------------------------------------------------------------------------- 1 | @echo off 2 | set "MY_DIR=%~dp0" 3 | set "MY_PWD=%cd%" 4 | 5 | if "%MY_PATH_SET_@__exe_name@%"=="" ( 6 | set "MY_PATH_SET_@__exe_name@=1" 7 | set "PATH=@__dll_search_paths@;%PATH%" 8 | ) 9 | 10 | ::cd "%MY_DIR%" 11 | "%MY_DIR%@__exe_name@.exe" %* 12 | ::cd "%MY_PWD%" 13 | ::pause >nul 14 | -------------------------------------------------------------------------------- /cmake/templates/pkginfo.sh.in: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | OpenCV_VERSION=@OpenCV_VERSION@ 4 | OpenCV_VERSION_MAJOR=@OpenCV_VERSION_MAJOR@ 5 | OpenCV_VERSION_MINOR=@OpenCV_VERSION_MINOR@ 6 | OpenCV_VERSION_PATCH=@OpenCV_VERSION_PATCH@ 7 | OpenCV_VERSION_STATUS=@OpenCV_VERSION_STATUS@ 8 | 9 | _contains() { 10 | [ `echo $1 | grep -c "$2"` -gt 0 ] 11 | } 12 | 13 | if _contains "@OpenCV_INCLUDE_DIRS@" "/ros/"; then 14 | ROS_VERSION=$(rosversion -d) 15 | OpenCV_VERSION=ros-$ROS_VERSION 16 | fi 17 | -------------------------------------------------------------------------------- /demo/build-demo.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set buildOutputFile=build 4 | 5 | if exist .\%buildOutputFile% ( 6 | echo del %buildOutputFile% 7 | del %buildOutputFile% 8 | ) else ( 9 | echo mkdir %buildOutputFile% 10 | mkdir %buildOutputFile% 11 | ) 12 | 13 | cd %buildOutputFile% 14 | echo. 15 | 16 | echo start... "call cmake ." 17 | call cmake-gui ..\. 18 | echo. 19 | 20 | echo %cd%\indemind_demos.sln 21 | start .\indemind_demos.sln 22 | echo. 23 | 24 | cd .. 25 | copy %cd%\..\src\detector\lib\win10-x64\MNN.dll %cd%\output\bin\MNN.dll 26 | copy %cd%\..\lib\win10-x64\indemind.dll %cd%\output\bin\indemind.dll 27 | copy %cd%\..\src\detector\config\blazeface.mnn %cd%\output\bin\blazeface.mnn 28 | 29 | ::pause 30 | exit 31 | -------------------------------------------------------------------------------- /demo/get_depth.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #include "imrdata.h" 15 | #include "imrsdk.h" 16 | #include "logging.h" 17 | #include "times.h" 18 | #include "types.h" 19 | #include 20 | #include 21 | using namespace indem; 22 | 23 | template void clear(std::queue &q) { 24 | std::queue empty; 25 | swap(empty, q); 26 | } 27 | 28 | int main(int argc, char **argv) { 29 | auto m_pSDK = new CIMRSDK(); 30 | MRCONFIG config = {0}; 31 | config.bSlam = false; 32 | config.imgResolution = IMG_640; 33 | config.imgFrequency = 50; 34 | config.imuFrequency = 1000; 35 | 36 | m_pSDK->Init(config); 37 | std::queue depth_queue; 38 | std::mutex mutex_depth; 39 | int depth_count = 0; 40 | if (m_pSDK->EnableDepthProcessor()) { 41 | m_pSDK->RegistDepthCallback( 42 | [&depth_count, &depth_queue, &mutex_depth](double time, cv::Mat depth) { 43 | if (!depth.empty()) { 44 | depth.convertTo(depth, CV_16U, 1000.0); 45 | { 46 | std::unique_lock u_lock(mutex_depth); 47 | depth_queue.push(depth); 48 | } 49 | ++depth_count; 50 | } 51 | }); 52 | } 53 | auto &&time_beg = times::now(); 54 | while (true) { 55 | if (!depth_queue.empty()) { 56 | std::unique_lock u_lock(mutex_depth); 57 | cv::imshow("depth", depth_queue.front()); 58 | clear(depth_queue); 59 | } 60 | char key = static_cast(cv::waitKey(1)); 61 | if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q 62 | break; 63 | } 64 | } 65 | delete m_pSDK; 66 | auto &&time_end = times::now(); 67 | 68 | float elapsed_ms = 69 | times::count(time_end - time_beg) * 0.001f; 70 | #ifdef __linux 71 | LOG(INFO) << "Time beg: " << times::to_local_string(time_beg) 72 | << ", end: " << times::to_local_string(time_end) 73 | << ", cost: " << elapsed_ms << "ms"; 74 | LOG(INFO) << "depth count: " << depth_count 75 | << ", fps: " << (1000.f * depth_count / elapsed_ms); 76 | #endif 77 | return 0; 78 | } -------------------------------------------------------------------------------- /demo/get_device_info.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #include "imrdata.h" 15 | #include "imrsdk.h" 16 | #include "logging.h" 17 | #include "svc_config.h" 18 | #include "times.h" 19 | #include "types.h" 20 | #include 21 | #include 22 | 23 | using namespace indem; 24 | 25 | int main(int argc, char **argv) { 26 | auto m_pSDK = new CIMRSDK(); 27 | MRCONFIG config = {0}; 28 | config.bSlam = false; 29 | config.imgResolution = IMG_640; 30 | config.imgFrequency = 50; 31 | config.imuFrequency = 1000; 32 | 33 | // m_pSDK->Init(config); 34 | indem::MoudleAllParam param = m_pSDK->GetModuleParams(); 35 | indem::ModuleInfo info = m_pSDK->GetModuleInfo(); 36 | 37 | std::cout << "Module info: " << std::endl; 38 | info.printInfo(); 39 | std::cout << "Left param: " << std::endl; 40 | param._left_camera[RESOLUTION::RES_640X400].printInfo(); 41 | std::cout << "Right param: " << std::endl; 42 | param._right_camera[RESOLUTION::RES_640X400].printInfo(); 43 | std::cout << "Imu param: " << std::endl; 44 | param._imu.printInfo(); 45 | delete m_pSDK; 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /demo/get_points.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #include "imrdata.h" 15 | #include "imrsdk.h" 16 | #include "logging.h" 17 | #include "times.h" 18 | #include "types.h" 19 | #include "util_pcl.h" 20 | #include 21 | #include 22 | using namespace indem; 23 | 24 | template void clear(std::queue &q) { 25 | std::queue empty; 26 | swap(empty, q); 27 | } 28 | 29 | int main(int argc, char **argv) { 30 | auto m_pSDK = new CIMRSDK(); 31 | MRCONFIG config = {0}; 32 | config.bSlam = false; 33 | config.imgResolution = IMG_640; 34 | config.imgFrequency = 50; 35 | config.imuFrequency = 1000; 36 | 37 | m_pSDK->Init(config); 38 | std::queue points_queue; 39 | std::mutex mutex_points; 40 | int points_count = 0; 41 | if (m_pSDK->EnablePointProcessor()) { 42 | // m_pSDK->EnableLRConsistencyCheck(); 43 | // m_pSDK->SetDepthCalMode(DepthCalMode::HIGH_ACCURACY); 44 | m_pSDK->RegistPointCloudCallback( 45 | [&points_count, &points_queue, &mutex_points](double time, cv::Mat points) { 46 | if (!points.empty()) { 47 | { 48 | std::unique_lock lock(mutex_points); 49 | points_queue.push(points); 50 | } 51 | ++points_count; 52 | } 53 | }); 54 | } 55 | PCViewer pcviewer; 56 | auto &&time_beg = times::now(); 57 | while (true) { 58 | if (!points_queue.empty()) { 59 | std::unique_lock lock(mutex_points); 60 | pcviewer.Update(points_queue.front()); 61 | clear(points_queue); 62 | } 63 | char key = static_cast(cv::waitKey(1)); 64 | if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q 65 | break; 66 | } 67 | if (pcviewer.WasStopped()) { 68 | break; 69 | } 70 | } 71 | delete m_pSDK; 72 | 73 | auto &&time_end = times::now(); 74 | 75 | float elapsed_ms = 76 | times::count(time_end - time_beg) * 0.001f; 77 | #ifdef __linux 78 | LOG(INFO) << "Time beg: " << times::to_local_string(time_beg) 79 | << ", end: " << times::to_local_string(time_end) 80 | << ", cost: " << elapsed_ms << "ms"; 81 | LOG(INFO) << "depth count: " << points_count 82 | << ", fps: " << (1000.f * points_count / elapsed_ms); 83 | #endif 84 | return 0; 85 | } -------------------------------------------------------------------------------- /demo/get_rectified_img.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #include "imrdata.h" 15 | #include "imrsdk.h" 16 | #include "logging.h" 17 | #include "times.h" 18 | #include "types.h" 19 | #include 20 | #include 21 | using namespace indem; 22 | 23 | template void clear(std::queue &q) { 24 | std::queue empty; 25 | swap(empty, q); 26 | } 27 | 28 | int main(int argc, char **argv) { 29 | auto m_pSDK = new CIMRSDK(); 30 | MRCONFIG config = {0}; 31 | config.bSlam = false; 32 | config.imgResolution = IMG_640; 33 | config.imgFrequency = 50; 34 | config.imuFrequency = 1000; 35 | 36 | m_pSDK->Init(config); 37 | std::queue rectified_queue; 38 | std::mutex mutex_rectified; 39 | int rectified_img_count = 0; 40 | if (m_pSDK->EnableRectifyProcessor()) { 41 | m_pSDK->RegistRectifiedImgCallback( 42 | [&rectified_img_count, &rectified_queue, &mutex_rectified]( 43 | double time, cv::Mat left, cv::Mat right) { 44 | if (!left.empty() && !right.empty()) { 45 | cv::Mat img; 46 | cv::hconcat(left, right, img); 47 | { 48 | std::unique_lock lock(mutex_rectified); 49 | rectified_queue.push(img); 50 | } 51 | ++rectified_img_count; 52 | } 53 | }); 54 | } 55 | auto &&time_beg = times::now(); 56 | while (true) { 57 | if (!rectified_queue.empty()) { 58 | std::unique_lock lock(mutex_rectified); 59 | cv::imshow("rectified_img", rectified_queue.front()); 60 | clear(rectified_queue); 61 | } 62 | char key = static_cast(cv::waitKey(1)); 63 | if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q 64 | break; 65 | } 66 | } 67 | delete m_pSDK; 68 | 69 | auto &&time_end = times::now(); 70 | 71 | float elapsed_ms = 72 | times::count(time_end - time_beg) * 0.001f; 73 | #ifdef __linux 74 | LOG(INFO) << "Time beg: " << times::to_local_string(time_beg) 75 | << ", end: " << times::to_local_string(time_end) 76 | << ", cost: " << elapsed_ms << "ms"; 77 | LOG(INFO) << "rectified count: " << rectified_img_count 78 | << ", fps: " << (1000.f * rectified_img_count / elapsed_ms); 79 | #endif 80 | return 0; 81 | } -------------------------------------------------------------------------------- /demo/util_pcl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Indemind Co., Ltd. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // limitations under the License. 15 | #ifndef UTIL_PCL_H_ 16 | #define UTIL_PCL_H_ 17 | #pragma once 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | class PCViewer { 26 | public: 27 | PCViewer(); 28 | ~PCViewer(); 29 | 30 | void Update(const cv::Mat &xyz); 31 | 32 | void Update(pcl::PointCloud::ConstPtr pc); 33 | 34 | bool WasVisual() const; 35 | bool WasStopped() const; 36 | 37 | private: 38 | void ConvertMatToPointCloud(const cv::Mat &xyz, 39 | pcl::PointCloud::Ptr pc); 40 | 41 | std::shared_ptr viewer_; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/imrdata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | //该文件存放SDK对外的数据接口 3 | //坐标系定义:x轴右,y轴上,z轴后 4 | struct ImrPose { 5 | double time; 6 | //[x,y,z] 7 | float _position[3]; 8 | //[w,x,y,z] 9 | float _rotation[4]; 10 | //[pitch roll psi] 11 | float _oula[3]; 12 | }; 13 | 14 | //模组位姿 15 | struct ImrModulePose { 16 | ImrPose _pose; 17 | double _cov[36]; //权重 18 | }; 19 | 20 | //模组摄像头图像数据 21 | struct ImrImage { 22 | double _time; 23 | int _width; 24 | int _height; 25 | unsigned char *_image; 26 | }; 27 | 28 | struct MrPoint { 29 | float _x; 30 | float _y; 31 | float _z; 32 | float _flag; 33 | }; 34 | 35 | //相机标定参数 36 | struct CameraCalibrationParameter { 37 | int _width; //图像宽 38 | int _height; //图像高 39 | int _channel; //通道数 40 | 41 | double _Kl[9]; // 3X3 左相机内参矩阵 42 | double _Kr[9]; // 3X3 右相机内参矩阵 43 | double _Dl[4]; // 4X1 左相机畸变差校正参数,鱼眼畸变 44 | double _Dr[4]; // 4X1 右相机畸变差校正参数,鱼眼畸变 45 | double _Pl[12]; // 3X4 基线校正后左相机投影矩阵 46 | double _Pr[12]; // 3X4 基线校正后右相机投影矩阵 47 | double _Rl[9]; // 3X3 基线校正后左相机旋转矩阵 48 | double _Rr[9]; // 3X3 基线校正后左相机旋转矩阵 49 | double _TSCl[16]; // 4X4 左相机系到传感器坐标系的变换 50 | double _TSCr[16]; // 4X4 右相机系到传感器坐标系的变换 51 | double _focal_length_l[2]; //相机fx,fy 52 | double _focal_length_r[2]; //相机fx,fy 53 | double _principal_point_l[2]; //相机cx,cy 54 | double _principal_point_r[2]; //相机cx,cy 55 | double _baseline; //基线,单位:m 56 | 57 | double _AMax; 58 | double _GMax; 59 | double _SigmaGC; 60 | double _SigmaAC; 61 | double _SigmaBg; 62 | double _SigmaBa; 63 | double _SigmaGwC; 64 | double _SigmaAwC; 65 | 66 | /* 加计参数,3X4矩阵,每个元素如下 67 | * x y z 68 | * 11 12 13 69 | * 21 22 23 70 | * 31 32 33 71 | */ 72 | double _Acc[12]; 73 | /* 陀螺参数,3X4矩阵,每个元素如下 74 | * x y z 75 | * 11 12 13 76 | * 21 22 23 77 | * 31 32 33 78 | */ 79 | double _Gyr[12]; 80 | }; -------------------------------------------------------------------------------- /include/svc_config.h: -------------------------------------------------------------------------------- 1 | #ifndef __SVC_CONFIG_H__ 2 | #define __SVC_CONFIG_H__ 3 | 4 | #include 5 | 6 | #define SVC_CONFIG 0 7 | 8 | #define SVC_INSTALL_PATH "/usr/local/bin/svc" 9 | 10 | namespace indem { 11 | 12 | class SVCConfig final { 13 | SVCConfig() {} 14 | ~SVCConfig() {} 15 | public: 16 | static std::string GetInstallPath() { return SVC_INSTALL_PATH; } 17 | }; 18 | 19 | } 20 | 21 | #endif /* __SVC_CONFIG_H__ */ 22 | -------------------------------------------------------------------------------- /lib/aarch64/libindemind.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/lib/aarch64/libindemind.so -------------------------------------------------------------------------------- /lib/others/tx2-opencv3.4.3/libindemind.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/lib/others/tx2-opencv3.4.3/libindemind.so -------------------------------------------------------------------------------- /lib/others/win10-x64-vs15-opencv3.4.3/Readme.txt: -------------------------------------------------------------------------------- 1 | 文件: 2 | indemind.lib 3 | indemind.dll 4 | 5 | 操作系统:win10(x64) 6 | 编译工具:visual studio 2015 7 | 编译平台:x64 8 | opencv版本:opencv 3.4.3 9 | boost版本:1.73.0 -------------------------------------------------------------------------------- /lib/others/win10-x64-vs15-opencv3.4.3/indemind.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/lib/others/win10-x64-vs15-opencv3.4.3/indemind.dll -------------------------------------------------------------------------------- /lib/others/win10-x64-vs15-opencv3.4.3/indemind.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/lib/others/win10-x64-vs15-opencv3.4.3/indemind.lib -------------------------------------------------------------------------------- /lib/others/x64-opencv3.4.3/libindemind.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/lib/others/x64-opencv3.4.3/libindemind.so -------------------------------------------------------------------------------- /lib/win10-x64/Readme.txt: -------------------------------------------------------------------------------- 1 | 文件: 2 | indemind.lib 3 | indemind.dll 4 | 5 | 操作系统:win10(x64) 6 | 编译工具:visual studio 2015 7 | 编译平台:x64 8 | opencv版本:opencv 3.3.1 9 | boost版本:1.73.0 -------------------------------------------------------------------------------- /lib/win10-x64/indemind.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/lib/win10-x64/indemind.dll -------------------------------------------------------------------------------- /lib/win10-x64/indemind.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/lib/win10-x64/indemind.lib -------------------------------------------------------------------------------- /lib/x86-64/libindemind.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/lib/x86-64/libindemind.so -------------------------------------------------------------------------------- /ros/src/imsee_ros_wrapper/config/settings.yaml: -------------------------------------------------------------------------------- 1 | # process setting 2 | enable_rectified: false 3 | enable_disparity: false 4 | enable_depth: false 5 | enable_point: false 6 | enable_detector: false 7 | 8 | # device setting 9 | # resolutuin index: 1 = IMG_640(640X400), 2 = IMG_1280(1280X800) 10 | resolution_index: 1 11 | # image frame rate range: IMG_640: 25, 50, 100, 200. IMG_1280: 25 50 100 12 | framerate: 50 13 | # imu frequency range: 100, 200, 500, 1000 14 | imu_frequency: 1000 -------------------------------------------------------------------------------- /ros/src/imsee_ros_wrapper/launch/display.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ros/src/imsee_ros_wrapper/launch/start.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ros/src/imsee_ros_wrapper/nodelet_plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | This is the nodelet of ROS interface for Indemind IMSEE camera. 6 | 7 | 8 | -------------------------------------------------------------------------------- /ros/src/imsee_ros_wrapper/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | imsee_ros_wrapper 4 | 0.0.0 5 | The imsee wrapper package 6 | 7 | Kalman Xiong 8 | 9 | Indemind License 10 | 11 | 12 | 13 | Kalman Xiong 14 | 15 | catkin 16 | cv_bridge 17 | geometry_msgs 18 | image_transport 19 | message_generation 20 | nodelet 21 | roscpp 22 | sensor_msgs 23 | std_msgs 24 | tf 25 | 26 | cv_bridge 27 | geometry_msgs 28 | image_transport 29 | nodelet 30 | roscpp 31 | sensor_msgs 32 | std_msgs 33 | tf 34 | 35 | cv_bridge 36 | geometry_msgs 37 | image_transport 38 | message_runtime 39 | nodelet 40 | roscpp 41 | sensor_msgs 42 | std_msgs 43 | tf 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /ros/src/imsee_ros_wrapper/src/wrapper_node.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Slightech Co., Ltd. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #include 15 | #include 16 | 17 | int main(int argc, char *argv[]) { 18 | ros::init(argc, argv, "imsee_wrapper_node"); 19 | ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, 20 | ros::console::levels::Info); 21 | 22 | nodelet::Loader nodelet; 23 | nodelet::M_string remap(ros::names::getRemappings()); 24 | nodelet::V_string nargv; 25 | nodelet.load(ros::this_node::getName(), "imsee/ROSWrapperNodelet", remap, 26 | nargv); 27 | 28 | ros::spin(); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /scripts/common/detect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [ -n "${_DETECT_SH_}" ] && return || readonly _DETECT_SH_=1 17 | [ -n "${_VERBOSE_}" ] && echo "-- INCLUDE: detect.sh" 18 | 19 | _detect() { 20 | cmd="$1"; optional="$2"; verbose="$3"; 21 | [ -n "$verbose" ] || [ -z "${_VERBOSE_}" ] || verbose=1; 22 | if ! type "$cmd" &> /dev/null; then 23 | [ -z "$verbose" ] || echo "-- DETECT: $cmd not found" 24 | if [ -z "$optional" ]; then 25 | echo >&2 "-- DETECT: $cmd not found, but required" 26 | exit 1 27 | fi 28 | else 29 | if [ -z "$verbose" ]; then 30 | eval "${cmd}_FOUND=1" &> /dev/null 31 | else 32 | echo "-- DETECT: $cmd found" 33 | eval "${cmd}_FOUND=1" 34 | fi 35 | fi 36 | } 37 | 38 | _detect_cmd() { 39 | [ -x "$(command -v $1)" ] 40 | } 41 | 42 | _detect_fn() { 43 | [ `type -t $1`"" == "function" ] 44 | } 45 | 46 | if [ -n "${_TEST_}" ]; then 47 | echo "-- TEST_BEG: _detect" 48 | _CMDS=(ls none) 49 | for _cmd in "${_CMDS[@]}"; do 50 | _detect "$_cmd" 1 51 | 52 | _CMD_FOUND="${_cmd}_FOUND" 53 | if [ -n "${!_CMD_FOUND}" ]; then 54 | echo "-- ${_CMD_FOUND} set" 55 | else 56 | echo "-- ${_CMD_FOUND} unset" 57 | fi 58 | done 59 | echo "-- TEST_END: _detect" 60 | 61 | echo "-- TEST_BEG: _detect_fn" 62 | _FUNCS=(_detect none) 63 | for _fn in "${_FUNCS[@]}"; do 64 | if _detect_fn "$_fn"; then 65 | echo "-- $_fn function exists" 66 | else 67 | echo "-- $_fn function not exist" 68 | fi 69 | done 70 | echo "-- TEST_END: _detect_fn" 71 | fi 72 | -------------------------------------------------------------------------------- /scripts/common/echo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [ -n "${_ECHO_SH_}" ] && return || readonly _ECHO_SH_=1 17 | [ -n "${_VERBOSE_}" ] && echo "-- INCLUDE: echo.sh" 18 | 19 | # if [ -n "$SCRIPTS_DIR" ]; then 20 | # source "$SCRIPTS_DIR/common/echo.sh" 21 | # else 22 | # source "$(dirname "$0")/echo.sh" 23 | # fi 24 | 25 | ECHO="echo -e" 26 | 27 | # task colors 28 | COLOR_STRONG="1;35" # Magenta 29 | COLOR_INFO="1;34" # Blue 30 | COLOR_WARN="1;33" # Yellow 31 | COLOR_DONE="1;32" # Green 32 | COLOR_ERROR="1;31" # Red 33 | # action colors 34 | COLOR_STRONG_NORMAL="35" 35 | COLOR_INFO_NORMAL="34" 36 | COLOR_WARN_NORMAL="33" 37 | COLOR_DONE_NORMAL="32" 38 | COLOR_ERROR_NORMAL="31" 39 | 40 | _echo_() { 41 | text="$1"; shift; options="$1"; shift; 42 | [ -z "$options" ] && options="$COLOR_STRONG"; 43 | $ECHO "\033[${options}m${text}\033[0m" 44 | } 45 | 46 | _echo_e_() { 47 | text="$1"; shift; options="$1"; shift; 48 | [ -z "$options" ] && options="$COLOR_ERROR"; 49 | $ECHO >&2 "\033[${options}m${text}\033[0m" 50 | } 51 | 52 | _echo() { 53 | $ECHO "$@" 54 | } 55 | 56 | _echo_s() { 57 | _echo_ "$1" "$COLOR_STRONG" 58 | } 59 | 60 | _echo_i() { 61 | _echo_ "$1" "$COLOR_INFO" 62 | } 63 | 64 | _echo_w() { 65 | _echo_ "$1" "$COLOR_WARN" 66 | } 67 | 68 | _echo_d() { 69 | _echo_ "$1" "$COLOR_DONE" 70 | } 71 | 72 | _echo_e() { 73 | _echo_e_ "$1" "$COLOR_ERROR" 74 | } 75 | 76 | _echo_sn() { 77 | _echo_ "$1" "$COLOR_STRONG_NORMAL" 78 | } 79 | 80 | _echo_in() { 81 | _echo_ "$1" "$COLOR_INFO_NORMAL" 82 | } 83 | 84 | _echo_wn() { 85 | _echo_ "$1" "$COLOR_WARN_NORMAL" 86 | } 87 | 88 | _echo_dn() { 89 | _echo_ "$1" "$COLOR_DONE_NORMAL" 90 | } 91 | 92 | _echo_en() { 93 | _echo_e_ "$1" "$COLOR_ERROR_NORMAL" 94 | } 95 | -------------------------------------------------------------------------------- /scripts/common/host.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [ -n "${_HOST_SH_}" ] && return || readonly _HOST_SH_=1 17 | [ -n "${_VERBOSE_}" ] && echo "-- INCLUDE: host.sh" 18 | 19 | _host_contains_() { 20 | [ `echo $1 | grep -c "$2"` -gt 0 ] 21 | } 22 | 23 | if _host_contains_ "$OS" "Windows_NT"; then 24 | 25 | HOST_OS="Win" 26 | 27 | if _host_contains_ "$PROCESSOR_ARCHITEW6432" "AMD64"; then 28 | HOST_ARCH="x64" 29 | else 30 | if _host_contains_ "$PROCESSOR_ARCHITECTURE" "AMD64"; then 31 | HOST_ARCH="x64" 32 | elif _host_contains_ "$PROCESSOR_ARCHITECTURE" "x86"; then 33 | HOST_ARCH="x86" 34 | else 35 | echo >&2 "-- HOST: unknown arch :(" 36 | exit 1 37 | fi 38 | fi 39 | 40 | else 41 | 42 | _UNAME_S=$(uname -s) 43 | 44 | if _host_contains_ "$_UNAME_S" "Linux"; then 45 | HOST_OS="Linux" 46 | elif _host_contains_ "$_UNAME_S" "Darwin"; then 47 | HOST_OS="Mac" 48 | elif _host_contains_ "$_UNAME_S" "MSYS\|MINGW"; then 49 | HOST_OS="Win" 50 | else 51 | echo >&2 "-- HOST: unknown os :(" 52 | exit 1 53 | fi 54 | 55 | _UNAME_M=$(uname -m) 56 | 57 | if _host_contains_ "$_UNAME_M" "x86_64"; then 58 | HOST_ARCH="x64" 59 | elif _host_contains_ "$_UNAME_M" "x86\|i686\|i386"; then 60 | HOST_ARCH="x86" 61 | elif _host_contains_ "$_UNAME_M" "arm"; then 62 | HOST_ARCH="Arm" 63 | elif _host_contains_ "$_UNAME_M" "aarch64"; then 64 | HOST_ARCH="AArch64" 65 | else 66 | echo >&2 "-- HOST: unknown arch :(" 67 | exit 1 68 | fi 69 | 70 | fi 71 | 72 | HOST_NAME="$HOST_OS" 73 | 74 | if [ "$HOST_OS" = "Win" ]; then 75 | _UNAME_S=$(uname -s) 76 | if [ -n "$_UNAME_S" ]; then 77 | if _host_contains_ "$_UNAME_S" "MINGW"; then 78 | HOST_NAME="MINGW" 79 | elif _host_contains_ "$_UNAME_S" "MSYS"; then 80 | HOST_NAME="MSYS" 81 | fi 82 | fi 83 | elif [ "$HOST_OS" = "Linux" ]; then 84 | _UNAME_A=$(uname -a) 85 | if _host_contains_ "$_UNAME_A" "tegra\|jetsonbot"; then 86 | HOST_NAME="Tegra" 87 | elif _host_contains_ "$_UNAME_A" "firefly"; then 88 | HOST_NAME="Firefly" 89 | elif _host_contains_ "$_UNAME_A" "ubuntu"; then 90 | HOST_NAME="Ubuntu" 91 | fi 92 | fi 93 | 94 | if [ -n "${_VERBOSE_}" ]; then 95 | echo "-- HOST_OS: $HOST_OS" 96 | echo "-- HOST_ARCH: $HOST_ARCH" 97 | echo "-- HOST_NAME: $HOST_NAME" 98 | fi 99 | -------------------------------------------------------------------------------- /scripts/common/mkdir.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [ -n "${_MKDIR_SH_}" ] && return || readonly _MKDIR_SH_=1 17 | [ -n "${_VERBOSE_}" ] && echo "-- INCLUDE: mkdir.sh" 18 | 19 | MKDIR="mkdir -p" 20 | 21 | _mkdir() { 22 | dir="$1"; required="$2"; verbose="$3"; 23 | [ -n "$verbose" ] || [ -z "${_VERBOSE_}" ] || verbose=1; 24 | if [ -e "$dir" ]; then 25 | if [ -d "$dir" ]; then 26 | [ -z "$verbose" ] || echo "-- MKDIR: $dir exists" 27 | else 28 | [ -z "$verbose" ] || echo >&2 "-- MKDIR: $dir not directory" 29 | if [ -n "$required" ]; then 30 | echo >&2 "-- MKDIR: $dir not directory, but required" 31 | exit 1 32 | fi 33 | fi 34 | else 35 | [ -z "$verbose" ] || echo "-- MKDIR: $dir creates" 36 | $MKDIR "$dir" 37 | fi 38 | } 39 | -------------------------------------------------------------------------------- /scripts/common/string.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | [ -n "${_STRING_SH_}" ] && return || readonly _STRING_SH_=1 17 | [ -n "${_VERBOSE_}" ] && echo "-- INCLUDE: string.sh" 18 | 19 | _startswith() { [ "$1" != "${1#$2}" ]; } 20 | _endswith() { [ "$1" != "${1%$2}" ]; } 21 | -------------------------------------------------------------------------------- /scripts/cp_files.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | BASE_DIR=$(cd "$(dirname "$0")" && pwd) 17 | PROJ_DIR=$BASE_DIR/.. 18 | DEMO_OUTPUT_DIR=$PROJ_DIR/demo/output/bin 19 | # DRIVER_BASE_DIR=$PROJ_DIR/src/driver/lib 20 | # DETECTOR_BASE_DIR=$PROJ_DIR/src/detector 21 | MNN_CONFIG_DIR=$DETECTOR_BASE_DIR/config 22 | 23 | # check host arch 24 | HOST_ARCH=$(uname -m) 25 | # echo "Host arch is $HOST_ARCH" 26 | 27 | # if [ "$HOST_ARCH" = "x86_64" ]; then 28 | # DRIVER_DIR=$DRIVER_BASE_DIR/x86-64 29 | # elif [ "$HOST_ARCH" = "aarch64" ]; then 30 | # DRIVER_DIR=$DRIVER_BASE_DIR/aarch64 31 | # else 32 | # echo "Unknown host arch :(" 33 | # exit 1 34 | # fi 35 | 36 | # creat link 37 | # if [ ! -f "$DEMO_OUTPUT_DIR/libusbdriver.so" ]; then 38 | # ln -s $DRIVER_DIR/libusbdriver.so $DEMO_OUTPUT_DIR 39 | # echo "Finish cp libusbdriver.so!" 40 | # fi 41 | 42 | if [ ! -f "$DEMO_OUTPUT_DIR/blazeface.mnn" ]; then 43 | ln -s $MNN_CONFIG_DIR/blazeface.mnn $DEMO_OUTPUT_DIR 44 | echo "Finish cp blazeface.mnn!" 45 | fi 46 | -------------------------------------------------------------------------------- /scripts/cp_files_ros.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | BASE_DIR=$(cd "$(dirname "$0")" && pwd) 17 | PROJ_DIR=$BASE_DIR/.. 18 | WRAPPER_OUTPUT_DIR=$PROJ_DIR/ros/devel/lib/imsee_ros_wrapper 19 | DRIVER_BASE_DIR=$PROJ_DIR/src/driver/lib 20 | DETECTOR_BASE_DIR=$PROJ_DIR/src/detector 21 | MNN_CONFIG_DIR=$DETECTOR_BASE_DIR/config 22 | MNN_LIB_BASE_DIR=$DETECTOR_BASE_DIR/lib 23 | 24 | # check host arch 25 | HOST_ARCH=$(uname -m) 26 | # echo "Host arch is $HOST_ARCH" 27 | 28 | # if [ "$HOST_ARCH" = "x86_64" ]; then 29 | # DRIVER_DIR=$DRIVER_BASE_DIR/x86-64 30 | # MNN_LIB_DIR=$MNN_LIB_BASE_DIR/x86-64 31 | # elif [ "$HOST_ARCH" = "aarch64" ]; then 32 | # DRIVER_DIR=$DRIVER_BASE_DIR/aarch64 33 | # MNN_LIB_DIR=$MNN_LIB_BASE_DIR/aarch64 34 | # else 35 | # echo "Unknown host arch :(" 36 | # exit 1 37 | # fi 38 | 39 | # creat link 40 | # if [ ! -f "$WRAPPER_OUTPUT_DIR/libusbdriver.so" ]; then 41 | # ln -s $DRIVER_DIR/libusbdriver.so $WRAPPER_OUTPUT_DIR 42 | # echo "Finish cp libusbdriver.so!" 43 | # fi 44 | 45 | if [ ! -f "$WRAPPER_OUTPUT_DIR/libMNN.so" ]; then 46 | ln -s $MNN_LIB_DIR/libMNN.so $WRAPPER_OUTPUT_DIR 47 | echo "Finish cp libMNN.so!" 48 | fi 49 | 50 | 51 | 52 | if [ ! -f "$WRAPPER_OUTPUT_DIR/blazeface.mnn" ]; then 53 | ln -s $MNN_CONFIG_DIR/blazeface.mnn $WRAPPER_OUTPUT_DIR 54 | echo "Finish cp blazeface.mnn!" 55 | fi 56 | -------------------------------------------------------------------------------- /scripts/cpplint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | BASE_DIR=$(cd "$(dirname "$0")" && pwd) 17 | ROOT_DIR=$(realpath "$BASE_DIR/..") 18 | 19 | source "$BASE_DIR/common/echo.sh" 20 | source "$BASE_DIR/common/detect.sh" 21 | source "$BASE_DIR/common/host.sh" 22 | 23 | PYTHON="python" 24 | if [ "$HOST_OS" = "Win" ]; then 25 | # default python on MSYS 26 | PYTHON="python2" 27 | fi 28 | 29 | CPPLINT="$PYTHON $ROOT_DIR/tools/linter/cpplint.py" 30 | # CPPLINT="cpplint" 31 | 32 | _detect $PYTHON 33 | 34 | DIRS=( 35 | _build/include 36 | include 37 | src 38 | ) 39 | 40 | FIND="$($BASE_DIR/getfind.sh)" 41 | 42 | PATT="-name *.cc -o -name *.h" 43 | PATT="$PATT -o -name *.cpp -o -name *.hpp" 44 | # PATT="$PATT -o -name *.cu -o -name *.cuh" 45 | # _echo "PATT: $PATT" 46 | 47 | ret=0 48 | _echo_s "WorkDir: $ROOT_DIR" 49 | for dir in "${DIRS[@]}"; do 50 | if [ -d "$ROOT_DIR/$dir" ]; then 51 | _echo_i "WorkDir: $dir" 52 | for f in `$FIND "$ROOT_DIR/$dir" -type f \( ${PATT} \)`; do 53 | _echo_in "cpplint $f" 54 | $CPPLINT "--verbose=1" \ 55 | "--filter=-legal/copyright,-build/c++11" \ 56 | "--root=$ROOT_DIR/$dir" "$f" 57 | if [ $? -eq 0 ]; then 58 | _echo_dn "cpplint success" 59 | else 60 | _echo_en "cpplint failed" 61 | ret=1 62 | fi 63 | done 64 | else 65 | _echo_i "WorkDir: $dir - not found" 66 | fi 67 | done 68 | 69 | if [ $ret -eq 0 ]; then 70 | _echo_d "Well done" 71 | else 72 | _echo_e "There are cpplint errors" 73 | fi 74 | -------------------------------------------------------------------------------- /scripts/getfind.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | FIND="find" 17 | 18 | if type where &> /dev/null; then 19 | for i in `where find`; do 20 | # find on MSYS instead of Windows 21 | if [ `echo $i | grep -c "msys"` -gt 0 ]; then 22 | FIND=`echo "${i%.exe}" | tr -d "[:space:]" | sed 's:\\\:/:g'` 23 | fi 24 | done 25 | fi 26 | 27 | echo "$FIND" 28 | -------------------------------------------------------------------------------- /scripts/init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # _VERBOSE_=1 17 | # _INIT_LINTER_=1 18 | # _INIT_COMMITIZEN_=1 19 | # _FORCE_INSRALL_=1 20 | _INSTALL_OPTIONS_=$@ 21 | 22 | BASE_DIR=$(cd "$(dirname "$0")" && pwd) 23 | 24 | source "$BASE_DIR/init_tools.sh" 25 | 26 | ## deps 27 | 28 | _echo_s "Init deps" 29 | 30 | #if [ "$HOST_OS" = "Linux" ]; then 31 | # _install_deps "$SUDO apt-get install" libv4l-dev 32 | #elif [ "$HOST_OS" = "Mac" ]; then 33 | # _install_deps "brew install" libuvc 34 | #elif [ "$HOST_OS" = "Win" ]; then 35 | # # _install_deps "pacman -S" ? 36 | # _echo 37 | #else # unexpected 38 | # _echo_e "Unknown host os :(" 39 | # exit 1 40 | #fi 41 | 42 | ## cmake version 43 | 44 | _cmake_version=`cmake --version | head -1` 45 | _cmake_version=${_cmake_version#*version} 46 | _cmake_version_major=`echo ${_cmake_version} | cut -d'.' -f1` 47 | if [ "$_cmake_version_major" -lt "3" ]; then 48 | _echo_s "Expect cmake version >= 3.0.0" 49 | if [ "$HOST_NAME" = "Ubuntu" ]; then 50 | # sudo apt remove cmake 51 | _echo "How to upgrade cmake in Ubuntu" 52 | _echo " https://askubuntu.com/questions/829310/how-to-upgrade-cmake-in-ubuntu" 53 | fi 54 | fi 55 | 56 | exit 0 57 | -------------------------------------------------------------------------------- /scripts/open.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | BASE_DIR=$(cd "$(dirname "$0")" && pwd) 17 | 18 | source "$BASE_DIR/common/echo.sh" 19 | source "$BASE_DIR/common/host.sh" 20 | 21 | if [ "$HOST_OS" = "Linux" ]; then 22 | OPEN="xdg-open" 23 | elif [ "$HOST_OS" = "Mac" ]; then 24 | OPEN="open" 25 | elif [ "$HOST_OS" = "Win" ]; then 26 | OPEN="start" 27 | else 28 | _echo_e "Unknown host os :(" 29 | exit 1 30 | fi 31 | 32 | [ $# -gt 0 ] && $OPEN "$@" 33 | -------------------------------------------------------------------------------- /scripts/version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2020 Indemind Co., Ltd. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | BASE_DIR=$(cd "$(dirname "$0")" && pwd) 17 | ROOT_DIR=$(dirname "$BASE_DIR") 18 | CONFIG_FILE="$ROOT_DIR/CMakeLists.txt" 19 | 20 | version=$(cat "$CONFIG_FILE" | grep -m1 "indemind VERSION") 21 | version=$(echo "${version%LANGUAGES*}") 22 | version=$(echo "${version#*VERSION}" | tr -d '[:space:]') 23 | 24 | echo "$version" 25 | -------------------------------------------------------------------------------- /scripts/win/cmake/indemind-targets-release.cmake: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "Release". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "indemind" for configuration "Release" 9 | set_property(TARGET indemind APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 10 | set_target_properties(indemind PROPERTIES 11 | IMPORTED_IMPLIB_RELEASE "${INDEMINDS_SDK_ROOT}/lib/indemind.lib" 12 | IMPORTED_LOCATION_RELEASE "${INDEMINDS_SDK_ROOT}/bin/indemind.dll" 13 | ) 14 | 15 | # Import target "indemind" for configuration "Debug" 16 | set_property(TARGET indemind APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) 17 | set_target_properties(indemind PROPERTIES 18 | IMPORTED_IMPLIB_DEBUG "${INDEMINDS_SDK_ROOT}/lib/indemindd.lib" 19 | IMPORTED_LOCATION_DEBUG "${INDEMINDS_SDK_ROOT}/bin/indemindd.dll" 20 | ) 21 | 22 | list(APPEND _IMPORT_CHECK_TARGETS indemind ) 23 | list(APPEND _IMPORT_CHECK_FILES_FOR_indemind 24 | "${INDEMINDS_SDK_ROOT}/lib/indemind.lib" "${INDEMINDS_SDK_ROOT}/bin/indemind.dll" 25 | "${INDEMINDS_SDK_ROOT}/lib/indemindd.lib" "${INDEMINDS_SDK_ROOT}/bin/indemindd.dll" 26 | ) 27 | 28 | # Commands beyond this point should not need to know the version. 29 | set(CMAKE_IMPORT_FILE_VERSION) 30 | -------------------------------------------------------------------------------- /scripts/win/generate.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set _MY_DIR=%~dp0 4 | 5 | set _VS_GEN="Visual Studio 15 2017 Win64" 6 | REM set _VS_GEN="Visual Studio 14 2015 Win64" 7 | 8 | cd %_MY_DIR% 9 | 10 | mkdir _build 11 | cd _build/ 12 | 13 | cmake -DCMAKE_BUILD_TYPE=Release ^ 14 | -DCMAKE_PREFIX_PATH="%_MY_DIR%/../lib/cmake" ^ 15 | -DOpenCV_DIR="%_MY_DIR%/../3rdparty/opencv/build" ^ 16 | -G %_VS_GEN% ^ 17 | .. 18 | 19 | cd %_MY_DIR% 20 | pause 21 | -------------------------------------------------------------------------------- /scripts/win/nsis/indemind.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/scripts/win/nsis/indemind.ico -------------------------------------------------------------------------------- /src/detector/config/blazeface.mnn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/detector/config/blazeface.mnn -------------------------------------------------------------------------------- /src/detector/config/default.yml: -------------------------------------------------------------------------------- 1 | %YAML:1.0 2 | 3 | display: true 4 | sleep_ms_per_frame: 100 5 | log_to_file: false 6 | -------------------------------------------------------------------------------- /src/detector/lib/aarch64/libMNN.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/detector/lib/aarch64/libMNN.so -------------------------------------------------------------------------------- /src/detector/lib/win10-x64/MNN.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/detector/lib/win10-x64/MNN.dll -------------------------------------------------------------------------------- /src/detector/lib/win10-x64/MNN.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/detector/lib/win10-x64/MNN.lib -------------------------------------------------------------------------------- /src/detector/lib/x86-64/libMNN.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/detector/lib/x86-64/libMNN.so -------------------------------------------------------------------------------- /src/driver/DriverInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef WIN32 3 | #define DRIVER_EXPORT extern "C" __declspec(dllexport) 4 | #else 5 | #define DRIVER_EXPORT 6 | #endif 7 | #include 8 | namespace indem { 9 | /*! 10 | * 相机返回的数据格式 11 | */ 12 | struct cameraData { 13 | //时间戳 14 | double _timeStamp; //单位:毫秒 15 | //图像数据 16 | unsigned char *_image; 17 | //数据宽高,通道数 18 | int _width, _height, _channel, _size; 19 | }; 20 | //相机数据回调函数 21 | typedef void (*DriverCameraDataCallback)(cameraData *data); 22 | 23 | /*! 24 | * 返回的IMU数据格式 25 | */ 26 | struct IMUData { 27 | //时间戳 28 | double _timeStamp; 29 | //[x,y,z]方向的加速度值,单位m/ss 30 | float _acc[3]; 31 | //[]姿态 32 | float _gyr[3]; 33 | }; 34 | /* IMU数据回调函数 */ 35 | typedef void (*DriverIMUDataCallback)(IMUData *data); 36 | 37 | //图像分辨率 38 | enum IMAGE_RESOLUTION { 39 | RESOLUTION_640, 40 | RESOLUTION_1280, 41 | RESOLUTION_DEFAULT = RESOLUTION_640 42 | }; 43 | //接入SDK的模组驱动接口 44 | class IDriverInterface { 45 | public: 46 | IDriverInterface() {} 47 | virtual ~IDriverInterface() {} 48 | 49 | //获取模组配置信息,version-结构体的版本号,params-用于接收配置的数组,len-实际拿到数据的长度 50 | virtual bool GetModuleParams(int &version, unsigned char *params, 51 | size_t &len) = 0; 52 | //设置摄像头回调函数 53 | virtual void SetCameraCallback(DriverCameraDataCallback callback) = 0; 54 | //设置IMU回调函数 55 | virtual void SetIMUCallback(DriverIMUDataCallback callback) = 0; 56 | //以指定的频率(单位Hz)打开设备 57 | virtual bool Open(int imuFreq = 1000, int imgFreq = 50, 58 | IMAGE_RESOLUTION resolution = RESOLUTION_DEFAULT) = 0; 59 | //关闭设备 60 | virtual void Close() = 0; 61 | }; 62 | }; // namespace indem 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | /* 68 | * \brief 69 | * 在SDK初始化、获取驱动信息的时候该接口都会调用,因此该接口的实现应该尽可能的简单 70 | */ 71 | DRIVER_EXPORT indem::IDriverInterface *DriverFactory(); 72 | 73 | /* 头显插入拔出回调函数 */ 74 | typedef void (*DriverHotplugCallback)(bool bArrive); 75 | DRIVER_EXPORT void SetHotplugCallback(DriverHotplugCallback callback); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | -------------------------------------------------------------------------------- /src/driver/lib/aarch64/libusbdriver.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/driver/lib/aarch64/libusbdriver.so -------------------------------------------------------------------------------- /src/driver/lib/win64/usbdriver.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/driver/lib/win64/usbdriver.dll -------------------------------------------------------------------------------- /src/driver/lib/win64/usbdriver.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/driver/lib/win64/usbdriver.lib -------------------------------------------------------------------------------- /src/driver/lib/win64/windriver.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/driver/lib/win64/windriver.dll -------------------------------------------------------------------------------- /src/driver/lib/x86-64/libusbdriver.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/INDEMIND/IMSEE-SDK/7d0d8d18ef1fd9ca2db29b49482d961d495c67c1/src/driver/lib/x86-64/libusbdriver.so -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Cholesky_Module Cholesky module 16 | * 17 | * 18 | * 19 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 20 | * Those decompositions are also accessible via the following methods: 21 | * - MatrixBase::llt() 22 | * - MatrixBase::ldlt() 23 | * - SelfAdjointView::llt() 24 | * - SelfAdjointView::ldlt() 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | */ 30 | 31 | #include "src/Cholesky/LLT.h" 32 | #include "src/Cholesky/LDLT.h" 33 | #ifdef EIGEN_USE_LAPACKE 34 | #include "src/misc/lapacke.h" 35 | #include "src/Cholesky/LLT_LAPACKE.h" 36 | #endif 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_CHOLESKY_MODULE_H 41 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 42 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/CholmodSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H 9 | #define EIGEN_CHOLMODSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup CholmodSupport_Module CholmodSupport module 21 | * 22 | * This module provides an interface to the Cholmod library which is part of the suitesparse package. 23 | * It provides the two following main factorization classes: 24 | * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. 25 | * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). 26 | * 27 | * For the sake of completeness, this module also propose the two following classes: 28 | * - class CholmodSimplicialLLT 29 | * - class CholmodSimplicialLDLT 30 | * Note that these classes does not bring any particular advantage compared to the built-in 31 | * SimplicialLLT and SimplicialLDLT factorization classes. 32 | * 33 | * \code 34 | * #include 35 | * \endcode 36 | * 37 | * 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. 38 | * The dependencies depend on how cholmod has been compiled. 39 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. 40 | * 41 | */ 42 | 43 | #include "src/CholmodSupport/CholmodSupport.h" 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H 48 | 49 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_EIGENVALUES_MODULE_H 9 | #define EIGEN_EIGENVALUES_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Cholesky" 16 | #include "Jacobi" 17 | #include "Householder" 18 | #include "LU" 19 | #include "Geometry" 20 | 21 | /** \defgroup Eigenvalues_Module Eigenvalues module 22 | * 23 | * 24 | * 25 | * This module mainly provides various eigenvalue solvers. 26 | * This module also provides some MatrixBase methods, including: 27 | * - MatrixBase::eigenvalues(), 28 | * - MatrixBase::operatorNorm() 29 | * 30 | * \code 31 | * #include 32 | * \endcode 33 | */ 34 | 35 | #include "src/misc/RealSvd2x2.h" 36 | #include "src/Eigenvalues/Tridiagonalization.h" 37 | #include "src/Eigenvalues/RealSchur.h" 38 | #include "src/Eigenvalues/EigenSolver.h" 39 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h" 40 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" 41 | #include "src/Eigenvalues/HessenbergDecomposition.h" 42 | #include "src/Eigenvalues/ComplexSchur.h" 43 | #include "src/Eigenvalues/ComplexEigenSolver.h" 44 | #include "src/Eigenvalues/RealQZ.h" 45 | #include "src/Eigenvalues/GeneralizedEigenSolver.h" 46 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h" 47 | #ifdef EIGEN_USE_LAPACKE 48 | #include "src/misc/lapacke.h" 49 | #include "src/Eigenvalues/RealSchur_LAPACKE.h" 50 | #include "src/Eigenvalues/ComplexSchur_LAPACKE.h" 51 | #include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h" 52 | #endif 53 | 54 | #include "src/Core/util/ReenableStupidWarnings.h" 55 | 56 | #endif // EIGEN_EIGENVALUES_MODULE_H 57 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 58 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/Geometry: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_GEOMETRY_MODULE_H 9 | #define EIGEN_GEOMETRY_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SVD" 16 | #include "LU" 17 | #include 18 | 19 | /** \defgroup Geometry_Module Geometry module 20 | * 21 | * This module provides support for: 22 | * - fixed-size homogeneous transformations 23 | * - translation, scaling, 2D and 3D rotations 24 | * - \link Quaternion quaternions \endlink 25 | * - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3) 26 | * - orthognal vector generation (\ref MatrixBase::unitOrthogonal) 27 | * - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink 28 | * - \link AlignedBox axis aligned bounding boxes \endlink 29 | * - \link umeyama least-square transformation fitting \endlink 30 | * 31 | * \code 32 | * #include 33 | * \endcode 34 | */ 35 | 36 | #include "src/Geometry/OrthoMethods.h" 37 | #include "src/Geometry/EulerAngles.h" 38 | 39 | #include "src/Geometry/Homogeneous.h" 40 | #include "src/Geometry/RotationBase.h" 41 | #include "src/Geometry/Rotation2D.h" 42 | #include "src/Geometry/Quaternion.h" 43 | #include "src/Geometry/AngleAxis.h" 44 | #include "src/Geometry/Transform.h" 45 | #include "src/Geometry/Translation.h" 46 | #include "src/Geometry/Scaling.h" 47 | #include "src/Geometry/Hyperplane.h" 48 | #include "src/Geometry/ParametrizedLine.h" 49 | #include "src/Geometry/AlignedBox.h" 50 | #include "src/Geometry/Umeyama.h" 51 | 52 | // Use the SSE optimized version whenever possible. At the moment the 53 | // SSE version doesn't compile when AVX is enabled 54 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX 55 | #include "src/Geometry/arch/Geometry_SSE.h" 56 | #endif 57 | 58 | #include "src/Core/util/ReenableStupidWarnings.h" 59 | 60 | #endif // EIGEN_GEOMETRY_MODULE_H 61 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 62 | 63 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/Householder: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 9 | #define EIGEN_HOUSEHOLDER_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Householder_Module Householder module 16 | * This module provides Householder transformations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/Householder/Householder.h" 24 | #include "src/Householder/HouseholderSequence.h" 25 | #include "src/Householder/BlockHouseholder.h" 26 | 27 | #include "src/Core/util/ReenableStupidWarnings.h" 28 | 29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 30 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 31 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/IterativeLinearSolvers: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 9 | #define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** 17 | * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module 18 | * 19 | * 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. 20 | * Those solvers are accessible via the following classes: 21 | * - ConjugateGradient for selfadjoint (hermitian) matrices, 22 | * - LeastSquaresConjugateGradient for rectangular least-square problems, 23 | * - BiCGSTAB for general square matrices. 24 | * 25 | * These iterative solvers are associated with some preconditioners: 26 | * - IdentityPreconditioner - not really useful 27 | * - DiagonalPreconditioner - also called Jacobi preconditioner, work very well on diagonal dominant matrices. 28 | * - IncompleteLUT - incomplete LU factorization with dual thresholding 29 | * 30 | * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport. 31 | * 32 | \code 33 | #include 34 | \endcode 35 | */ 36 | 37 | #include "src/IterativeLinearSolvers/SolveWithGuess.h" 38 | #include "src/IterativeLinearSolvers/IterativeSolverBase.h" 39 | #include "src/IterativeLinearSolvers/BasicPreconditioners.h" 40 | #include "src/IterativeLinearSolvers/ConjugateGradient.h" 41 | #include "src/IterativeLinearSolvers/LeastSquareConjugateGradient.h" 42 | #include "src/IterativeLinearSolvers/BiCGSTAB.h" 43 | #include "src/IterativeLinearSolvers/IncompleteLUT.h" 44 | #include "src/IterativeLinearSolvers/IncompleteCholesky.h" 45 | 46 | #include "src/Core/util/ReenableStupidWarnings.h" 47 | 48 | #endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 49 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 33 | 34 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/LU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_LU_MODULE_H 9 | #define EIGEN_LU_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup LU_Module LU module 16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 17 | * This module defines the following MatrixBase methods: 18 | * - MatrixBase::inverse() 19 | * - MatrixBase::determinant() 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/misc/Kernel.h" 27 | #include "src/misc/Image.h" 28 | #include "src/LU/FullPivLU.h" 29 | #include "src/LU/PartialPivLU.h" 30 | #ifdef EIGEN_USE_LAPACKE 31 | #include "src/misc/lapacke.h" 32 | #include "src/LU/PartialPivLU_LAPACKE.h" 33 | #endif 34 | #include "src/LU/Determinant.h" 35 | #include "src/LU/InverseImpl.h" 36 | 37 | // Use the SSE optimized version whenever possible. At the moment the 38 | // SSE version doesn't compile when AVX is enabled 39 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX 40 | #include "src/LU/arch/Inverse_SSE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_LU_MODULE_H 46 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 47 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/OrderingMethods: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_ORDERINGMETHODS_MODULE_H 9 | #define EIGEN_ORDERINGMETHODS_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** 16 | * \defgroup OrderingMethods_Module OrderingMethods module 17 | * 18 | * This module is currently for internal use only 19 | * 20 | * It defines various built-in and external ordering methods for sparse matrices. 21 | * They are typically used to reduce the number of elements during 22 | * the sparse matrix decomposition (LLT, LU, QR). 23 | * Precisely, in a preprocessing step, a permutation matrix P is computed using 24 | * those ordering methods and applied to the columns of the matrix. 25 | * Using for instance the sparse Cholesky decomposition, it is expected that 26 | * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A). 27 | * 28 | * 29 | * Usage : 30 | * \code 31 | * #include 32 | * \endcode 33 | * 34 | * A simple usage is as a template parameter in the sparse decomposition classes : 35 | * 36 | * \code 37 | * SparseLU > solver; 38 | * \endcode 39 | * 40 | * \code 41 | * SparseQR > solver; 42 | * \endcode 43 | * 44 | * It is possible as well to call directly a particular ordering method for your own purpose, 45 | * \code 46 | * AMDOrdering ordering; 47 | * PermutationMatrix perm; 48 | * SparseMatrix A; 49 | * //Fill the matrix ... 50 | * 51 | * ordering(A, perm); // Call AMD 52 | * \endcode 53 | * 54 | * \note Some of these methods (like AMD or METIS), need the sparsity pattern 55 | * of the input matrix to be symmetric. When the matrix is structurally unsymmetric, 56 | * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method. 57 | * If your matrix is already symmetric (at leat in structure), you can avoid that 58 | * by calling the method with a SelfAdjointView type. 59 | * 60 | * \code 61 | * // Call the ordering on the pattern of the lower triangular matrix A 62 | * ordering(A.selfadjointView(), perm); 63 | * \endcode 64 | */ 65 | 66 | #ifndef EIGEN_MPL2_ONLY 67 | #include "src/OrderingMethods/Amd.h" 68 | #endif 69 | 70 | #include "src/OrderingMethods/Ordering.h" 71 | #include "src/Core/util/ReenableStupidWarnings.h" 72 | 73 | #endif // EIGEN_ORDERINGMETHODS_MODULE_H 74 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 9 | #define EIGEN_PASTIXSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | #ifdef complex 21 | #undef complex 22 | #endif 23 | 24 | /** \ingroup Support_modules 25 | * \defgroup PaStiXSupport_Module PaStiXSupport module 26 | * 27 | * This module provides an interface to the PaSTiX library. 28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 29 | * It provides the two following main factorization classes: 30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | * 38 | * 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. 39 | * The dependencies depend on how PaSTiX has been compiled. 40 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 41 | * 42 | */ 43 | 44 | #include "src/PaStiXSupport/PaStiXSupport.h" 45 | 46 | #include "src/Core/util/ReenableStupidWarnings.h" 47 | 48 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 49 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * 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. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Cholesky" 16 | #include "Jacobi" 17 | #include "Householder" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #include "src/misc/lapacke.h" 40 | #include "src/QR/HouseholderQR_LAPACKE.h" 41 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 42 | #endif 43 | 44 | #include "src/Core/util/ReenableStupidWarnings.h" 45 | 46 | #endif // EIGEN_QR_MODULE_H 47 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 48 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(size_t size) 18 | { 19 | return Eigen::internal::aligned_malloc(size); 20 | } 21 | 22 | void qFree(void *ptr) 23 | { 24 | Eigen::internal::aligned_free(ptr); 25 | } 26 | 27 | void *qRealloc(void *ptr, size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 41 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 9 | #define EIGEN_SPQRSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SuiteSparseQR.hpp" 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup SPQRSupport_Module SuiteSparseQR module 19 | * 20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * 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,...). 27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 28 | * 29 | */ 30 | 31 | #include "src/CholmodSupport/CholmodSupport.h" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/SVD: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SVD_MODULE_H 9 | #define EIGEN_SVD_MODULE_H 10 | 11 | #include "QR" 12 | #include "Householder" 13 | #include "Jacobi" 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | /** \defgroup SVD_Module SVD module 18 | * 19 | * 20 | * 21 | * This module provides SVD decomposition for matrices (both real and complex). 22 | * Two decomposition algorithms are provided: 23 | * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. 24 | * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. 25 | * These decompositions are accessible via the respective classes and following MatrixBase methods: 26 | * - MatrixBase::jacobiSvd() 27 | * - MatrixBase::bdcSvd() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/misc/RealSvd2x2.h" 35 | #include "src/SVD/UpperBidiagonalization.h" 36 | #include "src/SVD/SVDBase.h" 37 | #include "src/SVD/JacobiSVD.h" 38 | #include "src/SVD/BDCSVD.h" 39 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 40 | #include "src/misc/lapacke.h" 41 | #include "src/SVD/JacobiSVD_LAPACKE.h" 42 | #endif 43 | 44 | #include "src/Core/util/ReenableStupidWarnings.h" 45 | 46 | #endif // EIGEN_SVD_MODULE_H 47 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 48 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #include "SparseCholesky" 29 | #include "SparseLU" 30 | #include "SparseQR" 31 | #include "IterativeLinearSolvers" 32 | 33 | #endif // EIGEN_SPARSE_MODULE_H 34 | 35 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #ifdef EIGEN_MPL2_ONLY 34 | #error The SparseCholesky module has nothing to offer in MPL2 only mode 35 | #endif 36 | 37 | #include "src/SparseCholesky/SimplicialCholesky.h" 38 | 39 | #ifndef EIGEN_MPL2_ONLY 40 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 46 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/SparseCore: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSECORE_MODULE_H 9 | #define EIGEN_SPARSECORE_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | /** 22 | * \defgroup SparseCore_Module SparseCore module 23 | * 24 | * This module provides a sparse matrix representation, and basic associated matrix manipulations 25 | * and operations. 26 | * 27 | * See the \ref TutorialSparse "Sparse tutorial" 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | * 33 | * This module depends on: Core. 34 | */ 35 | 36 | #include "src/SparseCore/SparseUtil.h" 37 | #include "src/SparseCore/SparseMatrixBase.h" 38 | #include "src/SparseCore/SparseAssign.h" 39 | #include "src/SparseCore/CompressedStorage.h" 40 | #include "src/SparseCore/AmbiVector.h" 41 | #include "src/SparseCore/SparseCompressedBase.h" 42 | #include "src/SparseCore/SparseMatrix.h" 43 | #include "src/SparseCore/SparseMap.h" 44 | #include "src/SparseCore/MappedSparseMatrix.h" 45 | #include "src/SparseCore/SparseVector.h" 46 | #include "src/SparseCore/SparseRef.h" 47 | #include "src/SparseCore/SparseCwiseUnaryOp.h" 48 | #include "src/SparseCore/SparseCwiseBinaryOp.h" 49 | #include "src/SparseCore/SparseTranspose.h" 50 | #include "src/SparseCore/SparseBlock.h" 51 | #include "src/SparseCore/SparseDot.h" 52 | #include "src/SparseCore/SparseRedux.h" 53 | #include "src/SparseCore/SparseView.h" 54 | #include "src/SparseCore/SparseDiagonalProduct.h" 55 | #include "src/SparseCore/ConservativeSparseSparseProduct.h" 56 | #include "src/SparseCore/SparseSparseProductWithPruning.h" 57 | #include "src/SparseCore/SparseProduct.h" 58 | #include "src/SparseCore/SparseDenseProduct.h" 59 | #include "src/SparseCore/SparseSelfAdjointView.h" 60 | #include "src/SparseCore/SparseTriangularView.h" 61 | #include "src/SparseCore/TriangularSolver.h" 62 | #include "src/SparseCore/SparsePermutation.h" 63 | #include "src/SparseCore/SparseFuzzy.h" 64 | #include "src/SparseCore/SparseSolverBase.h" 65 | 66 | #include "src/Core/util/ReenableStupidWarnings.h" 67 | 68 | #endif // EIGEN_SPARSECORE_MODULE_H 69 | 70 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | // Ordering interface 24 | #include "OrderingMethods" 25 | 26 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 27 | 28 | #include "src/SparseLU/SparseLU_Structs.h" 29 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 30 | #include "src/SparseLU/SparseLUImpl.h" 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseLU/SparseLU_Memory.h" 33 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 34 | #include "src/SparseLU/SparseLU_relax_snode.h" 35 | #include "src/SparseLU/SparseLU_pivotL.h" 36 | #include "src/SparseLU/SparseLU_panel_dfs.h" 37 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 38 | #include "src/SparseLU/SparseLU_panel_bmod.h" 39 | #include "src/SparseLU/SparseLU_column_dfs.h" 40 | #include "src/SparseLU/SparseLU_column_bmod.h" 41 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 42 | #include "src/SparseLU/SparseLU_pruneL.h" 43 | #include "src/SparseLU/SparseLU_Utils.h" 44 | #include "src/SparseLU/SparseLU.h" 45 | 46 | #endif // EIGEN_SPARSELU_MODULE_H 47 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "OrderingMethods" 32 | #include "src/SparseCore/SparseColEtree.h" 33 | #include "src/SparseQR/SparseQR.h" 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/SuperLUSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SUPERLUSUPPORT_MODULE_H 9 | #define EIGEN_SUPERLUSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #ifdef EMPTY 16 | #define EIGEN_EMPTY_WAS_ALREADY_DEFINED 17 | #endif 18 | 19 | typedef int int_t; 20 | #include 21 | #include 22 | #include 23 | 24 | // slu_util.h defines a preprocessor token named EMPTY which is really polluting, 25 | // so we remove it in favor of a SUPERLU_EMPTY token. 26 | // If EMPTY was already defined then we don't undef it. 27 | 28 | #if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) 29 | # undef EIGEN_EMPTY_WAS_ALREADY_DEFINED 30 | #elif defined(EMPTY) 31 | # undef EMPTY 32 | #endif 33 | 34 | #define SUPERLU_EMPTY (-1) 35 | 36 | namespace Eigen { struct SluMatrix; } 37 | 38 | /** \ingroup Support_modules 39 | * \defgroup SuperLUSupport_Module SuperLUSupport module 40 | * 41 | * This module provides an interface to the SuperLU library. 42 | * It provides the following factorization class: 43 | * - class SuperLU: a supernodal sequential LU factorization. 44 | * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). 45 | * 46 | * \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported. 47 | * 48 | * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. 49 | * 50 | * \code 51 | * #include 52 | * \endcode 53 | * 54 | * 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. 55 | * The dependencies depend on how superlu has been compiled. 56 | * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task. 57 | * 58 | */ 59 | 60 | #include "src/SuperLUSupport/SuperLUSupport.h" 61 | 62 | #include "src/Core/util/ReenableStupidWarnings.h" 63 | 64 | #endif // EIGEN_SUPERLUSUPPORT_MODULE_H 65 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup UmfPackSupport_Module UmfPackSupport module 21 | * 22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 23 | * It provides the following factorization class: 24 | * - class UmfPackLU: a multifrontal sequential LU factorization. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * 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. 31 | * The dependencies depend on how umfpack has been compiled. 32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/UmfPackSupport/UmfPackSupport.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 41 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/Assign.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2007 Michael Olbrich 5 | // Copyright (C) 2006-2010 Benoit Jacob 6 | // Copyright (C) 2008 Gael Guennebaud 7 | // 8 | // This Source Code Form is subject to the terms of the Mozilla 9 | // Public License v. 2.0. If a copy of the MPL was not distributed 10 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 | 12 | #ifndef EIGEN_ASSIGN_H 13 | #define EIGEN_ASSIGN_H 14 | 15 | namespace Eigen { 16 | 17 | template 18 | template 19 | EIGEN_STRONG_INLINE Derived& DenseBase 20 | ::lazyAssign(const DenseBase& other) 21 | { 22 | enum{ 23 | SameType = internal::is_same::value 24 | }; 25 | 26 | EIGEN_STATIC_ASSERT_LVALUE(Derived) 27 | EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived) 28 | EIGEN_STATIC_ASSERT(SameType,YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) 29 | 30 | eigen_assert(rows() == other.rows() && cols() == other.cols()); 31 | internal::call_assignment_no_alias(derived(),other.derived()); 32 | 33 | return derived(); 34 | } 35 | 36 | template 37 | template 38 | EIGEN_DEVICE_FUNC 39 | EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) 40 | { 41 | internal::call_assignment(derived(), other.derived()); 42 | return derived(); 43 | } 44 | 45 | template 46 | EIGEN_DEVICE_FUNC 47 | EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) 48 | { 49 | internal::call_assignment(derived(), other.derived()); 50 | return derived(); 51 | } 52 | 53 | template 54 | EIGEN_DEVICE_FUNC 55 | EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const MatrixBase& other) 56 | { 57 | internal::call_assignment(derived(), other.derived()); 58 | return derived(); 59 | } 60 | 61 | template 62 | template 63 | EIGEN_DEVICE_FUNC 64 | EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const DenseBase& other) 65 | { 66 | internal::call_assignment(derived(), other.derived()); 67 | return derived(); 68 | } 69 | 70 | template 71 | template 72 | EIGEN_DEVICE_FUNC 73 | EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const EigenBase& other) 74 | { 75 | internal::call_assignment(derived(), other.derived()); 76 | return derived(); 77 | } 78 | 79 | template 80 | template 81 | EIGEN_DEVICE_FUNC 82 | EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const ReturnByValue& other) 83 | { 84 | other.derived().evalTo(derived()); 85 | return derived(); 86 | } 87 | 88 | } // end namespace Eigen 89 | 90 | #endif // EIGEN_ASSIGN_H 91 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/DiagonalProduct.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2007-2009 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_DIAGONALPRODUCT_H 12 | #define EIGEN_DIAGONALPRODUCT_H 13 | 14 | namespace Eigen { 15 | 16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 17 | */ 18 | template 19 | template 20 | inline const Product 21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 22 | { 23 | return Product(derived(),a_diagonal.derived()); 24 | } 25 | 26 | } // end namespace Eigen 27 | 28 | #endif // EIGEN_DIAGONALPRODUCT_H 29 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/MathFunctionsImpl.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Pedro Gonnet (pedro.gonnet@gmail.com) 5 | // Copyright (C) 2016 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_MATHFUNCTIONSIMPL_H 12 | #define EIGEN_MATHFUNCTIONSIMPL_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | /** \internal \returns the hyperbolic tan of \a a (coeff-wise) 19 | Doesn't do anything fancy, just a 13/6-degree rational interpolant which 20 | is accurate up to a couple of ulp in the range [-9, 9], outside of which 21 | the tanh(x) = +/-1. 22 | 23 | This implementation works on both scalars and packets. 24 | */ 25 | template 26 | T generic_fast_tanh_float(const T& a_x) 27 | { 28 | // Clamp the inputs to the range [-9, 9] since anything outside 29 | // this range is +/-1.0f in single-precision. 30 | const T plus_9 = pset1(9.f); 31 | const T minus_9 = pset1(-9.f); 32 | // NOTE GCC prior to 6.3 might improperly optimize this max/min 33 | // step such that if a_x is nan, x will be either 9 or -9, 34 | // and tanh will return 1 or -1 instead of nan. 35 | // This is supposed to be fixed in gcc6.3, 36 | // see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72867 37 | const T x = pmax(minus_9,pmin(plus_9,a_x)); 38 | // The monomial coefficients of the numerator polynomial (odd). 39 | const T alpha_1 = pset1(4.89352455891786e-03f); 40 | const T alpha_3 = pset1(6.37261928875436e-04f); 41 | const T alpha_5 = pset1(1.48572235717979e-05f); 42 | const T alpha_7 = pset1(5.12229709037114e-08f); 43 | const T alpha_9 = pset1(-8.60467152213735e-11f); 44 | const T alpha_11 = pset1(2.00018790482477e-13f); 45 | const T alpha_13 = pset1(-2.76076847742355e-16f); 46 | 47 | // The monomial coefficients of the denominator polynomial (even). 48 | const T beta_0 = pset1(4.89352518554385e-03f); 49 | const T beta_2 = pset1(2.26843463243900e-03f); 50 | const T beta_4 = pset1(1.18534705686654e-04f); 51 | const T beta_6 = pset1(1.19825839466702e-06f); 52 | 53 | // Since the polynomials are odd/even, we need x^2. 54 | const T x2 = pmul(x, x); 55 | 56 | // Evaluate the numerator polynomial p. 57 | T p = pmadd(x2, alpha_13, alpha_11); 58 | p = pmadd(x2, p, alpha_9); 59 | p = pmadd(x2, p, alpha_7); 60 | p = pmadd(x2, p, alpha_5); 61 | p = pmadd(x2, p, alpha_3); 62 | p = pmadd(x2, p, alpha_1); 63 | p = pmul(x, p); 64 | 65 | // Evaluate the denominator polynomial p. 66 | T q = pmadd(x2, beta_6, beta_4); 67 | q = pmadd(x2, q, beta_2); 68 | q = pmadd(x2, q, beta_0); 69 | 70 | // Divide the numerator by the denominator. 71 | return pdiv(p, q); 72 | } 73 | 74 | } // end namespace internal 75 | 76 | } // end namespace Eigen 77 | 78 | #endif // EIGEN_MATHFUNCTIONSIMPL_H 79 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SELFCWISEBINARYOP_H 11 | #define EIGEN_SELFCWISEBINARYOP_H 12 | 13 | namespace Eigen { 14 | 15 | // TODO generalize the scalar type of 'other' 16 | 17 | template 18 | EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 19 | { 20 | typedef typename Derived::PlainObject PlainObject; 21 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 22 | return derived(); 23 | } 24 | 25 | template 26 | EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 27 | { 28 | typedef typename Derived::PlainObject PlainObject; 29 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op()); 30 | return derived(); 31 | } 32 | 33 | template 34 | EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other) 35 | { 36 | typedef typename Derived::PlainObject PlainObject; 37 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 38 | return derived(); 39 | } 40 | 41 | template 42 | EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 43 | { 44 | typedef typename Derived::PlainObject PlainObject; 45 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 46 | return derived(); 47 | } 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_SELFCWISEBINARYOP_H 52 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/Swap.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2006-2008 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SWAP_H 11 | #define EIGEN_SWAP_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // Overload default assignPacket behavior for swapping them 18 | template 19 | class generic_dense_assignment_kernel, Specialized> 20 | : public generic_dense_assignment_kernel, BuiltIn> 21 | { 22 | protected: 23 | typedef generic_dense_assignment_kernel, BuiltIn> Base; 24 | using Base::m_dst; 25 | using Base::m_src; 26 | using Base::m_functor; 27 | 28 | public: 29 | typedef typename Base::Scalar Scalar; 30 | typedef typename Base::DstXprType DstXprType; 31 | typedef swap_assign_op Functor; 32 | 33 | EIGEN_DEVICE_FUNC generic_dense_assignment_kernel(DstEvaluatorTypeT &dst, const SrcEvaluatorTypeT &src, const Functor &func, DstXprType& dstExpr) 34 | : Base(dst, src, func, dstExpr) 35 | {} 36 | 37 | template 38 | void assignPacket(Index row, Index col) 39 | { 40 | PacketType tmp = m_src.template packet(row,col); 41 | const_cast(m_src).template writePacket(row,col, m_dst.template packet(row,col)); 42 | m_dst.template writePacket(row,col,tmp); 43 | } 44 | 45 | template 46 | void assignPacket(Index index) 47 | { 48 | PacketType tmp = m_src.template packet(index); 49 | const_cast(m_src).template writePacket(index, m_dst.template packet(index)); 50 | m_dst.template writePacket(index,tmp); 51 | } 52 | 53 | // TODO find a simple way not to have to copy/paste this function from generic_dense_assignment_kernel, by simple I mean no CRTP (Gael) 54 | template 55 | void assignPacketByOuterInner(Index outer, Index inner) 56 | { 57 | Index row = Base::rowIndexByOuterInner(outer, inner); 58 | Index col = Base::colIndexByOuterInner(outer, inner); 59 | assignPacket(row, col); 60 | } 61 | }; 62 | 63 | } // namespace internal 64 | 65 | } // end namespace Eigen 66 | 67 | #endif // EIGEN_SWAP_H 68 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/arch/AVX/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_AVX_H 11 | #define EIGEN_TYPE_CASTING_AVX_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // For now we use SSE to handle integers, so we can't use AVX instructions to cast 18 | // from int to float 19 | template <> 20 | struct type_casting_traits { 21 | enum { 22 | VectorizedCast = 0, 23 | SrcCoeffRatio = 1, 24 | TgtCoeffRatio = 1 25 | }; 26 | }; 27 | 28 | template <> 29 | struct type_casting_traits { 30 | enum { 31 | VectorizedCast = 0, 32 | SrcCoeffRatio = 1, 33 | TgtCoeffRatio = 1 34 | }; 35 | }; 36 | 37 | 38 | 39 | template<> EIGEN_STRONG_INLINE Packet8i pcast(const Packet8f& a) { 40 | return _mm256_cvtps_epi32(a); 41 | } 42 | 43 | template<> EIGEN_STRONG_INLINE Packet8f pcast(const Packet8i& a) { 44 | return _mm256_cvtepi32_ps(a); 45 | } 46 | 47 | } // end namespace internal 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_TYPE_CASTING_AVX_H 52 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/arch/CUDA/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MATH_FUNCTIONS_CUDA_H 11 | #define EIGEN_MATH_FUNCTIONS_CUDA_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // Make sure this is only available when targeting a GPU: we don't want to 18 | // introduce conflicts between these packet_traits definitions and the ones 19 | // we'll use on the host side (SSE, AVX, ...) 20 | #if defined(__CUDACC__) && defined(EIGEN_USE_GPU) 21 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 22 | float4 plog(const float4& a) 23 | { 24 | return make_float4(logf(a.x), logf(a.y), logf(a.z), logf(a.w)); 25 | } 26 | 27 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 28 | double2 plog(const double2& a) 29 | { 30 | using ::log; 31 | return make_double2(log(a.x), log(a.y)); 32 | } 33 | 34 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 35 | float4 plog1p(const float4& a) 36 | { 37 | return make_float4(log1pf(a.x), log1pf(a.y), log1pf(a.z), log1pf(a.w)); 38 | } 39 | 40 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 41 | double2 plog1p(const double2& a) 42 | { 43 | return make_double2(log1p(a.x), log1p(a.y)); 44 | } 45 | 46 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 47 | float4 pexp(const float4& a) 48 | { 49 | return make_float4(expf(a.x), expf(a.y), expf(a.z), expf(a.w)); 50 | } 51 | 52 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 53 | double2 pexp(const double2& a) 54 | { 55 | using ::exp; 56 | return make_double2(exp(a.x), exp(a.y)); 57 | } 58 | 59 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 60 | float4 psqrt(const float4& a) 61 | { 62 | return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w)); 63 | } 64 | 65 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 66 | double2 psqrt(const double2& a) 67 | { 68 | using ::sqrt; 69 | return make_double2(sqrt(a.x), sqrt(a.y)); 70 | } 71 | 72 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 73 | float4 prsqrt(const float4& a) 74 | { 75 | return make_float4(rsqrtf(a.x), rsqrtf(a.y), rsqrtf(a.z), rsqrtf(a.w)); 76 | } 77 | 78 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 79 | double2 prsqrt(const double2& a) 80 | { 81 | return make_double2(rsqrt(a.x), rsqrt(a.y)); 82 | } 83 | 84 | 85 | #endif 86 | 87 | } // end namespace internal 88 | 89 | } // end namespace Eigen 90 | 91 | #endif // EIGEN_MATH_FUNCTIONS_CUDA_H 92 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 100 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/arch/SSE/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_SSE_H 11 | #define EIGEN_TYPE_CASTING_SSE_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | template <> 18 | struct type_casting_traits { 19 | enum { 20 | VectorizedCast = 1, 21 | SrcCoeffRatio = 1, 22 | TgtCoeffRatio = 1 23 | }; 24 | }; 25 | 26 | template<> EIGEN_STRONG_INLINE Packet4i pcast(const Packet4f& a) { 27 | return _mm_cvttps_epi32(a); 28 | } 29 | 30 | 31 | template <> 32 | struct type_casting_traits { 33 | enum { 34 | VectorizedCast = 1, 35 | SrcCoeffRatio = 1, 36 | TgtCoeffRatio = 1 37 | }; 38 | }; 39 | 40 | template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet4i& a) { 41 | return _mm_cvtepi32_ps(a); 42 | } 43 | 44 | 45 | template <> 46 | struct type_casting_traits { 47 | enum { 48 | VectorizedCast = 1, 49 | SrcCoeffRatio = 2, 50 | TgtCoeffRatio = 1 51 | }; 52 | }; 53 | 54 | template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet2d& a, const Packet2d& b) { 55 | return _mm_shuffle_ps(_mm_cvtpd_ps(a), _mm_cvtpd_ps(b), (1 << 2) | (1 << 6)); 56 | } 57 | 58 | template <> 59 | struct type_casting_traits { 60 | enum { 61 | VectorizedCast = 1, 62 | SrcCoeffRatio = 1, 63 | TgtCoeffRatio = 2 64 | }; 65 | }; 66 | 67 | template<> EIGEN_STRONG_INLINE Packet2d pcast(const Packet4f& a) { 68 | // Simply discard the second half of the input 69 | return _mm_cvtps_pd(a); 70 | } 71 | 72 | 73 | } // end namespace internal 74 | 75 | } // end namespace Eigen 76 | 77 | #endif // EIGEN_TYPE_CASTING_SSE_H 78 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED 2 | #undef EIGEN_WARNINGS_DISABLED 3 | 4 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 5 | #ifdef _MSC_VER 6 | #pragma warning( pop ) 7 | #elif defined __INTEL_COMPILER 8 | #pragma warning pop 9 | #elif defined __clang__ 10 | #pragma clang diagnostic pop 11 | #elif defined __GNUC__ && __GNUC__>=6 12 | #pragma GCC diagnostic pop 13 | #endif 14 | 15 | #if defined __NVCC__ 16 | // Don't reenable the diagnostic messages, as it turns out these messages need 17 | // to be disabled at the point of the template instantiation (i.e the user code) 18 | // otherwise they'll be triggered by nvcc. 19 | // #pragma diag_default code_is_unreachable 20 | // #pragma diag_default initialization_not_reachable 21 | // #pragma diag_default 2651 22 | // #pragma diag_default 2653 23 | #endif 24 | 25 | #endif 26 | 27 | #endif // EIGEN_WARNINGS_DISABLED 28 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MAPPED_SPARSEMATRIX_H 11 | #define EIGEN_MAPPED_SPARSEMATRIX_H 12 | 13 | namespace Eigen { 14 | 15 | /** \deprecated Use Map > 16 | * \class MappedSparseMatrix 17 | * 18 | * \brief Sparse matrix 19 | * 20 | * \param _Scalar the scalar type, i.e. the type of the coefficients 21 | * 22 | * See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme. 23 | * 24 | */ 25 | namespace internal { 26 | template 27 | struct traits > : traits > 28 | {}; 29 | } // end namespace internal 30 | 31 | template 32 | class MappedSparseMatrix 33 | : public Map > 34 | { 35 | typedef Map > Base; 36 | 37 | public: 38 | 39 | typedef typename Base::StorageIndex StorageIndex; 40 | typedef typename Base::Scalar Scalar; 41 | 42 | inline MappedSparseMatrix(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, StorageIndex* innerIndexPtr, Scalar* valuePtr, StorageIndex* innerNonZeroPtr = 0) 43 | : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZeroPtr) 44 | {} 45 | 46 | /** Empty destructor */ 47 | inline ~MappedSparseMatrix() {} 48 | }; 49 | 50 | namespace internal { 51 | 52 | template 53 | struct evaluator > 54 | : evaluator > > 55 | { 56 | typedef MappedSparseMatrix<_Scalar,_Options,_StorageIndex> XprType; 57 | typedef evaluator > Base; 58 | 59 | evaluator() : Base() {} 60 | explicit evaluator(const XprType &mat) : Base(mat) {} 61 | }; 62 | 63 | } 64 | 65 | } // end namespace Eigen 66 | 67 | #endif // EIGEN_MAPPED_SPARSEMATRIX_H 68 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | template 17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 18 | { 19 | const typename internal::nested_eval::type actualA(derived()); 20 | typename internal::conditional::type, 22 | const PlainObject>::type actualB(other.derived()); 23 | 24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 25 | } 26 | 27 | } // end namespace Eigen 28 | 29 | #endif // EIGEN_SPARSE_FUZZY_H 30 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/SparseCore/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSEREDUX_H 11 | #define EIGEN_SPARSEREDUX_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | typename internal::traits::Scalar 17 | SparseMatrixBase::sum() const 18 | { 19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 20 | Scalar res(0); 21 | internal::evaluator thisEval(derived()); 22 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) 24 | res += iter.value(); 25 | return res; 26 | } 27 | 28 | template 29 | typename internal::traits >::Scalar 30 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 31 | { 32 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 33 | if(this->isCompressed()) 34 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 35 | else 36 | return Base::sum(); 37 | } 38 | 39 | template 40 | typename internal::traits >::Scalar 41 | SparseVector<_Scalar,_Options,_Index>::sum() const 42 | { 43 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 44 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 45 | } 46 | 47 | } // end namespace Eigen 48 | 49 | #endif // EIGEN_SPARSEREDUX_H 50 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | 11 | #ifndef EIGEN_SPARSELU_UTILS_H 12 | #define EIGEN_SPARSELU_UTILS_H 13 | 14 | namespace Eigen { 15 | namespace internal { 16 | 17 | /** 18 | * \brief Count Nonzero elements in the factors 19 | */ 20 | template 21 | void SparseLUImpl::countnz(const Index n, Index& nnzL, Index& nnzU, GlobalLU_t& glu) 22 | { 23 | nnzL = 0; 24 | nnzU = (glu.xusub)(n); 25 | Index nsuper = (glu.supno)(n); 26 | Index jlen; 27 | Index i, j, fsupc; 28 | if (n <= 0 ) return; 29 | // For each supernode 30 | for (i = 0; i <= nsuper; i++) 31 | { 32 | fsupc = glu.xsup(i); 33 | jlen = glu.xlsub(fsupc+1) - glu.xlsub(fsupc); 34 | 35 | for (j = fsupc; j < glu.xsup(i+1); j++) 36 | { 37 | nnzL += jlen; 38 | nnzU += j - fsupc + 1; 39 | jlen--; 40 | } 41 | } 42 | } 43 | 44 | /** 45 | * \brief Fix up the data storage lsub for L-subscripts. 46 | * 47 | * It removes the subscripts sets for structural pruning, 48 | * and applies permutation to the remaining subscripts 49 | * 50 | */ 51 | template 52 | void SparseLUImpl::fixupL(const Index n, const IndexVector& perm_r, GlobalLU_t& glu) 53 | { 54 | Index fsupc, i, j, k, jstart; 55 | 56 | StorageIndex nextl = 0; 57 | Index nsuper = (glu.supno)(n); 58 | 59 | // For each supernode 60 | for (i = 0; i <= nsuper; i++) 61 | { 62 | fsupc = glu.xsup(i); 63 | jstart = glu.xlsub(fsupc); 64 | glu.xlsub(fsupc) = nextl; 65 | for (j = jstart; j < glu.xlsub(fsupc + 1); j++) 66 | { 67 | glu.lsub(nextl) = perm_r(glu.lsub(j)); // Now indexed into P*A 68 | nextl++; 69 | } 70 | for (k = fsupc+1; k < glu.xsup(i+1); k++) 71 | glu.xlsub(k) = nextl; // other columns in supernode i 72 | } 73 | 74 | glu.xlsub(n) = nextl; 75 | } 76 | 77 | } // end namespace internal 78 | 79 | } // end namespace Eigen 80 | #endif // EIGEN_SPARSELU_UTILS_H 81 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/StlSupport/details.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STL_DETAILS_H 12 | #define EIGEN_STL_DETAILS_H 13 | 14 | #ifndef EIGEN_ALIGNED_ALLOCATOR 15 | #define EIGEN_ALIGNED_ALLOCATOR Eigen::aligned_allocator 16 | #endif 17 | 18 | namespace Eigen { 19 | 20 | // This one is needed to prevent reimplementing the whole std::vector. 21 | template 22 | class aligned_allocator_indirection : public EIGEN_ALIGNED_ALLOCATOR 23 | { 24 | public: 25 | typedef size_t size_type; 26 | typedef ptrdiff_t difference_type; 27 | typedef T* pointer; 28 | typedef const T* const_pointer; 29 | typedef T& reference; 30 | typedef const T& const_reference; 31 | typedef T value_type; 32 | 33 | template 34 | struct rebind 35 | { 36 | typedef aligned_allocator_indirection other; 37 | }; 38 | 39 | aligned_allocator_indirection() {} 40 | aligned_allocator_indirection(const aligned_allocator_indirection& ) : EIGEN_ALIGNED_ALLOCATOR() {} 41 | aligned_allocator_indirection(const EIGEN_ALIGNED_ALLOCATOR& ) {} 42 | template 43 | aligned_allocator_indirection(const aligned_allocator_indirection& ) {} 44 | template 45 | aligned_allocator_indirection(const EIGEN_ALIGNED_ALLOCATOR& ) {} 46 | ~aligned_allocator_indirection() {} 47 | }; 48 | 49 | #if EIGEN_COMP_MSVC 50 | 51 | // sometimes, MSVC detects, at compile time, that the argument x 52 | // in std::vector::resize(size_t s,T x) won't be aligned and generate an error 53 | // even if this function is never called. Whence this little wrapper. 54 | #define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) \ 55 | typename Eigen::internal::conditional< \ 56 | Eigen::internal::is_arithmetic::value, \ 57 | T, \ 58 | Eigen::internal::workaround_msvc_stl_support \ 59 | >::type 60 | 61 | namespace internal { 62 | template struct workaround_msvc_stl_support : public T 63 | { 64 | inline workaround_msvc_stl_support() : T() {} 65 | inline workaround_msvc_stl_support(const T& other) : T(other) {} 66 | inline operator T& () { return *static_cast(this); } 67 | inline operator const T& () const { return *static_cast(this); } 68 | template 69 | inline T& operator=(const OtherT& other) 70 | { T::operator=(other); return *this; } 71 | inline workaround_msvc_stl_support& operator=(const workaround_msvc_stl_support& other) 72 | { T::operator=(other); return *this; } 73 | }; 74 | } 75 | 76 | #else 77 | 78 | #define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) T 79 | 80 | #endif 81 | 82 | } 83 | 84 | #endif // EIGEN_STL_DETAILS_H 85 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/misc/Kernel.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MISC_KERNEL_H 11 | #define EIGEN_MISC_KERNEL_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | /** \class kernel_retval_base 18 | * 19 | */ 20 | template 21 | struct traits > 22 | { 23 | typedef typename DecompositionType::MatrixType MatrixType; 24 | typedef Matrix< 25 | typename MatrixType::Scalar, 26 | MatrixType::ColsAtCompileTime, // the number of rows in the "kernel matrix" 27 | // is the number of cols of the original matrix 28 | // so that the product "matrix * kernel = zero" makes sense 29 | Dynamic, // we don't know at compile-time the dimension of the kernel 30 | MatrixType::Options, 31 | MatrixType::MaxColsAtCompileTime, // see explanation for 2nd template parameter 32 | MatrixType::MaxColsAtCompileTime // the kernel is a subspace of the domain space, 33 | // whose dimension is the number of columns of the original matrix 34 | > ReturnType; 35 | }; 36 | 37 | template struct kernel_retval_base 38 | : public ReturnByValue > 39 | { 40 | typedef _DecompositionType DecompositionType; 41 | typedef ReturnByValue Base; 42 | 43 | explicit kernel_retval_base(const DecompositionType& dec) 44 | : m_dec(dec), 45 | m_rank(dec.rank()), 46 | m_cols(m_rank==dec.cols() ? 1 : dec.cols() - m_rank) 47 | {} 48 | 49 | inline Index rows() const { return m_dec.cols(); } 50 | inline Index cols() const { return m_cols; } 51 | inline Index rank() const { return m_rank; } 52 | inline const DecompositionType& dec() const { return m_dec; } 53 | 54 | template inline void evalTo(Dest& dst) const 55 | { 56 | static_cast*>(this)->evalTo(dst); 57 | } 58 | 59 | protected: 60 | const DecompositionType& m_dec; 61 | Index m_rank, m_cols; 62 | }; 63 | 64 | } // end namespace internal 65 | 66 | #define EIGEN_MAKE_KERNEL_HELPERS(DecompositionType) \ 67 | typedef typename DecompositionType::MatrixType MatrixType; \ 68 | typedef typename MatrixType::Scalar Scalar; \ 69 | typedef typename MatrixType::RealScalar RealScalar; \ 70 | typedef Eigen::internal::kernel_retval_base Base; \ 71 | using Base::dec; \ 72 | using Base::rank; \ 73 | using Base::rows; \ 74 | using Base::cols; \ 75 | kernel_retval(const DecompositionType& dec) : Base(dec) {} 76 | 77 | } // end namespace Eigen 78 | 79 | #endif // EIGEN_MISC_KERNEL_H 80 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/misc/RealSvd2x2.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Benoit Jacob 5 | // Copyright (C) 2013-2016 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_REALSVD2X2_H 12 | #define EIGEN_REALSVD2X2_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | template 19 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q, 20 | JacobiRotation *j_left, 21 | JacobiRotation *j_right) 22 | { 23 | using std::sqrt; 24 | using std::abs; 25 | Matrix m; 26 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)), 27 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q)); 28 | JacobiRotation rot1; 29 | RealScalar t = m.coeff(0,0) + m.coeff(1,1); 30 | RealScalar d = m.coeff(1,0) - m.coeff(0,1); 31 | 32 | if(abs(d) < (std::numeric_limits::min)()) 33 | { 34 | rot1.s() = RealScalar(0); 35 | rot1.c() = RealScalar(1); 36 | } 37 | else 38 | { 39 | // If d!=0, then t/d cannot overflow because the magnitude of the 40 | // entries forming d are not too small compared to the ones forming t. 41 | RealScalar u = t / d; 42 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u)); 43 | rot1.s() = RealScalar(1) / tmp; 44 | rot1.c() = u / tmp; 45 | } 46 | m.applyOnTheLeft(0,1,rot1); 47 | j_right->makeJacobi(m,0,1); 48 | *j_left = rot1 * j_right->transpose(); 49 | } 50 | 51 | } // end namespace internal 52 | 53 | } // end namespace Eigen 54 | 55 | #endif // EIGEN_REALSVD2X2_H 56 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/signature_of_eigen3_matrix_library: -------------------------------------------------------------------------------- 1 | This file is just there as a signature to help identify directories containing Eigen3. When writing a script looking for Eigen3, just look for this file. This is especially useful to help disambiguate with Eigen2... 2 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/ArpackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_ARPACKSUPPORT_MODULE_H 10 | #define EIGEN_ARPACKSUPPORT_MODULE_H 11 | 12 | #include 13 | 14 | #include 15 | 16 | /** \defgroup ArpackSupport_Module Arpack support module 17 | * 18 | * This module provides a wrapper to Arpack, a library for sparse eigenvalue decomposition. 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | */ 24 | 25 | #include 26 | #include "src/Eigenvalues/ArpackSelfAdjointEigenSolver.h" 27 | 28 | #include 29 | 30 | #endif // EIGEN_ARPACKSUPPORT_MODULE_H 31 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 32 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/AutoDiff: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_AUTODIFF_MODULE 11 | #define EIGEN_AUTODIFF_MODULE 12 | 13 | namespace Eigen { 14 | 15 | /** 16 | * \defgroup AutoDiff_Module Auto Diff module 17 | * 18 | * This module features forward automatic differentation via a simple 19 | * templated scalar type wrapper AutoDiffScalar. 20 | * 21 | * Warning : this should NOT be confused with numerical differentiation, which 22 | * is a different method and has its own module in Eigen : \ref NumericalDiff_Module. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | */ 28 | //@{ 29 | 30 | } 31 | 32 | #include "src/AutoDiff/AutoDiffScalar.h" 33 | // #include "src/AutoDiff/AutoDiffVector.h" 34 | #include "src/AutoDiff/AutoDiffJacobian.h" 35 | 36 | namespace Eigen { 37 | //@} 38 | } 39 | 40 | #endif // EIGEN_AUTODIFF_MODULE 41 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/TensorSymmetry: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2013 Christian Seiler 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSORSYMMETRY_MODULE 11 | #define EIGEN_CXX11_TENSORSYMMETRY_MODULE 12 | 13 | #include 14 | 15 | #include 16 | 17 | #include "src/util/CXX11Meta.h" 18 | 19 | /** \defgroup CXX11_TensorSymmetry_Module Tensor Symmetry Module 20 | * 21 | * This module provides a classes that allow for the definition of 22 | * symmetries w.r.t. tensor indices. 23 | * 24 | * Including this module will implicitly include the Tensor module. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | */ 30 | 31 | #include "src/TensorSymmetry/util/TemplateGroupTheory.h" 32 | #include "src/TensorSymmetry/Symmetry.h" 33 | #include "src/TensorSymmetry/StaticSymmetry.h" 34 | #include "src/TensorSymmetry/DynamicSymmetry.h" 35 | 36 | #include 37 | 38 | #endif // EIGEN_CXX11_TENSORSYMMETRY_MODULE 39 | 40 | /* 41 | * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; 42 | */ 43 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/ThreadPool: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_MODULE 11 | #define EIGEN_CXX11_THREADPOOL_MODULE 12 | 13 | #include "../../../Eigen/Core" 14 | 15 | #include 16 | 17 | /** \defgroup CXX11_ThreadPool_Module C++11 ThreadPool Module 18 | * 19 | * This module provides 2 threadpool implementations 20 | * - a simple reference implementation 21 | * - a faster non blocking implementation 22 | * 23 | * This module requires C++11. 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | */ 29 | 30 | 31 | // The code depends on CXX11, so only include the module if the 32 | // compiler supports it. 33 | #if __cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #include "src/util/CXX11Meta.h" 49 | #include "src/util/MaxSizeVector.h" 50 | 51 | #include "src/ThreadPool/ThreadLocal.h" 52 | #include "src/ThreadPool/ThreadYield.h" 53 | #include "src/ThreadPool/EventCount.h" 54 | #include "src/ThreadPool/RunQueue.h" 55 | #include "src/ThreadPool/ThreadPoolInterface.h" 56 | #include "src/ThreadPool/ThreadEnvironment.h" 57 | #include "src/ThreadPool/SimpleThreadPool.h" 58 | #include "src/ThreadPool/NonBlockingThreadPool.h" 59 | 60 | #endif 61 | 62 | #include 63 | 64 | #endif // EIGEN_CXX11_THREADPOOL_MODULE 65 | 66 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionBlocking.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H 12 | 13 | 14 | namespace Eigen { 15 | namespace internal { 16 | 17 | enum { 18 | ShardByRow = 0, 19 | ShardByCol = 1 20 | }; 21 | 22 | 23 | // Default Blocking Strategy 24 | template 25 | class TensorContractionBlocking { 26 | public: 27 | 28 | typedef typename LhsMapper::Scalar LhsScalar; 29 | typedef typename RhsMapper::Scalar RhsScalar; 30 | 31 | EIGEN_DEVICE_FUNC TensorContractionBlocking(Index k, Index m, Index n, Index num_threads = 1) : 32 | kc_(k), mc_(m), nc_(n) 33 | { 34 | if (ShardingType == ShardByCol) { 35 | computeProductBlockingSizes(kc_, mc_, nc_, num_threads); 36 | } 37 | else { 38 | computeProductBlockingSizes(kc_, nc_, mc_, num_threads); 39 | } 40 | } 41 | 42 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index kc() const { return kc_; } 43 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index mc() const { return mc_; } 44 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index nc() const { return nc_; } 45 | 46 | private: 47 | Index kc_; 48 | Index mc_; 49 | Index nc_; 50 | }; 51 | 52 | 53 | } // end namespace internal 54 | } // end namespace Eigen 55 | 56 | #endif // EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H 57 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H 12 | 13 | namespace Eigen { 14 | 15 | /** \class TensorDevice 16 | * \ingroup CXX11_Tensor_Module 17 | * 18 | * \brief Pseudo expression providing an operator = that will evaluate its argument 19 | * on the specified computing 'device' (GPU, thread pool, ...) 20 | * 21 | * Example: 22 | * C.device(EIGEN_GPU) = A + B; 23 | * 24 | * Todo: operator *= and /=. 25 | */ 26 | 27 | template class TensorDevice { 28 | public: 29 | TensorDevice(const DeviceType& device, ExpressionType& expression) : m_device(device), m_expression(expression) {} 30 | 31 | template 32 | EIGEN_STRONG_INLINE TensorDevice& operator=(const OtherDerived& other) { 33 | typedef TensorAssignOp Assign; 34 | Assign assign(m_expression, other); 35 | internal::TensorExecutor::run(assign, m_device); 36 | return *this; 37 | } 38 | 39 | template 40 | EIGEN_STRONG_INLINE TensorDevice& operator+=(const OtherDerived& other) { 41 | typedef typename OtherDerived::Scalar Scalar; 42 | typedef TensorCwiseBinaryOp, const ExpressionType, const OtherDerived> Sum; 43 | Sum sum(m_expression, other); 44 | typedef TensorAssignOp Assign; 45 | Assign assign(m_expression, sum); 46 | internal::TensorExecutor::run(assign, m_device); 47 | return *this; 48 | } 49 | 50 | template 51 | EIGEN_STRONG_INLINE TensorDevice& operator-=(const OtherDerived& other) { 52 | typedef typename OtherDerived::Scalar Scalar; 53 | typedef TensorCwiseBinaryOp, const ExpressionType, const OtherDerived> Difference; 54 | Difference difference(m_expression, other); 55 | typedef TensorAssignOp Assign; 56 | Assign assign(m_expression, difference); 57 | internal::TensorExecutor::run(assign, m_device); 58 | return *this; 59 | } 60 | 61 | protected: 62 | const DeviceType& m_device; 63 | ExpressionType& m_expression; 64 | }; 65 | 66 | } // end namespace Eigen 67 | 68 | #endif // EIGEN_CXX11_TENSOR_TENSOR_DEVICE_H 69 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceDefault.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_DEVICE_DEFAULT_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_DEVICE_DEFAULT_H 12 | 13 | 14 | namespace Eigen { 15 | 16 | // Default device for the machine (typically a single cpu core) 17 | struct DefaultDevice { 18 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void* allocate(size_t num_bytes) const { 19 | return internal::aligned_malloc(num_bytes); 20 | } 21 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void deallocate(void* buffer) const { 22 | internal::aligned_free(buffer); 23 | } 24 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { 25 | ::memcpy(dst, src, n); 26 | } 27 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { 28 | memcpy(dst, src, n); 29 | } 30 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { 31 | memcpy(dst, src, n); 32 | } 33 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void memset(void* buffer, int c, size_t n) const { 34 | ::memset(buffer, c, n); 35 | } 36 | 37 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t numThreads() const { 38 | #ifndef __CUDA_ARCH__ 39 | // Running on the host CPU 40 | return 1; 41 | #else 42 | // Running on a CUDA device 43 | return 32; 44 | #endif 45 | } 46 | 47 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t firstLevelCacheSize() const { 48 | #ifndef __CUDA_ARCH__ 49 | // Running on the host CPU 50 | return l1CacheSize(); 51 | #else 52 | // Running on a CUDA device, return the amount of shared memory available. 53 | return 48*1024; 54 | #endif 55 | } 56 | 57 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE size_t lastLevelCacheSize() const { 58 | #ifndef __CUDA_ARCH__ 59 | // Running single threaded on the host CPU 60 | return l3CacheSize(); 61 | #else 62 | // Running on a CUDA device 63 | return firstLevelCacheSize(); 64 | #endif 65 | } 66 | 67 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int majorDeviceVersion() const { 68 | #ifndef __CUDA_ARCH__ 69 | // Running single threaded on the host CPU 70 | // Should return an enum that encodes the ISA supported by the CPU 71 | return 1; 72 | #else 73 | // Running on a CUDA device 74 | return __CUDA_ARCH__ / 100; 75 | #endif 76 | } 77 | }; 78 | 79 | } // namespace Eigen 80 | 81 | #endif // EIGEN_CXX11_TENSOR_TENSOR_DEVICE_DEFAULT_H 82 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGlobalFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 12 | 13 | namespace Eigen { 14 | 15 | /** \cpp11 \returns an expression of the coefficient-wise betainc(\a x, \a a, \a b) to the given tensors. 16 | * 17 | * This function computes the regularized incomplete beta function (integral). 18 | * 19 | */ 20 | template 21 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const 22 | TensorCwiseTernaryOp, 23 | const ADerived, const BDerived, const XDerived> 24 | betainc(const ADerived& a, const BDerived& b, const XDerived& x) { 25 | return TensorCwiseTernaryOp< 26 | internal::scalar_betainc_op, const ADerived, 27 | const BDerived, const XDerived>( 28 | a, b, x, internal::scalar_betainc_op()); 29 | } 30 | 31 | } // end namespace Eigen 32 | 33 | #endif // EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 34 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_IO_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_IO_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // Print the tensor as a 2d matrix 18 | template 19 | struct TensorPrinter { 20 | static void run (std::ostream& os, const Tensor& tensor) { 21 | typedef typename internal::remove_const::type Scalar; 22 | typedef typename Tensor::Index Index; 23 | const Index total_size = internal::array_prod(tensor.dimensions()); 24 | if (total_size > 0) { 25 | const Index first_dim = Eigen::internal::array_get<0>(tensor.dimensions()); 26 | static const int layout = Tensor::Layout; 27 | Map > matrix(const_cast(tensor.data()), first_dim, total_size/first_dim); 28 | os << matrix; 29 | } 30 | } 31 | }; 32 | 33 | 34 | // Print the tensor as a vector 35 | template 36 | struct TensorPrinter { 37 | static void run (std::ostream& os, const Tensor& tensor) { 38 | typedef typename internal::remove_const::type Scalar; 39 | typedef typename Tensor::Index Index; 40 | const Index total_size = internal::array_prod(tensor.dimensions()); 41 | if (total_size > 0) { 42 | Map > array(const_cast(tensor.data()), total_size); 43 | os << array; 44 | } 45 | } 46 | }; 47 | 48 | 49 | // Print the tensor as a scalar 50 | template 51 | struct TensorPrinter { 52 | static void run (std::ostream& os, const Tensor& tensor) { 53 | os << tensor.coeff(0); 54 | } 55 | }; 56 | } 57 | 58 | template 59 | std::ostream& operator << (std::ostream& os, const TensorBase& expr) { 60 | typedef TensorEvaluator, DefaultDevice> Evaluator; 61 | typedef typename Evaluator::Dimensions Dimensions; 62 | 63 | // Evaluate the expression if needed 64 | TensorForcedEvalOp eval = expr.eval(); 65 | Evaluator tensor(eval, DefaultDevice()); 66 | tensor.evalSubExprsIfNeeded(NULL); 67 | 68 | // Print the result 69 | static const int rank = internal::array_size::value; 70 | internal::TensorPrinter::run(os, tensor); 71 | 72 | // Cleanup. 73 | tensor.cleanup(); 74 | return os; 75 | } 76 | 77 | } // end namespace Eigen 78 | 79 | #endif // EIGEN_CXX11_TENSOR_TENSOR_IO_H 80 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_INITIALIZER_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_INITIALIZER_H 12 | 13 | #if EIGEN_HAS_VARIADIC_TEMPLATES 14 | 15 | #include 16 | 17 | namespace Eigen { 18 | 19 | /** \class TensorInitializer 20 | * \ingroup CXX11_Tensor_Module 21 | * 22 | * \brief Helper template to initialize Tensors from std::initializer_lists. 23 | */ 24 | namespace internal { 25 | 26 | template 27 | struct Initializer { 28 | typedef std::initializer_list< 29 | typename Initializer::InitList> InitList; 30 | 31 | static void run(TensorEvaluator& tensor, 32 | Eigen::array::Index, traits::NumDimensions>* indices, 33 | const InitList& vals) { 34 | int i = 0; 35 | for (auto v : vals) { 36 | (*indices)[traits::NumDimensions - N] = i++; 37 | Initializer::run(tensor, indices, v); 38 | } 39 | } 40 | }; 41 | 42 | template 43 | struct Initializer { 44 | typedef std::initializer_list::Scalar> InitList; 45 | 46 | static void run(TensorEvaluator& tensor, 47 | Eigen::array::Index, traits::NumDimensions>* indices, 48 | const InitList& vals) { 49 | int i = 0; 50 | // There is likely a faster way to do that than iterating. 51 | for (auto v : vals) { 52 | (*indices)[traits::NumDimensions - 1] = i++; 53 | tensor.coeffRef(*indices) = v; 54 | } 55 | } 56 | }; 57 | 58 | template 59 | struct Initializer { 60 | typedef typename traits::Scalar InitList; 61 | 62 | static void run(TensorEvaluator& tensor, 63 | Eigen::array::Index, traits::NumDimensions>*, 64 | const InitList& v) { 65 | tensor.coeffRef(0) = v; 66 | } 67 | }; 68 | 69 | 70 | template 71 | void initialize_tensor(TensorEvaluator& tensor, 72 | const typename Initializer::NumDimensions>::InitList& vals) { 73 | Eigen::array::Index, traits::NumDimensions> indices; 74 | Initializer::NumDimensions>::run(tensor, &indices, vals); 75 | } 76 | 77 | } // namespace internal 78 | } // namespace Eigen 79 | 80 | #endif // EIGEN_HAS_VARIADIC_TEMPLATES 81 | 82 | #endif // EIGEN_CXX11_TENSOR_TENSOR_INITIALIZER_H 83 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_META_MACROS_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_META_MACROS_H 12 | 13 | 14 | /** use this macro in sfinae selection in templated functions 15 | * 16 | * template::value , int >::type = 0 18 | * > 19 | * void foo(){} 20 | * 21 | * becomes => 22 | * 23 | * template::value ) 25 | * > 26 | * void foo(){} 27 | */ 28 | 29 | // SFINAE requires variadic templates 30 | #ifndef __CUDACC__ 31 | #if EIGEN_HAS_VARIADIC_TEMPLATES 32 | // SFINAE doesn't work for gcc <= 4.7 33 | #ifdef EIGEN_COMP_GNUC 34 | #if EIGEN_GNUC_AT_LEAST(4,8) 35 | #define EIGEN_HAS_SFINAE 36 | #endif 37 | #else 38 | #define EIGEN_HAS_SFINAE 39 | #endif 40 | #endif 41 | #endif 42 | 43 | #define EIGEN_SFINAE_ENABLE_IF( __condition__ ) \ 44 | typename internal::enable_if< ( __condition__ ) , int >::type = 0 45 | 46 | 47 | #if EIGEN_HAS_CONSTEXPR 48 | #define EIGEN_CONSTEXPR constexpr 49 | #else 50 | #define EIGEN_CONSTEXPR 51 | #endif 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorSycl.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Mehdi Goli Codeplay Software Ltd. 5 | // Ralph Potter Codeplay Software Ltd. 6 | // Luke Iwanski Codeplay Software Ltd. 7 | // Contact: eigen@codeplay.com 8 | // 9 | // This Source Code Form is subject to the terms of the Mozilla 10 | // Public License v. 2.0. If a copy of the MPL was not distributed 11 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 12 | 13 | // General include header of SYCL target for Tensor Module 14 | #ifndef UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_H 15 | #define UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_H 16 | 17 | #ifdef EIGEN_USE_SYCL 18 | 19 | // global pointer to set different attribute state for a class 20 | template 21 | struct MakeGlobalPointer { 22 | typedef typename cl::sycl::global_ptr::pointer_t Type; 23 | }; 24 | 25 | // global pointer to set different attribute state for a class 26 | template 27 | struct MakeLocalPointer { 28 | typedef typename cl::sycl::local_ptr::pointer_t Type; 29 | }; 30 | 31 | 32 | namespace Eigen { 33 | namespace TensorSycl { 34 | namespace internal { 35 | 36 | /// This struct is used for special expression nodes with no operations (for example assign and selectOP). 37 | struct NoOP; 38 | 39 | template struct GetType{ 40 | typedef const T Type; 41 | }; 42 | template struct GetType{ 43 | typedef T Type; 44 | }; 45 | 46 | } 47 | } 48 | } 49 | 50 | // tuple construction 51 | #include "TensorSyclTuple.h" 52 | 53 | // counting number of leaf at compile time 54 | #include "TensorSyclLeafCount.h" 55 | 56 | // The index PlaceHolder takes the actual expression and replaces the actual 57 | // data on it with the place holder. It uses the same pre-order expression tree 58 | // traverse as the leaf count in order to give the right access number to each 59 | // node in the expression 60 | #include "TensorSyclPlaceHolderExpr.h" 61 | 62 | // creation of an accessor tuple from a tuple of SYCL buffers 63 | #include "TensorSyclExtractAccessor.h" 64 | 65 | // this is used to change the address space type in tensor map for GPU 66 | #include "TensorSyclConvertToDeviceExpression.h" 67 | 68 | // this is used to extract the functors 69 | #include "TensorSyclExtractFunctors.h" 70 | 71 | // this is used to create tensormap on the device 72 | // this is used to construct the expression on the device 73 | #include "TensorSyclExprConstructor.h" 74 | 75 | /// this is used for extracting tensor reduction 76 | #include "TensorReductionSycl.h" 77 | 78 | // kernel execution using fusion 79 | #include "TensorSyclRun.h" 80 | 81 | #endif // end of EIGEN_USE_SYCL 82 | #endif // UNSUPPORTED_EIGEN_CXX11_SRC_TENSOR_TENSORSYCL_H 83 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadEnvironment.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 12 | 13 | namespace Eigen { 14 | 15 | struct StlThreadEnvironment { 16 | struct Task { 17 | std::function f; 18 | }; 19 | 20 | // EnvThread constructor must start the thread, 21 | // destructor must join the thread. 22 | class EnvThread { 23 | public: 24 | EnvThread(std::function f) : thr_(std::move(f)) {} 25 | ~EnvThread() { thr_.join(); } 26 | 27 | private: 28 | std::thread thr_; 29 | }; 30 | 31 | EnvThread* CreateThread(std::function f) { return new EnvThread(std::move(f)); } 32 | Task CreateTask(std::function f) { return Task{std::move(f)}; } 33 | void ExecuteTask(const Task& t) { t.f(); } 34 | }; 35 | 36 | } // namespace Eigen 37 | 38 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 39 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_LOCAL_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_LOCAL_H 12 | 13 | // Try to come up with a portable implementation of thread local variables 14 | #if EIGEN_COMP_GNUC && EIGEN_GNUC_AT_MOST(4, 7) 15 | #define EIGEN_THREAD_LOCAL static __thread 16 | #elif EIGEN_COMP_CLANG 17 | #define EIGEN_THREAD_LOCAL static __thread 18 | #else 19 | #define EIGEN_THREAD_LOCAL static thread_local 20 | #endif 21 | 22 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_LOCAL_H 23 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadPoolInterface.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 12 | 13 | namespace Eigen { 14 | 15 | // This defines an interface that ThreadPoolDevice can take to use 16 | // custom thread pools underneath. 17 | class ThreadPoolInterface { 18 | public: 19 | virtual void Schedule(std::function fn) = 0; 20 | 21 | // Returns the number of threads in the pool. 22 | virtual int NumThreads() const = 0; 23 | 24 | // Returns a logical thread index between 0 and NumThreads() - 1 if called 25 | // from one of the threads in the pool. Returns -1 otherwise. 26 | virtual int CurrentThreadId() const = 0; 27 | 28 | virtual ~ThreadPoolInterface() {} 29 | }; 30 | 31 | } // namespace Eigen 32 | 33 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 34 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadYield.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 12 | 13 | // Try to come up with a portable way to yield 14 | #if EIGEN_COMP_GNUC && EIGEN_GNUC_AT_MOST(4, 7) 15 | #define EIGEN_THREAD_YIELD() sched_yield() 16 | #else 17 | #define EIGEN_THREAD_YIELD() std::this_thread::yield() 18 | #endif 19 | 20 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 21 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/EulerAngles: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Tal Hadad 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_EULERANGLES_MODULE_H 11 | #define EIGEN_EULERANGLES_MODULE_H 12 | 13 | 14 | #include "Eigen/Core" 15 | #include "Eigen/Geometry" 16 | 17 | #include "Eigen/src/Core/util/DisableStupidWarnings.h" 18 | 19 | namespace Eigen { 20 | 21 | /** 22 | * \defgroup EulerAngles_Module EulerAngles module 23 | * \brief This module provides generic euler angles rotation. 24 | * 25 | * Euler angles are a way to represent 3D rotation. 26 | * 27 | * In order to use this module in your code, include this header: 28 | * \code 29 | * #include 30 | * \endcode 31 | * 32 | * See \ref EulerAngles for more information. 33 | * 34 | */ 35 | 36 | } 37 | 38 | #include "src/EulerAngles/EulerSystem.h" 39 | #include "src/EulerAngles/EulerAngles.h" 40 | 41 | #include "Eigen/src/Core/util/ReenableStupidWarnings.h" 42 | 43 | #endif // EIGEN_EULERANGLES_MODULE_H 44 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/IterativeSolvers: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_ITERATIVE_SOLVERS_MODULE_H 11 | #define EIGEN_ITERATIVE_SOLVERS_MODULE_H 12 | 13 | #include 14 | 15 | /** 16 | * \defgroup IterativeSolvers_Module Iterative solvers module 17 | * This module aims to provide various iterative linear and non linear solver algorithms. 18 | * It currently provides: 19 | * - a constrained conjugate gradient 20 | * - a Householder GMRES implementation 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | //@{ 26 | 27 | #ifndef EIGEN_MPL2_ONLY 28 | #include "src/IterativeSolvers/IterationController.h" 29 | #include "src/IterativeSolvers/ConstrainedConjGrad.h" 30 | #endif 31 | 32 | #include "src/IterativeSolvers/IncompleteLU.h" 33 | #include "../../Eigen/Jacobi" 34 | #include "../../Eigen/Householder" 35 | #include "src/IterativeSolvers/GMRES.h" 36 | #include "src/IterativeSolvers/DGMRES.h" 37 | //#include "src/IterativeSolvers/SSORPreconditioner.h" 38 | #include "src/IterativeSolvers/MINRES.h" 39 | 40 | //@} 41 | 42 | #endif // EIGEN_ITERATIVE_SOLVERS_MODULE_H 43 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/KroneckerProduct: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_KRONECKER_PRODUCT_MODULE_H 10 | #define EIGEN_KRONECKER_PRODUCT_MODULE_H 11 | 12 | #include "../../Eigen/Core" 13 | 14 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 15 | 16 | #include "../../Eigen/src/SparseCore/SparseUtil.h" 17 | 18 | namespace Eigen { 19 | 20 | /** 21 | * \defgroup KroneckerProduct_Module KroneckerProduct module 22 | * 23 | * This module contains an experimental Kronecker product implementation. 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | */ 29 | 30 | } // namespace Eigen 31 | 32 | #include "src/KroneckerProduct/KroneckerTensorProduct.h" 33 | 34 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif // EIGEN_KRONECKER_PRODUCT_MODULE_H 37 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/LevenbergMarquardt: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Thomas Capricelli 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_LEVENBERGMARQUARDT_MODULE 11 | #define EIGEN_LEVENBERGMARQUARDT_MODULE 12 | 13 | // #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | /** 23 | * \defgroup LevenbergMarquardt_Module Levenberg-Marquardt module 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | * 29 | * 30 | */ 31 | 32 | #include "Eigen/SparseCore" 33 | #ifndef EIGEN_PARSED_BY_DOXYGEN 34 | 35 | #include "src/LevenbergMarquardt/LMqrsolv.h" 36 | #include "src/LevenbergMarquardt/LMcovar.h" 37 | #include "src/LevenbergMarquardt/LMpar.h" 38 | 39 | #endif 40 | 41 | #include "src/LevenbergMarquardt/LevenbergMarquardt.h" 42 | #include "src/LevenbergMarquardt/LMonestep.h" 43 | 44 | 45 | #endif // EIGEN_LEVENBERGMARQUARDT_MODULE 46 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/MoreVectorization: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_MOREVECTORIZATION_MODULE_H 10 | #define EIGEN_MOREVECTORIZATION_MODULE_H 11 | 12 | #include 13 | 14 | namespace Eigen { 15 | 16 | /** 17 | * \defgroup MoreVectorization More vectorization module 18 | */ 19 | 20 | } 21 | 22 | #include "src/MoreVectorization/MathFunctions.h" 23 | 24 | #endif // EIGEN_MOREVECTORIZATION_MODULE_H 25 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/NumericalDiff: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Thomas Capricelli 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_NUMERICALDIFF_MODULE 11 | #define EIGEN_NUMERICALDIFF_MODULE 12 | 13 | #include 14 | 15 | namespace Eigen { 16 | 17 | /** 18 | * \defgroup NumericalDiff_Module Numerical differentiation module 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | * 24 | * See http://en.wikipedia.org/wiki/Numerical_differentiation 25 | * 26 | * Warning : this should NOT be confused with automatic differentiation, which 27 | * is a different method and has its own module in Eigen : \ref 28 | * AutoDiff_Module. 29 | * 30 | * Currently only "Forward" and "Central" schemes are implemented. Those 31 | * are basic methods, and there exist some more elaborated way of 32 | * computing such approximates. They are implemented using both 33 | * proprietary and free software, and usually requires linking to an 34 | * external library. It is very easy for you to write a functor 35 | * using such software, and the purpose is quite orthogonal to what we 36 | * want to achieve with Eigen. 37 | * 38 | * This is why we will not provide wrappers for every great numerical 39 | * differentiation software that exist, but should rather stick with those 40 | * basic ones, that still are useful for testing. 41 | * 42 | * Also, the \ref NonLinearOptimization_Module needs this in order to 43 | * provide full features compatibility with the original (c)minpack 44 | * package. 45 | * 46 | */ 47 | } 48 | 49 | //@{ 50 | 51 | #include "src/NumericalDiff/NumericalDiff.h" 52 | 53 | //@} 54 | 55 | 56 | #endif // EIGEN_NUMERICALDIFF_MODULE 57 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/Skyline: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_SKYLINE_MODULE_H 10 | #define EIGEN_SKYLINE_MODULE_H 11 | 12 | 13 | #include "Eigen/Core" 14 | 15 | #include "Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | /** 23 | * \defgroup Skyline_Module Skyline module 24 | * 25 | * 26 | * 27 | * 28 | */ 29 | 30 | #include "src/Skyline/SkylineUtil.h" 31 | #include "src/Skyline/SkylineMatrixBase.h" 32 | #include "src/Skyline/SkylineStorage.h" 33 | #include "src/Skyline/SkylineMatrix.h" 34 | #include "src/Skyline/SkylineInplaceLU.h" 35 | #include "src/Skyline/SkylineProduct.h" 36 | 37 | #include "Eigen/src/Core/util/ReenableStupidWarnings.h" 38 | 39 | #endif // EIGEN_SKYLINE_MODULE_H 40 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/SparseExtra: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_EXTRA_MODULE_H 11 | #define EIGEN_SPARSE_EXTRA_MODULE_H 12 | 13 | #include "../../Eigen/Sparse" 14 | 15 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #ifdef EIGEN_GOOGLEHASH_SUPPORT 26 | #include 27 | #endif 28 | 29 | /** 30 | * \defgroup SparseExtra_Module SparseExtra module 31 | * 32 | * This module contains some experimental features extending the sparse module. 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | */ 38 | 39 | 40 | #include "src/SparseExtra/DynamicSparseMatrix.h" 41 | #include "src/SparseExtra/BlockOfDynamicSparseMatrix.h" 42 | #include "src/SparseExtra/RandomSetter.h" 43 | 44 | #include "src/SparseExtra/MarketIO.h" 45 | 46 | #if !defined(_WIN32) 47 | #include 48 | #include "src/SparseExtra/MatrixMarketIterator.h" 49 | #endif 50 | 51 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 52 | 53 | #endif // EIGEN_SPARSE_EXTRA_MODULE_H 54 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/SpecialFunctions: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPECIALFUNCTIONS_MODULE 11 | #define EIGEN_SPECIALFUNCTIONS_MODULE 12 | 13 | #include 14 | 15 | #include "../../Eigen/Core" 16 | 17 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 18 | 19 | namespace Eigen { 20 | 21 | /** 22 | * \defgroup SpecialFunctions_Module Special math functions module 23 | * 24 | * This module features additional coefficient-wise math functions available 25 | * within the numext:: namespace for the scalar version, and as method and/or free 26 | * functions of Array. Those include: 27 | * 28 | * - erf 29 | * - erfc 30 | * - lgamma 31 | * - igamma 32 | * - igammac 33 | * - digamma 34 | * - polygamma 35 | * - zeta 36 | * - betainc 37 | * 38 | * \code 39 | * #include 40 | * \endcode 41 | */ 42 | //@{ 43 | 44 | } 45 | 46 | #include "src/SpecialFunctions/SpecialFunctionsImpl.h" 47 | #include "src/SpecialFunctions/SpecialFunctionsPacketMath.h" 48 | #include "src/SpecialFunctions/SpecialFunctionsHalf.h" 49 | #include "src/SpecialFunctions/SpecialFunctionsFunctors.h" 50 | #include "src/SpecialFunctions/SpecialFunctionsArrayAPI.h" 51 | 52 | #if defined EIGEN_VECTORIZE_CUDA 53 | #include "src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h" 54 | #endif 55 | 56 | namespace Eigen { 57 | //@} 58 | } 59 | 60 | 61 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 62 | 63 | #endif // EIGEN_SPECIALFUNCTIONS_MODULE 64 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/Splines: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 20010-2011 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPLINES_MODULE_H 11 | #define EIGEN_SPLINES_MODULE_H 12 | 13 | namespace Eigen 14 | { 15 | /** 16 | * \defgroup Splines_Module Spline and spline fitting module 17 | * 18 | * This module provides a simple multi-dimensional spline class while 19 | * offering most basic functionality to fit a spline to point sets. 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | } 26 | 27 | #include "src/Splines/SplineFwd.h" 28 | #include "src/Splines/Spline.h" 29 | #include "src/Splines/SplineFitting.h" 30 | 31 | #endif // EIGEN_SPLINES_MODULE_H 32 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_INCOMPLETE_LU_H 11 | #define EIGEN_INCOMPLETE_LU_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | class IncompleteLU : public SparseSolverBase > 17 | { 18 | protected: 19 | typedef SparseSolverBase > Base; 20 | using Base::m_isInitialized; 21 | 22 | typedef _Scalar Scalar; 23 | typedef Matrix Vector; 24 | typedef typename Vector::Index Index; 25 | typedef SparseMatrix FactorType; 26 | 27 | public: 28 | typedef Matrix MatrixType; 29 | 30 | IncompleteLU() {} 31 | 32 | template 33 | IncompleteLU(const MatrixType& mat) 34 | { 35 | compute(mat); 36 | } 37 | 38 | Index rows() const { return m_lu.rows(); } 39 | Index cols() const { return m_lu.cols(); } 40 | 41 | template 42 | IncompleteLU& compute(const MatrixType& mat) 43 | { 44 | m_lu = mat; 45 | int size = mat.cols(); 46 | Vector diag(size); 47 | for(int i=0; i 78 | void _solve_impl(const Rhs& b, Dest& x) const 79 | { 80 | x = m_lu.template triangularView().solve(b); 81 | x = m_lu.template triangularView().solve(x); 82 | } 83 | 84 | protected: 85 | FactorType m_lu; 86 | }; 87 | 88 | } // end namespace Eigen 89 | 90 | #endif // EIGEN_INCOMPLETE_LU_H 91 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMcovar.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This code initially comes from MINPACK whose original authors are: 5 | // Copyright Jorge More - Argonne National Laboratory 6 | // Copyright Burt Garbow - Argonne National Laboratory 7 | // Copyright Ken Hillstrom - Argonne National Laboratory 8 | // 9 | // This Source Code Form is subject to the terms of the Minpack license 10 | // (a BSD-like license) described in the campaigned CopyrightMINPACK.txt file. 11 | 12 | #ifndef EIGEN_LMCOVAR_H 13 | #define EIGEN_LMCOVAR_H 14 | 15 | namespace Eigen { 16 | 17 | namespace internal { 18 | 19 | template 20 | void covar( 21 | Matrix< Scalar, Dynamic, Dynamic > &r, 22 | const VectorXi& ipvt, 23 | Scalar tol = std::sqrt(NumTraits::epsilon()) ) 24 | { 25 | using std::abs; 26 | /* Local variables */ 27 | Index i, j, k, l, ii, jj; 28 | bool sing; 29 | Scalar temp; 30 | 31 | /* Function Body */ 32 | const Index n = r.cols(); 33 | const Scalar tolr = tol * abs(r(0,0)); 34 | Matrix< Scalar, Dynamic, 1 > wa(n); 35 | eigen_assert(ipvt.size()==n); 36 | 37 | /* form the inverse of r in the full upper triangle of r. */ 38 | l = -1; 39 | for (k = 0; k < n; ++k) 40 | if (abs(r(k,k)) > tolr) { 41 | r(k,k) = 1. / r(k,k); 42 | for (j = 0; j <= k-1; ++j) { 43 | temp = r(k,k) * r(j,k); 44 | r(j,k) = 0.; 45 | r.col(k).head(j+1) -= r.col(j).head(j+1) * temp; 46 | } 47 | l = k; 48 | } 49 | 50 | /* form the full upper triangle of the inverse of (r transpose)*r */ 51 | /* in the full upper triangle of r. */ 52 | for (k = 0; k <= l; ++k) { 53 | for (j = 0; j <= k-1; ++j) 54 | r.col(j).head(j+1) += r.col(k).head(j+1) * r(j,k); 55 | r.col(k).head(k+1) *= r(k,k); 56 | } 57 | 58 | /* form the full lower triangle of the covariance matrix */ 59 | /* in the strict lower triangle of r and in wa. */ 60 | for (j = 0; j < n; ++j) { 61 | jj = ipvt[j]; 62 | sing = j > l; 63 | for (i = 0; i <= j; ++i) { 64 | if (sing) 65 | r(i,j) = 0.; 66 | ii = ipvt[i]; 67 | if (ii > jj) 68 | r(ii,jj) = r(i,j); 69 | if (ii < jj) 70 | r(jj,ii) = r(i,j); 71 | } 72 | wa[jj] = r(j,j); 73 | } 74 | 75 | /* symmetrize the covariance matrix in r. */ 76 | r.topLeftCorner(n,n).template triangularView() = r.topLeftCorner(n,n).transpose(); 77 | r.diagonal() = wa; 78 | } 79 | 80 | } // end namespace internal 81 | 82 | } // end namespace Eigen 83 | 84 | #endif // EIGEN_LMCOVAR_H 85 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/MatrixFunctions/StemFunction.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2010, 2013 Jitse Niesen 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STEM_FUNCTION 11 | #define EIGEN_STEM_FUNCTION 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | /** \brief The exponential function (and its derivatives). */ 18 | template 19 | Scalar stem_function_exp(Scalar x, int) 20 | { 21 | using std::exp; 22 | return exp(x); 23 | } 24 | 25 | /** \brief Cosine (and its derivatives). */ 26 | template 27 | Scalar stem_function_cos(Scalar x, int n) 28 | { 29 | using std::cos; 30 | using std::sin; 31 | Scalar res; 32 | 33 | switch (n % 4) { 34 | case 0: 35 | res = std::cos(x); 36 | break; 37 | case 1: 38 | res = -std::sin(x); 39 | break; 40 | case 2: 41 | res = -std::cos(x); 42 | break; 43 | case 3: 44 | res = std::sin(x); 45 | break; 46 | } 47 | return res; 48 | } 49 | 50 | /** \brief Sine (and its derivatives). */ 51 | template 52 | Scalar stem_function_sin(Scalar x, int n) 53 | { 54 | using std::cos; 55 | using std::sin; 56 | Scalar res; 57 | 58 | switch (n % 4) { 59 | case 0: 60 | res = std::sin(x); 61 | break; 62 | case 1: 63 | res = std::cos(x); 64 | break; 65 | case 2: 66 | res = -std::sin(x); 67 | break; 68 | case 3: 69 | res = -std::cos(x); 70 | break; 71 | } 72 | return res; 73 | } 74 | 75 | /** \brief Hyperbolic cosine (and its derivatives). */ 76 | template 77 | Scalar stem_function_cosh(Scalar x, int n) 78 | { 79 | using std::cosh; 80 | using std::sinh; 81 | Scalar res; 82 | 83 | switch (n % 2) { 84 | case 0: 85 | res = std::cosh(x); 86 | break; 87 | case 1: 88 | res = std::sinh(x); 89 | break; 90 | } 91 | return res; 92 | } 93 | 94 | /** \brief Hyperbolic sine (and its derivatives). */ 95 | template 96 | Scalar stem_function_sinh(Scalar x, int n) 97 | { 98 | using std::cosh; 99 | using std::sinh; 100 | Scalar res; 101 | 102 | switch (n % 2) { 103 | case 0: 104 | res = std::sinh(x); 105 | break; 106 | case 1: 107 | res = std::cosh(x); 108 | break; 109 | } 110 | return res; 111 | } 112 | 113 | } // end namespace internal 114 | 115 | } // end namespace Eigen 116 | 117 | #endif // EIGEN_STEM_FUNCTION 118 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/chkder.h: -------------------------------------------------------------------------------- 1 | #define chkder_log10e 0.43429448190325182765 2 | #define chkder_factor 100. 3 | 4 | namespace Eigen { 5 | 6 | namespace internal { 7 | 8 | template 9 | void chkder( 10 | const Matrix< Scalar, Dynamic, 1 > &x, 11 | const Matrix< Scalar, Dynamic, 1 > &fvec, 12 | const Matrix< Scalar, Dynamic, Dynamic > &fjac, 13 | Matrix< Scalar, Dynamic, 1 > &xp, 14 | const Matrix< Scalar, Dynamic, 1 > &fvecp, 15 | int mode, 16 | Matrix< Scalar, Dynamic, 1 > &err 17 | ) 18 | { 19 | using std::sqrt; 20 | using std::abs; 21 | using std::log; 22 | 23 | typedef DenseIndex Index; 24 | 25 | const Scalar eps = sqrt(NumTraits::epsilon()); 26 | const Scalar epsf = chkder_factor * NumTraits::epsilon(); 27 | const Scalar epslog = chkder_log10e * log(eps); 28 | Scalar temp; 29 | 30 | const Index m = fvec.size(), n = x.size(); 31 | 32 | if (mode != 2) { 33 | /* mode = 1. */ 34 | xp.resize(n); 35 | for (Index j = 0; j < n; ++j) { 36 | temp = eps * abs(x[j]); 37 | if (temp == 0.) 38 | temp = eps; 39 | xp[j] = x[j] + temp; 40 | } 41 | } 42 | else { 43 | /* mode = 2. */ 44 | err.setZero(m); 45 | for (Index j = 0; j < n; ++j) { 46 | temp = abs(x[j]); 47 | if (temp == 0.) 48 | temp = 1.; 49 | err += temp * fjac.col(j); 50 | } 51 | for (Index i = 0; i < m; ++i) { 52 | temp = 1.; 53 | if (fvec[i] != 0. && fvecp[i] != 0. && abs(fvecp[i] - fvec[i]) >= epsf * abs(fvec[i])) 54 | temp = eps * abs((fvecp[i] - fvec[i]) / eps - err[i]) / (abs(fvec[i]) + abs(fvecp[i])); 55 | err[i] = 1.; 56 | if (temp > NumTraits::epsilon() && temp < eps) 57 | err[i] = (chkder_log10e * log(temp) - epslog) / epslog; 58 | if (temp >= eps) 59 | err[i] = 0.; 60 | } 61 | } 62 | } 63 | 64 | } // end namespace internal 65 | 66 | } // end namespace Eigen 67 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/covar.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | template 6 | void covar( 7 | Matrix< Scalar, Dynamic, Dynamic > &r, 8 | const VectorXi &ipvt, 9 | Scalar tol = std::sqrt(NumTraits::epsilon()) ) 10 | { 11 | using std::abs; 12 | typedef DenseIndex Index; 13 | 14 | /* Local variables */ 15 | Index i, j, k, l, ii, jj; 16 | bool sing; 17 | Scalar temp; 18 | 19 | /* Function Body */ 20 | const Index n = r.cols(); 21 | const Scalar tolr = tol * abs(r(0,0)); 22 | Matrix< Scalar, Dynamic, 1 > wa(n); 23 | eigen_assert(ipvt.size()==n); 24 | 25 | /* form the inverse of r in the full upper triangle of r. */ 26 | l = -1; 27 | for (k = 0; k < n; ++k) 28 | if (abs(r(k,k)) > tolr) { 29 | r(k,k) = 1. / r(k,k); 30 | for (j = 0; j <= k-1; ++j) { 31 | temp = r(k,k) * r(j,k); 32 | r(j,k) = 0.; 33 | r.col(k).head(j+1) -= r.col(j).head(j+1) * temp; 34 | } 35 | l = k; 36 | } 37 | 38 | /* form the full upper triangle of the inverse of (r transpose)*r */ 39 | /* in the full upper triangle of r. */ 40 | for (k = 0; k <= l; ++k) { 41 | for (j = 0; j <= k-1; ++j) 42 | r.col(j).head(j+1) += r.col(k).head(j+1) * r(j,k); 43 | r.col(k).head(k+1) *= r(k,k); 44 | } 45 | 46 | /* form the full lower triangle of the covariance matrix */ 47 | /* in the strict lower triangle of r and in wa. */ 48 | for (j = 0; j < n; ++j) { 49 | jj = ipvt[j]; 50 | sing = j > l; 51 | for (i = 0; i <= j; ++i) { 52 | if (sing) 53 | r(i,j) = 0.; 54 | ii = ipvt[i]; 55 | if (ii > jj) 56 | r(ii,jj) = r(i,j); 57 | if (ii < jj) 58 | r(jj,ii) = r(i,j); 59 | } 60 | wa[jj] = r(j,j); 61 | } 62 | 63 | /* symmetrize the covariance matrix in r. */ 64 | r.topLeftCorner(n,n).template triangularView() = r.topLeftCorner(n,n).transpose(); 65 | r.diagonal() = wa; 66 | } 67 | 68 | } // end namespace internal 69 | 70 | } // end namespace Eigen 71 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | template 6 | DenseIndex fdjac1( 7 | const FunctorType &Functor, 8 | Matrix< Scalar, Dynamic, 1 > &x, 9 | Matrix< Scalar, Dynamic, 1 > &fvec, 10 | Matrix< Scalar, Dynamic, Dynamic > &fjac, 11 | DenseIndex ml, DenseIndex mu, 12 | Scalar epsfcn) 13 | { 14 | using std::sqrt; 15 | using std::abs; 16 | 17 | typedef DenseIndex Index; 18 | 19 | /* Local variables */ 20 | Scalar h; 21 | Index j, k; 22 | Scalar eps, temp; 23 | Index msum; 24 | int iflag; 25 | Index start, length; 26 | 27 | /* Function Body */ 28 | const Scalar epsmch = NumTraits::epsilon(); 29 | const Index n = x.size(); 30 | eigen_assert(fvec.size()==n); 31 | Matrix< Scalar, Dynamic, 1 > wa1(n); 32 | Matrix< Scalar, Dynamic, 1 > wa2(n); 33 | 34 | eps = sqrt((std::max)(epsfcn,epsmch)); 35 | msum = ml + mu + 1; 36 | if (msum >= n) { 37 | /* computation of dense approximate jacobian. */ 38 | for (j = 0; j < n; ++j) { 39 | temp = x[j]; 40 | h = eps * abs(temp); 41 | if (h == 0.) 42 | h = eps; 43 | x[j] = temp + h; 44 | iflag = Functor(x, wa1); 45 | if (iflag < 0) 46 | return iflag; 47 | x[j] = temp; 48 | fjac.col(j) = (wa1-fvec)/h; 49 | } 50 | 51 | }else { 52 | /* computation of banded approximate jacobian. */ 53 | for (k = 0; k < msum; ++k) { 54 | for (j = k; (msum<0) ? (j>n): (jn): (j(0,j-mu); 69 | length = (std::min)(n-1, j+ml) - start + 1; 70 | fjac.col(j).segment(start, length) = ( wa1.segment(start, length)-fvec.segment(start, length))/h; 71 | } 72 | } 73 | } 74 | return 0; 75 | } 76 | 77 | } // end namespace internal 78 | 79 | } // end namespace Eigen 80 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | // TODO : move this to GivensQR once there's such a thing in Eigen 6 | 7 | template 8 | void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector > &v_givens, const std::vector > &w_givens) 9 | { 10 | typedef DenseIndex Index; 11 | 12 | /* apply the first set of givens rotations to a. */ 13 | for (Index j = n-2; j>=0; --j) 14 | for (Index i = 0; i 6 | void rwupdt( 7 | Matrix< Scalar, Dynamic, Dynamic > &r, 8 | const Matrix< Scalar, Dynamic, 1> &w, 9 | Matrix< Scalar, Dynamic, 1> &b, 10 | Scalar alpha) 11 | { 12 | typedef DenseIndex Index; 13 | 14 | const Index n = r.cols(); 15 | eigen_assert(r.rows()>=n); 16 | std::vector > givens(n); 17 | 18 | /* Local variables */ 19 | Scalar temp, rowj; 20 | 21 | /* Function Body */ 22 | for (Index j = 0; j < n; ++j) { 23 | rowj = w[j]; 24 | 25 | /* apply the previous transformations to */ 26 | /* r(i,j), i=0,1,...,j-1, and to w(j). */ 27 | for (Index i = 0; i < j; ++i) { 28 | temp = givens[i].c() * r(i,j) + givens[i].s() * rowj; 29 | rowj = -givens[i].s() * r(i,j) + givens[i].c() * rowj; 30 | r(i,j) = temp; 31 | } 32 | 33 | /* determine a givens rotation which eliminates w(j). */ 34 | givens[j].makeGivens(-r(j,j), rowj); 35 | 36 | if (rowj == 0.) 37 | continue; // givens[j] is identity 38 | 39 | /* apply the current transformation to r(j,j), b(j), and alpha. */ 40 | r(j,j) = givens[j].c() * r(j,j) + givens[j].s() * rowj; 41 | temp = givens[j].c() * b[j] + givens[j].s() * alpha; 42 | alpha = -givens[j].s() * b[j] + givens[j].c() * alpha; 43 | b[j] = temp; 44 | } 45 | } 46 | 47 | } // end namespace internal 48 | 49 | } // end namespace Eigen 50 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsHalf.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPECIALFUNCTIONS_HALF_H 9 | #define EIGEN_SPECIALFUNCTIONS_HALF_H 10 | 11 | namespace Eigen { 12 | namespace numext { 13 | 14 | #if EIGEN_HAS_C99_MATH 15 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half lgamma(const Eigen::half& a) { 16 | return Eigen::half(Eigen::numext::lgamma(static_cast(a))); 17 | } 18 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half digamma(const Eigen::half& a) { 19 | return Eigen::half(Eigen::numext::digamma(static_cast(a))); 20 | } 21 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half zeta(const Eigen::half& x, const Eigen::half& q) { 22 | return Eigen::half(Eigen::numext::zeta(static_cast(x), static_cast(q))); 23 | } 24 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half polygamma(const Eigen::half& n, const Eigen::half& x) { 25 | return Eigen::half(Eigen::numext::polygamma(static_cast(n), static_cast(x))); 26 | } 27 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half erf(const Eigen::half& a) { 28 | return Eigen::half(Eigen::numext::erf(static_cast(a))); 29 | } 30 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half erfc(const Eigen::half& a) { 31 | return Eigen::half(Eigen::numext::erfc(static_cast(a))); 32 | } 33 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half igamma(const Eigen::half& a, const Eigen::half& x) { 34 | return Eigen::half(Eigen::numext::igamma(static_cast(a), static_cast(x))); 35 | } 36 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half igammac(const Eigen::half& a, const Eigen::half& x) { 37 | return Eigen::half(Eigen::numext::igammac(static_cast(a), static_cast(x))); 38 | } 39 | template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half betainc(const Eigen::half& a, const Eigen::half& b, const Eigen::half& x) { 40 | return Eigen::half(Eigen::numext::betainc(static_cast(a), static_cast(b), static_cast(x))); 41 | } 42 | #endif 43 | 44 | } // end namespace numext 45 | } // end namespace Eigen 46 | 47 | #endif // EIGEN_SPECIALFUNCTIONS_HALF_H 48 | -------------------------------------------------------------------------------- /third_party/Eigen3/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsPacketMath.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPECIALFUNCTIONS_PACKETMATH_H 11 | #define EIGEN_SPECIALFUNCTIONS_PACKETMATH_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | /** \internal \returns the ln(|gamma(\a a)|) (coeff-wise) */ 18 | template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS 19 | Packet plgamma(const Packet& a) { using numext::lgamma; return lgamma(a); } 20 | 21 | /** \internal \returns the derivative of lgamma, psi(\a a) (coeff-wise) */ 22 | template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS 23 | Packet pdigamma(const Packet& a) { using numext::digamma; return digamma(a); } 24 | 25 | /** \internal \returns the zeta function of two arguments (coeff-wise) */ 26 | template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS 27 | Packet pzeta(const Packet& x, const Packet& q) { using numext::zeta; return zeta(x, q); } 28 | 29 | /** \internal \returns the polygamma function (coeff-wise) */ 30 | template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS 31 | Packet ppolygamma(const Packet& n, const Packet& x) { using numext::polygamma; return polygamma(n, x); } 32 | 33 | /** \internal \returns the erf(\a a) (coeff-wise) */ 34 | template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS 35 | Packet perf(const Packet& a) { using numext::erf; return erf(a); } 36 | 37 | /** \internal \returns the erfc(\a a) (coeff-wise) */ 38 | template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS 39 | Packet perfc(const Packet& a) { using numext::erfc; return erfc(a); } 40 | 41 | /** \internal \returns the incomplete gamma function igamma(\a a, \a x) */ 42 | template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 43 | Packet pigamma(const Packet& a, const Packet& x) { using numext::igamma; return igamma(a, x); } 44 | 45 | /** \internal \returns the complementary incomplete gamma function igammac(\a a, \a x) */ 46 | template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 47 | Packet pigammac(const Packet& a, const Packet& x) { using numext::igammac; return igammac(a, x); } 48 | 49 | /** \internal \returns the complementary incomplete gamma function betainc(\a a, \a b, \a x) */ 50 | template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 51 | Packet pbetainc(const Packet& a, const Packet& b,const Packet& x) { using numext::betainc; return betainc(a, b, x); } 52 | 53 | } // end namespace internal 54 | 55 | } // end namespace Eigen 56 | 57 | #endif // EIGEN_SPECIALFUNCTIONS_PACKETMATH_H 58 | 59 | -------------------------------------------------------------------------------- /third_party/Eigen3/share/eigen3/cmake/Eigen3Config.cmake: -------------------------------------------------------------------------------- 1 | # This file exports the Eigen3::Eigen CMake target which should be passed to the 2 | # target_link_libraries command. 3 | 4 | 5 | ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### 6 | ####### Any changes to this file will be overwritten by the next CMake run #### 7 | ####### The input file was Eigen3Config.cmake.in ######## 8 | 9 | get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) 10 | 11 | macro(set_and_check _var _file) 12 | set(${_var} "${_file}") 13 | if(NOT EXISTS "${_file}") 14 | message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") 15 | endif() 16 | endmacro() 17 | 18 | #################################################################################### 19 | 20 | include ("${CMAKE_CURRENT_LIST_DIR}/Eigen3Targets.cmake") 21 | 22 | # Legacy variables, do *not* use. May be removed in the future. 23 | 24 | set (EIGEN3_FOUND 1) 25 | set (EIGEN3_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/UseEigen3.cmake") 26 | 27 | set (EIGEN3_DEFINITIONS "") 28 | set (EIGEN3_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include/eigen3") 29 | set (EIGEN3_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/eigen3") 30 | set (EIGEN3_ROOT_DIR "${PACKAGE_PREFIX_DIR}") 31 | 32 | set (EIGEN3_VERSION_STRING "3.3.1") 33 | set (EIGEN3_VERSION_MAJOR "3") 34 | set (EIGEN3_VERSION_MINOR "3") 35 | set (EIGEN3_VERSION_PATCH "1") 36 | -------------------------------------------------------------------------------- /third_party/Eigen3/share/eigen3/cmake/Eigen3ConfigVersion.cmake: -------------------------------------------------------------------------------- 1 | # This is a basic version file for the Config-mode of find_package(). 2 | # It is used by write_basic_package_version_file() as input file for configure_file() 3 | # to create a version-file which can be installed along a config.cmake file. 4 | # 5 | # The created file sets PACKAGE_VERSION_EXACT if the current version string and 6 | # the requested version string are exactly the same and it sets 7 | # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, 8 | # but only if the requested major version is the same as the current one. 9 | # The variable CVF_VERSION must be set before calling configure_file(). 10 | 11 | 12 | set(PACKAGE_VERSION "3.3.1") 13 | 14 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) 15 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 16 | else() 17 | 18 | if("3.3.1" MATCHES "^([0-9]+)\\.") 19 | set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") 20 | else() 21 | set(CVF_VERSION_MAJOR "3.3.1") 22 | endif() 23 | 24 | if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) 25 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 26 | else() 27 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 28 | endif() 29 | 30 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) 31 | set(PACKAGE_VERSION_EXACT TRUE) 32 | endif() 33 | endif() 34 | 35 | 36 | # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: 37 | if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "" STREQUAL "") 38 | return() 39 | endif() 40 | 41 | # check that the installed version has the same 32/64bit-ness as the one which is currently searching: 42 | if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "") 43 | math(EXPR installedBits " * 8") 44 | set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") 45 | set(PACKAGE_VERSION_UNSUITABLE TRUE) 46 | endif() 47 | -------------------------------------------------------------------------------- /third_party/Eigen3/share/eigen3/cmake/UseEigen3.cmake: -------------------------------------------------------------------------------- 1 | # -*- cmake -*- 2 | # 3 | # UseEigen3.cmake 4 | 5 | add_definitions ( ${EIGEN3_DEFINITIONS} ) 6 | include_directories ( ${EIGEN3_INCLUDE_DIRS} ) 7 | --------------------------------------------------------------------------------