├── .gitee ├── ISSUE_TEMPLATE.zh-CN.md └── PULL_REQUEST_TEMPLATE.zh-CN.md ├── .gitignore ├── AstroLib.sln ├── AstroLib.suo ├── AstroLib ├── AstroLib.h ├── AstroLib.vcproj ├── AstroLib.vcproj.CMSE01.Wang.user ├── AstroLib.vcxproj ├── AstroLib.vcxproj.filters ├── AstroLib.vcxproj.user ├── AstroLib_ReadMe.txt ├── Include │ ├── AsAtmosphere.h │ ├── AsAttitude.h │ ├── AsAttitudeParam.h │ ├── AsAttitudeParam_2023.h │ ├── AsCommon.h │ ├── AsCoordSystem_2023.h │ ├── AsCoordinate.h │ ├── AsCoordinate_2023.h │ ├── AsDResolve.h │ ├── AsInterpolation.h │ ├── AsMath.h │ ├── AsMatrix.h │ ├── AsOrbit.h │ ├── AsOrbitParam.h │ ├── AsOrbitParam_2023.h │ ├── AsPlanetProp.h │ ├── AsRandom.h │ ├── AsRightFunction.h │ ├── AsTimeSystem.h │ ├── AsVector.h │ ├── Eigen.h │ ├── Eigen │ │ ├── Cholesky │ │ ├── CholmodSupport │ │ ├── Core │ │ ├── Dense │ │ ├── Eigen │ │ ├── Eigenvalues │ │ ├── Geometry │ │ ├── Householder │ │ ├── IterativeLinearSolvers │ │ ├── Jacobi │ │ ├── KLUSupport │ │ ├── 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 │ │ │ ├── ArithmeticSequence.h │ │ │ ├── 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 │ │ │ ├── IndexedView.h │ │ │ ├── Inverse.h │ │ │ ├── Map.h │ │ │ ├── MapBase.h │ │ │ ├── MathFunctions.h │ │ │ ├── MathFunctionsImpl.h │ │ │ ├── Matrix.h │ │ │ ├── MatrixBase.h │ │ │ ├── NestByValue.h │ │ │ ├── NoAlias.h │ │ │ ├── NumTraits.h │ │ │ ├── PartialReduxEvaluator.h │ │ │ ├── PermutationMatrix.h │ │ │ ├── PlainObjectBase.h │ │ │ ├── Product.h │ │ │ ├── ProductEvaluators.h │ │ │ ├── Random.h │ │ │ ├── Redux.h │ │ │ ├── Ref.h │ │ │ ├── Replicate.h │ │ │ ├── Reshaped.h │ │ │ ├── ReturnByValue.h │ │ │ ├── Reverse.h │ │ │ ├── Select.h │ │ │ ├── SelfAdjointView.h │ │ │ ├── SelfCwiseBinaryOp.h │ │ │ ├── Solve.h │ │ │ ├── SolveTriangular.h │ │ │ ├── SolverBase.h │ │ │ ├── StableNorm.h │ │ │ ├── StlIterators.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 │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AltiVec │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── MatrixProduct.h │ │ │ │ │ ├── MatrixProductCommon.h │ │ │ │ │ ├── MatrixProductMMA.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── CUDA │ │ │ │ │ └── Complex.h │ │ │ │ ├── Default │ │ │ │ │ ├── BFloat16.h │ │ │ │ │ ├── ConjHelper.h │ │ │ │ │ ├── GenericPacketMathFunctions.h │ │ │ │ │ ├── GenericPacketMathFunctionsFwd.h │ │ │ │ │ ├── Half.h │ │ │ │ │ ├── Settings.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── GPU │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── HIP │ │ │ │ │ └── hcc │ │ │ │ │ │ └── math_constants.h │ │ │ │ ├── MSA │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── NEON │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SSE │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SVE │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── SYCL │ │ │ │ │ ├── InteropHeaders.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ ├── SyclMemoryModel.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 │ │ │ │ ├── ConfigureVectorization.h │ │ │ │ ├── Constants.h │ │ │ │ ├── DisableStupidWarnings.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── IndexedViewHelper.h │ │ │ │ ├── IntegralConstant.h │ │ │ │ ├── MKL_support.h │ │ │ │ ├── Macros.h │ │ │ │ ├── Memory.h │ │ │ │ ├── Meta.h │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ ├── ReshapedHelper.h │ │ │ │ ├── StaticAssert.h │ │ │ │ ├── SymbolicIndex.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_SIMD.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 │ │ │ ├── KLUSupport │ │ │ └── KLUSupport.h │ │ │ ├── LU │ │ │ ├── Determinant.h │ │ │ ├── FullPivLU.h │ │ │ ├── InverseImpl.h │ │ │ ├── PartialPivLU.h │ │ │ ├── PartialPivLU_LAPACKE.h │ │ │ └── arch │ │ │ │ └── InverseSize4.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 │ │ │ ├── IndexedViewMethods.h │ │ │ ├── MatrixCwiseBinaryOps.h │ │ │ ├── MatrixCwiseUnaryOps.h │ │ │ └── ReshapedMethods.h │ ├── IzzoLam.h │ ├── LambertProblem.hpp │ ├── LambertProblemT.hpp │ ├── MyvectorT.hpp │ ├── sofa.h │ └── sofam.h └── Src │ ├── AsAtmosphere.cpp │ ├── AsAttitude.cpp │ ├── AsAttitudeParam.cpp │ ├── AsAttitudeParam_2023.cpp │ ├── AsCommon.cpp │ ├── AsCoordSystem_2023.cpp │ ├── AsCoordinate.cpp │ ├── AsCoordinate_2023.cpp │ ├── AsDResolve.cpp │ ├── AsInterpolation.cpp │ ├── AsMath.cpp │ ├── AsMatrix.cpp │ ├── AsOrbit.cpp │ ├── AsOrbitParam.cpp │ ├── AsOrbitParam_2023.cpp │ ├── AsPlanetProp.cpp │ ├── AsRandom.cpp │ ├── AsRightFunction.cpp │ ├── AsTimeSystem.cpp │ ├── AsVector.cpp │ ├── IzzoLam.cpp │ └── Sofa │ ├── a2af.c │ ├── a2tf.c │ ├── ab.c │ ├── ae2hd.c │ ├── af2a.c │ ├── anp.c │ ├── anpm.c │ ├── apcg.c │ ├── apcg13.c │ ├── apci.c │ ├── apci13.c │ ├── apco.c │ ├── apco13.c │ ├── apcs.c │ ├── apcs13.c │ ├── aper.c │ ├── aper13.c │ ├── apio.c │ ├── apio13.c │ ├── atcc13.c │ ├── atccq.c │ ├── atci13.c │ ├── atciq.c │ ├── atciqn.c │ ├── atciqz.c │ ├── atco13.c │ ├── atic13.c │ ├── aticq.c │ ├── aticqn.c │ ├── atio13.c │ ├── atioq.c │ ├── atoc13.c │ ├── atoi13.c │ ├── atoiq.c │ ├── bi00.c │ ├── bp00.c │ ├── bp06.c │ ├── bpn2xy.c │ ├── c2i00a.c │ ├── c2i00b.c │ ├── c2i06a.c │ ├── c2ibpn.c │ ├── c2ixy.c │ ├── c2ixys.c │ ├── c2s.c │ ├── c2t00a.c │ ├── c2t00b.c │ ├── c2t06a.c │ ├── c2tcio.c │ ├── c2teqx.c │ ├── c2tpe.c │ ├── c2txy.c │ ├── cal2jd.c │ ├── cp.c │ ├── cpv.c │ ├── cr.c │ ├── d2dtf.c │ ├── d2tf.c │ ├── dat.c │ ├── dtdb.c │ ├── dtf2d.c │ ├── eceq06.c │ ├── ecm06.c │ ├── ee00.c │ ├── ee00a.c │ ├── ee00b.c │ ├── ee06a.c │ ├── eect00.c │ ├── eform.c │ ├── eo06a.c │ ├── eors.c │ ├── epb.c │ ├── epb2jd.c │ ├── epj.c │ ├── epj2jd.c │ ├── epv00.c │ ├── eqec06.c │ ├── eqeq94.c │ ├── era00.c │ ├── fad03.c │ ├── fae03.c │ ├── faf03.c │ ├── faju03.c │ ├── fal03.c │ ├── falp03.c │ ├── fama03.c │ ├── fame03.c │ ├── fane03.c │ ├── faom03.c │ ├── fapa03.c │ ├── fasa03.c │ ├── faur03.c │ ├── fave03.c │ ├── fk425.c │ ├── fk45z.c │ ├── fk524.c │ ├── fk52h.c │ ├── fk54z.c │ ├── fk5hip.c │ ├── fk5hz.c │ ├── fw2m.c │ ├── fw2xy.c │ ├── g2icrs.c │ ├── gc2gd.c │ ├── gc2gde.c │ ├── gd2gc.c │ ├── gd2gce.c │ ├── gmst00.c │ ├── gmst06.c │ ├── gmst82.c │ ├── gst00a.c │ ├── gst00b.c │ ├── gst06.c │ ├── gst06a.c │ ├── gst94.c │ ├── h2fk5.c │ ├── hd2ae.c │ ├── hd2pa.c │ ├── hfk5z.c │ ├── icrs2g.c │ ├── ir.c │ ├── jd2cal.c │ ├── jdcalf.c │ ├── ld.c │ ├── ldn.c │ ├── ldsun.c │ ├── lteceq.c │ ├── ltecm.c │ ├── lteqec.c │ ├── ltp.c │ ├── ltpb.c │ ├── ltpecl.c │ ├── ltpequ.c │ ├── makefile │ ├── moon98.c │ ├── num00a.c │ ├── num00b.c │ ├── num06a.c │ ├── numat.c │ ├── nut00a.c │ ├── nut00b.c │ ├── nut06a.c │ ├── nut80.c │ ├── nutm80.c │ ├── obl06.c │ ├── obl80.c │ ├── p06e.c │ ├── p2pv.c │ ├── p2s.c │ ├── pap.c │ ├── pas.c │ ├── pb06.c │ ├── pdp.c │ ├── pfw06.c │ ├── plan94.c │ ├── pm.c │ ├── pmat00.c │ ├── pmat06.c │ ├── pmat76.c │ ├── pmp.c │ ├── pmpx.c │ ├── pmsafe.c │ ├── pn.c │ ├── pn00.c │ ├── pn00a.c │ ├── pn00b.c │ ├── pn06.c │ ├── pn06a.c │ ├── pnm00a.c │ ├── pnm00b.c │ ├── pnm06a.c │ ├── pnm80.c │ ├── pom00.c │ ├── ppp.c │ ├── ppsp.c │ ├── pr00.c │ ├── prec76.c │ ├── pv2p.c │ ├── pv2s.c │ ├── pvdpv.c │ ├── pvm.c │ ├── pvmpv.c │ ├── pvppv.c │ ├── pvstar.c │ ├── pvtob.c │ ├── pvu.c │ ├── pvup.c │ ├── pvxpv.c │ ├── pxp.c │ ├── refco.c │ ├── rm2v.c │ ├── rv2m.c │ ├── rx.c │ ├── rxp.c │ ├── rxpv.c │ ├── rxr.c │ ├── ry.c │ ├── rz.c │ ├── s00.c │ ├── s00a.c │ ├── s00b.c │ ├── s06.c │ ├── s06a.c │ ├── s2c.c │ ├── s2p.c │ ├── s2pv.c │ ├── s2xpv.c │ ├── sepp.c │ ├── seps.c │ ├── sp00.c │ ├── starpm.c │ ├── starpv.c │ ├── sxp.c │ ├── sxpv.c │ ├── t_sofa_c.c │ ├── taitt.c │ ├── taiut1.c │ ├── taiutc.c │ ├── tcbtdb.c │ ├── tcgtt.c │ ├── tdbtcb.c │ ├── tdbtt.c │ ├── tf2a.c │ ├── tf2d.c │ ├── tpors.c │ ├── tporv.c │ ├── tpsts.c │ ├── tpstv.c │ ├── tpxes.c │ ├── tpxev.c │ ├── tr.c │ ├── trxp.c │ ├── trxpv.c │ ├── tttai.c │ ├── tttcg.c │ ├── tttdb.c │ ├── ttut1.c │ ├── ut1tai.c │ ├── ut1tt.c │ ├── ut1utc.c │ ├── utctai.c │ ├── utcut1.c │ ├── xy06.c │ ├── xys00a.c │ ├── xys00b.c │ ├── xys06a.c │ ├── zp.c │ ├── zpv.c │ └── zr.c ├── Examples ├── AstroLibExamples.cpp ├── AstroLibExamples.h ├── Examples.vcproj ├── Examples.vcxproj ├── Examples.vcxproj.filters ├── Examples.vcxproj.user ├── ReadMe.txt └── Src │ ├── ExampleAttitude.cpp │ ├── ExampleAttitude.h │ ├── ExampleMath.cpp │ ├── ExampleMath.h │ ├── ExampleODEResolve.cpp │ ├── ExampleODEResolve.h │ ├── ExampleOrbElemConv.cpp │ ├── ExampleOrbElemConv.h │ ├── ExampleOrbProp.cpp │ └── ExampleOrbProp.h ├── Graphics3D ├── 2k_earth_daymap.bmp ├── Graphics3D.cpp ├── Graphics3D.filters ├── Graphics3D.h ├── Graphics3D.user ├── Graphics3D.vcxproj ├── Graphics3D.vcxproj.filters ├── ReadMe.txt ├── glut.def ├── glut.h ├── glut32.dll ├── glut32.lib ├── glut32bit64bit.zip ├── glut64.dll ├── glut64.lib ├── msvcp100d.dll ├── msvcr100d.dll ├── ucrtbased.dll ├── vcruntime140.dll └── vcruntime140d.dll ├── LICENSE ├── LowOrbitConstellation ├── Coverage.cpp ├── LowOrbitConstellation.cpp ├── LowOrbitConstellation.h ├── LowOrbitConstellation.vcproj ├── LowOrbitConstellation.vcxproj ├── LowOrbitConstellation.vcxproj.filters ├── LowOrbitConstellation.vcxproj.user ├── Output │ ├── 目标卫星星历.txt │ ├── 观测卫星1星历.txt │ └── 观测卫星2星历.txt ├── ReadMe.txt └── Readxingli.cpp ├── Matlab ├── MonteCarlo_Matlab │ ├── blade1D.m │ ├── bladeLtbc.m │ ├── bladedet.m │ ├── bladeuni.m │ └── uniforml.m └── SimDoF6_Matlab │ ├── DoF6.mdl │ ├── actxlicense.m │ └── slprj │ ├── grt │ └── DoF6 │ │ └── tmwinternal │ │ └── minfo.mat │ ├── modeladvisor │ └── DoF6 │ │ └── 6DoF_20_28Quaternion_29 │ │ ├── Thumbs.db │ │ ├── copy.png │ │ ├── cut.png │ │ ├── folder.png │ │ ├── folder_failed.png │ │ ├── folder_pass.png │ │ ├── folder_warning.png │ │ ├── geninfo.mat │ │ ├── icon_folder.png │ │ ├── icon_procedure.png │ │ ├── icon_task.png │ │ ├── icon_task_disabled.png │ │ ├── icon_task_pselected.png │ │ ├── icon_task_required.png │ │ ├── info_icon.png │ │ ├── mdladvinfo.mat │ │ ├── minus.png │ │ ├── paste.png │ │ ├── plus.png │ │ ├── procedure_failed.png │ │ ├── procedure_passed.png │ │ ├── procedure_warning.png │ │ ├── task_failed.png │ │ ├── task_forcepass.png │ │ ├── task_passed.png │ │ ├── task_req_forcepassed.png │ │ ├── task_req_passed.png │ │ ├── task_warning.png │ │ ├── vandv.png │ │ └── vandvback.png │ └── sl_proj.tmw ├── MultiRendezvous ├── MultiRendezvous.vcxproj ├── MultiRendezvous.vcxproj.filters ├── MultiRendezvous.vcxproj.user ├── ReadMe.txt ├── Src │ ├── MulChCtrl.cpp │ ├── MulChCtrl.h │ ├── MulSpacecraft.cpp │ ├── MulSpacecraft.h │ ├── ObserveGEO.cpp │ └── ObserveGEO.h └── output │ ├── Chase.txt │ ├── MulRend.png │ ├── RelPosVel.txt │ ├── Target0.txt │ ├── main_mp4.m │ ├── main_plot.m │ └── my_animation.mp4 ├── ParallelSim ├── ParallelSim.cpp ├── ParallelSim.vcxproj ├── ParallelSim.vcxproj.filters ├── ParallelSim.vcxproj.user ├── ReadMe.txt └── Src │ ├── MultiThread.h │ ├── MultiThreadAtomic.cpp │ ├── MultiThreadDynamic.cpp │ ├── MultiThreadStatic.cpp │ ├── SimOpenMP.cpp │ └── SimOpenMP.h ├── README.en.md ├── README.md ├── Rendezvous ├── Output │ ├── 500次结果 │ │ ├── Chase.txt │ │ ├── MonteCarlo.txt │ │ ├── RelPosVel.txt │ │ ├── Target.txt │ │ ├── graph.asv │ │ └── plotgraph.m │ ├── Chase.txt │ ├── MonteCarlo.txt │ ├── RelPosVel.txt │ ├── Target.txt │ ├── graphTest.m │ └── plotgraph.m ├── ReadMe.txt ├── Rendezvous.cpp ├── Rendezvous.h ├── Rendezvous.vcxproj ├── Rendezvous.vcxproj.filters ├── Rendezvous.vcxproj.user └── Src │ ├── ChCtrl.cpp │ ├── ChCtrl.h │ ├── Spacecraft.cpp │ └── Spacecraft.h ├── SimDoF6 ├── Output │ ├── Result.txt │ └── plotgraph.m ├── ReadMe.txt ├── SimDoF6.cpp ├── SimDoF6.h ├── SimDoF6.vcproj.CMSE01.Wang.user ├── SimDoF6.vcxproj ├── SimDoF6.vcxproj.filters ├── SimDoF6.vcxproj.user └── Src │ ├── DoF6.cpp │ └── DoF6.h ├── VisibilityAnalysis ├── Parameter.h ├── ToolFunction.cpp ├── ToolFunctions.h ├── VisibilityAnalysis.vcxproj ├── VisibilityAnalysis.vcxproj.filters └── main.cpp └── docs └── resources ├── AstroLib.png ├── Example_Ui.png ├── Graphics3D_Ui.png ├── Rendezvous_Ui.png ├── Rendezvous_pos.png ├── Rendezvous_xyz.png ├── Rendezvous_xz.png ├── SimDoF6_AngVel.png ├── SimDoF6_PosVel.png └── SimDoF6_Ui.png /.gitee/ISSUE_TEMPLATE.zh-CN.md: -------------------------------------------------------------------------------- 1 | ### 该问题是怎么引起的? 2 | 3 | 4 | 5 | ### 重现步骤 6 | 7 | 8 | 9 | ### 报错信息 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md: -------------------------------------------------------------------------------- 1 | ### 相关的Issue 2 | 3 | 4 | ### 原因(目的、解决的问题等) 5 | 6 | 7 | ### 描述(做了什么,变更了什么) 8 | 9 | 10 | ### 测试用例(新增、改动、可能影响的功能) 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | /AstroLib.opensdf 34 | 35 | #Build results 36 | Debug/ 37 | Release/ 38 | x64/ 39 | x86/ 40 | *.tlog/ 41 | 42 | #Visual Studio 2015/2017 cache/options directory 43 | .vs/ 44 | 45 | #files built by Visual Studio 46 | *.sbr 47 | *.obj 48 | *.ilk 49 | *.log 50 | *.ipdb 51 | *.pdb 52 | *.idb 53 | *.opt 54 | *.iobj 55 | *.ipdb 56 | *.tlog 57 | 58 | #Visual C++ cache files 59 | ipch/ 60 | *.aps 61 | *.ncb 62 | *.opendb 63 | *.sdf 64 | *.cachefile 65 | *.VC.db -------------------------------------------------------------------------------- /AstroLib.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/AstroLib.suo -------------------------------------------------------------------------------- /AstroLib/AstroLib.vcproj.CMSE01.Wang.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /AstroLib/AstroLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /AstroLib/AstroLib_ReadMe.txt: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2022 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | 该程序包作为《航天系统建模与仿真》的一个配套程序 9 | 提供了矢量、矩阵、姿态、轨道、插值、积分算法等仿真需要的基本程序。 10 | 11 | ======================================================================== 12 | 航天仿真库 AstroLib 13 | 《航天系统建模与仿真》配套代码 14 | <> 15 | 源码地址:https://gitee.com/wanghmail/AstroLib 16 | ======================================================================== 17 | 18 | 19 | ======================================================================== 20 | 功能 21 | ======================================================================== 22 | 1. 矢量和矩阵; 23 | 2. 数值算法, 包括数学基本运算,随机数生成,插值,常微分方程初值问题求解等; 24 | 3. 时间系统和坐标系统; 25 | 4. 姿态参数, 姿态参数转换; 26 | 5. 轨道参数, 轨道参数转换; 27 | 6. 姿态动力学; 28 | 7. 轨道动力学; 29 | 8. 空间环境; 30 | 9. 飞行器六自由度仿真实例; 31 | 10. 并行仿真实例; 32 | 11. 交会对接接近段仿真实例. 33 | 34 | 35 | 36 | ======================================================================== 37 | 使用方法 38 | ======================================================================== 39 | 1. 将AstroLib.h文件和Include、Lib目录拷贝到自己的项目目录下; 40 | 2. 在需要用到库中函数的地方包含"AstroLib.h"文件即可. 41 | 42 | 43 | ======================================================================== 44 | 命名约定 45 | ======================================================================== 46 | 类类型 C 47 | 枚举类型 E 48 | 枚举量 AsE 49 | 常数 AsC 50 | 全局变量 AsG 51 | 全局函数 As 52 | 53 | Note: 本命名约定仅用于AstroLib程序内部. 54 | 55 | 56 | 57 | 58 | //////////////////////////////////////////////////////////////////////////// 59 | // // 60 | // Copyright (c) 2003-2022 // 61 | // Wang Hua // 62 | // // 63 | //////////////////////////////////////////////////////////////////////////// 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /AstroLib/Include/AsAtmosphere.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2000-2021 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsAtmosphere.h 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | /// @file 12 | /// @brief 大气模型头文件 13 | 14 | #if !defined(ASATMOSPHERE_H_) 15 | #define ASATMOSPHERE_H_ 16 | 17 | 18 | #include "AsCommon.h" 19 | 20 | 21 | 22 | 23 | //==================================================================== 24 | // 25 | // Grouping: 大气模型系列函数 26 | // 27 | //==================================================================== 28 | 29 | //******************************************************************** 30 | /// finds the atmospheric density using exponential atmosphere model. 31 | /// returns the density based on the exponential model. 32 | /// refDensity * exp((refHeight - height) / scaleHeight); 33 | /// @Author Wang Hua 34 | /// @Date 2007.1.22 35 | /// @Input 36 | /// @Param refDensity reference density 37 | /// @Param refHeight reference height 38 | /// @Param scaleHeight scale height 39 | /// @Param height the altitude of interest 40 | /// @Return Density (kg/m^3) 41 | //******************************************************************** 42 | double AsExponentialAtmDens ( 43 | double refDensity, 44 | double refHeight, 45 | double scaleHeight, 46 | double height); 47 | 48 | //******************************************************************** 49 | /// 采用公式拟合GB1920-80标准大气,计算大气密度、压强和温度 50 | /// <<远程火箭弹道学>> P41 51 | /// @Author 张海联 2002-10-17, Wang Hua 2009-11-3 52 | /// @Date 2009-11-3 53 | /// @Input 54 | /// @Param alt 几何高度(米) 55 | /// @Output 56 | /// @Param density 大气密度(单位:千克/立方米) 57 | /// @Param pressure 大气压力(单位:帕) 58 | /// @Param temperature 温度 (单位:K) 59 | /// @Param sonicSpeed 音速 (单位:m/s) 60 | /// @Return 61 | //******************************************************************** 62 | void AsGB1980FitAtm( 63 | double alt, 64 | double& density, 65 | double& pressure, 66 | double& temperature, 67 | double& sonicSpeed); 68 | 69 | 70 | 71 | 72 | 73 | #endif // !defined(_ASATMOSPHERE_H_) 74 | -------------------------------------------------------------------------------- /AstroLib/Include/AsAttitude.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2000-2021 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsAttitude.h 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | /// @file 12 | /// @brief 姿态函数,头文件 13 | 14 | #if !defined(_AsAttitude_H__INCLUDED_) 15 | #define _AsAttitude_H__INCLUDED_ 16 | 17 | 18 | #include "AsCoordinate.h" 19 | #include "AsAttitudeParam.h" 20 | #include "AsRightFunction.h" 21 | 22 | 23 | class CAttitude 24 | { 25 | // 26 | //Operation. 27 | // 28 | public: 29 | CAttitude(); 30 | virtual ~CAttitude(); 31 | 32 | void AttitudeStep(double step, 33 | const CMatrix& inertia, const CCoord& torque, 34 | CQuaternion& quat, CCoord& angVel); 35 | 36 | 37 | // 38 | //Attribute. 39 | // 40 | private: 41 | //轨道姿态计算右函数类 42 | class CFuncAtt : public CRightFunc 43 | { 44 | // 45 | //Operation. 46 | // 47 | public: 48 | CFuncAtt(); 49 | virtual ~CFuncAtt(); 50 | 51 | void operator()(double t, const CVector &x, CVector &result) const; 52 | 53 | // 54 | //Attribute 55 | // 56 | public: 57 | CCoord m_Torque; 58 | CMatrix m_Inertia; 59 | 60 | }m_FuncAtt; 61 | }; 62 | 63 | #endif // !defined(_AsAttitude_H__INCLUDED_) 64 | -------------------------------------------------------------------------------- /AstroLib/Include/AsAttitudeParam_2023.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "AsCoordinate.h" 4 | #include "AsMath.h" 5 | #include "AsAttitudeParam.h" 6 | 7 | 8 | 9 | 10 | ///*********************************************************************** 11 | /// The conversion from matrix to axis and angle. 12 | /// @Author Xiao Yao 13 | /// @Date 2023.4.2 14 | /// @Input 15 | /// @Param mtx 坐标转换矩阵 16 | /// @Output 17 | /// @Param axis 旋转轴矢量 18 | /// @Param angle 旋转角[0, pi] 19 | ///*********************************************************************** 20 | void AsMtxToAxAng(const CMatrix& mtx, CCoord& axis, double& angle); 21 | 22 | ///*********************************************************************** 23 | ///将四元数转化成欧拉角_123转序 24 | /// @Author Liu Tianqing 25 | /// @Date 2023.04.06 26 | /// @Input 27 | /// @Param q 标准化四元数 28 | /// @Output 29 | /// @Param euler 欧拉角 30 | ///*********************************************************************** 31 | bool AsQuatToEuler123(const CQuaternion& q, CEuler& euler); 32 | 33 | ///*********************************************************************** 34 | /// 方向余弦阵转321转序欧拉角 35 | /// @Author Li Sibei 36 | /// @Date 2023.04.06 37 | /// @Input 38 | /// @Param mtx 方向余弦阵 39 | /// @Output 40 | /// @Param euler 欧拉角 41 | ///*********************************************************************** 42 | void AsMtxToEuler321(const CMatrix& mtx, CEuler& euler); 43 | 44 | ///*********************************************************************** 45 | /// 方向余弦矩阵转为313转序Euler角 46 | /// @Author Wang Weili 47 | /// @Date 2023.4 48 | /// @Input 49 | /// @Param mtx 坐标转移矩阵 50 | /// @Output 51 | /// @Param euler 欧拉角 52 | ///*********************************************************************** 53 | void AsMtxToEuler313(const CMatrix& mtx, CEuler& euler); 54 | 55 | ///*********************************************************************** 56 | /// 方向余弦矩阵转为312转序Euler角 57 | /// @Author Zhang Xuaying 58 | /// @Date 2023.04.01 59 | /// @Input 60 | /// @Param mtx 方向余弦矩阵 61 | /// @Output 62 | /// @Param euler 欧拉角(rad) 63 | ///*********************************************************************** 64 | void AsMtxToEuler312(const CMatrix& mtx, CEuler& euler); 65 | 66 | ///****************************************************** 67 | /// 根据转序和坐标转移矩阵计算Euler角,转序为2-3-1 68 | /// @author Sun Fengyan 69 | /// @data 2023.4 70 | /// @Version 1.0 71 | /// @Input 72 | /// @Param mtx 坐标转移矩阵 73 | /// @Output 74 | /// @Param euler 欧拉角返回值(单位:rad) 75 | ///****************************************************** 76 | void AsMtxToEuler231(const CMatrix& mtx, CEuler& euler); 77 | 78 | ///*********************************************************************** 79 | /// 方向余弦阵转123转序欧拉角 80 | /// @Author Gong he 81 | /// @Date 2023.04.14 82 | /// @Input 83 | /// @Param mtx 方向余弦阵 84 | /// @Output 85 | /// @Param angle 欧拉角 86 | ///*********************************************************************** 87 | void AsMtxToEuler123(const CMatrix& mtx, CEuler& euler); -------------------------------------------------------------------------------- /AstroLib/Include/AsCommon.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2008 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsCommon.h 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | #if !defined(_ASCOMMON_H_) 13 | #define _ASCOMMON_H_ 14 | 15 | 16 | 17 | 18 | #endif // !defined(_ASCOMMON_H_) 19 | -------------------------------------------------------------------------------- /AstroLib/Include/AsCoordinate_2023.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | -------------------------------------------------------------------------------- /AstroLib/Include/AsDResolve.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2008 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsDResolve.h 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | #if !defined(_ASDRESOLVE_H_) 13 | #define _ASDRESOLVE_H_ 14 | 15 | 16 | #include "AsCommon.h" 17 | #include "AsRightFunction.h" 18 | #include "AsVector.h" 19 | #include "AsMatrix.h" 20 | 21 | 22 | 23 | 24 | 25 | // 26 | //Fixed stepsize integration function of ordinary differential equations. 27 | // 28 | 29 | 30 | //********************************************************************* 31 | /// Fourth-order Runge-Kutta method. 32 | /// @Author Wang Hua 33 | /// @Date 2005.1 34 | /// @Input 35 | /// @Param func user-supplied class that computes the right-hand side derivatives. 36 | /// @Param step stepsize 37 | /// @Param t starting value of the indepentent variable. 38 | /// @In/Out 39 | /// @Param x input dependent variable at the starting. output new value 40 | // of dependent variable. 41 | /// @Output 42 | //********************************************************************* 43 | void AsODERungeKutta4 ( 44 | const CRightFunc& func, 45 | double step, 46 | double t, 47 | CVector& x); 48 | 49 | 50 | 51 | 52 | 53 | 54 | #endif // !defined(_ASDRESOLVE_H_) 55 | -------------------------------------------------------------------------------- /AstroLib/Include/AsOrbitParam_2023.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AsOrbitParam.h" 3 | #include "AsCoordinate.h" 4 | #include "AsMath.h" 5 | 6 | 7 | //******************************************************************** 8 | /// 修正轨道根数转换为位置速度/modified orbit element to cartesian state element. 9 | /// @Author Zhang Yu 10 | /// @Date 2023/4/2 11 | /// @Input 12 | /// @Param modOrb 修正轨道根数 13 | /// @Param gm 中心体引力常数 14 | /// @Output 15 | /// @Param pos 位置 16 | /// @Param vel 速度 17 | /// @Return true=成功; false=输入错误 18 | //******************************************************************** 19 | bool AsModOrbElemToCart( 20 | const CModOrbElem& modOrb, 21 | double gm, 22 | CCoord& pos, 23 | CCoord& vel); 24 | 25 | //******************************************************************** 26 | /// cartesian state element to modified orbit element 27 | /// @Author Zhang Sai 28 | /// @Date 2023.04.03 29 | /// @Input 30 | /// @Param pos 位置 31 | /// @Param vel 速度 32 | /// @Param gm 中心体引力常数 33 | /// @Output 34 | /// @Param modOrb m_I [0, pi] 35 | /// m_RAAN [0, 2pi] 36 | /// m_ArgPeri [0, 2pi] 37 | /// m_TrueA [0, 2pi] 38 | /// @Return true=成功; false=输入错误 39 | //******************************************************************** 40 | bool AsCartToModOrbElem(const CCoord3& pos, const CCoord3& vel, double gm, CModOrbElem& modOrb); 41 | 42 | ///*********************************************************************** 43 | /// 轨道六根数变换位置速度 44 | /// 在参考坐标系下,物体坐标为(r*cos(trueA), r*sin(trueA), 0) 45 | /// 统一单位 m kg rad 46 | /// @Author Guan Yuming 47 | /// @Date 2023.04.06 48 | /// @Input 49 | /// @Param Orb 轨道根数 50 | /// @Output 51 | /// @Param cartPos; 地心坐标系中位置矢量 52 | /// @Param cartVel 地心坐标系中速度矢量 53 | ///*********************************************************************** 54 | bool AsOrbElemToCart(const COrbElem& Orb, double gm, CCoord& cartPos, CCoord & cartVel); 55 | 56 | //******************************************************************** 57 | /// 由位置坐标s.m_Pos和速度矢量s.m_Vel计算经典轨道根数 58 | /// @Author Zhang Zhongneng 59 | /// @Date 2023.04.06 60 | /// @Input 61 | /// @Param pos 位置 62 | /// @Param vel 速度 63 | /// @Param gm 中心体引力常数 64 | /// @Output 65 | /// @Param elem 飞行器轨道根数 66 | /// @Return true=成功; false=输入错误 67 | //******************************************************************** 68 | bool AsCartToOrbElem( 69 | const CCoord& pos, 70 | const CCoord& vel, 71 | double gm, 72 | COrbElem& elem); 73 | -------------------------------------------------------------------------------- /AstroLib/Include/AsPlanetProp.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2000-2021 // 4 | // Wang Hua // 5 | // National University of Defense Technology // 6 | // // 7 | //////////////////////////////////////////////////////////////////////////// 8 | 9 | // AsPlanetProp.h 10 | // 11 | ////////////////////////////////////////////////////////////////////// 12 | 13 | #if !defined(ASPLANETPROP_H_) 14 | #define ASPLANETPROP_H_ 15 | 16 | 17 | #include "AsCommon.h" 18 | #include "AsMatrix.h" 19 | #include 20 | 21 | 22 | 23 | 24 | class CCoord; 25 | 26 | 27 | 28 | //******************************************************************** 29 | /// 计算地心赤道坐标系中的太阳位置 30 | /// calcuLates the Geocentric Equatorial position for the SUN given the Julian Date. 31 | /// @Author Wang Hua 32 | /// @Date 2004.11.15 33 | /// @Input 34 | /// @Param julianDate Julian Date 35 | /// @Output 36 | /// @Param sunPos Geocentric Equatorial Position vector of the SUN (meter) 37 | /// @Return 38 | //******************************************************************** 39 | void AsSunProp ( 40 | double julianDate, 41 | CCoord& sunPos); 42 | 43 | 44 | 45 | #endif // !defined(_ASPLANETPROP_H_) 46 | -------------------------------------------------------------------------------- /AstroLib/Include/AsRandom.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2008 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsRandom.h 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | /// @file 12 | /// @brief 随机数类,头文件 13 | 14 | #if !defined(_ASRANDOM_H_) 15 | #define _ASRANDOM_H_ 16 | 17 | 18 | #include "AsCommon.h" 19 | #include 20 | #include 21 | 22 | 23 | 24 | 25 | 26 | // 27 | //Random number generator class. 28 | // 29 | class CRandom 30 | { 31 | // 32 | //Operation. 33 | // 34 | public: 35 | CRandom(); 36 | CRandom(int seed); 37 | virtual ~CRandom(); 38 | 39 | // 40 | //seed operate function 41 | // 42 | void Init (int seed); 43 | int GetSeed (); 44 | 45 | // 46 | //Uniform derivates 47 | // 48 | double Rand0 (); 49 | 50 | double Gauss(); ///< 生成均值为0方差为1的Gauss分布随机数 51 | 52 | // 53 | //Attribute. 54 | // 55 | private: 56 | int m_Seed; ///< seed of random 57 | 58 | //Gauss(). 59 | int m_iset; 60 | double m_gset; 61 | 62 | }; 63 | 64 | 65 | //*********************************************************************** 66 | /// 获取随机数种子 67 | /// @Author Wang Hua 68 | /// @Date 2007.4.29 69 | /// @Input 70 | /// @Return 随机数种子,负整数 71 | //*********************************************************************** 72 | inline int AsRandomSeed() 73 | { 74 | time_t ltime; 75 | time(& ltime); 76 | return static_cast(-ltime-rand()); 77 | } 78 | 79 | 80 | // 81 | //Inline funciton 82 | // 83 | //*********************************************************************** 84 | /// 初始化随机数种子,需要产生独立分布的随机数时必须调用这个函数 85 | /// @Author Wang Hua 86 | /// @Date 2007.4.29 87 | /// @Input 88 | /// @Param seed 随机数种子,负整数 89 | //*********************************************************************** 90 | inline void CRandom::Init(int seed) 91 | { 92 | m_Seed = seed; 93 | } 94 | 95 | 96 | //*********************************************************************** 97 | /// 返回当前的随机数种子 98 | /// @Author Wang Hua 99 | /// @Date 2007.4.29 100 | /// @Output 101 | /// @Param seed 随机数种子,负整数 102 | //*********************************************************************** 103 | inline int CRandom::GetSeed() 104 | { 105 | return m_Seed; 106 | } 107 | 108 | 109 | 110 | 111 | 112 | #endif // !defined(_ASRANDOM_H_) 113 | -------------------------------------------------------------------------------- /AstroLib/Include/AsRightFunction.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2008 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsRightFunction.h 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | #if !defined(_ASRIGHTFUNCTION_H_) 13 | #define _ASRIGHTFUNCTION_H_ 14 | 15 | 16 | #include "AsCommon.h" 17 | #include "AsVector.h" 18 | 19 | 20 | 21 | 22 | 23 | // 24 | //右函数类,用于其它右函数计算类的基类 25 | // 26 | class CRightFunc 27 | { 28 | public: 29 | CRightFunc(){}; 30 | virtual ~CRightFunc(){}; 31 | 32 | /// @Input 33 | /// @Param t 自变量的值 34 | /// @Param x 初始函数值 35 | /// @Output 36 | /// @Param result 计算得到的函数值 37 | virtual void operator() (double t, const CVector& x, CVector& result) const = 0; 38 | 39 | }; 40 | 41 | 42 | // 43 | //右函数类,用于其它右函数计算类的基类 44 | //double * version 45 | // 46 | class AsTRightFunc 47 | { 48 | public: 49 | AsTRightFunc(){}; 50 | virtual ~AsTRightFunc(){}; 51 | 52 | /// @Input 53 | /// @Param t 自变量的值 54 | /// @Param x 初始函数值 55 | /// @Param n 初始函数值的个数 56 | /// @Output 57 | /// @Param result 计算得到的函数值 58 | virtual void operator() (double t, const double* x, int n, double* result) const = 0; 59 | 60 | }; 61 | 62 | 63 | 64 | 65 | 66 | #endif // !defined(_ASRIGHTFUNCTION_H_) 67 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen.h: -------------------------------------------------------------------------------- 1 | #ifndef Eigen_Include 2 | #define Eigen_Include 3 | 4 | 5 | // 6 | //Include file. 7 | // 8 | #include "./Eigen/Cholesky" 9 | #include "./Eigen/Core" 10 | #include "./Eigen/Dense" 11 | #include "./Eigen/Eigen" 12 | #include "./Eigen/Eigenvalues" 13 | #include "./Eigen/Geometry" 14 | #include "./Eigen/Householder" 15 | #include "./Eigen/IterativeLinearSolvers" 16 | #include "./Eigen/Jacobi" 17 | #include "./Eigen/LU" 18 | #include "./Eigen/OrderingMethods" 19 | #include "./Eigen/QR" 20 | #include "./Eigen/QtAlignedMalloc" 21 | #include "./Eigen/Sparse" 22 | #include "./Eigen/SparseCholesky" 23 | #include "./Eigen/SparseCore" 24 | #include "./Eigen/SparseLU" 25 | #include "./Eigen/SparseQR" 26 | #include "./Eigen/StdDeque" 27 | #include "./Eigen/StdList" 28 | #include "./Eigen/StdVector" 29 | #include "./Eigen/SVD" 30 | 31 | //#include "./Eigen/CholmodSupport" 32 | //#include "./Eigen/KLUSupport" 33 | //#include "./Eigen/MetisSupport" 34 | //#include "./Eigen/PardisoSupport" 35 | //#include "./Eigen/PaStiXSupport" 36 | //#include "./Eigen/SPQRSupport" 37 | //#include "./Eigen/SuperLUSupport" 38 | //#include "./Eigen/UmfPackSupport" 39 | 40 | 41 | #endif //Eigen_Include 42 | 43 | 44 | //////////////////////////////////////////////////////////////////////////// 45 | // // 46 | // Copyright (c) 2003-2023 // 47 | // Wang Hua // 48 | // // 49 | //////////////////////////////////////////////////////////////////////////// 50 | 51 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | #include "Jacobi" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** \defgroup Cholesky_Module Cholesky module 17 | * 18 | * 19 | * 20 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 21 | * Those decompositions are also accessible via the following methods: 22 | * - MatrixBase::llt() 23 | * - MatrixBase::ldlt() 24 | * - SelfAdjointView::llt() 25 | * - SelfAdjointView::ldlt() 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | */ 31 | 32 | #include "src/Cholesky/LLT.h" 33 | #include "src/Cholesky/LDLT.h" 34 | #ifdef EIGEN_USE_LAPACKE 35 | #ifdef EIGEN_USE_MKL 36 | #include "mkl_lapacke.h" 37 | #else 38 | #include "src/misc/lapacke.h" 39 | #endif 40 | #include "src/Cholesky/LLT_LAPACKE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_CHOLESKY_MODULE_H 46 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /AstroLib/Include/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 "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | #include "LU" 17 | #include "Geometry" 18 | 19 | #include "src/Core/util/DisableStupidWarnings.h" 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 | #ifdef EIGEN_USE_MKL 49 | #include "mkl_lapacke.h" 50 | #else 51 | #include "src/misc/lapacke.h" 52 | #endif 53 | #include "src/Eigenvalues/RealSchur_LAPACKE.h" 54 | #include "src/Eigenvalues/ComplexSchur_LAPACKE.h" 55 | #include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h" 56 | #endif 57 | 58 | #include "src/Core/util/ReenableStupidWarnings.h" 59 | 60 | #endif // EIGEN_EIGENVALUES_MODULE_H 61 | -------------------------------------------------------------------------------- /AstroLib/Include/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 "SVD" 14 | #include "LU" 15 | #include 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 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. 53 | #if (defined EIGEN_VECTORIZE_SSE) || (defined EIGEN_VECTORIZE_NEON) 54 | #include "src/Geometry/arch/Geometry_SIMD.h" 55 | #endif 56 | 57 | #include "src/Core/util/ReenableStupidWarnings.h" 58 | 59 | #endif // EIGEN_GEOMETRY_MODULE_H 60 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | 33 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/KLUSupport: -------------------------------------------------------------------------------- 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_KLUSUPPORT_MODULE_H 9 | #define EIGEN_KLUSUPPORT_MODULE_H 10 | 11 | #include 12 | 13 | #include 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup KLUSupport_Module KLUSupport module 22 | * 23 | * This module provides an interface to the KLU library which is part of the suitesparse package. 24 | * It provides the following factorization class: 25 | * - class KLU: a sparse LU factorization, well-suited for circuit simulation. 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | * 31 | * In order to use this module, the klu and btf headers must be accessible from the include paths, and your binary must be linked to the klu library and its dependencies. 32 | * The dependencies depend on how umfpack has been compiled. 33 | * For a cmake based project, you can use our FindKLU.cmake module to help you in this task. 34 | * 35 | */ 36 | 37 | #include "src/KLUSupport/KLUSupport.h" 38 | 39 | #include 40 | 41 | #endif // EIGEN_KLUSUPPORT_MODULE_H 42 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | #ifdef EIGEN_USE_MKL 32 | #include "mkl_lapacke.h" 33 | #else 34 | #include "src/misc/lapacke.h" 35 | #endif 36 | #include "src/LU/PartialPivLU_LAPACKE.h" 37 | #endif 38 | #include "src/LU/Determinant.h" 39 | #include "src/LU/InverseImpl.h" 40 | 41 | #if defined EIGEN_VECTORIZE_SSE || defined EIGEN_VECTORIZE_NEON 42 | #include "src/LU/arch/InverseSize4.h" 43 | #endif 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_LU_MODULE_H 48 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | #include "src/OrderingMethods/Amd.h" 67 | #include "src/OrderingMethods/Ordering.h" 68 | #include "src/Core/util/ReenableStupidWarnings.h" 69 | 70 | #endif // EIGEN_ORDERINGMETHODS_MODULE_H 71 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | * This wrapper resuires PaStiX version 5.x compiled without MPI support. 40 | * The dependencies depend on how PaSTiX has been compiled. 41 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 42 | * 43 | */ 44 | 45 | #include "src/PaStiXSupport/PaStiXSupport.h" 46 | 47 | #include "src/Core/util/ReenableStupidWarnings.h" 48 | 49 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 50 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 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 | #ifdef EIGEN_USE_MKL 40 | #include "mkl_lapacke.h" 41 | #else 42 | #include "src/misc/lapacke.h" 43 | #endif 44 | #include "src/QR/HouseholderQR_LAPACKE.h" 45 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_QR_MODULE_H 51 | -------------------------------------------------------------------------------- /AstroLib/Include/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(std::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, std::size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | std::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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | #ifdef EIGEN_USE_MKL 41 | #include "mkl_lapacke.h" 42 | #else 43 | #include "src/misc/lapacke.h" 44 | #endif 45 | #include "src/SVD/JacobiSVD_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SVD_MODULE_H 51 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | #include "src/SparseCholesky/SimplicialCholesky.h" 34 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 38 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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/Core/util/DisableStupidWarnings.h" 27 | 28 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 29 | 30 | #include "src/SparseLU/SparseLU_Structs.h" 31 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 32 | #include "src/SparseLU/SparseLUImpl.h" 33 | #include "src/SparseCore/SparseColEtree.h" 34 | #include "src/SparseLU/SparseLU_Memory.h" 35 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 36 | #include "src/SparseLU/SparseLU_relax_snode.h" 37 | #include "src/SparseLU/SparseLU_pivotL.h" 38 | #include "src/SparseLU/SparseLU_panel_dfs.h" 39 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 40 | #include "src/SparseLU/SparseLU_panel_bmod.h" 41 | #include "src/SparseLU/SparseLU_column_dfs.h" 42 | #include "src/SparseLU/SparseLU_column_bmod.h" 43 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 44 | #include "src/SparseLU/SparseLU_pruneL.h" 45 | #include "src/SparseLU/SparseLU_Utils.h" 46 | #include "src/SparseLU/SparseLU.h" 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SPARSELU_MODULE_H 51 | -------------------------------------------------------------------------------- /AstroLib/Include/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 "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseQR/SparseQR.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /AstroLib/Include/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 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes 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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes 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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes 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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | EIGEN_DEVICE_FUNC 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 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/NestByValue.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) 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 | #ifndef EIGEN_NESTBYVALUE_H 12 | #define EIGEN_NESTBYVALUE_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | template 18 | struct traits > : public traits 19 | { 20 | enum { 21 | Flags = traits::Flags & ~NestByRefBit 22 | }; 23 | }; 24 | } 25 | 26 | /** \class NestByValue 27 | * \ingroup Core_Module 28 | * 29 | * \brief Expression which must be nested by value 30 | * 31 | * \tparam ExpressionType the type of the object of which we are requiring nesting-by-value 32 | * 33 | * This class is the return type of MatrixBase::nestByValue() 34 | * and most of the time this is the only way it is used. 35 | * 36 | * \sa MatrixBase::nestByValue() 37 | */ 38 | template class NestByValue 39 | : public internal::dense_xpr_base< NestByValue >::type 40 | { 41 | public: 42 | 43 | typedef typename internal::dense_xpr_base::type Base; 44 | EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue) 45 | 46 | EIGEN_DEVICE_FUNC explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {} 47 | 48 | EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); } 49 | EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); } 50 | 51 | EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; } 52 | 53 | EIGEN_DEVICE_FUNC const ExpressionType& nestedExpression() const { return m_expression; } 54 | 55 | protected: 56 | const ExpressionType m_expression; 57 | }; 58 | 59 | /** \returns an expression of the temporary version of *this. 60 | */ 61 | template 62 | EIGEN_DEVICE_FUNC inline const NestByValue 63 | DenseBase::nestByValue() const 64 | { 65 | return NestByValue(derived()); 66 | } 67 | 68 | namespace internal { 69 | 70 | // Evaluator of Solve -> eval into a temporary 71 | template 72 | struct evaluator > 73 | : public evaluator 74 | { 75 | typedef evaluator Base; 76 | 77 | EIGEN_DEVICE_FUNC explicit evaluator(const NestByValue& xpr) 78 | : Base(xpr.nestedExpression()) 79 | {} 80 | }; 81 | } 82 | 83 | } // end namespace Eigen 84 | 85 | #endif // EIGEN_NESTBYVALUE_H 86 | -------------------------------------------------------------------------------- /AstroLib/Include/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_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 19 | { 20 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 21 | return derived(); 22 | } 23 | 24 | template 25 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 26 | { 27 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op()); 28 | return derived(); 29 | } 30 | 31 | template 32 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other) 33 | { 34 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 35 | return derived(); 36 | } 37 | 38 | template 39 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 40 | { 41 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 42 | return derived(); 43 | } 44 | 45 | } // end namespace Eigen 46 | 47 | #endif // EIGEN_SELFCWISEBINARYOP_H 48 | -------------------------------------------------------------------------------- /AstroLib/Include/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 EIGEN_STRONG_INLINE 34 | generic_dense_assignment_kernel(DstEvaluatorTypeT &dst, const SrcEvaluatorTypeT &src, const Functor &func, DstXprType& dstExpr) 35 | : Base(dst, src, func, dstExpr) 36 | {} 37 | 38 | template 39 | EIGEN_STRONG_INLINE void assignPacket(Index row, Index col) 40 | { 41 | PacketType tmp = m_src.template packet(row,col); 42 | const_cast(m_src).template writePacket(row,col, m_dst.template packet(row,col)); 43 | m_dst.template writePacket(row,col,tmp); 44 | } 45 | 46 | template 47 | EIGEN_STRONG_INLINE void assignPacket(Index index) 48 | { 49 | PacketType tmp = m_src.template packet(index); 50 | const_cast(m_src).template writePacket(index, m_dst.template packet(index)); 51 | m_dst.template writePacket(index,tmp); 52 | } 53 | 54 | // 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) 55 | template 56 | EIGEN_STRONG_INLINE void assignPacketByOuterInner(Index outer, Index inner) 57 | { 58 | Index row = Base::rowIndexByOuterInner(outer, inner); 59 | Index col = Base::colIndexByOuterInner(outer, inner); 60 | assignPacket(row, col); 61 | } 62 | }; 63 | 64 | } // namespace internal 65 | 66 | } // end namespace Eigen 67 | 68 | #endif // EIGEN_SWAP_H 69 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/arch/AVX512/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2019 Rasmus Munk Larsen 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_AVX512_H 11 | #define EIGEN_TYPE_CASTING_AVX512_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | template<> EIGEN_STRONG_INLINE Packet16i pcast(const Packet16f& a) { 18 | return _mm512_cvttps_epi32(a); 19 | } 20 | 21 | template<> EIGEN_STRONG_INLINE Packet16f pcast(const Packet16i& a) { 22 | return _mm512_cvtepi32_ps(a); 23 | } 24 | 25 | template<> EIGEN_STRONG_INLINE Packet16i preinterpret(const Packet16f& a) { 26 | return _mm512_castps_si512(a); 27 | } 28 | 29 | template<> EIGEN_STRONG_INLINE Packet16f preinterpret(const Packet16i& a) { 30 | return _mm512_castsi512_ps(a); 31 | } 32 | 33 | template <> 34 | struct type_casting_traits { 35 | enum { 36 | VectorizedCast = 1, 37 | SrcCoeffRatio = 1, 38 | TgtCoeffRatio = 1 39 | }; 40 | }; 41 | 42 | template<> EIGEN_STRONG_INLINE Packet16f pcast(const Packet16h& a) { 43 | return half2float(a); 44 | } 45 | 46 | template <> 47 | struct type_casting_traits { 48 | enum { 49 | VectorizedCast = 1, 50 | SrcCoeffRatio = 1, 51 | TgtCoeffRatio = 1 52 | }; 53 | }; 54 | 55 | template<> EIGEN_STRONG_INLINE Packet16h pcast(const Packet16f& a) { 56 | return float2half(a); 57 | } 58 | 59 | template <> 60 | struct type_casting_traits { 61 | enum { 62 | VectorizedCast = 1, 63 | SrcCoeffRatio = 1, 64 | TgtCoeffRatio = 1 65 | }; 66 | }; 67 | 68 | template<> EIGEN_STRONG_INLINE Packet16f pcast(const Packet16bf& a) { 69 | return Bf16ToF32(a); 70 | } 71 | 72 | template <> 73 | struct type_casting_traits { 74 | enum { 75 | VectorizedCast = 1, 76 | SrcCoeffRatio = 1, 77 | TgtCoeffRatio = 1 78 | }; 79 | }; 80 | 81 | template<> EIGEN_STRONG_INLINE Packet16bf pcast(const Packet16f& a) { 82 | return F32ToBf16(a); 83 | } 84 | 85 | } // end namespace internal 86 | 87 | } // end namespace Eigen 88 | 89 | #endif // EIGEN_TYPE_CASTING_AVX512_H 90 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/arch/AltiVec/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2007 Julien Pommier 5 | // Copyright (C) 2009 Gael Guennebaud 6 | // Copyright (C) 2016 Konstantinos Margaritis 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_MATH_FUNCTIONS_ALTIVEC_H 13 | #define EIGEN_MATH_FUNCTIONS_ALTIVEC_H 14 | 15 | namespace Eigen { 16 | 17 | namespace internal { 18 | 19 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 20 | Packet4f plog(const Packet4f& _x) 21 | { 22 | return plog_float(_x); 23 | } 24 | 25 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 26 | Packet4f pexp(const Packet4f& _x) 27 | { 28 | return pexp_float(_x); 29 | } 30 | 31 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 32 | Packet4f psin(const Packet4f& _x) 33 | { 34 | return psin_float(_x); 35 | } 36 | 37 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 38 | Packet4f pcos(const Packet4f& _x) 39 | { 40 | return pcos_float(_x); 41 | } 42 | 43 | #ifndef EIGEN_COMP_CLANG 44 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 45 | Packet4f prsqrt(const Packet4f& x) 46 | { 47 | return vec_rsqrt(x); 48 | } 49 | #endif 50 | 51 | #ifdef __VSX__ 52 | #ifndef EIGEN_COMP_CLANG 53 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 54 | Packet2d prsqrt(const Packet2d& x) 55 | { 56 | return vec_rsqrt(x); 57 | } 58 | #endif 59 | 60 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 61 | Packet4f psqrt(const Packet4f& x) 62 | { 63 | return vec_sqrt(x); 64 | } 65 | 66 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 67 | Packet2d psqrt(const Packet2d& x) 68 | { 69 | return vec_sqrt(x); 70 | } 71 | 72 | template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED 73 | Packet2d pexp(const Packet2d& _x) 74 | { 75 | return pexp_double(_x); 76 | } 77 | #endif 78 | 79 | // Hyperbolic Tangent function. 80 | template <> 81 | EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f 82 | ptanh(const Packet4f& x) { 83 | return internal::generic_fast_tanh_float(x); 84 | } 85 | 86 | } // end namespace internal 87 | 88 | } // end namespace Eigen 89 | 90 | #endif // EIGEN_MATH_FUNCTIONS_ALTIVEC_H 91 | -------------------------------------------------------------------------------- /AstroLib/Include/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 110 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 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/arch/GPU/TypeCasting.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_TYPE_CASTING_GPU_H 11 | #define EIGEN_TYPE_CASTING_GPU_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | #if (defined(EIGEN_HAS_CUDA_FP16) && defined(EIGEN_CUDA_ARCH) && EIGEN_CUDA_ARCH >= 300) || \ 18 | (defined(EIGEN_HAS_HIP_FP16) && defined(EIGEN_HIP_DEVICE_COMPILE)) 19 | 20 | 21 | template <> 22 | struct type_casting_traits { 23 | enum { 24 | VectorizedCast = 1, 25 | SrcCoeffRatio = 1, 26 | TgtCoeffRatio = 2 27 | }; 28 | }; 29 | 30 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE float4 pcast(const half2& a, const half2& b) { 31 | float2 r1 = __half22float2(a); 32 | float2 r2 = __half22float2(b); 33 | return make_float4(r1.x, r1.y, r2.x, r2.y); 34 | } 35 | 36 | 37 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4h2 pcast(const float4& a, const float4& b) { 38 | Packet4h2 r; 39 | half2* r_alias=reinterpret_cast(&r); 40 | r_alias[0]=__floats2half2_rn(a.x,a.y); 41 | r_alias[1]=__floats2half2_rn(a.z,a.w); 42 | r_alias[2]=__floats2half2_rn(b.x,b.y); 43 | r_alias[3]=__floats2half2_rn(b.z,b.w); 44 | return r; 45 | } 46 | 47 | template <> 48 | struct type_casting_traits { 49 | enum { 50 | VectorizedCast = 1, 51 | SrcCoeffRatio = 2, 52 | TgtCoeffRatio = 1 53 | }; 54 | }; 55 | 56 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE float4 pcast(const Packet4h2& a) { 57 | // Simply discard the second half of the input 58 | float4 r; 59 | const half2* a_alias=reinterpret_cast(&a); 60 | float2 r1 = __half22float2(a_alias[0]); 61 | float2 r2 = __half22float2(a_alias[1]); 62 | r.x=static_cast(r1.x); 63 | r.y=static_cast(r1.y); 64 | r.z=static_cast(r2.x); 65 | r.w=static_cast(r2.y); 66 | return r; 67 | } 68 | 69 | template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE half2 pcast(const float4& a) { 70 | // Simply discard the second half of the input 71 | return __floats2half2_rn(a.x, a.y); 72 | } 73 | 74 | #endif 75 | 76 | } // end namespace internal 77 | 78 | } // end namespace Eigen 79 | 80 | #endif // EIGEN_TYPE_CASTING_GPU_H 81 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/arch/HIP/hcc/math_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * math_constants.h - 3 | * HIP equivalent of the CUDA header of the same name 4 | */ 5 | 6 | #ifndef __MATH_CONSTANTS_H__ 7 | #define __MATH_CONSTANTS_H__ 8 | 9 | /* single precision constants */ 10 | 11 | #define HIPRT_INF_F __int_as_float(0x7f800000) 12 | #define HIPRT_NAN_F __int_as_float(0x7fffffff) 13 | #define HIPRT_MIN_DENORM_F __int_as_float(0x00000001) 14 | #define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff) 15 | #define HIPRT_NEG_ZERO_F __int_as_float(0x80000000) 16 | #define HIPRT_ZERO_F 0.0f 17 | #define HIPRT_ONE_F 1.0f 18 | 19 | /* double precision constants */ 20 | #define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000) 21 | #define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000) 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/arch/SVE/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 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_SVE_H 11 | #define EIGEN_MATH_FUNCTIONS_SVE_H 12 | 13 | namespace Eigen { 14 | namespace internal { 15 | 16 | template <> 17 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf pexp(const PacketXf& x) { 18 | return pexp_float(x); 19 | } 20 | 21 | template <> 22 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf plog(const PacketXf& x) { 23 | return plog_float(x); 24 | } 25 | 26 | template <> 27 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf psin(const PacketXf& x) { 28 | return psin_float(x); 29 | } 30 | 31 | template <> 32 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf pcos(const PacketXf& x) { 33 | return pcos_float(x); 34 | } 35 | 36 | // Hyperbolic Tangent function. 37 | template <> 38 | EIGEN_STRONG_INLINE EIGEN_UNUSED PacketXf ptanh(const PacketXf& x) { 39 | return internal::generic_fast_tanh_float(x); 40 | } 41 | } // end namespace internal 42 | } // end namespace Eigen 43 | 44 | #endif // EIGEN_MATH_FUNCTIONS_SVE_H 45 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/arch/SVE/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 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_SVE_H 11 | #define EIGEN_TYPE_CASTING_SVE_H 12 | 13 | namespace Eigen { 14 | namespace internal { 15 | 16 | template <> 17 | struct type_casting_traits { 18 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 19 | }; 20 | 21 | template <> 22 | struct type_casting_traits { 23 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 24 | }; 25 | 26 | template <> 27 | EIGEN_STRONG_INLINE PacketXf pcast(const PacketXi& a) { 28 | return svcvt_f32_s32_z(svptrue_b32(), a); 29 | } 30 | 31 | template <> 32 | EIGEN_STRONG_INLINE PacketXi pcast(const PacketXf& a) { 33 | return svcvt_s32_f32_z(svptrue_b32(), a); 34 | } 35 | 36 | template <> 37 | EIGEN_STRONG_INLINE PacketXf preinterpret(const PacketXi& a) { 38 | return svreinterpret_f32_s32(a); 39 | } 40 | 41 | template <> 42 | EIGEN_STRONG_INLINE PacketXi preinterpret(const PacketXf& a) { 43 | return svreinterpret_s32_f32(a); 44 | } 45 | 46 | } // namespace internal 47 | } // namespace Eigen 48 | 49 | #endif // EIGEN_TYPE_CASTING_SVE_H 50 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/arch/SYCL/TypeCasting.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: 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 | /***************************************************************** 14 | * TypeCasting.h 15 | * 16 | * \brief: 17 | * TypeCasting 18 | * 19 | *****************************************************************/ 20 | 21 | #ifndef EIGEN_TYPE_CASTING_SYCL_H 22 | #define EIGEN_TYPE_CASTING_SYCL_H 23 | 24 | namespace Eigen { 25 | 26 | namespace internal { 27 | #ifdef SYCL_DEVICE_ONLY 28 | template <> 29 | struct type_casting_traits { 30 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 31 | }; 32 | 33 | template <> 34 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_int4 35 | pcast(const cl::sycl::cl_float4& a) { 36 | return a 37 | .template convert(); 38 | } 39 | 40 | template <> 41 | struct type_casting_traits { 42 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 43 | }; 44 | 45 | template <> 46 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_float4 47 | pcast(const cl::sycl::cl_int4& a) { 48 | return a.template convert(); 50 | } 51 | 52 | template <> 53 | struct type_casting_traits { 54 | enum { VectorizedCast = 1, SrcCoeffRatio = 2, TgtCoeffRatio = 1 }; 55 | }; 56 | 57 | template <> 58 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_float4 59 | pcast( 60 | const cl::sycl::cl_double2& a, const cl::sycl::cl_double2& b) { 61 | auto a1 = a.template convert(); 63 | auto b1 = b.template convert(); 65 | return cl::sycl::float4(a1.x(), a1.y(), b1.x(), b1.y()); 66 | } 67 | 68 | template <> 69 | struct type_casting_traits { 70 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 2 }; 71 | }; 72 | 73 | template <> 74 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE cl::sycl::cl_double2 75 | pcast(const cl::sycl::cl_float4& a) { 76 | // Simply discard the second half of the input 77 | return cl::sycl::cl_double2(a.x(), a.y()); 78 | } 79 | 80 | #endif 81 | } // end namespace internal 82 | 83 | } // end namespace Eigen 84 | 85 | #endif // EIGEN_TYPE_CASTING_SYCL_H 86 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED_2 2 | // "DisableStupidWarnings.h" was included twice recursively: Do not reenable warnings yet! 3 | # undef EIGEN_WARNINGS_DISABLED_2 4 | 5 | #elif defined(EIGEN_WARNINGS_DISABLED) 6 | #undef EIGEN_WARNINGS_DISABLED 7 | 8 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 9 | #ifdef _MSC_VER 10 | #pragma warning( pop ) 11 | #elif defined __INTEL_COMPILER 12 | #pragma warning pop 13 | #elif defined __clang__ 14 | #pragma clang diagnostic pop 15 | #elif defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 16 | #pragma GCC diagnostic pop 17 | #endif 18 | 19 | #if defined __NVCC__ 20 | // Don't reenable the diagnostic messages, as it turns out these messages need 21 | // to be disabled at the point of the template instantiation (i.e the user code) 22 | // otherwise they'll be triggered by nvcc. 23 | // #pragma diag_default code_is_unreachable 24 | // #pragma diag_default initialization_not_reachable 25 | // #pragma diag_default 2651 26 | // #pragma diag_default 2653 27 | #endif 28 | 29 | #endif 30 | 31 | #endif // EIGEN_WARNINGS_DISABLED 32 | -------------------------------------------------------------------------------- /AstroLib/Include/Eigen/src/Core/util/ReshapedHelper.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2017 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 | 11 | #ifndef EIGEN_RESHAPED_HELPER_H 12 | #define EIGEN_RESHAPED_HELPER_H 13 | 14 | namespace Eigen { 15 | 16 | enum AutoSize_t { AutoSize }; 17 | const int AutoOrder = 2; 18 | 19 | namespace internal { 20 | 21 | template 22 | struct get_compiletime_reshape_size { 23 | enum { value = get_fixed_value::value }; 24 | }; 25 | 26 | template 27 | Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) { 28 | return internal::get_runtime_value(size); 29 | } 30 | 31 | template 32 | struct get_compiletime_reshape_size { 33 | enum { 34 | other_size = get_fixed_value::value, 35 | value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size }; 36 | }; 37 | 38 | inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { 39 | return total/other; 40 | } 41 | 42 | template 43 | struct get_compiletime_reshape_order { 44 | enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order }; 45 | }; 46 | 47 | } 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_RESHAPED_HELPER_H 52 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/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 | -------------------------------------------------------------------------------- /AstroLib/Include/IzzoLam.h: -------------------------------------------------------------------------------- 1 | #ifndef IZZOLAM_H 2 | #define IZZOLAM_H 3 | 4 | /** 5 | * Calculates the solution to the Lambert's problem using the Izzo algorithm. 6 | * 7 | * @param r1 The position vector of the departure point. 8 | * @param r2 The position vector of the arrival point. 9 | * @param tof The time of flight between the departure and arrival points. 10 | * @param mu The gravitational parameter of the central body. 11 | * @param way The direction of the transfer: 1 for short way, -1 for long way. 12 | * @param multi_revs The maximum number of complete revolutions allowed. 13 | * @param v1 The velocity vector at the departure point (output parameter). 14 | * @param v2 The velocity vector at the arrival point (output parameter). 15 | * 16 | * @return 0 if the algorithm successfully converges, -1 otherwise. 17 | * 18 | * @throws ErrorType if there was an error in the calculation. 19 | */ 20 | int solve_lambert_izzo(double r1[3], double r2[3], double tof, double mu, int way, int multi_revs, 21 | double v1[][3], double v2[][3]); 22 | 23 | #endif // IZZOLAM_H -------------------------------------------------------------------------------- /AstroLib/Include/LambertProblem.hpp: -------------------------------------------------------------------------------- 1 | #ifndef LAMBERT_PROBLEM_H 2 | #define LAMBERT_PROBLEM_H 3 | 4 | #include "MyvectorT.hpp" 5 | 6 | #define _USE_MATH_DEFINES 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #define Vector3T Vector3 13 | 14 | template class lambert_problem { 15 | public: 16 | /** 17 | * @brief Construct a new lambert problem object 18 | * 19 | * @param r1 first cartesian position 20 | * @param r2 second cartesian position 21 | * @param tof time of flight 22 | * @param mu gravity parameter 23 | * @param sl 1: short way transfer; -1: long way transfer 24 | * @param multi_revs maximum number of multirevolutions to compute 25 | */ 26 | lambert_problem(const Vector3T &r1 = {1, 0, 0}, const Vector3T &r2 = {0, 1, 0}, 27 | const ST &tof = M_PI_2, const double &mu = 1., const int &sl = 1, 28 | const int &multi_revs = 6); 29 | void Solve(); 30 | void SolveTimeEquation(); 31 | void ConstructTerminalVecolityComponent(const ST &x, ST &vr1, ST &vr2, ST &vt1, ST &vt2) const; 32 | void CalTerminalVelocities(const ST &x, Vector3T &v1, Vector3T &v2) const; 33 | 34 | const std::vector &get_v1() const; 35 | const std::vector &get_v2() const; 36 | const Vector3T &get_r1() const; 37 | const Vector3T &get_r2() const; 38 | const ST &get_tof() const; 39 | const double &get_mu() const; 40 | ST get_lambda() const { return m_lambda; } 41 | ST get_T() const { return sqrt(2.0 * m_mu / m_s / m_s / m_s) * m_tof; } 42 | const std::vector &get_x() const; 43 | const std::vector &get_iters() const; 44 | int get_Nmax() const; 45 | 46 | private: 47 | const Vector3T m_r1, m_r2; 48 | const ST m_tof; 49 | const double m_mu; 50 | std::vector m_v1; 51 | std::vector m_v2; 52 | std::vector m_iters; 53 | std::vector m_x; 54 | ST m_s, m_c, m_lambda; 55 | int m_Nmax; 56 | int m_multi_revs; 57 | 58 | Vector3T ir1_, ir2_, ih_, it1_, it2_; 59 | }; 60 | 61 | //#undef _USE_MATH_DEFINES 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /AstroLib/Include/MyvectorT.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MYVECTOR_H 2 | #define MYVECTOR_H 3 | #include 4 | 5 | template class Vector3 { 6 | public: 7 | T x, y, z; 8 | 9 | Vector3(T x_val = 0, T y_val = 0, T z_val = 0) : x(x_val), y(y_val), z(z_val) {} 10 | 11 | Vector3 operator+(const Vector3& other) const { 12 | return Vector3(x + other.x, y + other.y, z + other.z); 13 | } 14 | 15 | Vector3 operator-(const Vector3& other) const { 16 | return Vector3(x - other.x, y - other.y, z - other.z); 17 | } 18 | 19 | Vector3 operator*(T scalar) const { return Vector3(x * scalar, y * scalar, z * scalar); } 20 | 21 | Vector3 operator/(T scalar) const { 22 | if (scalar == 0) { 23 | throw std::invalid_argument("Division by zero."); 24 | } 25 | return Vector3(x / scalar, y / scalar, z / scalar); 26 | } 27 | 28 | T& operator[](int index) { 29 | if (index < 0 || index >= 3) { 30 | throw std::out_of_range("Index out of range."); 31 | } 32 | 33 | if (index == 0) { 34 | return x; 35 | } else if (index == 1) { 36 | return y; 37 | } else { 38 | return z; 39 | } 40 | } 41 | 42 | const T& operator[](int index) const { 43 | if (index < 0 || index >= 3) { 44 | throw std::out_of_range("Index out of range."); 45 | } 46 | 47 | if (index == 0) { 48 | return x; 49 | } else if (index == 1) { 50 | return y; 51 | } else { 52 | return z; 53 | } 54 | } 55 | 56 | T dot(const Vector3& other) const { return x * other.x + y * other.y + z * other.z; } 57 | 58 | Vector3 cross(const Vector3& other) const { 59 | return Vector3(y * other.z - z * other.y, z * other.x - x * other.z, x * other.y - y * other.x); 60 | } 61 | 62 | T norm() const { return std::sqrt(x * x + y * y + z * z); } 63 | 64 | Vector3 normalized() const { 65 | T n = norm(); 66 | if (n != 0) { 67 | return Vector3(x / n, y / n, z / n); 68 | } 69 | return *this; 70 | } 71 | }; 72 | 73 | #endif -------------------------------------------------------------------------------- /AstroLib/Src/AsCommon.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2006 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsCommon.cpp 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | 13 | #include "AsCommon.h" 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /AstroLib/Src/AsCoordinate_2023.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2006 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsCoordinate_2023.cpp 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | 13 | #include "AsCoordinate_2023.h" 14 | 15 | 16 | 17 | using namespace std; 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /AstroLib/Src/AsDResolve.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2006 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsDResolve.cpp 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | 13 | #include "AsDResolve.h" 14 | #include "AsMath.h" 15 | #include 16 | 17 | 18 | using namespace std; 19 | 20 | 21 | 22 | //********************************************************************* 23 | /// Fourth-order Runge-Kutta method. 24 | /// @Author Wang Hua 25 | /// @Date 2005.1 26 | /// @Input 27 | /// @Param func user-supplied class that computes the right-hand side derivatives. 28 | /// @Param step stepsize 29 | /// @Param t starting value of the indepentent variable. 30 | /// @In/Out 31 | /// @Param x input dependent variable at the starting. output new value 32 | // of dependent variable. 33 | /// @Output 34 | //********************************************************************* 35 | void AsODERungeKutta4( 36 | const CRightFunc& func, 37 | double step, 38 | double t, 39 | CVector &x) 40 | { 41 | int n=x.GetSize(); 42 | CVector dxm(n),dxdt(n); 43 | 44 | //First step. 45 | func(t,x,dxm); 46 | 47 | //Second step. 48 | double hh = step*0.5; 49 | double th = t+hh; 50 | func(th,x+hh*dxm,dxdt); 51 | 52 | //Third step. 53 | dxm += dxdt+dxdt; 54 | func(th,x+hh*dxdt,dxdt); 55 | 56 | //Fourth step. 57 | dxm += dxdt+dxdt; 58 | func(t+step,x+step*dxdt,dxdt); 59 | 60 | //Accumulate increments with proper weights. 61 | x += (dxdt+dxm)*step/6.0; 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /AstroLib/Src/AsMath.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2006 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsMath.cpp 9 | // 10 | /////////////////////////// 11 | 12 | 13 | #include "AsMath.h" 14 | #include "AsVector.h" 15 | #include 16 | 17 | 18 | using namespace std; 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /AstroLib/Src/AsPlanetProp.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2000-2021 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsPlanetProp.cpp 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | 13 | #include "AsPlanetProp.h" 14 | #include "AsCoordinate.h" 15 | #include "AsMath.h" 16 | #include "AsTimeSystem.h" 17 | #include "AsAttitudeParam.h" 18 | #include 19 | 20 | 21 | using namespace std; 22 | 23 | 24 | 25 | //******************************************************************** 26 | /// 计算地心赤道坐标系中的太阳位置 27 | /// calcuLates the Geocentric Equatorial position for the SUN given the Julian Date. 28 | /// @Author Wang Hua 29 | /// @Date 2004.11.15 30 | /// @Input 31 | /// @Param julianDate Julian Date 32 | /// @Output 33 | /// @Param sunPos Geocentric Equatorial Position vector of the SUN (meter) 34 | /// @Return 35 | //******************************************************************** 36 | void AsSunProp(double JD, CCoord& RSun) 37 | { 38 | //the distance between sun and earth. IAU1976 39 | const double AU = 1.4959787e11; 40 | 41 | double RSun4, MeanLong, MeanAnomaly, EclpLong, Obliquity, TUT1, TTDB; 42 | 43 | // Initialize values 44 | TUT1 = (JD - 2451545.0) / 36525.0; 45 | 46 | //Mean Longitude 47 | MeanLong = 280.4606184 + 36000.77005361 * TUT1; 48 | MeanLong = fmod(MeanLong, 360.0); // deg 49 | 50 | TTDB = TUT1; 51 | MeanAnomaly = 357.5277233 + 35999.05034 * TTDB; 52 | MeanAnomaly = AsDegToRad(MeanAnomaly); // rad 53 | 54 | //Ecliptic Longitude 55 | EclpLong = MeanLong + 1.914666471 * sin(MeanAnomaly) + 56 | 0.019994643 * sin(2.0 * MeanAnomaly); // deg 57 | EclpLong = AsDegToRad(EclpLong); 58 | 59 | //Mean Obliquity of the Ecliptic 60 | Obliquity = 23.439291 - 0.0130042 * TTDB; // deg 61 | Obliquity = AsDegToRad(Obliquity); 62 | 63 | // Find magnitude of SUN vector, THEN components 64 | RSun4 = 1.000140612 - 0.016708617 * cos(MeanAnomaly) - 65 | 0.000139589 * cos(2.0 * MeanAnomaly); // in AU's 66 | RSun4 = RSun4 * AU; //AU to meter 67 | RSun[0] = RSun4 * cos(EclpLong); 68 | RSun[1] = RSun4 * cos(Obliquity) * sin(EclpLong); 69 | RSun[2] = RSun4 * sin(Obliquity) * sin(EclpLong); 70 | } 71 | 72 | -------------------------------------------------------------------------------- /AstroLib/Src/AsRightFunction.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2006 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | // AsRightFunction.cpp 9 | // 10 | ////////////////////////////////////////////////////////////////////// 11 | 12 | 13 | #include "AsRightFunction.h" 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /AstroLib/Src/IzzoLam.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "LambertProblemT.hpp" 3 | #include "IzzoLam.h" 4 | 5 | int solve_lambert_izzo(double r1[3], double r2[3], double tof, double mu, int way, int multi_revs, 6 | double v1[][3], double v2[][3]) { 7 | 8 | int dimV = multi_revs * 2 + 1; 9 | memset(v1, 0, sizeof(double) * 3 * dimV); memset(v2, 0, sizeof(double) * 3 * dimV); 10 | 11 | const Vector3 r1vec(r1[0], r1[1], r1[2]); 12 | const Vector3 r2vec(r2[0], r2[1], r2[2]); 13 | 14 | lambert_problem lp(r1vec, r2vec, tof, mu, way, multi_revs); 15 | lp.Solve(); 16 | std::vector> v1ls = lp.get_v1(); 17 | std::vector> v2ls = lp.get_v2(); 18 | 19 | for (size_t i = 0; i < v1ls.size(); i++) { 20 | v1[i][0] = v1ls[i][0]; 21 | v1[i][1] = v1ls[i][1]; 22 | v1[i][2] = v1ls[i][2]; 23 | v2[i][0] = v2ls[i][0]; 24 | v2[i][1] = v2ls[i][1]; 25 | v2[i][2] = v2ls[i][2]; 26 | } 27 | 28 | return 0; 29 | } 30 | 31 | 32 | //{ 33 | // double r1[3]{ 41960184.323318355,3473991.642108842,-96064.78455976033 }, r2[3]{ -6441593.34, 41608179.66, 13233.21 }, tof = 43200, mu = 3.986e14, v1[1][3], v2[1][3]; 34 | // int way = 1, multi_revs = 0; 35 | // solve_lambert_izzo(r1, r2, tof, mu, way, multi_revs, v1, v2); 36 | // cout << v1[0][0] << endl; 37 | //} -------------------------------------------------------------------------------- /Examples/AstroLibExamples.cpp: -------------------------------------------------------------------------------- 1 | // AstroLibExamples.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include 5 | #include 6 | #include "AstroLibExamples.h" 7 | #include "ExampleOrbElemConv.h" 8 | #include "ExampleMath.h" 9 | #include "ExampleOrbProp.h" 10 | #include "ExampleAttitude.h" 11 | #include "ExampleODEResolve.h" 12 | 13 | #include "AstroLib.h" 14 | 15 | 16 | 17 | void main() 18 | { 19 | printf("*****************************************************************\n"); 20 | printf("* AstroLib Example\n"); 21 | printf("*****************************************************************\n\n"); 22 | 23 | int sel; 24 | 25 | /////////////////////////////// 26 | 27 | while (true) 28 | { 29 | printf("\n*****************************************************************\n"); 30 | printf("Please select example program to run...\n"); 31 | printf("*****************************************************************\n"); 32 | printf("[1]. Orbit Element Conversion\n"); 33 | printf("[2]. Math\n"); 34 | printf("[3]. Orbit Propagation\n"); 35 | printf("[4]. Attitude\n"); 36 | printf("[5]. Ordinary Differential Equation\n"); 37 | printf("[6]. Exit\n\n"); 38 | printf("Your select is?\n>> "); 39 | 40 | scanf("%d", &sel); 41 | switch(sel) 42 | { 43 | case 1: 44 | ExampleOrbElemConv(); 45 | break; 46 | case 2: 47 | ExampleMath(); 48 | break; 49 | case 3: 50 | ExampleOrbProp(); 51 | break; 52 | case 4: 53 | ExampleAttitude(); 54 | break; 55 | case 5: 56 | ExampleODEResolve(); 57 | break; 58 | default: 59 | cout<<"\nError select!\n"; 60 | } 61 | } 62 | 63 | } 64 | 65 | 66 | -------------------------------------------------------------------------------- /Examples/AstroLibExamples.h: -------------------------------------------------------------------------------- 1 |  2 | #if !defined(AFX_ASTROLIBEXAMPLES_H__A94E219F_5EC1_4DF2_973D_CFEB16259FBE__INCLUDED_) 3 | #define AFX_ASTROLIBEXAMPLES_H__A94E219F_5EC1_4DF2_973D_CFEB16259FBE__INCLUDED_ 4 | 5 | #pragma once 6 | 7 | 8 | #include "AstroLib.h" 9 | 10 | 11 | #endif // !defined(AFX_ASTROLIBEXAMPLES_H__A94E219F_5EC1_4DF2_973D_CFEB16259FBE__INCLUDED_) 12 | -------------------------------------------------------------------------------- /Examples/Examples.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | Source Files 9 | 10 | 11 | Source Files 12 | 13 | 14 | Source Files 15 | 16 | 17 | Source Files 18 | 19 | 20 | Source Files 21 | 22 | 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | {e39009d5-122b-452e-bfac-d5f5222a5ca0} 49 | h;hpp;hxx;hm;inl 50 | 51 | 52 | {29018bbc-b339-4779-872a-9101ac483ca3} 53 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 54 | 55 | 56 | -------------------------------------------------------------------------------- /Examples/Examples.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | 6 | -------------------------------------------------------------------------------- /Examples/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Examples/ReadMe.txt -------------------------------------------------------------------------------- /Examples/Src/ExampleAttitude.cpp: -------------------------------------------------------------------------------- 1 | // ExampleAttitude.cpp: implementation of the ExampleAttitude class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "AstroLibExamples.h" 6 | #include "ExampleAttitude.h" 7 | 8 | 9 | //******************************************************************** 10 | /// 姿态参数演示例子. 11 | /// @Author Wang Hua 12 | /// @Date 2008.10.16 13 | //******************************************************************** 14 | void ExampleAttitude() 15 | { 16 | CEuler euler(45*AsCDegToRad, 30*AsCDegToRad, 60*AsCDegToRad); 17 | CQuaternion q; 18 | CMatrix mtx(3,3); 19 | 20 | //将按照321顺序旋转的Euler角转换为转移矩阵 21 | AsEulerToMtx(euler, 321, mtx); 22 | 23 | //将转移矩阵转换为四元数 24 | AsMtxToQuat(mtx, q); 25 | 26 | //输出结果 27 | printf("The euler angle is: \n"); 28 | printf("angle1 = %10.6f rad\n", euler.m_Angle1); 29 | printf("angle2 = %10.6f rad\n", euler.m_Angle2); 30 | printf("angle3 = %10.6f rad\n", euler.m_Angle3); 31 | printf("The quaternion is: \n"); 32 | printf("x = %10.6f\n", q.m_Qx); 33 | printf("y = %10.6f\n", q.m_Qy); 34 | printf("z = %10.6f\n", q.m_Qz); 35 | printf("s = %10.6f\n\n", q.m_Qs); 36 | } -------------------------------------------------------------------------------- /Examples/Src/ExampleAttitude.h: -------------------------------------------------------------------------------- 1 | // ExampleAttitude.h: interface for the ExampleAttitude class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_EXAMPLEATTITUDE_H__85840D7E_D5E4_4EBB_831F_C2AADBBB2AD5__INCLUDED_) 6 | #define AFX_EXAMPLEATTITUDE_H__85840D7E_D5E4_4EBB_831F_C2AADBBB2AD5__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | void ExampleAttitude(); 14 | 15 | 16 | #endif // !defined(AFX_EXAMPLEATTITUDE_H__85840D7E_D5E4_4EBB_831F_C2AADBBB2AD5__INCLUDED_) 17 | -------------------------------------------------------------------------------- /Examples/Src/ExampleMath.cpp: -------------------------------------------------------------------------------- 1 | // ExampleMath.cpp: implementation of the ExampleMath class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "AstroLibExamples.h" 6 | #include "ExampleMath.h" 7 | 8 | 9 | //******************************************************************** 10 | /// The purpose of this program is to provide an example 11 | /// that illustrates general math operations. 12 | /// Functions Used: AsDegToRad() 13 | /// AsMax() 14 | /// AsMin() 15 | /// AsRound() 16 | /// @Author Wang Hua 17 | /// @Date 2008.8.8 18 | //******************************************************************** 19 | void ExampleMath() 20 | { 21 | double angle1, 22 | angle2; 23 | 24 | printf("========================================================\n"); 25 | printf("Initial angles in degrees...\n"); 26 | printf("========================================================\n"); 27 | angle1 = 337.5; 28 | angle2 = 270.0; 29 | printf ("Angle1 (deg) = %.3f\n", angle1); 30 | printf ("Angle2 (deg) = %.3f\n\n", angle2); 31 | 32 | printf("========================================================\n"); 33 | printf("Convert angles to radians...\n"); 34 | printf("========================================================\n"); 35 | printf ("Angle1 (rad) = %.3f\n", AsDegToRad(angle1)); 36 | printf ("Angle2 (rad) = %.3f\n\n", AsDegToRad(angle2)); 37 | 38 | printf("========================================================\n"); 39 | printf("Determine the Maximum of the two angles...\n"); 40 | printf("========================================================\n"); 41 | printf ("Angle1 = %.3f\n", angle1); 42 | printf ("Angle2 = %.3f\n", angle2); 43 | printf ("Maximum = %.3f\n\n", AsMax(angle1, angle2)); 44 | 45 | printf("========================================================\n"); 46 | printf("Determine the Minimum of the two angles...\n"); 47 | printf("========================================================\n"); 48 | printf ("Angle1 = %.3f\n", angle1); 49 | printf ("Angle2 = %.3f\n", angle2); 50 | printf ("Minimum = %.3f\n\n", AsMin(angle1, angle2)); 51 | 52 | printf("========================================================\n"); 53 | printf("Round off Angle1 to the nearest whole degree...\n"); 54 | printf("========================================================\n"); 55 | printf ("Angle1 = %.3f\n", angle1); 56 | printf ("Rounded = %.3f\n\n", AsRound(angle1)); 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /Examples/Src/ExampleMath.h: -------------------------------------------------------------------------------- 1 | // ExampleMath.h: interface for the ExampleMath class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_EXAMPLEMATH_H__16158E0C_54B6_4355_90BB_C6A712079DE1__INCLUDED_) 6 | #define AFX_EXAMPLEMATH_H__16158E0C_54B6_4355_90BB_C6A712079DE1__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | void ExampleMath(); 14 | 15 | 16 | #endif // !defined(AFX_EXAMPLEMATH_H__16158E0C_54B6_4355_90BB_C6A712079DE1__INCLUDED_) 17 | -------------------------------------------------------------------------------- /Examples/Src/ExampleODEResolve.cpp: -------------------------------------------------------------------------------- 1 | // ExampleODEResolve.cpp: implementation of the CExampleODEResolve class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "AstroLibExamples.h" 6 | #include "ExampleODEResolve.h" 7 | 8 | 9 | 10 | //******************************************************************** 11 | /// 常微分方程组初值问题求解例子. 12 | /// @Author Wang Hua 13 | /// @Date 2009.4.9 14 | //******************************************************************** 15 | void ExampleODEResolve() 16 | { 17 | //定义描述常微分方程组的右函数类 18 | //这里的常微分方程为描述物体自由下落函数 19 | // dx/dt=v 20 | // dv/dt=a 21 | // a=9.8 22 | class CMyRightFunc : public CRightFunc 23 | { 24 | public: 25 | /// @Input 26 | /// @Param t 自变量的值 27 | /// @Param x 初始函数值,x[0]为位置,x[1]为速度 28 | /// @Output 29 | /// @Param result 计算得到的函数值 30 | virtual void operator() (double t, const CVector& x, CVector& result) const 31 | { 32 | result[0] = x[1]; 33 | result[1] = -9.8; 34 | } 35 | }; 36 | 37 | CMyRightFunc func; 38 | CVector x(2); 39 | 40 | x[0]=1000; //初始位置1000m 41 | x[1]=0; //初始速度0m/s 42 | 43 | //求解常微分方程,积分步长取1s,积分总时间为10s 44 | for (int i=0; i<10; i++) 45 | AsODERungeKutta4 (func, 1, 0, x); 46 | 47 | printf("The final position is %f (m)\n", x[0]); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Examples/Src/ExampleODEResolve.h: -------------------------------------------------------------------------------- 1 | // ExampleODEResolve.h: interface for the CExampleODEResolve class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_EXAMPLEODERESOLVE_H__6983EDDE_3CFE_42D1_8FA5_AD1211D1B4B4__INCLUDED_) 6 | #define AFX_EXAMPLEODERESOLVE_H__6983EDDE_3CFE_42D1_8FA5_AD1211D1B4B4__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | void ExampleODEResolve(); 14 | 15 | 16 | #endif // !defined(AFX_EXAMPLEODERESOLVE_H__6983EDDE_3CFE_42D1_8FA5_AD1211D1B4B4__INCLUDED_) 17 | -------------------------------------------------------------------------------- /Examples/Src/ExampleOrbElemConv.cpp: -------------------------------------------------------------------------------- 1 | // ExampleOrbElemConv.cpp: implementation of the ExampleOrbElemConv class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "AstroLibExamples.h" 6 | #include "ExampleOrbElemConv.h" 7 | 8 | 9 | 10 | //******************************************************************** 11 | /// 轨道参数集转换例子. 12 | /// @Author Wang Hua 13 | /// @Date 2008.8.8 14 | //******************************************************************** 15 | void ExampleOrbElemConv() 16 | { 17 | double gm = AsCEarthGrav; // gravitational parameter 18 | CModOrbElem modOrbElems; 19 | CCoord position1,position2, 20 | velocity1,velocity2; 21 | 22 | // Initialize the modified orbit elements for inertial frame 23 | modOrbElems.m_PeriRad = 6678137.0; 24 | modOrbElems.m_Ecc = 0.0; 25 | modOrbElems.m_I = AsDegToRad(28.5); 26 | modOrbElems.m_RAAN = 0.0; 27 | modOrbElems.m_ArgPeri = 0.0; 28 | modOrbElems.m_TrueA = 0.0; 29 | 30 | // Convert modified orbit elements to cartesian 31 | AsModOrbElemToCart(modOrbElems, gm, position1, velocity1); 32 | 33 | COrbElem orbElems; 34 | orbElems.m_SMajAx = 6678137.0; 35 | orbElems.m_Ecc = 0.0; 36 | orbElems.m_I = AsDegToRad(28.5); 37 | orbElems.m_RAAN = 0.0; 38 | orbElems.m_ArgPeri = 0.0; 39 | orbElems.m_TrueA = 0.0; 40 | 41 | // Convert orbit elements to cartesian 42 | AsOrbElemToCart(orbElems, gm, position2, velocity2); 43 | 44 | printf("Cartesian elements:\n"); 45 | printf("x = %10.6f\n", position1[0]); 46 | printf("y = %10.6f\n", position1[1]); 47 | printf("z = %10.6f\n", position1[2]); 48 | printf("xdot= %10.6f\n", velocity1[0]); 49 | printf("ydot= %10.6f\n", velocity1[1]); 50 | printf("zdot= %10.6f\n\n", velocity1[2]); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Examples/Src/ExampleOrbElemConv.h: -------------------------------------------------------------------------------- 1 | // ExampleOrbElemConv.h: interface for the ExampleOrbElemConv class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_EXAMPLEORBELEMCONV_H__EF3E2231_BE43_4804_B606_665BA478EAE5__INCLUDED_) 6 | #define AFX_EXAMPLEORBELEMCONV_H__EF3E2231_BE43_4804_B606_665BA478EAE5__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | void ExampleOrbElemConv(); 14 | 15 | 16 | #endif // !defined(AFX_EXAMPLEORBELEMCONV_H__EF3E2231_BE43_4804_B606_665BA478EAE5__INCLUDED_) 17 | -------------------------------------------------------------------------------- /Examples/Src/ExampleOrbProp.cpp: -------------------------------------------------------------------------------- 1 | // ExampleOrbProp.cpp: implementation of the ExampleOrbProp class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "AstroLibExamples.h" 6 | #include "ExampleOrbProp.h" 7 | #include 8 | #include 9 | 10 | 11 | 12 | //******************************************************************** 13 | /// 高精度轨道计算例子. 14 | /// @Author Wang Hua 15 | /// @Date 2008.8.8 16 | //******************************************************************** 17 | void ExampleOrbProp() 18 | { 19 | COrbit orb; 20 | int i, n; 21 | double duration, t1, t2, step; 22 | CCoord pos, vel; 23 | vector timeVec; 24 | vector posVec, velVec; 25 | 26 | // 27 | //设置参数 28 | // 29 | step=20; 30 | duration = 86400; 31 | 32 | pos = CCoord(-2830087.478, 5195460.811, 3098118.351); 33 | vel = CCoord(-4385.611, -4846.083, 4125.976); 34 | 35 | // 36 | //轨道计算 37 | // 38 | t2 = duration; 39 | for (t1 = 0; t1 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | void ExampleOrbProp(); 14 | 15 | 16 | #endif // !defined(AFX_ExampleOrbProp_H__E4EE5DCD_A4C7_4499_86B2_2B20F921C06C__INCLUDED_) 17 | -------------------------------------------------------------------------------- /Graphics3D/2k_earth_daymap.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/2k_earth_daymap.bmp -------------------------------------------------------------------------------- /Graphics3D/Graphics3D.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/Graphics3D.cpp -------------------------------------------------------------------------------- /Graphics3D/Graphics3D.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 23 | 24 | 头文件 25 | 26 | 27 | -------------------------------------------------------------------------------- /Graphics3D/Graphics3D.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/Graphics3D.h -------------------------------------------------------------------------------- /Graphics3D/Graphics3D.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Graphics3D/Graphics3D.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Header Files 6 | 7 | 8 | Header Files 9 | 10 | 11 | 12 | 13 | {a2c033f5-eb83-4a10-a0b8-93772ec37664} 14 | h;hpp;hxx;hm;inl 15 | 16 | 17 | {2570e01c-c4fc-4517-af1a-3bd411ea7f48} 18 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 19 | 20 | 21 | 22 | 23 | Source Files 24 | 25 | 26 | -------------------------------------------------------------------------------- /Graphics3D/ReadMe.txt: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2022 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | 该程序包是《航天系统建模与仿真》书的一个教学程序。 9 | Chapter 7 航天系统仿真可视化实例。 10 | W/S键为上下旋转,A/D键为左右旋转 11 | 12 | 13 | ======================================================================== 14 | 航天仿真库 AstroLib 15 | 《航天系统建模与仿真》配套代码 16 | <> 17 | 源码地址:https://gitee.com/wanghmail/AstroLib 18 | ======================================================================== 19 | -------------------------------------------------------------------------------- /Graphics3D/glut.def: -------------------------------------------------------------------------------- 1 | DESCRIPTION 'OpenGL Utility Toolkit for Win32' 2 | 3 | VERSION 3.7 4 | 5 | EXPORTS 6 | 7 | glutAddMenuEntry 8 | glutAddSubMenu 9 | glutAttachMenu 10 | glutBitmapCharacter 11 | glutBitmapLength 12 | glutBitmapWidth 13 | glutButtonBoxFunc 14 | glutChangeToMenuEntry 15 | glutChangeToSubMenu 16 | glutCopyColormap 17 | glutCreateMenu 18 | __glutCreateMenuWithExit 19 | glutCreateSubWindow 20 | glutCreateWindow 21 | __glutCreateWindowWithExit 22 | glutDestroyMenu 23 | glutDestroyWindow 24 | glutDetachMenu 25 | glutDeviceGet 26 | glutDialsFunc 27 | glutDisplayFunc 28 | glutEnterGameMode 29 | glutEntryFunc 30 | glutEstablishOverlay 31 | glutExtensionSupported 32 | glutForceJoystickFunc 33 | glutFullScreen 34 | glutGameModeGet 35 | glutGameModeString 36 | glutGet 37 | glutGetColor 38 | glutGetMenu 39 | glutGetModifiers 40 | glutGetWindow 41 | glutHideOverlay 42 | glutHideWindow 43 | glutIconifyWindow 44 | glutIdleFunc 45 | glutIgnoreKeyRepeat 46 | glutInit 47 | __glutInitWithExit 48 | glutInitDisplayMode 49 | glutInitDisplayString 50 | glutInitWindowPosition 51 | glutInitWindowSize 52 | glutJoystickFunc 53 | glutKeyboardFunc 54 | glutKeyboardUpFunc 55 | glutLayerGet 56 | glutLeaveGameMode 57 | glutMainLoop 58 | glutMenuStateFunc 59 | glutMenuStatusFunc 60 | glutMotionFunc 61 | glutMouseFunc 62 | glutOverlayDisplayFunc 63 | glutPassiveMotionFunc 64 | glutPopWindow 65 | glutPositionWindow 66 | glutPostOverlayRedisplay 67 | glutPostRedisplay 68 | glutPostWindowOverlayRedisplay 69 | glutPostWindowRedisplay 70 | glutPushWindow 71 | glutRemoveMenuItem 72 | glutRemoveOverlay 73 | glutReportErrors 74 | glutReshapeFunc 75 | glutReshapeWindow 76 | glutSetColor 77 | glutSetCursor 78 | glutSetIconTitle 79 | glutSetKeyRepeat 80 | glutSetMenu 81 | glutSetWindow 82 | glutSetWindowTitle 83 | glutSetupVideoResizing 84 | glutShowOverlay 85 | glutShowWindow 86 | glutSolidCone 87 | glutSolidCube 88 | glutSolidDodecahedron 89 | glutSolidIcosahedron 90 | glutSolidOctahedron 91 | glutSolidSphere 92 | glutSolidTeapot 93 | glutSolidTetrahedron 94 | glutSolidTorus 95 | glutSpaceballButtonFunc 96 | glutSpaceballMotionFunc 97 | glutSpaceballRotateFunc 98 | glutSpecialFunc 99 | glutSpecialUpFunc 100 | glutStopVideoResizing 101 | glutStrokeCharacter 102 | glutStrokeLength 103 | glutStrokeWidth 104 | glutSwapBuffers 105 | glutTabletButtonFunc 106 | glutTabletMotionFunc 107 | glutTimerFunc 108 | glutUseLayer 109 | glutVideoPan 110 | glutVideoResize 111 | glutVideoResizeGet 112 | glutVisibilityFunc 113 | glutWarpPointer 114 | glutWindowStatusFunc 115 | glutWireCone 116 | glutWireCube 117 | glutWireDodecahedron 118 | glutWireIcosahedron 119 | glutWireOctahedron 120 | glutWireSphere 121 | glutWireTeapot 122 | glutWireTetrahedron 123 | glutWireTorus 124 | ; __glutSetFCB 125 | ; __glutGetFCB 126 | 127 | -------------------------------------------------------------------------------- /Graphics3D/glut32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/glut32.dll -------------------------------------------------------------------------------- /Graphics3D/glut32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/glut32.lib -------------------------------------------------------------------------------- /Graphics3D/glut32bit64bit.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/glut32bit64bit.zip -------------------------------------------------------------------------------- /Graphics3D/glut64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/glut64.dll -------------------------------------------------------------------------------- /Graphics3D/glut64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/glut64.lib -------------------------------------------------------------------------------- /Graphics3D/msvcp100d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/msvcp100d.dll -------------------------------------------------------------------------------- /Graphics3D/msvcr100d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/msvcr100d.dll -------------------------------------------------------------------------------- /Graphics3D/ucrtbased.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/ucrtbased.dll -------------------------------------------------------------------------------- /Graphics3D/vcruntime140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/vcruntime140.dll -------------------------------------------------------------------------------- /Graphics3D/vcruntime140d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Graphics3D/vcruntime140d.dll -------------------------------------------------------------------------------- /LowOrbitConstellation/Coverage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/LowOrbitConstellation/Coverage.cpp -------------------------------------------------------------------------------- /LowOrbitConstellation/LowOrbitConstellation.h: -------------------------------------------------------------------------------- 1 |  2 | #if !defined(_CEx01_H__INCLUDED_) 3 | #define _CEx01_H__INCLUDED_ 4 | 5 | #pragma once 6 | 7 | 8 | #include "AstroLib.h" 9 | 10 | 11 | class CEx01 12 | { 13 | public: 14 | void Main(); ///< 仿真主程序 15 | 16 | private: 17 | void Initialization(); ///< 初始化 18 | void TimeAdvance(double step,double duration); ///< 时间推进 19 | void ReportGeneration(); ///< 星历报告生成 20 | void Coverage(); ///< 视场分析 21 | void Readxingli(int i, vector& time, vector& pos); ///< 读取星历 22 | 23 | public: 24 | //保存仿真中间数据 25 | std::vector m_TimeList; 26 | std::vector m_PosList; 27 | std::vector m_VelList; 28 | 29 | 30 | public: 31 | double m_Time; ///< 飞行器时间 32 | CCoord m_Pos; ///< 飞行器位置 33 | CCoord m_Vel; ///< 飞行器速度 34 | string m_Name; ///< 飞行器名称 35 | }; 36 | 37 | 38 | #endif // !defined(_CEx01_H__INCLUDED_) 39 | -------------------------------------------------------------------------------- /LowOrbitConstellation/LowOrbitConstellation.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | Source Files 9 | 10 | 11 | Source Files 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | {e39009d5-122b-452e-bfac-d5f5222a5ca0} 20 | h;hpp;hxx;hm;inl 21 | 22 | 23 | {29018bbc-b339-4779-872a-9101ac483ca3} 24 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 25 | 26 | 27 | 28 | 29 | Header Files 30 | 31 | 32 | -------------------------------------------------------------------------------- /LowOrbitConstellation/LowOrbitConstellation.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /LowOrbitConstellation/ReadMe.txt: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2024 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | 该程序包是《航天系统仿真与推演》课程的一项大作业。 9 | 低轨星座仿真实例。 10 | 本程序先后对三颗卫星的轨道进行计算,记录星历数据; 11 | 分析其中两颗观测卫星对目标卫星,在设定敏感角度下的观测情况。 12 | 13 | ======================================================================== 14 | 航天仿真库 AstroLib 15 | 《航天系统建模与仿真》配套代码 16 | <> 17 | 源码地址:https://gitee.com/wanghmail/AstroLib 18 | ======================================================================== 19 | -------------------------------------------------------------------------------- /LowOrbitConstellation/Readxingli.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/LowOrbitConstellation/Readxingli.cpp -------------------------------------------------------------------------------- /Matlab/MonteCarlo_Matlab/blade1D.m: -------------------------------------------------------------------------------- 1 | function [Ttbc, Tmh, Tmc, q] = blade1D(hgas, Tgas, ktbc, Ltbc, km, Lm, ... 2 | hcool, Tcool) 3 | 4 | % Calculate matrix 5 | K = [ -hgas, 0, 0, -1; ... 6 | ktbc/Ltbc, -ktbc/Ltbc, 0, -1; ... 7 | 0, km/Lm, -km/Lm, -1; ... 8 | 0, 0, hcool, -1;]; 9 | 10 | % Calculate right-hand side 11 | b = [-hgas*Tgas; 0; 0; hcool*Tcool]; 12 | 13 | u = K\b; 14 | 15 | Ttbc = u(1); 16 | Tmh = u(2); 17 | Tmc = u(3); 18 | q = u(4); 19 | 20 | 21 | -------------------------------------------------------------------------------- /Matlab/MonteCarlo_Matlab/bladeLtbc.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/MonteCarlo_Matlab/bladeLtbc.m -------------------------------------------------------------------------------- /Matlab/MonteCarlo_Matlab/bladedet.m: -------------------------------------------------------------------------------- 1 | % Nominal values of input parameters 2 | 3 | hgas = 3000; % TBC-gas heat transfer coef. (W/(m^2 K)) 4 | Tgas = 1500; % Mixed gas temperature (K) 5 | ktbc = 1; % TBC thermal conduct. (W/mK) 6 | Ltbc = 0.0005; % TBC thickness (m) 7 | km = 20; % Metal thermal conduct. (W/mK) 8 | Lm = 0.003; % Metal thickness (m) 9 | hcool = 1000; % Coolant-metal heat transfer coef. (W/(m^2 K)) 10 | Tcool = 600; % Coolant temperature (K) 11 | 12 | % Solve heat transfer problem 13 | 14 | [Ttbc, Tmh, Tmc, q] = blade1D(hgas, Tgas, ... 15 | ktbc, Ltbc, ... 16 | km, Lm, ... 17 | hcool, Tcool); 18 | 19 | fprintf('Tmh = %6.1f K\n',Tmh); -------------------------------------------------------------------------------- /Matlab/MonteCarlo_Matlab/bladeuni.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/MonteCarlo_Matlab/bladeuni.m -------------------------------------------------------------------------------- /Matlab/MonteCarlo_Matlab/uniforml.m: -------------------------------------------------------------------------------- 1 | x=[0.00025;0.00025;0.00075;0.00075]; 2 | y=[0;2000;2000;0]; 3 | plot(x,y); 4 | xlabel('L_{tbc} (m)'); 5 | ylabel('PDF(L_{tbc})'); -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/actxlicense.m: -------------------------------------------------------------------------------- 1 | function lic = actxlicense(progid) 2 | 3 | if strcmpi(progid, 'air.airctrl.1') 4 | lic = 'Copyright (c) 1996 '; 5 | return; 6 | end 7 | -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/grt/DoF6/tmwinternal/minfo.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/grt/DoF6/tmwinternal/minfo.mat -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/Thumbs.db -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/copy.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/cut.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/folder.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/folder_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/folder_failed.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/folder_pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/folder_pass.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/folder_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/folder_warning.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/geninfo.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/geninfo.mat -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_folder.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_procedure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_procedure.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_task.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_task_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_task_disabled.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_task_pselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_task_pselected.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_task_required.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/icon_task_required.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/info_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/info_icon.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/mdladvinfo.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/mdladvinfo.mat -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/minus.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/paste.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/plus.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/procedure_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/procedure_failed.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/procedure_passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/procedure_passed.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/procedure_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/procedure_warning.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_failed.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_forcepass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_forcepass.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_passed.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_req_forcepassed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_req_forcepassed.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_req_passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_req_passed.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/task_warning.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/vandv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/vandv.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/vandvback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/Matlab/SimDoF6_Matlab/slprj/modeladvisor/DoF6/6DoF_20_28Quaternion_29/vandvback.png -------------------------------------------------------------------------------- /Matlab/SimDoF6_Matlab/slprj/sl_proj.tmw: -------------------------------------------------------------------------------- 1 | Real-Time Workshop project marker file. Please don't change it. 2 | slprjVersion: 7.3_10 -------------------------------------------------------------------------------- /MultiRendezvous/MultiRendezvous.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 29 | 30 | 源文件 31 | 32 | 33 | 源文件 34 | 35 | 36 | 源文件 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /MultiRendezvous/MultiRendezvous.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /MultiRendezvous/ReadMe.txt: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2022 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | 该程序包是《航天系统建模与仿真》书的一个教学程序。 9 | 大作业 GEO卫星多脉冲交会观测仿真实例。 10 | 11 | ======================================================================== 12 | 航天仿真库 AstroLib 13 | 《航天系统建模与仿真》配套代码 14 | <> 15 | 源码地址:https://gitee.com/wanghmail/AstroLib 16 | ======================================================================== 17 | -------------------------------------------------------------------------------- /MultiRendezvous/Src/MulChCtrl.h: -------------------------------------------------------------------------------- 1 | // ChCtrl.h: interface for the CMulChCtrl class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(_MulChCtrl_H__) 6 | #define _MulChCtrl_H__ 7 | 8 | 9 | #include "AstroLib.h" 10 | 11 | 12 | // 13 | //追踪器制导控制类 14 | // 15 | class CMulChCtrl 16 | { 17 | public: 18 | CMulChCtrl(); 19 | virtual ~CMulChCtrl(); 20 | 21 | void Init(); 22 | void TimeAdvance(double step, 23 | const CCoord& chPos, const CCoord& chVel, const CCoord& tgPos, const CCoord& tgVel, 24 | double flyTimeApproach, const CCoord& endPos, bool& isEnd, CCoord& impulse, int aim); 25 | 26 | 27 | private: 28 | void GuidanceImpulse1( 29 | const CCoord& chPos, const CCoord& chVel, 30 | const CCoord& tgPos, const CCoord& tgVel, const CCoord& endRelPos, 31 | double flyTime, CCoord& impulse); 32 | void GuidanceImpulse2(const CCoord& chPos, const CCoord& chVel, const CCoord& tgPos, const CCoord& tgVel, 33 | const CCoord& endRelVel, CCoord& impulse); 34 | 35 | void Measure(const CCoord& chPos, const CCoord& chVel, 36 | const CCoord& tgPos, const CCoord& tgVel, 37 | CCoord& relPos, CCoord& relVel); 38 | void Engine(CCoord& impulse); 39 | 40 | public: 41 | //测量误差 42 | int m_UseMeasureRandom; // 是否考虑测量误差:0=无随机;1=随机 43 | int m_UseEngineRandom; // 是否考虑执行误差:0=无随机;1=随机 44 | double m_PosStdDev; // 位置测量标准差 45 | double m_VelStdDev; // 速度测量标准差 46 | double m_EngStdDev; // 执行误差标准差 47 | 48 | // 49 | //内部参数 50 | // 51 | private: 52 | double m_FlyTime[100]; // 从施加上一次冲量开始的飞行时间 53 | int m_PulseNum; // 冲量次数 54 | 55 | CRandom m_RandomPos[3]; // 位置随机数 56 | CRandom m_RandomVel[3]; // 速度随机数 57 | CRandom m_RandomEng[3]; // 执行机构随机数 58 | 59 | 60 | }; 61 | 62 | 63 | #endif // !defined(_MulChCtrl_H__) 64 | -------------------------------------------------------------------------------- /MultiRendezvous/Src/MulSpacecraft.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/MultiRendezvous/Src/MulSpacecraft.cpp -------------------------------------------------------------------------------- /MultiRendezvous/Src/MulSpacecraft.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/MultiRendezvous/Src/MulSpacecraft.h -------------------------------------------------------------------------------- /MultiRendezvous/Src/ObserveGEO.h: -------------------------------------------------------------------------------- 1 |  2 | #if !defined(_MulRendezvous_H__INCLUDED_) 3 | #define _MulRendezvous_H__INCLUDED_ 4 | 5 | #pragma once 6 | 7 | #include "AstroLib.h" 8 | #include "MulSpacecraft.h" 9 | #include "MulChCtrl.h" 10 | 11 | 12 | // 13 | //航天器多次交会对接总控 14 | // 15 | class CMulRendezvous 16 | { 17 | public: 18 | void Main(); // 仿真主程序 19 | 20 | private: 21 | void Initialization(); // 初始化 22 | bool TimeAdvance(double step); // 时间推进 23 | void ReportGeneration(); // 结果报告生成 24 | 25 | 26 | public: 27 | double m_Time; // 仿真时间 28 | int m_aim = 0; 29 | CCoord m_RelPos; // 相对速度 30 | CCoord m_RelVel; // 相对速度 31 | 32 | public: 33 | //保存仿真中间数据 34 | struct CHistoryData 35 | { 36 | std::vector m_TimeList; // 仿真总共消耗时间[s] 37 | std::vector m_chList; // 相对位置状态[m] 38 | std::vector m_tg1List; // 相对位置状态[m] 39 | std::vector m_tg2List; // 相对位置状态[m] 40 | 41 | std::vector m_ch_vList; // 相对速度状态[m/s] 42 | std::vector m_tg1_vList; // 相对速度状态[m/s] 43 | std::vector m_tg2_vList; // 相对速度状态[m/s] 44 | 45 | std::vector m_sun0List; // 阳光角[弧度] 46 | std::vector m_sun1List; // 阳光角[弧度] 47 | std::vector m_sun2List; // 阳光角[弧度] 48 | 49 | std::vector m_aimList; // 可观测时刻[s] 50 | }; 51 | CHistoryData m_HistoryData; // 历史数据 52 | 53 | private: 54 | CMulChCtrl m_ChCtrl; // 追踪器控制 55 | CMulSpacecraft m_ChDyn; // 追踪器动力学 56 | std::vector m_TgDyn; // 目标器动力学 57 | 58 | }; 59 | 60 | 61 | 62 | #endif // !defined(_MulRendezvous_H__INCLUDED_) 63 | -------------------------------------------------------------------------------- /MultiRendezvous/output/MulRend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/MultiRendezvous/output/MulRend.png -------------------------------------------------------------------------------- /MultiRendezvous/output/main_mp4.m: -------------------------------------------------------------------------------- 1 | clear; 2 | % 创建一个 VideoWriter 对象 3 | writerObj = VideoWriter('my_animation.mp4', 'MPEG-4'); 4 | writerObj.FrameRate = 10; % 设置帧率 5 | 6 | % 打开 VideoWriter 对象 7 | open(writerObj); 8 | 9 | % 创建一个图形窗口 10 | 11 | 12 | load RelPosVel.txt; 13 | data=RelPosVel; 14 | 15 | 16 | figure(1); 17 | x=plot(data(1,2),-data(1,4),'o'); 18 | hold on 19 | xx=plot(data(1,2),-data(1,4)); 20 | a=plot(0,0,'o'); 21 | b=plot(data(1,5),-data(1,7),'o'); 22 | c=plot(data(1,8),-data(1,10),'o'); 23 | xlabel('v-bar(m)');ylabel('r-bar(m)'); 24 | 25 | axis equal 26 | axis([-1e5,3e5,-5e4,5e4]) 27 | 28 | step=50; 29 | s=size(data)/step; 30 | 31 | for j=1:s(1) 32 | set(xx,'xdata',data(1:10:j*step,2),'ydata',-data(1:10:j*step,4)); 33 | set(x,'xdata',data(j*step,2),'ydata',-data(j*step,4)); 34 | set(b,'xdata',data(j*step,5),'ydata',-data(j*step,7)); 35 | set(c,'xdata',data(j*step,8),'ydata',-data(j*step,10)); 36 | drawnow 37 | % 将当前图形帧写入 VideoWriter 对象 38 | writeVideo(writerObj, getframe(gcf)); 39 | end 40 | 41 | legend([a,b,c],{'目标1','目标2','目标3'}); 42 | % 关闭 VideoWriter 对象 43 | close(writerObj); -------------------------------------------------------------------------------- /MultiRendezvous/output/main_plot.m: -------------------------------------------------------------------------------- 1 | clear; 2 | load RelPosVel.txt; 3 | data=RelPosVel; 4 | 5 | 6 | figure(1); 7 | plot(data(:,2),-data(:,4)); 8 | xlabel('v-bar(m)');ylabel('r-bar(m)'); 9 | axis equal 10 | axis([-1e5,2.5e5,-4e4,2e4]) 11 | 12 | hold on 13 | aim1=find(RelPosVel(:,11)==1); 14 | plot(data(aim1,2),-data(aim1,4),'LineWidth',3); 15 | aim2=find(RelPosVel(:,11)==2); 16 | plot(data(aim2,2),-data(aim2,4),'LineWidth',3); 17 | aim3=find(RelPosVel(:,11)==3); 18 | plot(data(aim3,2),-data(aim3,4),'LineWidth',3); 19 | 20 | print('MulRend.png','-dpng','-r1000') -------------------------------------------------------------------------------- /MultiRendezvous/output/my_animation.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/MultiRendezvous/output/my_animation.mp4 -------------------------------------------------------------------------------- /ParallelSim/ParallelSim.cpp: -------------------------------------------------------------------------------- 1 | // ParallelCpp.cpp : 定义控制台应用程序的入口点。 2 | // 3 | 4 | #include 5 | #include 6 | #include 7 | #include "MultiThread.h" 8 | #include "SimOpenMP.h" 9 | 10 | 11 | using namespace std; 12 | 13 | 14 | 15 | int main() 16 | { 17 | printf("*****************************************************************\n"); 18 | printf("* *\n"); 19 | printf("* <> *\n"); 20 | printf("* Parellel Sim *\n"); 21 | printf("* *\n"); 22 | printf("*****************************************************************\n\n"); 23 | 24 | //C++多线程仿真 25 | //MultiThreadStatic(); 26 | //MultiThreadAtomic(); 27 | //MultiThreadDynamic(); 28 | 29 | //OpenMP仿真 30 | SimOpenMP(); 31 | 32 | int i; 33 | cin>>i; 34 | 35 | return 0; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /ParallelSim/ParallelSim.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 源文件 26 | 27 | 28 | 源文件 29 | 30 | 31 | 源文件 32 | 33 | 34 | 35 | 36 | 头文件 37 | 38 | 39 | 头文件 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ParallelSim/ParallelSim.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ParallelSim/ReadMe.txt: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////// 2 | // // 3 | // Copyright (c) 2003-2022 // 4 | // Wang Hua // 5 | // // 6 | //////////////////////////////////////////////////////////////////////////// 7 | 8 | 该程序包是《航天系统建模与仿真》书的一个教学程序。 9 | Chapter 8 并行仿真实例。 10 | 11 | ======================================================================== 12 | 航天仿真库 AstroLib 13 | 《航天系统建模与仿真》配套代码 14 | <> 15 | 源码地址:https://gitee.com/wanghmail/AstroLib 16 | ======================================================================== 17 | -------------------------------------------------------------------------------- /ParallelSim/Src/MultiThread.h: -------------------------------------------------------------------------------- 1 | // MultiThread.h 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(MultiThread__INCLUDED_) 6 | #define MultiThread__INCLUDED_ 7 | 8 | 9 | 10 | void MultiThreadStatic(); 11 | void MultiThreadDynamic(); 12 | void MultiThreadAtomic(); 13 | 14 | 15 | 16 | #endif // !defined(MultiThread__INCLUDED_) 17 | -------------------------------------------------------------------------------- /ParallelSim/Src/MultiThreadAtomic.cpp: -------------------------------------------------------------------------------- 1 | // Atomic.cpp : 定义控制台应用程序的入口点。 2 | // 3 | 4 | #include "MultiThread.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include // <- atomic datatypes 10 | #include 11 | #include "AstroLib.h" 12 | 13 | 14 | using namespace std; 15 | 16 | 17 | //多线程同步 18 | void MultiThreadAtomic() 19 | { 20 | std::mutex mutex; 21 | std::vector threads; 22 | const uint64_t num_threads =10; 23 | const uint64_t num_iters=100000000; 24 | 25 | auto lock_count = [&](volatile uint64_t* counter, 26 | const auto& id)-> void 27 | { 28 | for (uint64_t i=id; i lock_guard(mutex); 31 | (*counter)++; 32 | } 33 | }; 34 | 35 | auto atomic_count=[&](volatile std::atomic* counter, 36 | const auto& id)-> void 37 | { 38 | for (uint64_t i=id; i atomic_counter(0); 53 | threads.clear(); 54 | for (uint64_t id=0; id 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "AstroLib.h" 11 | 12 | using namespace std; 13 | 14 | 15 | 16 | //计算函数 17 | void GetResult(int id, int num_threads, const std::vector& largeArrays, double& result) 18 | { 19 | int num = largeArrays.size(); 20 | int lower = id*num/num_threads; 21 | int upper = (id+1)*num/num_threads; 22 | if (id==num_threads-1) 23 | upper = num; 24 | 25 | for (int i=lower; i& largeArrays, 36 | int num_threads=2) 37 | { 38 | //创建子线程 39 | std::vector threads; 40 | vector results(num_threads); 41 | 42 | for (int id=0; id largeArrays(num); 68 | for (int i=0; i> 15 | 源码地址:https://gitee.com/wanghmail/AstroLib 16 | ======================================================================== 17 | -------------------------------------------------------------------------------- /Rendezvous/Rendezvous.h: -------------------------------------------------------------------------------- 1 |  2 | #if !defined(_RENDEZVOUS_H__INCLUDED_) 3 | #define _RENDEZVOUS_H__INCLUDED_ 4 | 5 | #pragma once 6 | 7 | 8 | #include "AstroLib.h" 9 | #include "Spacecraft.h" 10 | #include "ChCtrl.h" 11 | 12 | 13 | // 14 | //航天器交会对接总控 15 | // 16 | class CRendezvous 17 | { 18 | public: 19 | void Main(); // 仿真主程序 20 | void MainMonteCarlo(); // MonteCarlo仿真主程序 21 | 22 | private: 23 | void Initialization(); // 初始化 24 | bool TimeAdvance(double step); // 时间推进 25 | void ReportGeneration(); // 结果报告生成 26 | 27 | 28 | public: 29 | double m_Time; // 仿真时间 30 | 31 | CCoord m_RelPos; // 相对速度 32 | CCoord m_RelVel; // 相对速度 33 | 34 | public: 35 | //保存仿真中间数据 36 | struct CHistoryData 37 | { 38 | std::vector m_TimeList; // 仿真总共消耗时间[s] 39 | std::vector m_RelPosList; // 相对位置状态[m] 40 | std::vector m_RelVelList; // 相对速度状态[m/s] 41 | }; 42 | CHistoryData m_HistoryData; // 历史数据 43 | 44 | private: 45 | CChCtrl m_ChCtrl; // 追踪器控制 46 | CSpacecraft m_ChDyn; // 追踪器动力学 47 | CSpacecraft m_TgDyn; // 目标器动力学 48 | 49 | }; 50 | 51 | 52 | 53 | #endif // _RENDEZVOUS_H__INCLUDED_ 54 | -------------------------------------------------------------------------------- /Rendezvous/Rendezvous.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 32 | 33 | 源文件 34 | 35 | 36 | 源文件 37 | 38 | 39 | 源文件 40 | 41 | 42 | -------------------------------------------------------------------------------- /Rendezvous/Rendezvous.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Rendezvous/Src/ChCtrl.h: -------------------------------------------------------------------------------- 1 | // ChCtrl.h: interface for the CChCtrl class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(_CHCTRL_H__) 6 | #define _CHCTRL_H__ 7 | 8 | 9 | #include "AstroLib.h" 10 | 11 | 12 | // 13 | //追踪器制导控制类 14 | // 15 | class CChCtrl 16 | { 17 | public: 18 | CChCtrl(); 19 | virtual ~CChCtrl(); 20 | 21 | void Init(); 22 | void TimeAdvance(double step, 23 | const CCoord& chPos, const CCoord& chVel, const CCoord& tgPos, const CCoord& tgVel, 24 | double flyTimeApproach, const CCoord& endPos, bool& isEnd, CCoord& impulse); 25 | 26 | 27 | private: 28 | void GuidanceImpulse1( 29 | const CCoord& chPos, const CCoord& chVel, 30 | const CCoord& tgPos, const CCoord& tgVel, const CCoord& endRelPos, 31 | double flyTime, CCoord& impulse); 32 | void GuidanceImpulse2(const CCoord& chPos, const CCoord& chVel, const CCoord& tgPos, const CCoord& tgVel, 33 | const CCoord& endRelVel, CCoord& impulse); 34 | 35 | void Measure(const CCoord& chPos, const CCoord& chVel, 36 | const CCoord& tgPos, const CCoord& tgVel, 37 | CCoord& relPos, CCoord& relVel); 38 | void Engine(CCoord& impulse); 39 | 40 | public: 41 | //测量误差 42 | int m_UseMeasureRandom; // 是否考虑测量误差:0=无随机;1=随机 43 | int m_UseEngineRandom; // 是否考虑执行误差:0=无随机;1=随机 44 | double m_PosStdDev; // 位置测量标准差 45 | double m_VelStdDev; // 速度测量标准差 46 | double m_EngStdDev; // 执行误差标准差 47 | 48 | // 49 | //内部参数 50 | // 51 | private: 52 | double m_FlyTime; // 从施加第一次冲量开始的飞行时间 53 | int m_PulseNum; // 冲量次数 54 | 55 | CRandom m_RandomPos[3]; // 位置随机数 56 | CRandom m_RandomVel[3]; // 速度随机数 57 | CRandom m_RandomEng[3]; // 执行机构随机数 58 | 59 | 60 | }; 61 | 62 | 63 | #endif // !defined(_CHCTRL_H__) 64 | -------------------------------------------------------------------------------- /SimDoF6/Output/plotgraph.m: -------------------------------------------------------------------------------- 1 | load Result.txt; 2 | data=Result; 3 | 4 | figure(100); 5 | subplot(2,1,1); 6 | plot(data(:,1),data(:,2),data(:,1),data(:,3),data(:,1),data(:,4)); 7 | xlabel('time(s)');ylabel('position(m)') 8 | 9 | subplot(2,1,2); 10 | plot(data(:,1),data(:,5),data(:,1),data(:,6),data(:,1),data(:,7)); 11 | xlabel('time(s)');ylabel('velocity(m/s)') 12 | 13 | figure(200); 14 | plot(data(:,1),data(:,12),data(:,1),data(:,13),data(:,1),data(:,14)); 15 | xlabel('time(s)');ylabel('angle velocity(m/s)') -------------------------------------------------------------------------------- /SimDoF6/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/SimDoF6/ReadMe.txt -------------------------------------------------------------------------------- /SimDoF6/SimDoF6.h: -------------------------------------------------------------------------------- 1 |  2 | #if !defined(AFX_SIM_H__B0B3B510_F9D9_4417_84A3_59D66930CEE9__INCLUDED_) 3 | #define AFX_SIM_H__B0B3B510_F9D9_4417_84A3_59D66930CEE9__INCLUDED_ 4 | 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | 9 | 10 | #include "AstroLib.h" 11 | 12 | 13 | // 14 | //飞行器六自由度仿真实现 15 | // 16 | class CSimDoF6 17 | { 18 | public: 19 | void Main(); ///< 仿真主程序 20 | 21 | private: 22 | void Initialization(); ///< 初始化 23 | void TimeAdvance(double step); ///< 时间推进 24 | void ReportGeneration(); ///< 结果报告生成 25 | 26 | 27 | public: 28 | //保存仿真中间数据 29 | std::vector m_TimeList; 30 | std::vector m_PosList; 31 | std::vector m_VelList; 32 | std::vector m_QuatList; 33 | std::vector m_AngVelList; 34 | 35 | 36 | public: 37 | double m_Time; ///< 飞行器时间 38 | CCoord m_Pos; ///< 飞行器位置 39 | CCoord m_Vel; ///< 飞行器速度 40 | CQuaternion m_Quat; ///< 飞行器四元数 41 | CCoord m_AngVel; ///< 飞行器角速度 42 | 43 | double m_Mass; ///< 飞行器质量 44 | CMatrix m_Inertia; ///< 飞行器转动惯量 45 | }; 46 | 47 | 48 | 49 | #endif // !defined(AFX_SIM_H__B0B3B510_F9D9_4417_84A3_59D66930CEE9__INCLUDED_) 50 | -------------------------------------------------------------------------------- /SimDoF6/SimDoF6.vcproj.CMSE01.Wang.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /SimDoF6/SimDoF6.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {0ced3f4a-8e8d-4f88-bc43-c87351f4456d} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp 7 | 8 | 9 | {03515293-2f50-4ef7-a123-ebb3936cad7e} 10 | h;hpp;hxx;hm;inl;fi;fd 11 | 12 | 13 | {220b9f6c-e3c8-4d91-8e3d-c370d7a92016} 14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /SimDoF6/SimDoF6.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /SimDoF6/Src/DoF6.h: -------------------------------------------------------------------------------- 1 | // DoF6.h: interface for the CDoF6 class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_DOF6_H__8599D4D4_C0F7_428F_9D8E_1CE91D76D292__INCLUDED_) 6 | #define AFX_DOF6_H__8599D4D4_C0F7_428F_9D8E_1CE91D76D292__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | #include "AstroLib.h" 14 | 15 | 16 | class CDoF6 17 | { 18 | // 19 | //Operation. 20 | // 21 | public: 22 | CDoF6(); 23 | virtual ~CDoF6(); 24 | 25 | void DoF6 (double step, double mass, 26 | const CMatrix& inertia, const CCoord& force, const CCoord& torque, 27 | CCoord& pos, CCoord& vel, CQuaternion& quat, CCoord& angVel); 28 | 29 | 30 | // 31 | //Attribute. 32 | // 33 | private: 34 | //轨道姿态计算右函数类 35 | class CFuncOrbAtt : public CRightFunc 36 | { 37 | // 38 | //Operation. 39 | // 40 | public: 41 | CFuncOrbAtt(); 42 | virtual ~CFuncOrbAtt(); 43 | 44 | void operator()(double t, const CVector &x, CVector &result) const; 45 | 46 | // 47 | //Attribute 48 | // 49 | public: 50 | CCoord m_Force; 51 | CCoord m_Torque; 52 | CMatrix m_Inertia; 53 | double m_Mass; 54 | 55 | }m_FuncOrbAtt; 56 | }; 57 | 58 | #endif // !defined(AFX_DOF6_H__8599D4D4_C0F7_428F_9D8E_1CE91D76D292__INCLUDED_) 59 | -------------------------------------------------------------------------------- /VisibilityAnalysis/Parameter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | 19 | using namespace std; 20 | 21 | // 常量声明 22 | #define pi 3.141592653589793 23 | #define mu 3.98600441e5 24 | #define we 7.2921158553e-5 25 | #define omega 7.2921158553e-5 26 | #define Re 6378.136 27 | #define flat 0.00335281317789691 //地球扁率 28 | #define aunit 149597870.0 //// 天文单位 29 | #define mu_sun 1.32712440018e11 //// 太阳引力系数 30 | #define mu_moon 4.902801e4 //// 月球引力系数 31 | #define J2 0.00108264 32 | #define J3 -2.5356e-6 33 | #define J4 -1.62336e-6 34 | 35 | 36 | -------------------------------------------------------------------------------- /VisibilityAnalysis/ToolFunctions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Parameter.h" 3 | 4 | // 基础函数 5 | double fix(double x); 6 | long double modulo(long double x); 7 | double sign(double x); 8 | double atan3(double x, double z); 9 | double r2r(double x); 10 | double dot(double a[3], double b[3]); 11 | double norm(double a[3]); 12 | 13 | 14 | double* orb2eci(double oev[6]); 15 | double* LLH2ECF(double Latitude, double longitude, double altitude); 16 | 17 | long double julian(double x[6]); 18 | double gast(double x); 19 | 20 | double linemulti(double x[3], double y[3]); 21 | double** matmulti(double x[3][3], double y[3][3]); 22 | double** mattrans(double x[3][3]); 23 | double* matm31(double x[3][3], double y[3]); 24 | 25 | 26 | double** R1(double x); 27 | double** R2(double x); 28 | double** R3(double x); 29 | 30 | double** nutation(double x); 31 | double** precession(double x); 32 | 33 | double** C_RNP_Fun(double Time[6]); 34 | 35 | void Add1Day(int year, int month, int day, int* out_year, int* out_month, int* out_day); 36 | double* AddSec(double Time[6], double addsec); 37 | 38 | string UTCGTime(double* UTCG0); 39 | 40 | // 轨道动力学 41 | void OrbitDynamics(double t, double y[6], double f[3], double ydot[6]); 42 | void orb_rkf78(double x[], double h, double ti, double tf, double f_c[], double* xoutAdr, int neq); -------------------------------------------------------------------------------- /VisibilityAnalysis/VisibilityAnalysis.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 26 | 27 | 源文件 28 | 29 | 30 | 源文件 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/resources/AstroLib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/AstroLib.png -------------------------------------------------------------------------------- /docs/resources/Example_Ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/Example_Ui.png -------------------------------------------------------------------------------- /docs/resources/Graphics3D_Ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/Graphics3D_Ui.png -------------------------------------------------------------------------------- /docs/resources/Rendezvous_Ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/Rendezvous_Ui.png -------------------------------------------------------------------------------- /docs/resources/Rendezvous_pos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/Rendezvous_pos.png -------------------------------------------------------------------------------- /docs/resources/Rendezvous_xyz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/Rendezvous_xyz.png -------------------------------------------------------------------------------- /docs/resources/Rendezvous_xz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/Rendezvous_xz.png -------------------------------------------------------------------------------- /docs/resources/SimDoF6_AngVel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/SimDoF6_AngVel.png -------------------------------------------------------------------------------- /docs/resources/SimDoF6_PosVel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/SimDoF6_PosVel.png -------------------------------------------------------------------------------- /docs/resources/SimDoF6_Ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wanghmail/AstroLib/139587f024d63a9a19b7c7beac0209b245e309d3/docs/resources/SimDoF6_Ui.png --------------------------------------------------------------------------------