├── .clang-format ├── .cmakelintrc ├── .drone.yml ├── .drone.yml.sig ├── .drone ├── build.sh ├── copy_build.sh └── test_quant.sh ├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── .gitignore ├── .lgtm.yml ├── .travis.yml ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── cmake ├── Modules │ ├── FindJellyfish.cmake │ ├── FindJemalloc.cmake │ ├── FindTBB.cmake │ ├── FindTcmalloc.cmake │ ├── Findcereal.cmake │ ├── Findlibdivsufsort.cmake │ ├── Findlibgff.cmake │ └── Findlibstadenio.cmake ├── PostInstall.cmake ├── SimpleTest.cmake ├── TestSalmonFMD.cmake ├── TestSalmonQuasi.cmake └── UnitTests.cmake ├── current_version.txt ├── doc ├── FileFormats.md ├── Makefile ├── license-header.txt ├── logo.png ├── requirements.txt ├── salmon_logo.png ├── source │ ├── ReadLibraryIllustration.png │ ├── alevin.rst │ ├── building.rst │ ├── conf.py │ ├── file_formats.rst │ ├── index.rst │ ├── library_type.rst │ ├── license.rst │ └── salmon.rst └── steps_to_prepare_release.md ├── docker ├── Dockerfile └── build_test.sh ├── include ├── AlevinHash.hpp ├── AlevinOpts.hpp ├── AlevinTypes.hpp ├── AlevinUtils.hpp ├── AlignmentCommon.hpp ├── AlignmentGroup.hpp ├── AlignmentLibrary.hpp ├── AlignmentModel.hpp ├── AtomicMatrix.hpp ├── BAMQueue.hpp ├── BAMQueue.tpp ├── BAMUtils.hpp ├── BarcodeGroup.hpp ├── BarcodeModel.hpp ├── BiasParams.hpp ├── BinaryLiteral.hpp ├── BootstrapWriter.hpp ├── ClusterForest.hpp ├── CollapsedCellOptimizer.hpp ├── CollapsedEMOptimizer.hpp ├── CollapsedGibbsSampler.hpp ├── CommonTypes.hpp ├── DedupUMI.hpp ├── DistributionUtils.hpp ├── EMUtils.hpp ├── EffectiveLengthStats.hpp ├── EquivalenceClassBuilder.hpp ├── FASTAParser.hpp ├── FastxParser.hpp ├── FastxParserThreadUtils.hpp ├── ForgettingMassCalculator.hpp ├── FragmentLengthDistribution.hpp ├── FragmentList.hpp ├── FragmentStartPositionDistribution.hpp ├── GCFragModel.hpp ├── GZipWriter.hpp ├── GenomicFeature.hpp ├── Graph.hpp ├── IOUtils.hpp ├── IndexVersionInfo.hpp ├── KmerContext.hpp ├── LibraryFormat.hpp ├── LibraryTypeDetector.hpp ├── MappingStatistics.hpp ├── MicroOpts.hpp ├── MiniBatchInfo.hpp ├── MultinomialSampler.hpp ├── NullFragmentFilter.hpp ├── ONTAlignmentModel.hpp ├── OutputUnmappedFilter.hpp ├── PCA.hpp ├── ProgramOptionsGenerator.hpp ├── ReadExperiment.hpp ├── ReadKmerDist.hpp ├── ReadLibrary.hpp ├── ReadPair.hpp ├── ReadProducer.hpp ├── SBModel.hpp ├── SGSmooth.hpp ├── SalmonConfig.hpp ├── SalmonDefaults.hpp ├── SalmonExceptions.hpp ├── SalmonIndex.hpp ├── SalmonIndexVersionInfo.hpp ├── SalmonMappingUtils.hpp ├── SalmonMath.hpp ├── SalmonOpts.hpp ├── SalmonSpinLock.hpp ├── SalmonStringUtils.hpp ├── SalmonUtils.hpp ├── Sampler.hpp ├── SequenceBiasModel.hpp ├── SimplePosBias.hpp ├── SingleCellProtocols.hpp ├── StadenUtils.hpp ├── SufficientStatisticsQueue.hpp ├── TextBootstrapWriter.hpp ├── Transcript.hpp ├── TranscriptCluster.hpp ├── TranscriptGeneMap.hpp ├── TranscriptGroup.hpp ├── TryableSpinLock.hpp ├── UnpairedRead.hpp ├── UtilityFunctions.hpp ├── VersionChecker.hpp ├── WhiteList.hpp ├── atomicops.h ├── backtrace.hpp ├── blockingconcurrentqueue.h ├── bucket_container.hh ├── concurrentqueue.h ├── core │ ├── algorithm.hpp │ ├── any.hpp │ ├── array.hpp │ ├── deque.hpp │ ├── forward_list.hpp │ ├── functional.hpp │ ├── internal.hpp │ ├── iterator.hpp │ ├── list.hpp │ ├── map.hpp │ ├── memory.hpp │ ├── memory_resource.hpp │ ├── meta.hpp │ ├── numeric.hpp │ ├── optional.hpp │ ├── propagate_const.hpp │ ├── range.hpp │ ├── regex.hpp │ ├── set.hpp │ ├── string.hpp │ ├── string_view.hpp │ ├── type_traits.hpp │ ├── typeinfo.hpp │ ├── unordered_map.hpp │ ├── unordered_set.hpp │ ├── utility.hpp │ ├── variant.hpp │ └── vector.hpp ├── cuckoohash_config.hh ├── cuckoohash_map.hh ├── cuckoohash_util.hh ├── dbg.hpp ├── default_hasher.hh ├── edlib.h ├── eigen3 │ ├── Eigen │ │ ├── Cholesky │ │ ├── CholmodSupport │ │ ├── Core │ │ ├── Dense │ │ ├── Eigen │ │ ├── Eigenvalues │ │ ├── Geometry │ │ ├── Householder │ │ ├── IterativeLinearSolvers │ │ ├── Jacobi │ │ ├── LU │ │ ├── MetisSupport │ │ ├── OrderingMethods │ │ ├── PaStiXSupport │ │ ├── PardisoSupport │ │ ├── QR │ │ ├── QtAlignedMalloc │ │ ├── SPQRSupport │ │ ├── SVD │ │ ├── Sparse │ │ ├── SparseCholesky │ │ ├── SparseCore │ │ ├── SparseLU │ │ ├── SparseQR │ │ ├── StdDeque │ │ ├── StdList │ │ ├── StdVector │ │ ├── SuperLUSupport │ │ ├── UmfPackSupport │ │ └── src │ │ │ ├── Cholesky │ │ │ ├── LDLT.h │ │ │ ├── LLT.h │ │ │ └── LLT_LAPACKE.h │ │ │ ├── CholmodSupport │ │ │ └── CholmodSupport.h │ │ │ ├── Core │ │ │ ├── Array.h │ │ │ ├── ArrayBase.h │ │ │ ├── ArrayWrapper.h │ │ │ ├── Assign.h │ │ │ ├── AssignEvaluator.h │ │ │ ├── Assign_MKL.h │ │ │ ├── BandMatrix.h │ │ │ ├── Block.h │ │ │ ├── BooleanRedux.h │ │ │ ├── CommaInitializer.h │ │ │ ├── ConditionEstimator.h │ │ │ ├── CoreEvaluators.h │ │ │ ├── CoreIterators.h │ │ │ ├── CwiseBinaryOp.h │ │ │ ├── CwiseNullaryOp.h │ │ │ ├── CwiseTernaryOp.h │ │ │ ├── CwiseUnaryOp.h │ │ │ ├── CwiseUnaryView.h │ │ │ ├── DenseBase.h │ │ │ ├── DenseCoeffsBase.h │ │ │ ├── DenseStorage.h │ │ │ ├── Diagonal.h │ │ │ ├── DiagonalMatrix.h │ │ │ ├── DiagonalProduct.h │ │ │ ├── Dot.h │ │ │ ├── EigenBase.h │ │ │ ├── ForceAlignedAccess.h │ │ │ ├── Fuzzy.h │ │ │ ├── GeneralProduct.h │ │ │ ├── GenericPacketMath.h │ │ │ ├── GlobalFunctions.h │ │ │ ├── IO.h │ │ │ ├── Inverse.h │ │ │ ├── Map.h │ │ │ ├── MapBase.h │ │ │ ├── MathFunctions.h │ │ │ ├── MathFunctionsImpl.h │ │ │ ├── Matrix.h │ │ │ ├── MatrixBase.h │ │ │ ├── NestByValue.h │ │ │ ├── NoAlias.h │ │ │ ├── NumTraits.h │ │ │ ├── PermutationMatrix.h │ │ │ ├── PlainObjectBase.h │ │ │ ├── Product.h │ │ │ ├── ProductEvaluators.h │ │ │ ├── Random.h │ │ │ ├── Redux.h │ │ │ ├── Ref.h │ │ │ ├── Replicate.h │ │ │ ├── ReturnByValue.h │ │ │ ├── Reverse.h │ │ │ ├── Select.h │ │ │ ├── SelfAdjointView.h │ │ │ ├── SelfCwiseBinaryOp.h │ │ │ ├── Solve.h │ │ │ ├── SolveTriangular.h │ │ │ ├── SolverBase.h │ │ │ ├── StableNorm.h │ │ │ ├── Stride.h │ │ │ ├── Swap.h │ │ │ ├── Transpose.h │ │ │ ├── Transpositions.h │ │ │ ├── TriangularMatrix.h │ │ │ ├── VectorBlock.h │ │ │ ├── VectorwiseOp.h │ │ │ ├── Visitor.h │ │ │ ├── arch │ │ │ │ ├── AVX │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── AVX512 │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── AltiVec │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── CUDA │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── Half.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ ├── PacketMathHalf.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ ├── Default │ │ │ │ │ └── Settings.h │ │ │ │ ├── NEON │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ │ ├── SSE │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ ├── PacketMath.h │ │ │ │ │ └── TypeCasting.h │ │ │ │ └── ZVector │ │ │ │ │ ├── Complex.h │ │ │ │ │ ├── MathFunctions.h │ │ │ │ │ └── PacketMath.h │ │ │ ├── functors │ │ │ │ ├── AssignmentFunctors.h │ │ │ │ ├── BinaryFunctors.h │ │ │ │ ├── NullaryFunctors.h │ │ │ │ ├── StlFunctors.h │ │ │ │ ├── TernaryFunctors.h │ │ │ │ └── UnaryFunctors.h │ │ │ ├── products │ │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ │ ├── GeneralMatrixMatrix.h │ │ │ │ ├── GeneralMatrixMatrixTriangular.h │ │ │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h │ │ │ │ ├── GeneralMatrixMatrix_BLAS.h │ │ │ │ ├── GeneralMatrixVector.h │ │ │ │ ├── GeneralMatrixVector_BLAS.h │ │ │ │ ├── Parallelizer.h │ │ │ │ ├── SelfadjointMatrixMatrix.h │ │ │ │ ├── SelfadjointMatrixMatrix_BLAS.h │ │ │ │ ├── SelfadjointMatrixVector.h │ │ │ │ ├── SelfadjointMatrixVector_BLAS.h │ │ │ │ ├── SelfadjointProduct.h │ │ │ │ ├── SelfadjointRank2Update.h │ │ │ │ ├── TriangularMatrixMatrix.h │ │ │ │ ├── TriangularMatrixMatrix_BLAS.h │ │ │ │ ├── TriangularMatrixVector.h │ │ │ │ ├── TriangularMatrixVector_BLAS.h │ │ │ │ ├── TriangularSolverMatrix.h │ │ │ │ ├── TriangularSolverMatrix_BLAS.h │ │ │ │ └── TriangularSolverVector.h │ │ │ └── util │ │ │ │ ├── BlasUtil.h │ │ │ │ ├── Constants.h │ │ │ │ ├── DisableStupidWarnings.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── MKL_support.h │ │ │ │ ├── Macros.h │ │ │ │ ├── Memory.h │ │ │ │ ├── Meta.h │ │ │ │ ├── NonMPL2.h │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ ├── StaticAssert.h │ │ │ │ └── XprHelper.h │ │ │ ├── Eigenvalues │ │ │ ├── ComplexEigenSolver.h │ │ │ ├── ComplexSchur.h │ │ │ ├── ComplexSchur_LAPACKE.h │ │ │ ├── EigenSolver.h │ │ │ ├── GeneralizedEigenSolver.h │ │ │ ├── GeneralizedSelfAdjointEigenSolver.h │ │ │ ├── HessenbergDecomposition.h │ │ │ ├── MatrixBaseEigenvalues.h │ │ │ ├── RealQZ.h │ │ │ ├── RealSchur.h │ │ │ ├── RealSchur_LAPACKE.h │ │ │ ├── SelfAdjointEigenSolver.h │ │ │ ├── SelfAdjointEigenSolver_LAPACKE.h │ │ │ └── Tridiagonalization.h │ │ │ ├── Geometry │ │ │ ├── AlignedBox.h │ │ │ ├── AngleAxis.h │ │ │ ├── EulerAngles.h │ │ │ ├── Homogeneous.h │ │ │ ├── Hyperplane.h │ │ │ ├── OrthoMethods.h │ │ │ ├── ParametrizedLine.h │ │ │ ├── Quaternion.h │ │ │ ├── Rotation2D.h │ │ │ ├── RotationBase.h │ │ │ ├── Scaling.h │ │ │ ├── Transform.h │ │ │ ├── Translation.h │ │ │ ├── Umeyama.h │ │ │ └── arch │ │ │ │ └── Geometry_SSE.h │ │ │ ├── Householder │ │ │ ├── BlockHouseholder.h │ │ │ ├── Householder.h │ │ │ └── HouseholderSequence.h │ │ │ ├── IterativeLinearSolvers │ │ │ ├── BasicPreconditioners.h │ │ │ ├── BiCGSTAB.h │ │ │ ├── ConjugateGradient.h │ │ │ ├── IncompleteCholesky.h │ │ │ ├── IncompleteLUT.h │ │ │ ├── IterativeSolverBase.h │ │ │ ├── LeastSquareConjugateGradient.h │ │ │ └── SolveWithGuess.h │ │ │ ├── Jacobi │ │ │ └── Jacobi.h │ │ │ ├── LU │ │ │ ├── Determinant.h │ │ │ ├── FullPivLU.h │ │ │ ├── InverseImpl.h │ │ │ ├── PartialPivLU.h │ │ │ ├── PartialPivLU_LAPACKE.h │ │ │ └── arch │ │ │ │ └── Inverse_SSE.h │ │ │ ├── MetisSupport │ │ │ └── MetisSupport.h │ │ │ ├── OrderingMethods │ │ │ ├── Amd.h │ │ │ ├── Eigen_Colamd.h │ │ │ └── Ordering.h │ │ │ ├── PaStiXSupport │ │ │ └── PaStiXSupport.h │ │ │ ├── PardisoSupport │ │ │ └── PardisoSupport.h │ │ │ ├── QR │ │ │ ├── ColPivHouseholderQR.h │ │ │ ├── ColPivHouseholderQR_LAPACKE.h │ │ │ ├── CompleteOrthogonalDecomposition.h │ │ │ ├── FullPivHouseholderQR.h │ │ │ ├── HouseholderQR.h │ │ │ └── HouseholderQR_LAPACKE.h │ │ │ ├── SPQRSupport │ │ │ └── SuiteSparseQRSupport.h │ │ │ ├── SVD │ │ │ ├── BDCSVD.h │ │ │ ├── JacobiSVD.h │ │ │ ├── JacobiSVD_LAPACKE.h │ │ │ ├── SVDBase.h │ │ │ └── UpperBidiagonalization.h │ │ │ ├── SparseCholesky │ │ │ ├── SimplicialCholesky.h │ │ │ └── SimplicialCholesky_impl.h │ │ │ ├── SparseCore │ │ │ ├── AmbiVector.h │ │ │ ├── CompressedStorage.h │ │ │ ├── ConservativeSparseSparseProduct.h │ │ │ ├── MappedSparseMatrix.h │ │ │ ├── SparseAssign.h │ │ │ ├── SparseBlock.h │ │ │ ├── SparseColEtree.h │ │ │ ├── SparseCompressedBase.h │ │ │ ├── SparseCwiseBinaryOp.h │ │ │ ├── SparseCwiseUnaryOp.h │ │ │ ├── SparseDenseProduct.h │ │ │ ├── SparseDiagonalProduct.h │ │ │ ├── SparseDot.h │ │ │ ├── SparseFuzzy.h │ │ │ ├── SparseMap.h │ │ │ ├── SparseMatrix.h │ │ │ ├── SparseMatrixBase.h │ │ │ ├── SparsePermutation.h │ │ │ ├── SparseProduct.h │ │ │ ├── SparseRedux.h │ │ │ ├── SparseRef.h │ │ │ ├── SparseSelfAdjointView.h │ │ │ ├── SparseSolverBase.h │ │ │ ├── SparseSparseProductWithPruning.h │ │ │ ├── SparseTranspose.h │ │ │ ├── SparseTriangularView.h │ │ │ ├── SparseUtil.h │ │ │ ├── SparseVector.h │ │ │ ├── SparseView.h │ │ │ └── TriangularSolver.h │ │ │ ├── SparseLU │ │ │ ├── SparseLU.h │ │ │ ├── SparseLUImpl.h │ │ │ ├── SparseLU_Memory.h │ │ │ ├── SparseLU_Structs.h │ │ │ ├── SparseLU_SupernodalMatrix.h │ │ │ ├── SparseLU_Utils.h │ │ │ ├── SparseLU_column_bmod.h │ │ │ ├── SparseLU_column_dfs.h │ │ │ ├── SparseLU_copy_to_ucol.h │ │ │ ├── SparseLU_gemm_kernel.h │ │ │ ├── SparseLU_heap_relax_snode.h │ │ │ ├── SparseLU_kernel_bmod.h │ │ │ ├── SparseLU_panel_bmod.h │ │ │ ├── SparseLU_panel_dfs.h │ │ │ ├── SparseLU_pivotL.h │ │ │ ├── SparseLU_pruneL.h │ │ │ └── SparseLU_relax_snode.h │ │ │ ├── SparseQR │ │ │ └── SparseQR.h │ │ │ ├── StlSupport │ │ │ ├── StdDeque.h │ │ │ ├── StdList.h │ │ │ ├── StdVector.h │ │ │ └── details.h │ │ │ ├── SuperLUSupport │ │ │ └── SuperLUSupport.h │ │ │ ├── UmfPackSupport │ │ │ └── UmfPackSupport.h │ │ │ ├── misc │ │ │ ├── Image.h │ │ │ ├── Kernel.h │ │ │ ├── RealSvd2x2.h │ │ │ ├── blas.h │ │ │ ├── lapack.h │ │ │ ├── lapacke.h │ │ │ └── lapacke_mangling.h │ │ │ └── plugins │ │ │ ├── ArrayCwiseBinaryOps.h │ │ │ ├── ArrayCwiseUnaryOps.h │ │ │ ├── BlockMethods.h │ │ │ ├── CommonCwiseBinaryOps.h │ │ │ ├── CommonCwiseUnaryOps.h │ │ │ ├── MatrixCwiseBinaryOps.h │ │ │ └── MatrixCwiseUnaryOps.h │ ├── signature_of_eigen3_matrix_library │ └── unsupported │ │ └── Eigen │ │ ├── AdolcForward │ │ ├── AlignedVector3 │ │ ├── ArpackSupport │ │ ├── AutoDiff │ │ ├── BVH │ │ ├── CXX11 │ │ ├── Tensor │ │ ├── TensorSymmetry │ │ ├── ThreadPool │ │ └── src │ │ │ ├── Tensor │ │ │ ├── Tensor.h │ │ │ ├── TensorArgMax.h │ │ │ ├── TensorAssign.h │ │ │ ├── TensorBase.h │ │ │ ├── TensorBroadcasting.h │ │ │ ├── TensorChipping.h │ │ │ ├── TensorConcatenation.h │ │ │ ├── TensorContraction.h │ │ │ ├── TensorContractionBlocking.h │ │ │ ├── TensorContractionCuda.h │ │ │ ├── TensorContractionMapper.h │ │ │ ├── TensorContractionThreadPool.h │ │ │ ├── TensorConversion.h │ │ │ ├── TensorConvolution.h │ │ │ ├── TensorCostModel.h │ │ │ ├── TensorCustomOp.h │ │ │ ├── TensorDevice.h │ │ │ ├── TensorDeviceCuda.h │ │ │ ├── TensorDeviceDefault.h │ │ │ ├── TensorDeviceSycl.h │ │ │ ├── TensorDeviceThreadPool.h │ │ │ ├── TensorDimensionList.h │ │ │ ├── TensorDimensions.h │ │ │ ├── TensorEvalTo.h │ │ │ ├── TensorEvaluator.h │ │ │ ├── TensorExecutor.h │ │ │ ├── TensorExpr.h │ │ │ ├── TensorFFT.h │ │ │ ├── TensorFixedSize.h │ │ │ ├── TensorForcedEval.h │ │ │ ├── TensorForwardDeclarations.h │ │ │ ├── TensorFunctors.h │ │ │ ├── TensorGenerator.h │ │ │ ├── TensorGlobalFunctions.h │ │ │ ├── TensorIO.h │ │ │ ├── TensorImagePatch.h │ │ │ ├── TensorIndexList.h │ │ │ ├── TensorInflation.h │ │ │ ├── TensorInitializer.h │ │ │ ├── TensorIntDiv.h │ │ │ ├── TensorLayoutSwap.h │ │ │ ├── TensorMacros.h │ │ │ ├── TensorMap.h │ │ │ ├── TensorMeta.h │ │ │ ├── TensorMorphing.h │ │ │ ├── TensorPadding.h │ │ │ ├── TensorPatch.h │ │ │ ├── TensorRandom.h │ │ │ ├── TensorReduction.h │ │ │ ├── TensorReductionCuda.h │ │ │ ├── TensorReductionSycl.h │ │ │ ├── TensorRef.h │ │ │ ├── TensorReverse.h │ │ │ ├── TensorScan.h │ │ │ ├── TensorShuffling.h │ │ │ ├── TensorStorage.h │ │ │ ├── TensorStriding.h │ │ │ ├── TensorSycl.h │ │ │ ├── TensorSyclConvertToDeviceExpression.h │ │ │ ├── TensorSyclExprConstructor.h │ │ │ ├── TensorSyclExtractAccessor.h │ │ │ ├── TensorSyclExtractFunctors.h │ │ │ ├── TensorSyclLeafCount.h │ │ │ ├── TensorSyclPlaceHolderExpr.h │ │ │ ├── TensorSyclRun.h │ │ │ ├── TensorSyclTuple.h │ │ │ ├── TensorTraits.h │ │ │ ├── TensorUInt128.h │ │ │ └── TensorVolumePatch.h │ │ │ ├── TensorSymmetry │ │ │ ├── DynamicSymmetry.h │ │ │ ├── StaticSymmetry.h │ │ │ ├── Symmetry.h │ │ │ └── util │ │ │ │ └── TemplateGroupTheory.h │ │ │ ├── ThreadPool │ │ │ ├── EventCount.h │ │ │ ├── NonBlockingThreadPool.h │ │ │ ├── RunQueue.h │ │ │ ├── SimpleThreadPool.h │ │ │ ├── ThreadEnvironment.h │ │ │ ├── ThreadLocal.h │ │ │ ├── ThreadPoolInterface.h │ │ │ └── ThreadYield.h │ │ │ └── util │ │ │ ├── CXX11Meta.h │ │ │ ├── CXX11Workarounds.h │ │ │ ├── EmulateArray.h │ │ │ ├── EmulateCXX11Meta.h │ │ │ └── MaxSizeVector.h │ │ ├── EulerAngles │ │ ├── FFT │ │ ├── IterativeSolvers │ │ ├── KroneckerProduct │ │ ├── LevenbergMarquardt │ │ ├── MPRealSupport │ │ ├── MatrixFunctions │ │ ├── MoreVectorization │ │ ├── NonLinearOptimization │ │ ├── NumericalDiff │ │ ├── OpenGLSupport │ │ ├── Polynomials │ │ ├── Skyline │ │ ├── SparseExtra │ │ ├── SpecialFunctions │ │ ├── Splines │ │ └── src │ │ ├── AutoDiff │ │ ├── AutoDiffJacobian.h │ │ ├── AutoDiffScalar.h │ │ └── AutoDiffVector.h │ │ ├── BVH │ │ ├── BVAlgorithms.h │ │ └── KdBVH.h │ │ ├── Eigenvalues │ │ └── ArpackSelfAdjointEigenSolver.h │ │ ├── EulerAngles │ │ ├── EulerAngles.h │ │ └── EulerSystem.h │ │ ├── FFT │ │ ├── ei_fftw_impl.h │ │ └── ei_kissfft_impl.h │ │ ├── IterativeSolvers │ │ ├── ConstrainedConjGrad.h │ │ ├── DGMRES.h │ │ ├── GMRES.h │ │ ├── IncompleteLU.h │ │ ├── IterationController.h │ │ ├── MINRES.h │ │ └── Scaling.h │ │ ├── KroneckerProduct │ │ └── KroneckerTensorProduct.h │ │ ├── LevenbergMarquardt │ │ ├── LMcovar.h │ │ ├── LMonestep.h │ │ ├── LMpar.h │ │ ├── LMqrsolv.h │ │ └── LevenbergMarquardt.h │ │ ├── MatrixFunctions │ │ ├── MatrixExponential.h │ │ ├── MatrixFunction.h │ │ ├── MatrixLogarithm.h │ │ ├── MatrixPower.h │ │ ├── MatrixSquareRoot.h │ │ └── StemFunction.h │ │ ├── MoreVectorization │ │ └── MathFunctions.h │ │ ├── NonLinearOptimization │ │ ├── HybridNonLinearSolver.h │ │ ├── LevenbergMarquardt.h │ │ ├── chkder.h │ │ ├── covar.h │ │ ├── dogleg.h │ │ ├── fdjac1.h │ │ ├── lmpar.h │ │ ├── qrsolv.h │ │ ├── r1mpyq.h │ │ ├── r1updt.h │ │ └── rwupdt.h │ │ ├── NumericalDiff │ │ └── NumericalDiff.h │ │ ├── Polynomials │ │ ├── Companion.h │ │ ├── PolynomialSolver.h │ │ └── PolynomialUtils.h │ │ ├── Skyline │ │ ├── SkylineInplaceLU.h │ │ ├── SkylineMatrix.h │ │ ├── SkylineMatrixBase.h │ │ ├── SkylineProduct.h │ │ ├── SkylineStorage.h │ │ └── SkylineUtil.h │ │ ├── SparseExtra │ │ ├── BlockOfDynamicSparseMatrix.h │ │ ├── BlockSparseMatrix.h │ │ ├── DynamicSparseMatrix.h │ │ ├── MarketIO.h │ │ ├── MatrixMarketIterator.h │ │ └── RandomSetter.h │ │ ├── SpecialFunctions │ │ ├── SpecialFunctionsArrayAPI.h │ │ ├── SpecialFunctionsFunctors.h │ │ ├── SpecialFunctionsHalf.h │ │ ├── SpecialFunctionsImpl.h │ │ ├── SpecialFunctionsPacketMath.h │ │ └── arch │ │ │ └── CUDA │ │ │ └── CudaSpecialFunctions.h │ │ └── Splines │ │ ├── Spline.h │ │ ├── SplineFitting.h │ │ └── SplineFwd.h ├── ezETAProgressBar.hpp ├── fastapprox.h ├── format.h ├── httplib.hpp ├── jellyfish │ ├── int128.hpp │ ├── mer_dna.hpp │ └── misc.hpp ├── json.hpp ├── kseq++.hpp ├── kseq.h ├── lightweightsemaphore.h ├── make_unique.hpp ├── nonstd │ ├── optional.hpp │ └── string_view.hpp ├── parallel_hashmap │ ├── btree.h │ ├── conanfile.py │ ├── meminfo.h │ ├── phmap.h │ ├── phmap_base.h │ ├── phmap_bits.h │ ├── phmap_config.h │ ├── phmap_dump.h │ ├── phmap_fwd_decl.h │ └── phmap_utils.h ├── pcg_extras.hpp ├── pcg_random.hpp ├── peglib.h ├── posix.h ├── radicl │ ├── BasicBinWriter.hpp │ └── RADHeader.hpp ├── readerwriterqueue.h ├── spdlog │ ├── async_logger.h │ ├── common.h │ ├── details │ │ ├── async_log_helper.h │ │ ├── async_logger_impl.h │ │ ├── file_helper.h │ │ ├── log_msg.h │ │ ├── logger_impl.h │ │ ├── mpmc_bounded_q.h │ │ ├── null_mutex.h │ │ ├── os.h │ │ ├── pattern_formatter_impl.h │ │ ├── registry.h │ │ └── spdlog_impl.h │ ├── fmt │ │ ├── bundled │ │ │ ├── container.h │ │ │ ├── format.cc │ │ │ ├── format.h │ │ │ ├── ostream.cc │ │ │ ├── ostream.h │ │ │ ├── posix.cc │ │ │ ├── posix.h │ │ │ ├── printf.cc │ │ │ ├── printf.h │ │ │ ├── string.h │ │ │ └── time.h │ │ ├── fmt.h │ │ └── ostr.h │ ├── formatter.h │ ├── logger.h │ ├── sinks │ │ ├── android_sink.h │ │ ├── ansicolor_sink.h │ │ ├── base_sink.h │ │ ├── dist_sink.h │ │ ├── file_sinks.h │ │ ├── msvc_sink.h │ │ ├── null_sink.h │ │ ├── ostream_sink.h │ │ ├── sink.h │ │ ├── stdout_sinks.h │ │ ├── syslog_sink.h │ │ ├── wincolor_sink.h │ │ └── windebug_sink.h │ ├── spdlog.h │ └── tweakme.h ├── spline.h ├── strict_fstream.hpp ├── stx │ ├── any.hpp │ ├── optional.hpp │ ├── string_view.hpp │ └── variant.hpp ├── xxhash.h └── zstr.hpp ├── sample_data.tgz ├── scripts ├── AddHeaders.sh ├── ComputeMutationRate.py ├── ConvertBootstrapsToTSV.py ├── Dockerfile ├── MutateReference.py ├── build_docker_binary.sh ├── bump_version.sh ├── check_shasum.sh ├── compile.sh ├── cpld.bash ├── fetchPufferfish.sh ├── fetchRapMap.sh ├── lint.sh ├── make-release.sh ├── merge_into_develop.sh ├── merge_into_master.sh ├── push-binary.sh ├── runner.sh ├── test_sim_corr.py └── v1_10x │ ├── run.sh │ └── wrapper.cpp ├── src ├── Alevin.cpp ├── AlevinHash.cpp ├── AlevinUtils.cpp ├── AlignmentCommon.cpp ├── AlignmentModel.cpp ├── BAMUtils.cpp ├── BuildSalmonIndex.cpp ├── CMakeLists.txt ├── CollapsedCellOptimizer.cpp ├── CollapsedEMOptimizer.cpp ├── CollapsedGibbsSampler.cpp ├── DedupUMI.cpp ├── DistributionUtils.cpp ├── EMUtils.cpp ├── EffectiveLengthStats.cpp ├── FASTAParser.cpp ├── FastxParser.cpp ├── FragmentLengthDistribution.cpp ├── FragmentList.cpp ├── FragmentStartPositionDistribution.cpp ├── GZipWriter.cpp ├── GenomicFeature.cpp ├── Graph.cpp ├── LibraryFormat.cpp ├── ONTAlignmentModel.cpp ├── PCA.cpp ├── PCAUtils.cpp ├── ProgramOptionsGenerator.cpp ├── SBModel.cpp ├── SGSmooth.cpp ├── Salmon.cpp ├── SalmonAlevin.cpp ├── SalmonExceptions.cpp ├── SalmonQuantMerge.cpp ├── SalmonQuantify.cpp ├── SalmonQuantifyAlignments.cpp ├── SalmonStringUtils.cpp ├── SalmonUtils.cpp ├── SequenceBiasModel.cpp ├── SimplePosBias.cpp ├── SingleCellProtocols.cpp ├── StadenUtils.cpp ├── TestUtils.cpp ├── TranscriptGroup.cpp ├── VersionChecker.cpp ├── WhiteList.cpp ├── backtrace.cc ├── edlib.cpp ├── jellyfish │ └── mer_dna.cc ├── posix.cc └── xxhash.c └── tests ├── GCSampleTests.cpp ├── KmerHistTests.cpp ├── LibraryTypeTests.cpp ├── README.md ├── UnitTests.cpp ├── alevin_test_data.tar.gz ├── basic_alevin_test.sh ├── catch.hpp ├── compile_tests └── int128_numeric_limits.cpp └── test_quant.nf /.cmakelintrc: -------------------------------------------------------------------------------- 1 | filter=-linelength 2 | -------------------------------------------------------------------------------- /.drone.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | setup: 3 | image: combinelab/hbb_salmon_build:latest 4 | commands: 5 | - echo "Starting build" 6 | - ./.drone/build.sh 7 | test_indexing: 8 | image: combinelab/hbb_salmon_build:latest 9 | commands: 10 | - echo "[Testing quant]" 11 | - ./.drone/test_quant.sh 12 | volumes: 13 | - /mnt/scratch6/avi/data:/mnt/data 14 | - /mnt/scratch6/salmon_ci:/mnt/ci_res 15 | copy_build: 16 | image: combinelab/hbb_salmon_build:latest 17 | commands: 18 | - echo "[Packaging binary]" 19 | - ./.drone/copy_build.sh 20 | volumes: 21 | - /mnt/scratch6/avi/data:/mnt/data 22 | - /mnt/scratch6/salmon_ci:/mnt/ci_res 23 | -------------------------------------------------------------------------------- /.drone.yml.sig: -------------------------------------------------------------------------------- 1 | eyJhbGciOiJIUzI1NiJ9.IHBpcGVsaW5lOgogIHNldHVwOgogICBpbWFnZTogaGJiOnNhbG1vbl9idWlsZAogICBjb21tYW5kczoKICAgIC0gZWNobyAiU3RhcnRpbmcgYnVpbGQiCiAgICAtIC4vLmRyb25lL2J1aWxkLnNoCiAgdGVzdF9pbmRleGluZzoKICAgaW1hZ2U6IGhiYjpzYWxtb25fYnVpbGQKICAgY29tbWFuZHM6CiAgICAtIGVjaG8gIltUZXN0aW5nIHF1YW50XSIKICAgIC0gLi8uZHJvbmUvdGVzdF9xdWFudC5zaCAKICAgdm9sdW1lczoKICAgIC0gL21udC9zY3JhdGNoNi9hdmkvZGF0YTovbW50L2RhdGEKICAgIC0gL21udC9zY3JhdGNoNi9zYWxtb25fY2k6L21udC9jaV9yZXMKICBjb3B5X2J1aWxkOgogICAgaW1hZ2U6IGhiYjpzYWxtb25fYnVpbGQKICAgIGNvbW1hbmRzOgogICAgIC0gZWNobyAiW1BhY2thZ2luZyBiaW5hcnldIgogICAgIC0gLi8uZHJvbmUvY29weV9idWlsZC5zaAogICAgdm9sdW1lczoKICAgICAtIC9tbnQvc2NyYXRjaDYvYXZpL2RhdGE6L21udC9kYXRhCiAgICAgLSAvbW50L3NjcmF0Y2g2L3NhbG1vbl9jaTovbW50L2NpX3JlcwogIG5vdGlmeV9naXR0ZXI6CiAgICBpbWFnZTogcGx1Z2lucy9naXR0ZXIKICAgIGNvbW1hbmRzOgogICAgIC0gZWNobyAiW05vdGlmeWluZyBnaXR0ZXJdIgo.kChHrx65f5Zt-QSX0Rb7idcN7cnZaQS9mmMDPBi3RPE -------------------------------------------------------------------------------- /.drone/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source /hbb_shlib/activate 3 | 4 | set -e 5 | 6 | export CFLAGS="-g -O2 -I/hbb_shlib/include" 7 | export CXXFLAGS="-g -O2 -I/hbb_shlib/include" 8 | 9 | CPATH=`pwd` 10 | echo "[Drone build] current path : ${CPATH}" 11 | echo "[Drone build] making build directory" 12 | 13 | mkdir build 14 | cd build 15 | 16 | echo "[Drone build] cmake configuration" 17 | 18 | cmake -DDO_QUIET_MAKE=TRUE -DBOOST_ROOT=/usr -DNO_IPO=TRUE -DCMAKE_BUILD_TYPE=RELEASE .. 19 | 20 | echo "[Drone build] making salmon and installing locally (this could take a while)" 21 | 22 | make -j8 -s install 23 | -------------------------------------------------------------------------------- /.drone/copy_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source /hbb_exe/activate 3 | 4 | set -e 5 | 6 | cd scripts 7 | bash make-release.sh -v latest -n linux_x86_64 8 | cd ../RELEASES 9 | mkdir -p "/mnt/ci_res/${DRONE_REPO}/${DRONE_COMMIT_BRANCH}/build" 10 | cp *.tar.gz "/mnt/ci_res/${DRONE_REPO}/${DRONE_COMMIT_BRANCH}/build/" 11 | -------------------------------------------------------------------------------- /.drone/test_quant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source /hbb_exe/activate 3 | 4 | set -e 5 | 6 | CPATH=`pwd` 7 | echo "[Drone test] current path : ${CPATH}" 8 | SD=`ls -la ${CPATH}` 9 | echo "[subdirs] : ${SD}" 10 | echo "[Drone test] making quant test directory" 11 | 12 | export PATH=/root/miniconda2/bin:$PATH 13 | export PYTHONPATH=/root/miniconda2/lib/python2.7/site-packages 14 | 15 | echo "[Drone test] run nextflow pipeline" 16 | 17 | nextflow tests/test_quant.nf 18 | # store the nextflow return value 19 | nextflowret=$? 20 | if [ $nextflowret -ne 0 ]; then 21 | echo "[Drone test]: nextflow pipeline test_quant.nf failed!" 22 | exit 1 23 | fi 24 | 25 | echo "[Drone test] echoing quants here" 26 | grep "spearman" sim/*.json 27 | 28 | mkdir -p "/mnt/ci_res/${DRONE_REPO}/${DRONE_COMMIT_BRANCH}/${DRONE_COMMIT_SHA}/sim" 29 | cp sim/*.json "/mnt/ci_res/${DRONE_REPO}/${DRONE_COMMIT_BRANCH}/${DRONE_COMMIT_SHA}/sim/" 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Is the bug primarily related to salmon (bulk mode) or alevin (single-cell mode)?** 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps and data to reproduce the behavior: 14 | 15 | Specifically, please provide at least the following information: 16 | 17 | * Which version of salmon was used? 18 | * How was salmon installed (compiled, downloaded executable, through bioconda)? 19 | * Which reference (e.g. transcriptome) was used? 20 | * Which read files were used? 21 | * Which which program options were used? 22 | 23 | 24 | **Expected behavior** 25 | A clear and concise description of what you expected to happen. 26 | 27 | **Screenshots** 28 | If applicable, add screenshots or terminal output to help explain your problem. 29 | 30 | **Desktop (please complete the following information):** 31 | - OS: [e.g. Ubuntu Linux, OSX] 32 | - Version [ If you are on OSX, the output of `sw_vers`. If you are on linux the output of `uname -a` and `lsb_release -a`] 33 | 34 | **Additional context** 35 | Add any other context about the problem here. 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | 30 | # Emacs save files 31 | *~ 32 | -------------------------------------------------------------------------------- /.lgtm.yml: -------------------------------------------------------------------------------- 1 | path_classifiers: 2 | docs: 3 | # Identify the top-level file called `generate_javadoc.py` as documentation-related. 4 | - doc 5 | # The default behavior is to tag library code as `library`. Results are hidden 6 | # for library code. You can tag further files as being library code by adding them 7 | # to the `library` section. Test if we can have a list. 8 | library: 9 | - external 10 | - include/core 11 | - include/eigen3 12 | - include/jellyfish 13 | - include/nonstd 14 | - include/parallel_hashmap 15 | - include/spdlog 16 | - include/stx 17 | 18 | extraction: 19 | cpp: 20 | configure: 21 | command: 22 | - mkdir build 23 | - cd build 24 | - cmake -DFETCH_STADEN=TRUE .. 25 | index: 26 | build_command: 27 | - cd build 28 | - make 29 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | sudo: false 3 | git: 4 | depth: 1 5 | language: generic 6 | matrix: 7 | include: 8 | - env: CC=gcc-7 CXX=g++-7 AR=gcc-ar-7 NM=gcc-nm-7 RANLIB=gcc-ranlib-7 9 | - env: CC=gcc-5 CXX=g++-5 AR=gcc-ar-5 NM=gcc-nm-5 RANLIB=gcc-ranlib-5 10 | - language: python 11 | python: "3.6" 12 | name: Lint cmake files. 13 | install: pip3 install cmakelint 14 | script: scripts/lint.sh 15 | allow_failures: 16 | - name: Lint cmake files. 17 | fast_finish: true 18 | 19 | install: 20 | # https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test 21 | - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 22 | - sudo apt-get update -qq 23 | - sudo apt-get install -qq zlib1g-dev libbz2-dev cmake 24 | - | 25 | if [[ "${CC}" =~ gcc- ]]; then 26 | echo "Installing ${CC}." 27 | sudo apt-get install -qq "${CC}" 28 | fi 29 | - | 30 | if [[ "${CXX}" =~ g\+\+- ]]; then 31 | echo "Installing ${CXX}." 32 | sudo apt-get install -qq "${CXX}" 33 | fi 34 | 35 | before_script: 36 | - wget https://cmake.org/files/v3.15/cmake-3.15.2-Linux-x86_64.sh 37 | - sudo sh cmake-3.15.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir 38 | 39 | script: 40 | - PATH=/usr/local/bin:$PATH 41 | - LD_LIBRARY_PATH=${TRAVIS_BUILD_DIR}/lib:$LD_LIBRARY_PATH 42 | - mkdir build 43 | - pushd build 44 | # Set make -j N considering Travis providing 2 cores. 45 | # VERBOSE=1 to show the input commands in generatd Makefile for debug. 46 | - | 47 | cmake \ 48 | -DCMAKE_BUILD_TYPE=RELEASE \ 49 | -DFETCH_BOOST=TRUE \ 50 | -DNO_RTM=TRUE \ 51 | .. && \ 52 | make -j 4 VERBOSE=1 && \ 53 | make install && \ 54 | ./src/salmon -h 55 | - | 56 | make CTEST_OUTPUT_ON_FAILURE=1 VERBOSE=1 test 57 | - popd 58 | 59 | after_success: 60 | - ./scripts/push-binary.sh 61 | 62 | after_failure: 63 | - echo "Failure" 64 | - ls -laR $TRAVIS_BUILD_DIR/build/Testing/ 65 | - cat $TRAVIS_BUILD_DIR/build/Testing/Temporary/* 66 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing code 2 | 3 | Any code that you contribute will be licensed under the GPLv3-license adopted by salmon. However, by contributing 4 | code to this project, you also extend permission for your contribution to be re-licensed under the BSD 3-clause 5 | license (under which we anticipate Salmon will be released once existing GPL code can be removed). 6 | 7 | Code contributions should be made via pull requests. Please make all PRs to the _develop_ branch 8 | of the repository. PRs made to the _master_ branch may be rejected if they cannot be cleanly rebased 9 | on _develop_. Before you make a PR, please check that: 10 | 11 | * Your PR describes the purpose of your commit. Is it fixing a bug, adding functionality, etc.? 12 | * Commit messages have been made using [*conventional commits*](https://www.conventionalcommits.org/en/v1.0.0/) — please format all of your commit messages as such. 13 | * Any non-obvious code is documented (we don't yet have formal documentation guidelines yet, so use common sense) 14 | -------------------------------------------------------------------------------- /cmake/Modules/FindJellyfish.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Find Jellyfish 3 | # 4 | # This sets the following variables: 5 | # JELLYFISH_FOUND - True if Jellyfish was found. 6 | # JELLYFISH_INCLUDE_DIRS - Directories containing the Jellyfish include files. 7 | # JELLYFISH_DEFINITIONS - Compiler flags for Jellyfish. 8 | 9 | find_path(JELLYFISH_INCLUDE_DIR jellyfish 10 | HINTS "${JELLYFISH_ROOT}/include" "$ENV{JELLYFISH_ROOT}/include" "/usr/include" "$ENV{PROGRAMFILES}/jellyfish/include") 11 | 12 | set(JELLYFISH_INCLUDE_DIRS ${JELLYFISH_INCLUDE_DIR}) 13 | 14 | include(FindPackageHandleStandardArgs) 15 | #message("Required Jellyfish version ${Jellyfish_FIND_VERSION}") 16 | find_package_handle_standard_args(Jellyfish 17 | DEFAULT_MSG 18 | FOUND_VAR JELLYFISH_FOUND 19 | REQUIRED_VARS JELLYFISH_INCLUDE_DIR 20 | VERSION_VAR Jellyfish_FOUND_VERSION) 21 | 22 | mark_as_advanced(JELLYFISH_INCLUDE_DIR) 23 | 24 | if(JELLYFISH_FOUND) 25 | message(STATUS "Jellyfish found (include: ${JELLYFISH_INCLUDE_DIRS})") 26 | endif(JELLYFISH_FOUND) 27 | -------------------------------------------------------------------------------- /cmake/Modules/FindJemalloc.cmake: -------------------------------------------------------------------------------- 1 | # From: https://raw.githubusercontent.com/STEllAR-GROUP/hpx/master/cmake/FindJemalloc.cmake 2 | # Copyright (c) 2014 Thomas Heller 3 | # Copyright (c) 2007-2012 Hartmut Kaiser 4 | # Copyright (c) 2010-2011 Matt Anderson 5 | # Copyright (c) 2011 Bryce Lelbach 6 | # 7 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | 10 | find_package(PkgConfig) 11 | pkg_check_modules(PC_JEMALLOC QUIET libjemalloc) 12 | 13 | find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h 14 | HINTS 15 | ${JEMALLOC_ROOT} ENV JEMALLOC_ROOT 16 | ${PC_JEMALLOC_MINIMAL_INCLUDEDIR} 17 | ${PC_JEMALLOC_MINIMAL_INCLUDE_DIRS} 18 | ${PC_JEMALLOC_INCLUDEDIR} 19 | ${PC_JEMALLOC_INCLUDE_DIRS} 20 | PATH_SUFFIXES include) 21 | 22 | find_library(JEMALLOC_LIBRARY NAMES jemalloc libjemalloc 23 | HINTS 24 | ${JEMALLOC_ROOT} ENV JEMALLOC_ROOT 25 | ${PC_JEMALLOC_MINIMAL_LIBDIR} 26 | ${PC_JEMALLOC_MINIMAL_LIBRARY_DIRS} 27 | ${PC_JEMALLOC_LIBDIR} 28 | ${PC_JEMALLOC_LIBRARY_DIRS} 29 | PATH_SUFFIXES lib lib64) 30 | 31 | if(JEMALLOC_INCLUDE_DIR) 32 | set(_version_regex "^#define[ \t]+JEMALLOC_VERSION[ \t]+\"([^\"]+)\".*") 33 | file(STRINGS "${JEMALLOC_INCLUDE_DIR}/jemalloc/jemalloc.h" 34 | JEMALLOC_VERSION REGEX "${_version_regex}") 35 | string(REGEX REPLACE "${_version_regex}" "\\1" 36 | JEMALLOC_VERSION "${JEMALLOC_VERSION}") 37 | unset(_version_regex) 38 | endif() 39 | 40 | include(FindPackageHandleStandardArgs) 41 | # handle the QUIETLY and REQUIRED arguments and set JEMALLOC_FOUND to TRUE 42 | # if all listed variables are TRUE and the requested version matches. 43 | find_package_handle_standard_args(Jemalloc REQUIRED_VARS 44 | JEMALLOC_LIBRARY JEMALLOC_INCLUDE_DIR 45 | VERSION_VAR JEMALLOC_VERSION) 46 | 47 | 48 | if(JEMALLOC_FOUND) 49 | set(JEMALLOC_LIBRARIES ${JEMALLOC_LIBRARY}) 50 | set(JEMALLOC_INCLUDE_DIRS ${JEMALLOC_INCLUDE_DIR}) 51 | endif() 52 | 53 | mark_as_advanced(JEMALLOC_INCLUDE_DIR JEMALLOC_LIBRARY) 54 | -------------------------------------------------------------------------------- /cmake/Modules/FindTcmalloc.cmake: -------------------------------------------------------------------------------- 1 | # - Find Tcmalloc 2 | # Find the native Tcmalloc includes and library 3 | # 4 | # Tcmalloc_INCLUDE_DIR - where to find Tcmalloc.h, etc. 5 | # Tcmalloc_LIBRARIES - List of libraries when using Tcmalloc. 6 | # Tcmalloc_FOUND - True if Tcmalloc found. 7 | 8 | find_path(Tcmalloc_INCLUDE_DIR google/tcmalloc.h NO_DEFAULT_PATH PATHS 9 | ${HT_DEPENDENCY_INCLUDE_DIR} 10 | /usr/include 11 | /opt/local/include 12 | /usr/local/include 13 | ) 14 | 15 | if (USE_TCMALLOC) 16 | set(Tcmalloc_NAMES tcmalloc) 17 | else () 18 | set(Tcmalloc_NAMES tcmalloc_minimal tcmalloc) 19 | endif () 20 | 21 | find_library(Tcmalloc_LIBRARY NO_DEFAULT_PATH 22 | NAMES ${Tcmalloc_NAMES} 23 | PATHS ${HT_DEPENDENCY_LIB_DIR} /lib /usr/lib /usr/local/lib /opt/local/lib 24 | ) 25 | 26 | if (Tcmalloc_INCLUDE_DIR AND Tcmalloc_LIBRARY) 27 | set(Tcmalloc_FOUND TRUE) 28 | set( Tcmalloc_LIBRARIES ${Tcmalloc_LIBRARY} ) 29 | else () 30 | set(Tcmalloc_FOUND FALSE) 31 | set( Tcmalloc_LIBRARIES ) 32 | endif () 33 | 34 | if (Tcmalloc_FOUND) 35 | message(STATUS "Found Tcmalloc: ${Tcmalloc_LIBRARY}") 36 | else () 37 | message(STATUS "Not Found Tcmalloc: ${Tcmalloc_LIBRARY}") 38 | if (Tcmalloc_FIND_REQUIRED) 39 | message(STATUS "Looked for Tcmalloc libraries named ${Tcmalloc_NAMES}.") 40 | message(FATAL_ERROR "Could NOT find Tcmalloc library") 41 | endif () 42 | endif () 43 | 44 | mark_as_advanced( 45 | Tcmalloc_LIBRARY 46 | Tcmalloc_INCLUDE_DIR 47 | ) 48 | -------------------------------------------------------------------------------- /cmake/Modules/Findcereal.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Find Cereal 3 | # 4 | # This sets the following variables: 5 | # CEREAL_FOUND - True if Cereal was found. 6 | # CEREAL_INCLUDE_DIRS - Directories containing the Cereal include files. 7 | # CEREAL_DEFINITIONS - Compiler flags for Cereal. 8 | 9 | find_path(CEREAL_INCLUDE_DIR cereal 10 | HINTS "${CEREAL_ROOT}/include" "$ENV{CEREAL_ROOT}/include" "/usr/include" "$ENV{PROGRAMFILES}/cereal/include") 11 | 12 | set(CEREAL_INCLUDE_DIRS ${CEREAL_INCLUDE_DIR}) 13 | 14 | if(CEREAL_INCLUDE_DIR) 15 | set(CEREAL_FOUND YES) 16 | set(CEREAL_VERSION_MAJOR 0) 17 | set(CEREAL_VERSION_MINOR 0) 18 | set(CEREAL_VERSION_PATCH 0) 19 | if(EXISTS "${CEREAL_INCLUDE_DIR}/cereal/version.hpp") 20 | # Read and parse cereal version header file for version number 21 | file(READ "${CEREAL_INCLUDE_DIR}/cereal/version.hpp" 22 | _CEREAL_HEADER_CONTENTS) 23 | string(REGEX REPLACE ".*#define CEREAL_VERSION_MAJOR ([0-9]+).*" "\\1" 24 | CEREAL_VERSION_MAJOR "${_CEREAL_HEADER_CONTENTS}") 25 | string(REGEX REPLACE ".*#define CEREAL_VERSION_MINOR ([0-9]+).*" "\\1" 26 | CEREAL_VERSION_MINOR "${_CEREAL_HEADER_CONTENTS}") 27 | string(REGEX REPLACE ".*#define CEREAL_VERSION_PATCH ([0-9]+).*" "\\1" 28 | CEREAL_VERSION_PATCH "${_CEREAL_HEADER_CONTENTS}") 29 | set(CEREAL_VERSION_STRING "${CEREAL_VERSION_MAJOR}.${CEREAL_VERSION_MINOR}.${CEREAL_VERSION_PATCH}") 30 | else() 31 | set(CEREAL_FOUND NO) 32 | endif() 33 | endif() 34 | 35 | include(FindPackageHandleStandardArgs) 36 | find_package_handle_standard_args(cereal 37 | REQUIRED_VARS CEREAL_INCLUDE_DIR 38 | VERSION_VAR CEREAL_VERSION_STRING) 39 | 40 | mark_as_advanced(CEREAL_INCLUDE_DIR) 41 | 42 | if(CEREAL_FOUND) 43 | message(STATUS "cereal found (include: ${CEREAL_INCLUDE_DIRS})") 44 | endif(CEREAL_FOUND) 45 | -------------------------------------------------------------------------------- /cmake/Modules/Findlibdivsufsort.cmake: -------------------------------------------------------------------------------- 1 | 2 | find_path(SUFFARRAY_INCLUDE_DIR divsufsort64.h 3 | HINTS ${SUFFARRAY_ROOT} ENV SUFFARRAY_ROOT 4 | PATH_SUFFIXES include) 5 | 6 | find_library(SUFFARRAY_LIBRARY NAMES divsufsort divsufsort64 libdivsufsort libdivsufsort64 7 | HINTS ${SUFFARRAY_ROOT} ENV SUFFARRAY_ROOT PATH_SUFFIXES lib lib64) 8 | 9 | find_library(SUFFARRAY_LIBRARY64 NAMES divsufsort64 libdivsufsort64 10 | HINTS ${SUFFARRAY_ROOT} ENV SUFFARRAY_ROOT PATH_SUFFIXES lib lib64) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(libdivsufsort DEFAULT_MSG 14 | SUFFARRAY_LIBRARY 15 | SUFFARRAY_LIBRARY64 16 | SUFFARRAY_INCLUDE_DIR) 17 | 18 | mark_as_advanced(SUFFARRAY_INCLUDE_DIR SUFFARRAY_LIBRARY) 19 | -------------------------------------------------------------------------------- /cmake/Modules/Findlibgff.cmake: -------------------------------------------------------------------------------- 1 | 2 | find_path(GFF_INCLUDE_DIR gff.h 3 | HINTS ${GFF_ROOT} ENV GFF_ROOT 4 | PATH_SUFFIXES include) 5 | 6 | find_library(GFF_LIBRARY NAMES gff libgff 7 | HINTS ${GFF_ROOT} ENV GFF_ROOT PATH_SUFFIXES lib lib64) 8 | 9 | include(FindPackageHandleStandardArgs) 10 | find_package_handle_standard_args(libgff DEFAULT_MSG 11 | GFF_INCLUDE_DIR GFF_LIBRARY) 12 | 13 | mark_as_advanced(GFF_INCLUDE_DIR GFF_LIBRARY) 14 | -------------------------------------------------------------------------------- /cmake/Modules/Findlibstadenio.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Find Staden IOLib 3 | # 4 | # This sets the following variables: 5 | # STADEN_FOUND - True if Staden IOLib was found. 6 | # STADEN_INCLUDE_DIR - Header files. 7 | # STADEN_LIBRARIES - Staden IOLib library. 8 | 9 | find_path(STADEN_INCLUDE_DIR io_lib 10 | HINTS ${STADEN_ROOT} ENV STADEN_ROOT 11 | PATH_SUFFIXES include) 12 | 13 | find_library(STADEN_LIBRARY NAMES staden-read libstaden-read 14 | HINTS ${STADEN_ROOT} ENV STADEN_ROOT PATH_SUFFIXES lib lib64) 15 | 16 | find_library(HTSCODEC_LIBRARY NAMES htscodecs libhtscodecs 17 | HINTS ${STADEN_ROOT} ENV STADEN_ROOT PATH_SUFFIXES lib lib64) 18 | 19 | if(STADEN_INCLUDE_DIR) 20 | set(_version_regex "^#define[ \t]+PACKAGE_VERSION[ \t]+\"([^\"]+)\".*") 21 | file(STRINGS "${STADEN_INCLUDE_DIR}/io_lib/io_lib_config.h" 22 | STADEN_VERSION REGEX "${_version_regex}") 23 | string(REGEX REPLACE "${_version_regex}" "\\1" 24 | STADEN_VERSION "${STADEN_VERSION}") 25 | unset(_version_regex) 26 | endif() 27 | 28 | include(FindPackageHandleStandardArgs) 29 | find_package_handle_standard_args(libstadenio DEFAULT_MSG 30 | STADEN_LIBRARY 31 | STADEN_INCLUDE_DIR 32 | STADEN_VERSION) 33 | 34 | if (LIBSTADENIO_FOUND) 35 | message(STATUS "Staden IOLib found (include: ${STADEN_INCLUDE_DIR})") 36 | set(STADEN_LIBRARIES "${STADEN_LIBRARY};${HTSCODEC_LIBRARY}") 37 | endif() 38 | 39 | mark_as_advanced(STADEN_INCLUDE_DIR STADEN_LIBRARY) 40 | -------------------------------------------------------------------------------- /cmake/PostInstall.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | # Print some post install messages for the user 3 | ## 4 | message("\n\n") 5 | message("Installation complete. Please ensure the following paths are set properly.") 6 | message("==========================================================================") 7 | #if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 8 | # message("Fixing library names with install_name_tool") 9 | # execute_process(COMMAND install_name_tool -add_rpath ${CMAKE_INSTALL_PREFIX}/bin ${CMAKE_INSTALL_PREFIX}/bin/salmon) 10 | # execute_process(COMMAND install_name_tool -add_rpath ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/bin/salmon) 11 | # execute_process(COMMAND install_name_tool -add_rpath @executable_path ${CMAKE_INSTALL_PREFIX}/bin/salmon) 12 | #endif() 13 | message("Please add ${CMAKE_INSTALL_PREFIX}/bin to your PATH") 14 | if ("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") 15 | message("Please add ${CMAKE_INSTALL_PREFIX}/lib to your DYLD_FALLBACK_LIBRARY_PATH") 16 | else() 17 | message("Please add ${CMAKE_INSTALL_PREFIX}/lib to your LD_LIBRARY_PATH") 18 | endif() 19 | message("==========================================================================") 20 | -------------------------------------------------------------------------------- /cmake/SimpleTest.cmake: -------------------------------------------------------------------------------- 1 | execute_process(COMMAND tar xzvf sample_data.tgz 2 | WORKING_DIRECTORY ${TOPLEVEL_DIR} 3 | RESULT_VARIABLE TAR_RESULT 4 | ) 5 | 6 | if (TAR_RESULT) 7 | message(FATAL_ERROR "Error untarring sample_data.tgz") 8 | endif() 9 | 10 | set(INDEX_CMD ${TOPLEVEL_DIR}/build/src/sailfish --no-version-check index -t transcripts.fasta -k 20 -o sample_index --force) 11 | execute_process(COMMAND ${INDEX_CMD} 12 | WORKING_DIRECTORY ${TOPLEVEL_DIR}/sample_data 13 | RESULT_VARIABLE INDEX_RESULT 14 | ) 15 | 16 | if (INDEX_RESULT) 17 | message(FATAL_ERROR "Error running ${INDEX_COMMAND}") 18 | endif() 19 | 20 | set(QUANT_COMMAND ${TOPLEVEL_DIR}/build/src/sailfish --no-version-check quant -i sample_index --noBiasCorrect -l IU -1 reads_1.fastq -2 reads_2.fastq -o sample_quant) 21 | execute_process(COMMAND ${QUANT_COMMAND} 22 | WORKING_DIRECTORY ${TOPLEVEL_DIR}/sample_data 23 | RESULT_VARIABLE QUANT_RESULT 24 | ) 25 | if (QUANT_RESULT) 26 | message(FATAL_ERROR "Error running ${QUANT_RESULT}") 27 | endif() 28 | 29 | if (EXISTS ${TOPLEVEL_DIR}/sample_data/sample_quant/quant.sf) 30 | message("Sailfish ran successfully") 31 | else() 32 | message(FATAL_ERROR "Sailfish failed to produce output") 33 | endif() 34 | 35 | 36 | -------------------------------------------------------------------------------- /cmake/TestSalmonFMD.cmake: -------------------------------------------------------------------------------- 1 | execute_process(COMMAND tar xzvf sample_data.tgz 2 | WORKING_DIRECTORY ${TOPLEVEL_DIR} 3 | RESULT_VARIABLE TAR_RESULT 4 | ) 5 | 6 | if (TAR_RESULT) 7 | message(FATAL_ERROR "Error untarring sample_data.tgz") 8 | endif() 9 | 10 | set(SALMON_FMD_INDEX_CMD ${CMAKE_BINARY_DIR}/salmon index -t transcripts.fasta -i sample_salmon_fmd_index --type fmd) 11 | execute_process(COMMAND ${SALMON_FMD_INDEX_CMD} 12 | WORKING_DIRECTORY ${TOPLEVEL_DIR}/sample_data 13 | RESULT_VARIABLE SALMON_FMD_INDEX_RESULT 14 | ) 15 | 16 | if (SALMON_FMD_INDEX_RESULT) 17 | message(FATAL_ERROR "Error running ${SALMON_FMD_INDEX_COMMAND}") 18 | endif() 19 | 20 | set(SALMON_QUANT_COMMAND ${CMAKE_BINARY_DIR}/salmon quant -i sample_salmon_fmd_index -l IU -1 reads_1.fastq -2 reads_2.fastq -o sample_salmon_fmd_quant) 21 | execute_process(COMMAND ${SALMON_QUANT_COMMAND} 22 | WORKING_DIRECTORY ${TOPLEVEL_DIR}/sample_data 23 | RESULT_VARIABLE SALMON_FMD_QUANT_RESULT 24 | ) 25 | if (SALMON_FMD_QUANT_RESULT) 26 | message(FATAL_ERROR "Error running ${SALMON_FMD_QUANT_RESULT}") 27 | endif() 28 | 29 | if (EXISTS ${TOPLEVEL_DIR}/sample_data/sample_salmon_fmd_quant/quant.sf) 30 | message("Salmon (read) ran successfully") 31 | else() 32 | message(FATAL_ERROR "Salmon (read --- fmd-index) failed to produce output") 33 | endif() 34 | -------------------------------------------------------------------------------- /cmake/TestSalmonQuasi.cmake: -------------------------------------------------------------------------------- 1 | execute_process(COMMAND tar xzvf sample_data.tgz 2 | WORKING_DIRECTORY ${TOPLEVEL_DIR} 3 | RESULT_VARIABLE TAR_RESULT 4 | ) 5 | 6 | if (TAR_RESULT) 7 | message(FATAL_ERROR "Error untarring sample_data.tgz") 8 | endif() 9 | 10 | set(SALMON_QUASI_INDEX_CMD ${CMAKE_BINARY_DIR}/salmon index -t transcripts.fasta -i sample_salmon_quasi_index) 11 | execute_process(COMMAND ${SALMON_QUASI_INDEX_CMD} 12 | WORKING_DIRECTORY ${TOPLEVEL_DIR}/sample_data 13 | RESULT_VARIABLE SALMON_QUASI_INDEX_RESULT 14 | ) 15 | 16 | if (SALMON_QUASI_INDEX_RESULT) 17 | message(FATAL_ERROR 18 | "While running: ${SALMON_QUASI_INDEX_CMD}\n" 19 | "error: ${SALMON_QUASI_INDEX_RESULT}" 20 | ) 21 | endif() 22 | 23 | set(SALMON_QUANT_COMMAND ${CMAKE_BINARY_DIR}/salmon quant -i sample_salmon_quasi_index -l IU -1 reads_1.fastq -2 reads_2.fastq -o sample_salmon_quasi_quant) 24 | execute_process(COMMAND ${SALMON_QUANT_COMMAND} 25 | WORKING_DIRECTORY ${TOPLEVEL_DIR}/sample_data 26 | RESULT_VARIABLE SALMON_QUASI_QUANT_RESULT 27 | ) 28 | if (SALMON_QUASI_QUANT_RESULT) 29 | message(FATAL_ERROR 30 | "While running: ${SALMON_QUANT_COMMAND}\n" 31 | "error: ${SALMON_QUASI_QUANT_RESULT}" 32 | ) 33 | endif() 34 | 35 | if (EXISTS ${TOPLEVEL_DIR}/sample_data/sample_salmon_quasi_quant/quant.sf) 36 | message("Salmon (read) ran successfully") 37 | else() 38 | message(FATAL_ERROR "Salmon (read --- quasi-index) failed to produce output") 39 | endif() 40 | -------------------------------------------------------------------------------- /cmake/UnitTests.cmake: -------------------------------------------------------------------------------- 1 | set(TEST_COMMAND ./unitTests) 2 | message(STATUS "For unit tests, will set working directory to ${TOPLEVEL_DIR}/tests") 3 | execute_process(COMMAND ${TEST_COMMAND} 4 | WORKING_DIRECTORY ${TOPLEVEL_DIR}/tests 5 | RESULT_VARIABLE UNIT_TEST_RESULT 6 | ) 7 | if (UNIT_TEST_RESULT) 8 | message(FATAL_ERROR "Error running ${UNIT_TEST_RESULT}") 9 | endif() 10 | 11 | 12 | -------------------------------------------------------------------------------- /current_version.txt: -------------------------------------------------------------------------------- 1 | VERSION_MAJOR 1 2 | VERSION_MINOR 10 3 | VERSION_PATCH 3 4 | -------------------------------------------------------------------------------- /doc/FileFormats.md: -------------------------------------------------------------------------------- 1 | Transcript Index Format 2 | ======================= 3 | 4 | The sorted list (array) is the structure used by our program 5 | to count the k-mers from the reads and it relies on a transcript 6 | index. The index is (currently) simply a sorted array containing 7 | all of the kmers, in encoded (uint64_t) numeric order, that were 8 | seen in the trancsripts. The file format is as follows 9 | 10 | ```` 11 | kmer_len[uint32_t] 12 | num_kmers[uint32_t] 13 | k_1[uint_64t] . . . k_{num_kmers}[uint64_t] 14 | ```` -------------------------------------------------------------------------------- /doc/license-header.txt: -------------------------------------------------------------------------------- 1 | /** 2 | >HEADER 3 | Copyright (c) 2013/2014 Rob Patro robp@cs.cmu.edu 4 | 5 | This file is part of the Sailfish suite. 6 | 7 | Sailfish is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | Sailfish is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Sailfish. If not, see . 19 |
. 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/steps_to_prepare_release.md: -------------------------------------------------------------------------------- 1 | # Steps to prepare a release of salmon 2 | ----- 3 | 4 | 1. Tag corresponding commit of pufferfish so that it can be stably pulled in for source builds. 5 | 2. Alter `fetchPufferfish.sh` to fetch the corresponding tagged version (and update the sha256 sum). 6 | 3. Bump salmon version in `include/SalmonConfig.hpp`, then rebuild and run the `bump_version.sh` script. 7 | 4. Ensure that everything builds cleanly on Linux (taken care of by CI) and OSX. 8 | 5. Merge the develop branch changes into master. 9 | 6. Tag the salmon release with a new version number. 10 | 7. Update the docker tag and build an image for docker hub. 11 | 8. Bump the Bioconda version and build a new Bioconda release. 12 | 9. Add release notes for the tagged master version. 13 | 10. Upload the pre-compiled linux binary (from the CI server) to GitHub. 14 | 11. Place a new version file on the website and update the old one. 15 | 12. (not technically part of release) Reset the relevant changes (steps 1,2) on the develop branch so they now point to a non-tagged pufferfish. 16 | -------------------------------------------------------------------------------- /docker/build_test.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | SALMON_VERSION=1.10.3 3 | TMPDIR=/mnt/scratch7/DELETE_ME_TEMP docker build --no-cache -t combinelab/salmon:${SALMON_VERSION} -t combinelab/salmon:latest . 4 | -------------------------------------------------------------------------------- /include/AlevinHash.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __ALEVIN_HASH_HPP__ 2 | #define __ALEVIN_HASH_HPP__ 3 | 4 | #include 5 | #include 6 | 7 | #include "spdlog/spdlog.h" 8 | 9 | #include "AlevinOpts.hpp" 10 | #include "AlevinUtils.hpp" 11 | #include "SingleCellProtocols.hpp" 12 | #include "GZipWriter.hpp" 13 | #include "TranscriptGroup.hpp" 14 | #include "CollapsedCellOptimizer.hpp" 15 | #include "BarcodeGroup.hpp" 16 | #include "SalmonIndex.hpp" 17 | 18 | namespace apt = alevin::protocols; 19 | namespace bfs = boost::filesystem; 20 | 21 | template 22 | void alevinOptimize( std::vector& trueBarcodesVec, 23 | spp::sparse_hash_map& txpToGeneMap, 24 | spp::sparse_hash_map& geneIdxMap, 25 | EqMapT& fullEqMap, 26 | AlevinOpts& aopt, 27 | GZipWriter& gzw, 28 | CFreqMapT& freqCounter, 29 | size_t numLowConfidentBarcode); 30 | 31 | template 32 | int salmonHashQuantify(AlevinOpts& aopt, 33 | bfs::path& outputDirectory, 34 | CFreqMapT& freqCounter); 35 | #endif // __ALEVIN_HASH_HPP__ 36 | -------------------------------------------------------------------------------- /include/AlevinTypes.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __ALEVIN_TYPES_HPP__ 2 | #define __ALEVIN_TYPES_HPP__ 3 | 4 | #include "pufferfish/Kmer.hpp" 5 | 6 | namespace alevin { 7 | namespace types { 8 | 9 | using AlevinUMIKmer = combinelib::kmers::Kmer<32,2>; 10 | // Can only hold the barcode if it's <= 32 nucleotides 11 | using AlevinCellBarcodeKmer = combinelib::kmers::Kmer<32,5>; 12 | 13 | } 14 | } 15 | 16 | #endif//__ALEVIN_TYPES_HPP__ 17 | 18 | -------------------------------------------------------------------------------- /include/BAMUtils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __SALMON_BAM_UTILS__ 2 | #define __SALMON_BAM_UTILS__ 3 | 4 | extern "C" { 5 | #include "io_lib/os.h" 6 | #include "io_lib/scram.h" 7 | #undef max 8 | #undef min 9 | } 10 | 11 | #include 12 | #include 13 | 14 | namespace salmon { 15 | namespace bam_utils { 16 | 17 | enum class AlignerDetails : uint8_t 18 | { 19 | BOWTIE2=1, // a standard bowtie 2 configuration 20 | BOWTIE2_LOCAL, // using --local flag 21 | STAR, // STAR aligner 22 | BWA_MEM, // BWA-MEM aligner 23 | MINIMAP2, // minimap2 aligner 24 | RAPMAP, // rapmap aligner/mapper 25 | PUFFERFISH, // pufferfish / puffalign aligner 26 | UNKNOWN 27 | }; 28 | 29 | std::string to_string(AlignerDetails a); 30 | AlignerDetails inferAlignerFromHeader(SAM_hdr* header); 31 | } 32 | } 33 | 34 | #endif // __SALMON_BAM_UTILS__ 35 | -------------------------------------------------------------------------------- /include/BarcodeGroup.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BARCODE_GROUP_HPP 2 | #define BARCODE_GROUP_HPP 3 | 4 | #include 5 | #include "xxhash.h" 6 | #include "metro/metrohash.h" 7 | #include "tsl/array_map.h" 8 | 9 | struct BarcodeGroupStringHasher { 10 | std::size_t operator()(const std::string& k) const { 11 | char* pt = const_cast(k.data()); 12 | return XXH64(static_cast(pt), k.size() * sizeof(char), 0); 13 | } 14 | }; 15 | 16 | struct BarcodeGroupStringHasherMetro { 17 | std::size_t operator()(const char* key, std::size_t key_size) const { 18 | std::size_t r; 19 | MetroHash64::Hash(reinterpret_cast(key), key_size, reinterpret_cast(&r), 0); 20 | return r; 21 | } 22 | }; 23 | 24 | //using CFreqMapT = libcuckoo::cuckoohash_map; 25 | using CFreqMapT = tsl::array_map; 26 | 27 | using MapT = std::vector>; 28 | using TrueBcsT = std::unordered_set; 29 | using TrueMapT = std::unordered_map; 30 | using SoftMapT = std::unordered_map; 31 | 32 | #endif // BARCODE_GROUP_HPP 33 | -------------------------------------------------------------------------------- /include/BiasParams.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __BIAS_PARAMS__ 2 | #define __BIAS_PARAMS__ 3 | 4 | #include "DistributionUtils.hpp" 5 | #include "GCFragModel.hpp" 6 | #include "ReadKmerDist.hpp" 7 | #include "SBModel.hpp" 8 | #include "SalmonMath.hpp" 9 | #include "SimplePosBias.hpp" 10 | #include 11 | 12 | struct BiasParams { 13 | double massFwd{salmon::math::LOG_0}; 14 | double massRC{salmon::math::LOG_0}; 15 | 16 | /** 17 | * Positional bias 18 | **/ 19 | std::vector posBiasFW; 20 | std::vector posBiasRC; 21 | 22 | /** 23 | * fragment-GC bias counts 24 | **/ 25 | // std::vector observedGCMass = std::vector(101, 26 | // salmon::math::LOG_0); 27 | GCFragModel observedGCMass; 28 | 29 | ReadKmerDist<8, uint32_t> seqBiasFW; 30 | ReadKmerDist<8, uint32_t> seqBiasRC; 31 | 32 | /** 33 | * Sequence-specific bias models 34 | **/ 35 | SBModel seqBiasModelFW; 36 | SBModel seqBiasModelRC; 37 | 38 | BiasParams(size_t numCondBins = 3, size_t numGCBins = 101, 39 | bool seqBiasPseudocount = false) 40 | : seqBiasFW(seqBiasPseudocount), seqBiasRC(seqBiasPseudocount), 41 | posBiasFW(5), posBiasRC(5), observedGCMass(numCondBins, numGCBins) {} 42 | }; 43 | 44 | #endif //__GC_BIAS_PARAMS__ 45 | -------------------------------------------------------------------------------- /include/BootstrapWriter.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __BOOTSTRAP_WRITER_HPP__ 2 | #define __BOOTSTRAP_WRITER_HPP__ 3 | 4 | #include 5 | #include 6 | 7 | class BootstrapWriter { 8 | public: 9 | virtual ~BootstrapWriter() {} 10 | virtual bool writeHeader(std::string& comments, 11 | std::vector& transcripts) = 0; 12 | virtual bool writeBootstrap(std::vector& abund) = 0; 13 | }; 14 | 15 | #endif // __BOOTSTRAP_WRITER_HPP__ 16 | -------------------------------------------------------------------------------- /include/CollapsedEMOptimizer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef COLLAPSED_EM_OPTIMIZER_HPP 2 | #define COLLAPSED_EM_OPTIMIZER_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "ReadExperiment.hpp" 9 | #include "SalmonOpts.hpp" 10 | 11 | #include "Eigen/Dense" 12 | #include "cuckoohash_map.hh" 13 | 14 | class BootstrapWriter; 15 | 16 | class CollapsedEMOptimizer { 17 | public: 18 | using VecType = std::vector>; 19 | using SerialVecType = std::vector; 20 | CollapsedEMOptimizer(); 21 | 22 | template 23 | bool optimize( 24 | ExpT& readExp, SalmonOpts& sopt, 25 | double tolerance = 26 | 0.01, // A EM termination criteria, adopted from Bray et al. 2016 27 | uint32_t maxIter = 28 | 1000); // A EM termination criteria, adopted from Bray et al. 2016 29 | 30 | template 31 | bool gatherBootstraps( 32 | ExpT& readExp, SalmonOpts& sopt, 33 | std::function&)>& writeBootstrap, 34 | double relDiffTolerance, uint32_t maxIter); 35 | }; 36 | 37 | #endif // COLLAPSED_EM_OPTIMIZER_HPP 38 | -------------------------------------------------------------------------------- /include/CollapsedGibbsSampler.hpp: -------------------------------------------------------------------------------- 1 | #ifndef COLLAPSED_GIBBS_SAMPLER_HPP 2 | #define COLLAPSED_GIBBS_SAMPLER_HPP 3 | 4 | #include 5 | #include 6 | #include "SalmonOpts.hpp" 7 | 8 | #include "Eigen/Dense" 9 | #include "cuckoohash_map.hh" 10 | 11 | class BootstrapWriter; 12 | 13 | class CollapsedGibbsSampler { 14 | public: 15 | using VecType = std::vector; 16 | CollapsedGibbsSampler(); 17 | 18 | template 19 | bool sample(ExpT& readExp, SalmonOpts& sopt, 20 | std::function&)>& writeBootstrap, 21 | uint32_t numSamples = 500); 22 | 23 | /* 24 | template 25 | bool sampleMultipleChains(ExpT& readExp, 26 | SalmonOpts& sopt, 27 | std::function&)>& writeBootstrap, 28 | uint32_t numSamples = 500); 29 | */ 30 | }; 31 | 32 | #endif // COLLAPSED_EM_OPTIMIZER_HPP 33 | -------------------------------------------------------------------------------- /include/CommonTypes.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | >HEADER 3 | Copyright (c) 2013 Rob Patro robp@cs.cmu.edu 4 | 5 | This file is part of Sailfish. 6 | 7 | Sailfish is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | Sailfish is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Sailfish. If not, see . 19 |
26 | #include 27 | 28 | namespace Sailfish { 29 | /* 30 | struct Kmer { 31 | uint64_t kmer; 32 | }; 33 | 34 | struct Index { 35 | uint64_t index; 36 | }; 37 | */ 38 | struct TranscriptFeatures { 39 | std::string name; 40 | size_t length; 41 | double gcContent; 42 | std::array diNucleotides; 43 | }; 44 | } // namespace Sailfish 45 | 46 | #endif // COMMON_TYPES_HPP 47 | -------------------------------------------------------------------------------- /include/DedupUMI.hpp: -------------------------------------------------------------------------------- 1 | #ifndef DEDUP_UMI_HPP 2 | #define DEDUP_UMI_HPP 3 | 4 | #include "Graph.hpp" 5 | #include "GZipWriter.hpp" 6 | #include "AlevinUtils.hpp" 7 | 8 | struct SalmonEqClass { 9 | std::vector labels; 10 | uint32_t count; 11 | }; 12 | 13 | using UGroupT = spp::sparse_hash_map; 14 | using TGroupT = std::vector; 15 | 16 | // takem from https://stackoverflow.com/questions/896155/tr1unordered-set-union-and-intersection/896440 17 | template 18 | OutIt unordered_set_intersection(InIt1 b1, InIt1 e1, InIt2 b2, InIt2 e2, OutIt out) { 19 | while (!(b1 == e1)) { 20 | if (!(std::find(b2, e2, *b1) == e2)) { 21 | *out = *b1; 22 | ++out; 23 | } 24 | 25 | ++b1; 26 | } 27 | 28 | return out; 29 | } 30 | 31 | bool dedupClasses(std::vector& geneAlphas, 32 | double& totalUMICount, 33 | std::vector& txpGroups, 34 | std::vector& umiGroups, 35 | std::vector& salmonEqclasses, 36 | uint32_t umiLength, 37 | spp::sparse_hash_map& txpToGeneMap, 38 | std::vector& tiers, 39 | GZipWriter& gzw, uint32_t umiEditDistance, 40 | bool dumpUmiGraph, std::string& trueBarcodeStr, 41 | std::vector>& arboEqClassCount, 42 | bool dumpArborescences, 43 | std::atomic& totalUniEdgesCounts, 44 | std::atomic& totalBiEdgesCounts); 45 | 46 | #endif // DEDUP_UMI_HPP 47 | -------------------------------------------------------------------------------- /include/EMUtils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EM_UTILS_HPP 2 | #define EM_UTILS_HPP 3 | 4 | #include 5 | #include 6 | #include "Transcript.hpp" 7 | 8 | template 9 | void EMUpdate_(std::vector>& txpGroupLabels, 10 | std::vector>& txpGroupCombinedWeights, 11 | const std::vector& txpGroupCounts, 12 | const VecT& alphaIn, 13 | VecT& alphaOut); 14 | 15 | /** 16 | * set entries with values <= cutoff to 0. 17 | **/ 18 | template 19 | double truncateCountVector(VecT& alphas, double cutoff); 20 | 21 | #endif // EM_UTILS_HPP 22 | -------------------------------------------------------------------------------- /include/EffectiveLengthStats.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EFFECTIVE_LENGTH_STATS_HPP 2 | #define EFFECTIVE_LENGTH_STATS_HPP 3 | 4 | #include 5 | #include "Eigen/Dense" 6 | 7 | /** 8 | * Record a weighted average of per-transcript observed effective lengths. 9 | * These can then be combined to compute an "expected" effective length. 10 | **/ 11 | class EffectiveLengthStats { 12 | using VectorXu = Eigen::Matrix; 13 | 14 | public: 15 | EffectiveLengthStats(size_t numTxps); 16 | void addFragment(uint32_t txID, uint32_t len, double logMass); 17 | uint32_t getObservedCount(uint32_t txID); 18 | double getExpectedEffectiveLength(uint32_t txID); 19 | Eigen::VectorXd getExpectedEffectiveLengths(); 20 | void merge(const EffectiveLengthStats& other); 21 | 22 | private: 23 | size_t numTxps_; 24 | Eigen::VectorXd lengths_; 25 | Eigen::VectorXd weights_; 26 | VectorXu counts_; 27 | }; 28 | 29 | #endif // EFFECTIVE_LENGTH_STATS_HPP 30 | -------------------------------------------------------------------------------- /include/FASTAParser.hpp: -------------------------------------------------------------------------------- 1 | #ifndef FASTA_PARSER 2 | #define FASTA_PARSER 3 | 4 | #include 5 | 6 | class Transcript; 7 | struct SalmonOpts; 8 | 9 | class FASTAParser { 10 | public: 11 | FASTAParser(const std::string& fname); 12 | void populateTargets(std::vector& transcripts, SalmonOpts& sopt); 13 | 14 | private: 15 | std::string fname_; 16 | }; 17 | 18 | #endif // FASTA_PARSER 19 | -------------------------------------------------------------------------------- /include/FragmentList.hpp: -------------------------------------------------------------------------------- 1 | #ifndef FRAGMENT_LIST_HPP 2 | #define FRAGMENT_LIST_HPP 3 | 4 | extern "C" { 5 | #include "container.h" 6 | } 7 | 8 | class FragmentList { 9 | public: 10 | FragmentList(); 11 | 12 | // Free all of the structures allocated for this fragment list 13 | ~FragmentList(); 14 | 15 | void freeFragList(Container* frags); 16 | 17 | bool computeBestChain_(Container* frags, double& maxScore, uint32_t& bestPos); 18 | 19 | void computeBestChain(); 20 | 21 | void addFragMatch(uint32_t refStart, uint32_t queryStart, uint32_t len); 22 | 23 | void addFragMatch(uint32_t refStart, uint32_t refEnd, uint32_t queryStart, 24 | uint32_t queryEnd); 25 | 26 | void addFragMatchRC(uint32_t refStart, uint32_t queryStart, uint32_t len); 27 | 28 | void addFragMatchRC(uint32_t refStart, uint32_t refEnd, uint32_t queryStart, 29 | uint32_t queryEnd); 30 | 31 | bool isForward(); 32 | 33 | Container* fragments; 34 | Container* fragmentsRC; 35 | size_t numFrag; 36 | double bestHitScore; 37 | uint32_t bestHitPos; 38 | bool isForward_{true}; 39 | }; 40 | 41 | #endif // FRAGMENT_LIST_HPP 42 | -------------------------------------------------------------------------------- /include/IOUtils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef IO_UTILS 2 | #define IO_UTILS 3 | 4 | #include 5 | #include 6 | 7 | namespace ioutils { 8 | 9 | const char RESET_COLOR[] = "\x1b[0;0m"; 10 | const char SET_GREEN[] = "\x1b[0;32m"; 11 | const char SET_RED[] = "\x1b[0;31m"; 12 | 13 | } // namespace ioutils 14 | 15 | #endif // IO_UTILS 16 | -------------------------------------------------------------------------------- /include/IndexVersionInfo.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __INDEX_VERSION_INFO_HPP__ 2 | #define __INDEX_VERSION_INFO_HPP__ 3 | 4 | #include "cereal/archives/json.hpp" 5 | #include "cereal/types/vector.hpp" 6 | 7 | class IndexVersionInfo {}; 8 | 9 | #endif //__INDEX_VERSION_INFO_HPP__ 10 | -------------------------------------------------------------------------------- /include/KmerContext.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __KMER_CONTEXT_HPP__ 2 | #define __KMER_CONTEXT_HPP__ 3 | 4 | #include "SalmonUtils.hpp" 5 | #include "UtilityFunctions.hpp" 6 | #include 7 | #include 8 | 9 | class KmerContext { 10 | private: 11 | uint32_t _invalidIdx{std::numeric_limits::max()}; 12 | public: 13 | KmerContext(uint32_t K, salmon::utils::Direction dir) 14 | : _valid(false), _length(K), _dir(dir), _repr(_invalidIdx) { 15 | if (K == 0) { 16 | std::cerr << "Cannot create a k-mer context of size 0!\n"; 17 | std::exit(1); 18 | } 19 | } 20 | bool valid() const { return _valid; } 21 | uint32_t index() const { return _repr; } 22 | std::string str() const { 23 | return (valid() ? kmerForIndex(_repr, _length) : std::string(_length, 'X')); 24 | } 25 | 26 | void operator()(const char* s) { 27 | if (valid()) { 28 | _repr = nextKmerIndex(_repr, s[_length - 1], _length, _dir); 29 | } else { 30 | _repr = 0; 31 | _repr = indexForKmer(s, _length, _dir); 32 | _valid = true; 33 | } 34 | } 35 | 36 | private: 37 | bool _valid; 38 | uint32_t _length; 39 | salmon::utils::Direction _dir; 40 | uint32_t _repr; 41 | }; 42 | 43 | #endif //__KMER_CONTEXT_HPP__ 44 | -------------------------------------------------------------------------------- /include/MappingStatistics.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __SALMON_MAPPING_STATISTICS__ 2 | #define __SALMON_MAPPING_STATISTICS__ 3 | 4 | #include 5 | 6 | // class to collect statistics we may want about mapping / alignment 7 | class MappingStatistics { 8 | public: 9 | std::atomic numOrphansRescued{0}; 10 | // The number of mappings that were filtered due to alignment score 11 | std::atomic numMappingsFiltered{0}; 12 | std::atomic numFragmentsFiltered{0}; 13 | std::atomic numDecoyFragments{0}; 14 | std::atomic numDovetails{0}; 15 | }; 16 | 17 | #endif // __SALMON_MAPPING_STATISTICS__ 18 | -------------------------------------------------------------------------------- /include/MicroOpts.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MICROOPTS_HPP 2 | #define MICROOPTS_HPP 3 | 4 | /** Based on Likely.h from FB's Folly library **/ 5 | 6 | #undef LIKELY 7 | #undef UNLIKELY 8 | 9 | #if defined(__GUNC__) && __GNUC__ >= 4 10 | #define LIKELY(X) (__builtin_expect((x), 1)) 11 | #define UNLIKELY(X) (__builtin_expect((x), 0)) 12 | #elif defined(__clang__) 13 | 14 | #endif // MICROOPTS_HPP 15 | -------------------------------------------------------------------------------- /include/MultinomialSampler.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _MULTINOMIAL_SAMPLER_HPP_ 2 | #define _MULTINOMIAL_SAMPLER_HPP_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class MultinomialSampler { 9 | public: 10 | MultinomialSampler(std::random_device& rd) : gen_(rd()), u01_(0.0, 1.0) {} 11 | 12 | void operator()(std::vector::iterator sampleBegin, uint32_t n, 13 | uint32_t k, std::vector::iterator probsBegin, 14 | bool clearCounts = true) { 15 | uint32_t i, j; 16 | double u, sum; 17 | std::vector z(k + 1, 0.0); 18 | 19 | if (clearCounts) { 20 | for (i = 0; i < k; i++) { 21 | *(sampleBegin + i) = 0; 22 | } 23 | } 24 | 25 | z[0] = 0; 26 | for (i = 1; i <= k; i++) { 27 | sum = 0; 28 | for (j = 0; j < i; j++) 29 | sum += *(probsBegin + j); 30 | z[i] = sum; 31 | } 32 | 33 | // If k is small (<= 100), linear search is usually faster 34 | if (k <= 100) { 35 | for (j = 0; j < n; j++) { 36 | u = u01_(gen_); 37 | 38 | for (i = 0; i < k; i++) { 39 | if ((z[i] < u) && (u <= z[i + 1])) { 40 | (*(sampleBegin + i))++; 41 | break; 42 | } 43 | } 44 | } 45 | } else { // k is large enough to warrant binary search 46 | for (j = 0; j < n; j++) { 47 | u = u01_(gen_); 48 | 49 | // Find the offset of the element to increment 50 | auto it = std::lower_bound(z.begin(), z.end() - 1, u); 51 | size_t offset = static_cast(std::distance(z.begin(), it)); 52 | 53 | if (*it > u and offset > 0) { 54 | offset -= 1; 55 | } 56 | 57 | (*(sampleBegin + offset))++; 58 | } 59 | } 60 | } 61 | 62 | private: 63 | std::mt19937 gen_; 64 | std::uniform_real_distribution<> u01_; 65 | }; 66 | 67 | #endif //_MULTINOMIAL_SAMPLER_HPP_ 68 | -------------------------------------------------------------------------------- /include/NullFragmentFilter.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __NULL_FRAGMENT_FILTER_HPP__ 2 | #define __NULL_FRAGMENT_FILTER_HPP__ 3 | 4 | template class NullFragmentFilter { 5 | public: 6 | inline void processFrag(FragT* /*f*/) {} 7 | }; 8 | 9 | #endif // __NULL_FRAGMENT_FILTER_HPP__ 10 | -------------------------------------------------------------------------------- /include/OutputUnmappedFilter.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __OUTPUT_UNMAPPED_FILTER_HPP__ 2 | #define __OUTPUT_UNMAPPED_FILTER_HPP__ 3 | 4 | #include "ReadPair.hpp" 5 | #include "UnpairedRead.hpp" 6 | #include 7 | #include 8 | 9 | template class OutputUnmappedFilter { 10 | public: 11 | OutputUnmappedFilter(oneapi::tbb::concurrent_bounded_queue* outQueue) 12 | : outQueue_(outQueue), qlen_(0) { 13 | memset(&qname_[0], 0, 255); 14 | } 15 | 16 | inline void processFrag(FragT* f) { 17 | bool distinctRead{true}; 18 | 19 | // Check if the new read name is distinct from 20 | // the previous one. 21 | auto newLen = f->getNameLength(); 22 | if (qlen_ == newLen) { 23 | distinctRead = (memcmp(&qname_[0], f->getName(), qlen_) != 0); 24 | } 25 | 26 | // If this doesn't have the same name as the last read we saw, 27 | // than pass it to the output queue and update the name of the 28 | // most recently observed read. 29 | if (distinctRead) { 30 | auto* alnCpy = f->clone(); 31 | outQueue_->push(alnCpy); 32 | qlen_ = newLen; 33 | memcpy(&qname_[0], f->getName(), qlen_); 34 | } 35 | // If it does have the same name as the last read, no need 36 | // to update. 37 | } 38 | 39 | private: 40 | oneapi::tbb::concurrent_bounded_queue* outQueue_ = nullptr; 41 | char qname_[255]; 42 | uint32_t qlen_; 43 | }; 44 | 45 | #endif // __OUTPUT_UNMAPPED_FILTER_HPP__ 46 | -------------------------------------------------------------------------------- /include/ProgramOptionsGenerator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PROGRAM_OPTIONS_GENERATOR_HPP 2 | #define PROGRAM_OPTIONS_GENERATOR_HPP 3 | 4 | #include 5 | #include "SalmonOpts.hpp" 6 | 7 | namespace salmon { 8 | namespace po = boost::program_options; 9 | class ProgramOptionsGenerator{ 10 | public: 11 | po::options_description getMappingInputOptions(SalmonOpts& sopt); 12 | po::options_description getAlignmentInputOptions(SalmonOpts& sopt); 13 | 14 | po::options_description getBasicOptions(SalmonOpts& sopt); 15 | 16 | po::options_description getMappingSpecificOptions(SalmonOpts& sopt); 17 | po::options_description getAlignmentSpecificOptions(SalmonOpts& sopt); 18 | po::options_description getAlevinBasicOptions(SalmonOpts& sopt); 19 | po::options_description getAlevinDevsOptions(); 20 | po::options_description getAdvancedOptions(int32_t& numBiasSamples, SalmonOpts& sopt); 21 | po::options_description getHiddenOptions(SalmonOpts& sopt); 22 | po::options_description getTestingOptions(SalmonOpts& sopt); 23 | po::options_description getDeprecatedOptions(SalmonOpts& /*sopt*/); 24 | }; 25 | 26 | } 27 | 28 | #endif // PROGRAM_OPTIONS_GENERATOR_HPP 29 | -------------------------------------------------------------------------------- /include/SGSmooth.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __SGSMOOTH_HPP__ 2 | #define __SGSMOOTH_HPP__ 3 | 4 | #include 5 | 6 | // savitzky golay smoothing. 7 | std::vector sg_smooth(const std::vector& v, const int w, 8 | const int deg); 9 | //! numerical derivative based on savitzky golay smoothing. 10 | std::vector sg_derivative(const std::vector& v, const int w, 11 | const int deg, const double h = 1.0); 12 | 13 | #endif // __SGSMOOTH_HPP__ 14 | -------------------------------------------------------------------------------- /include/SalmonConfig.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | >HEADER 3 | Copyright (c) 2014-2024 Rob Patro rob@cs.umd.edu 4 | 5 | This file is part of Salmon. 6 | 7 | Salmon is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | Salmon is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Salmon. If not, see . 19 |
26 | #include 27 | 28 | namespace salmon { 29 | constexpr char majorVersion[] = "1"; 30 | constexpr char minorVersion[] = "10"; 31 | constexpr char patchVersion[] = "3"; 32 | constexpr char version[] = "1.10.3"; 33 | constexpr uint32_t indexVersion = 5; 34 | constexpr char requiredQuasiIndexVersion[] = "p7"; 35 | } // namespace salmon 36 | 37 | #endif // SALMON_CONFIG_HPP 38 | -------------------------------------------------------------------------------- /include/SalmonExceptions.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __SALMON_EXCEPTIONS_HPP__ 2 | #define __SALMON_EXCEPTIONS_HPP__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class InsufficientAssignedFragments : public std::runtime_error { 9 | public: 10 | InsufficientAssignedFragments(uint64_t numAssigned, 11 | uint64_t numRequired) noexcept; 12 | InsufficientAssignedFragments(InsufficientAssignedFragments&& other); 13 | virtual const char* what() const throw(); 14 | 15 | private: 16 | uint64_t numAssigned_; 17 | uint64_t numRequired_; 18 | std::ostringstream cnvt; 19 | std::string msg_; 20 | }; 21 | 22 | #endif //__SALMON_EXCEPTIONS_HPP__ 23 | -------------------------------------------------------------------------------- /include/SalmonSpinLock.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __SALMON_SPIN_LOCK_HPP__ 2 | #define __SALMON_SPIN_LOCK_HPP__ 3 | 4 | #include 5 | 6 | /** 7 | * since std::mutex is *VERY SLOW* on OSX, we use 8 | * this there instead. 9 | * Taken from 10 | * (http://stackoverflow.com/questions/22899053/why-is-stdmutex-so-slow-on-osx) 11 | */ 12 | class spin_lock { 13 | std::atomic _lock; 14 | 15 | public: 16 | spin_lock(const spin_lock&) = delete; 17 | spin_lock& operator=(const spin_lock&) = delete; 18 | 19 | spin_lock() : _lock(false) {} 20 | 21 | class scoped_lock { 22 | spin_lock& _lock; 23 | 24 | public: 25 | scoped_lock(const scoped_lock&) = delete; 26 | scoped_lock& operator=(const scoped_lock&) = delete; 27 | 28 | scoped_lock(spin_lock& lock) : _lock(lock) { 29 | bool expect = false; 30 | while (!_lock._lock.compare_exchange_weak(expect, true)) { 31 | expect = false; 32 | } 33 | } 34 | ~scoped_lock() { _lock._lock = false; } 35 | }; 36 | }; 37 | 38 | #endif // __SALMON_SPIN_LOCK_HPP__ 39 | -------------------------------------------------------------------------------- /include/SimplePosBias.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SIMPLE_POS_BIAS_HPP 2 | #define SIMPLE_POS_BIAS_HPP 3 | 4 | #include "spdlog/spdlog.h" 5 | #include "spline.h" 6 | #include 7 | #include 8 | #include 9 | 10 | class SimplePosBias { 11 | public: 12 | SimplePosBias(int32_t numBins = 20, bool logSpace = true); 13 | 14 | // Add a mass of @mass to bin @bin 15 | void addMass(int32_t bin, double mass); 16 | 17 | // Compute the bin for @pos on a transcript of length @length, 18 | // and add @mass to the appropriate bin 19 | void addMass(int32_t pos, int32_t length, double mass); 20 | 21 | // Project, via linear interpolation, the weights contained in "bins" 22 | // into the vector @out. 23 | void projectWeights(std::vector& out); 24 | 25 | // Combine the distribution @other 26 | // with this distribution 27 | void combine(const SimplePosBias& other); 28 | 29 | // We're finished updating this distribution, so 30 | // compute the cdf etc. 31 | void finalize(); 32 | 33 | // Seralize this model. 34 | bool writeBinary(boost::iostreams::filtering_ostream& out) const; 35 | 36 | private: 37 | int32_t numBins_; 38 | std::vector masses_; 39 | bool isLogged_{true}; 40 | bool isFinalized_{false}; 41 | ::tk::spline s_; 42 | // position bins taken from Cufflinks: 43 | // https://github.com/cole-trapnell-lab/cufflinks/blob/master/src/biascorrection.cpp 44 | const std::vector positionBins_{{.02, .04, .06, .08, .10, .15, .2, 45 | .3, .4, .5, .6, .7, .8, .85, 46 | .9, .92, .94, .96, .98, 1.0}}; 47 | }; 48 | 49 | #endif // SIMPLE_POS_BIAS_HPP 50 | -------------------------------------------------------------------------------- /include/StadenUtils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STADEN_UTILS 2 | #define STADEN_UTILS 3 | 4 | extern "C" { 5 | #include "io_lib/os.h" 6 | #include "io_lib/scram.h" 7 | #undef max 8 | #undef min 9 | } 10 | 11 | #include 12 | 13 | namespace staden { 14 | namespace utils { 15 | bam_seq_t* bam_init(); 16 | void bam_destroy(bam_seq_t* b); 17 | } // namespace utils 18 | } // namespace staden 19 | 20 | #endif // STADEN_UTILS 21 | -------------------------------------------------------------------------------- /include/TranscriptGroup.hpp: -------------------------------------------------------------------------------- 1 | #ifndef TRANSCRIPT_GROUP_HPP 2 | #define TRANSCRIPT_GROUP_HPP 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include "xxhash.h" 9 | 10 | class TranscriptGroup { 11 | public: 12 | TranscriptGroup(); 13 | TranscriptGroup(std::vector txpsIn); 14 | 15 | TranscriptGroup(std::vector txpsIn, size_t hashIn); 16 | 17 | TranscriptGroup(TranscriptGroup&& other); 18 | TranscriptGroup(const TranscriptGroup& other); 19 | 20 | TranscriptGroup& operator=(const TranscriptGroup& other); 21 | TranscriptGroup& operator=(TranscriptGroup&& other); 22 | 23 | friend bool operator==(const TranscriptGroup& lhs, 24 | const TranscriptGroup& rhs); 25 | 26 | void setValid(bool v) const; 27 | 28 | std::vector txps; 29 | size_t hash; 30 | double totalMass; 31 | mutable bool valid; 32 | }; 33 | 34 | bool operator==(const TranscriptGroup& lhs, const TranscriptGroup& rhs); 35 | 36 | struct TranscriptGroupHasher { 37 | std::size_t operator()(const TranscriptGroup& k) const { 38 | return k.hash; 39 | /* 40 | std::size_t seed{0}; 41 | for (auto e : k.txps) { 42 | boost::hash_combine(seed, e); 43 | } 44 | return seed; 45 | */ 46 | } 47 | }; 48 | 49 | #endif // TRANSCRIPT_GROUP_HPP 50 | -------------------------------------------------------------------------------- /include/TryableSpinLock.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRYABLE_SPIN_LOCK_HPP__ 2 | #define __TRYABLE_SPIN_LOCK_HPP__ 3 | 4 | #include 5 | 6 | // Taken from 7 | // http://stackoverflow.com/questions/26583433/c11-implementation-of-spinlock-using-atomic 8 | class TryableSpinLock { 9 | std::atomic_flag locked = ATOMIC_FLAG_INIT; 10 | 11 | public: 12 | void lock() { 13 | while (locked.test_and_set(std::memory_order_acquire)) { 14 | ; 15 | } 16 | } 17 | 18 | // from 19 | // http://stackoverflow.com/questions/19742993/implementing-a-spinlock-in-boost-example-neededhttp://stackoverflow.com/questions/19742993/implementing-a-spinlock-in-boost-example-needed 20 | // is this legit? 21 | bool try_lock() { return !locked.test_and_set(std::memory_order_acquire); } 22 | 23 | void unlock() { locked.clear(std::memory_order_release); } 24 | }; 25 | 26 | #endif //__TRYABLE_SPIN_LOCK_HPP__ 27 | -------------------------------------------------------------------------------- /include/VersionChecker.hpp: -------------------------------------------------------------------------------- 1 | // based off of 2 | // async_client.cpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef VERSION_CHECKER_HPP 12 | #define VERSION_CHECKER_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | std::string getVersionMessage(); 19 | 20 | #endif // VERSION_CHECKER_HPP -------------------------------------------------------------------------------- /include/WhiteList.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __WHITE_LIST_HPP__ 2 | #define __WHITE_LIST_HPP__ 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "SingleCellProtocols.hpp" 15 | #include "BarcodeGroup.hpp" 16 | //#include "RapMapUtils.hpp" 17 | #include "SingleCellProtocols.hpp" 18 | 19 | #include "oneapi/tbb/parallel_for.h" 20 | #include "oneapi/tbb/blocked_range.h" 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace alevin { 28 | namespace whitelist { 29 | 30 | using BlockedIndexRange = oneapi::tbb::blocked_range; 31 | using DoubleMatrixT = std::vector> ; 32 | using DoubleVectorT = std::vector ; 33 | 34 | uint32_t populate_count_matrix(boost::filesystem::path& outDir, 35 | size_t numElem, 36 | DoubleMatrixT& countMatrix); 37 | 38 | template 39 | bool performWhitelisting(AlevinOpts& aopt, 40 | std::vector& trueBarcodes, 41 | bool useRibo, bool useMito, 42 | size_t numLowConfidentBarcode); 43 | } 44 | } 45 | 46 | #endif // __WHITE_LIST_HPP__ 47 | -------------------------------------------------------------------------------- /include/backtrace.hpp: -------------------------------------------------------------------------------- 1 | /* This file is part of Jellyfish. 2 | 3 | This work is dual-licensed under 3-Clause BSD License or GPL 3.0. 4 | You can choose between one of them if you use this work. 5 | 6 | `SPDX-License-Identifier: BSD-3-Clause OR GPL-3.0` 7 | */ 8 | 9 | void print_backtrace(); 10 | void show_backtrace(); 11 | -------------------------------------------------------------------------------- /include/core/array.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_ARRAY_HPP 2 | #define CORE_ARRAY_HPP 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace core { 12 | inline namespace v2 { 13 | 14 | template 15 | constexpr auto make_array (Args&&... args) -> ::std::array< 16 | meta::either< 17 | meta::all< 18 | ::std::is_void::value, 19 | meta::none_of, is_reference_wrapper>() 20 | >(), 21 | common_type_t, 22 | V 23 | >, 24 | sizeof...(Args) 25 | > { return {{ core::forward(args)... }}; } 26 | 27 | template 28 | constexpr auto to_array (T (&array)[N], index_sequence) -> ::std::array< 29 | remove_cv_t, N 30 | > { return {{ array[Is]... }}; } 31 | 32 | template 33 | constexpr auto to_array (T (&array)[N]) -> ::std::array, N> { 34 | return (to_array)(array, make_index_sequence { }); 35 | } 36 | 37 | }} /* namespace core::v2 */ 38 | 39 | #endif /* CORE_ARRAY_HPP */ 40 | -------------------------------------------------------------------------------- /include/core/deque.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_DEQUE_HPP 2 | #define CORE_DEQUE_HPP 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace core { 10 | inline namespace v2 { 11 | 12 | template 13 | void erase_if (::std::deque& deq, Predicate pred) { 14 | deq.erase(::core::remove_if(deq, pred), end(deq)); 15 | } 16 | 17 | template 18 | void erase (::std::deque& deq, U const& value) { 19 | deq.erase(::core::remove(deq, value), end(deq)); 20 | } 21 | 22 | }} /* namespace core::v2 */ 23 | 24 | namespace core { 25 | inline namespace v2 { 26 | namespace pmr { 27 | 28 | template using deque = ::std::deque>; 29 | 30 | }}} /* namespace core::v2::pmr */ 31 | 32 | #endif /* CORE_DEQUE_HPP */ 33 | -------------------------------------------------------------------------------- /include/core/forward_list.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_FORWARD_LIST_HPP 2 | #define CORE_FORWARD_LIST_HPP 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace core { 10 | inline namespace v2 { 11 | 12 | template 13 | void erase_if (::std::forward_list& f, Predicate pred) { 14 | f.remove_if(pred); 15 | } 16 | 17 | template 18 | void erase (::std::forward_list& f, U const& value) { 19 | using ::std::placeholders::_1; 20 | f.remove_if(::std::bind(equal<>, _1, ::std::cref(value))); 21 | } 22 | 23 | }} /* namespace core::v2 */ 24 | 25 | namespace core { 26 | inline namespace v2 { 27 | namespace pmr { 28 | 29 | template 30 | using forward_list = ::std::forward_list>; 31 | 32 | }}} /* namespace core::v2::pmr */ 33 | 34 | #endif /* CORE_FORWARD_LIST_HPP */ 35 | -------------------------------------------------------------------------------- /include/core/list.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_LIST_HPP 2 | #define CORE_LIST_HPP 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace core { 10 | inline namespace v2 { 11 | 12 | template 13 | void erase_if (::std::list& l, Predicate pred) { l.remove_if(pred); } 14 | 15 | template 16 | void erase (::std::list& l, U const& value) { 17 | using ::std::placeholders::_1; 18 | l.remove_if(::std::bind(equal<>, _1, ::std::cref(value))); 19 | } 20 | 21 | }} /* namespace core::v2 */ 22 | 23 | namespace core { 24 | inline namespace v2 { 25 | namespace pmr { 26 | 27 | template using list = ::std::list>; 28 | 29 | }}} /* namespace core::v2::pmr */ 30 | 31 | #endif /* CORE_LIST_HPP */ 32 | -------------------------------------------------------------------------------- /include/core/map.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_MAP_HPP 2 | #define CORE_MAP_HPP 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace core { 10 | inline namespace v2 { 11 | 12 | template 13 | void erase_if (::std::multimap& m, Predicate pred) { 14 | for (auto iter = begin(m); iter != end(m);) { 15 | invoke(pred, *iter) ? iter = m.erase(iter) : ++iter; 16 | } 17 | } 18 | 19 | template 20 | void erase_if (::std::map& m, Predicate pred) { 21 | for (auto iter = begin(m); iter != end(m);) { 22 | invoke(pred, *iter) ? iter = m.erase(iter) : ++iter; 23 | } 24 | } 25 | 26 | }} /* namespace core::v2 */ 27 | 28 | namespace core { 29 | inline namespace v2 { 30 | namespace pmr { 31 | 32 | template > 33 | using multimap = ::std::multimap< 34 | Key, 35 | T, 36 | Compare, 37 | polymorphic_allocator<::std::pair> 38 | >; 39 | 40 | template > 41 | using map = ::std::map< 42 | Key, 43 | T, 44 | Compare, 45 | polymorphic_allocator<::std::pair> 46 | >; 47 | 48 | }}} /* namespace core::v2::pmr */ 49 | 50 | #endif /* CORE_MAP_HPP */ 51 | -------------------------------------------------------------------------------- /include/core/regex.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_REGEX_HPP 2 | #define CORE_REGEX_HPP 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace core { 10 | inline namespace v2 { 11 | namespace pmr { 12 | 13 | template 14 | using match_results = ::std::match_results< 15 | BidirIt, 16 | polymorphic_allocator<::std:::sub_match> 17 | >; 18 | 19 | using wsmatch = match_results; 20 | using wcmatch = match_results; 21 | using smatch = match_results; 22 | using cmatch = match_results; 23 | 24 | }}} /* namespace core::v2::pmr */ 25 | 26 | #endif /* CORE_REGEX_HPP */ 27 | -------------------------------------------------------------------------------- /include/core/set.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_SET_HPP 2 | #define CORE_SET_HPP 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace core { 9 | inline namespace v1 { 10 | 11 | template 12 | void erase_if (::std::multiset& s, Predicate pred) { 13 | for (auto iter = begin(s); iter != end(s);) { 14 | invoke(pred, *iter) ? iter = s.erase(iter) : ++iter; 15 | } 16 | } 17 | 18 | template 19 | void erase_if (::std::set& s, Predicate pred) { 20 | for (auto iter = begin(s); iter != end(s);) { 21 | invoke(pred, *iter) ? iter = s.erase(iter) : ++iter; 22 | } 23 | } 24 | 25 | }} /* namespace core::v1 */ 26 | 27 | namespace core { 28 | inline namespace v2 { 29 | namespace pmr { 30 | 31 | template > 32 | using multiset = ::std::multiset>; 33 | 34 | template > 35 | using set = ::std::set>; 36 | 37 | }}} /* namespace core::v2::pmr */ 38 | 39 | #endif /* CORE_SET_HPP */ 40 | -------------------------------------------------------------------------------- /include/core/string.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_STRING_HPP 2 | #define CORE_STRING_HPP 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace core { 10 | inline namespace v2 { 11 | 12 | template 13 | void erase_if (::std::basic_string& str, Predicate pred) { 14 | s.erase(::core::remove_if(str, pred), ::std::end(str)); 15 | } 16 | 17 | template 18 | void erase (::std::basic_string& str, U const& value) { 19 | s.erase(::core::remove(str, value), ::std::end(str)); 20 | } 21 | 22 | }} /* namespace core::v2 */ 23 | 24 | namespace core { 25 | inline namespace v2 { 26 | namespace pmr { 27 | 28 | template > 29 | using basic_string = ::std::basic_string< 30 | CharT, 31 | Traits, 32 | polymorphic_allocator 33 | >; 34 | 35 | using u32string = basic_string; 36 | using u16string = basic_string; 37 | using wstring = basic_string; 38 | using string = basic_string; 39 | 40 | }}} /* namespace core::v2::pmr */ 41 | 42 | #endif /* CORE_STRING_HPP */ 43 | -------------------------------------------------------------------------------- /include/core/typeinfo.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_TYPEINFO_HPP 2 | #define CORE_TYPEINFO_HPP 3 | 4 | #include 5 | #include 6 | 7 | #ifndef CORE_NO_RTTI 8 | #include 9 | #include 10 | #endif /* CORE_NO_RTTI */ 11 | 12 | namespace core { 13 | inline namespace v2 { 14 | 15 | #ifndef CORE_NO_RTTI 16 | using type_info = ::std::type_info; 17 | 18 | template 19 | type_info const& type_of () noexcept { return typeid(T); } 20 | #else /* CORE_NO_RTTI */ 21 | struct type_info final { 22 | 23 | type_info (type_info const&) = delete; 24 | type_info () = delete; 25 | virtual ~type_info () = default; 26 | 27 | type_info& operator = (type_info const&) = delete; 28 | 29 | /* If we had C++14 template variables, this would actually be easier */ 30 | template 31 | friend type_info const& type_of () noexcept { 32 | return type_info::cref>>(); 33 | } 34 | 35 | bool operator == (type_info const& that) const noexcept { 36 | return this->id == that.id; 37 | } 38 | 39 | bool operator != (type_info const& that) const noexcept { 40 | return this->id != that.id; 41 | } 42 | 43 | bool before (type_info const& that) const noexcept { 44 | return this->id < that.id; 45 | } 46 | 47 | ::std::size_t hash_code () const noexcept { return this->id; } 48 | 49 | private: 50 | type_info (::std::uintptr_t id) noexcept : id { id } { } 51 | 52 | template 53 | static type_info const& cref () noexcept { 54 | static ::std::uintptr_t const value { }; 55 | static type_info const instance { as_int(::std::addressof(value)) }; 56 | return instance; 57 | } 58 | 59 | ::std::uintptr_t const id; 60 | }; 61 | 62 | #endif /* CORE_NO_RTTI */ 63 | 64 | }} /* namespace core::v2 */ 65 | 66 | #endif /* CORE_TYPEINFO_HPP */ 67 | -------------------------------------------------------------------------------- /include/core/unordered_map.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_UNORDERED_MAP_HPP 2 | #define CORE_UNORDERED_MAP_HPP 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace core { 9 | inline namespace v2 { 10 | 11 | template 12 | void erase_if (::std::unordered_multimap& m, Predicate pred) { 13 | for (auto iter = begin(m); iter != end(m);) { 14 | invoke(pred, *iter) ? iter = m.erase(iter) : ++iter; 15 | } 16 | } 17 | 18 | template 19 | void erase_if (::std::unordered_map& m, Predicate pred) { 20 | for (auto iter = begin(m); iter != end(m);) { 21 | invoke(pred, *iter) ? iter = m.erase(iter) : ++iter; 22 | } 23 | } 24 | 25 | }} /* namespace core::v2 */ 26 | 27 | namespace core { 28 | inline namespace v2 { 29 | namespace pmr { 30 | 31 | template < 32 | class Key, 33 | class T, 34 | class Hash=::std::hash, 35 | class Pred=::std::equal_to 36 | > using unordered_multimap = ::std::unordered_multimap< 37 | Key, 38 | T, 39 | Hash, 40 | Pred, 41 | polymorphic_allocator<::std::pair> 42 | >; 43 | 44 | template < 45 | class Key, 46 | class T, 47 | class Hash=::std::hash, 48 | class Pred=::std::equal_to 49 | > using unordered_map = ::std::unordered_map< 50 | Key, 51 | T, 52 | Hash, 53 | Pred, 54 | polymorphic_allocator<::std::pair> 55 | >; 56 | 57 | }}} /* namespace core::v2::pmr */ 58 | 59 | #endif /* CORE_UNORDERED_MAP_HPP */ 60 | -------------------------------------------------------------------------------- /include/core/unordered_set.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_UNORDERED_SET_HPP 2 | #define CORE_UNORDERED_SET_HPP 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace core { 9 | inline namespace v2 { 10 | 11 | template 12 | void erase_if (::std::unordered_multiset& m, Predicate pred) { 13 | for (auto iter = begin(m); iter != end(m);) { 14 | invoke(pred, *iter) ? iter = m.erase(iter) : ++iter; 15 | } 16 | } 17 | 18 | template 19 | void erase_if (::std::unordered_set& m, Predicate pred) { 20 | for (auto iter = begin(m); iter != end(m);) { 21 | invoke(pred, *iter) ? iter = m.erase(iter) : ++iter; 22 | } 23 | } 24 | 25 | }} /* namespace core::v2 */ 26 | 27 | namespace core { 28 | inline namespace v2 { 29 | namespace pmr { 30 | 31 | template < 32 | class Key, 33 | class Hash=::std::hash, 34 | class Pred=::std::equal_to 35 | > using unordered_multiset = ::std::unordered_multiset< 36 | Key, 37 | Hash, 38 | Pred, 39 | polymorphic_allocator 40 | >; 41 | 42 | template < 43 | class Key, 44 | class Hash=::std::hash, 45 | class Pred=::std::equal_to 46 | > using unordered_set = ::std::unordered_set< 47 | Key, 48 | Hash, 49 | Pred, 50 | polymorphic_allocator> 51 | >; 52 | 53 | }}} /* namespace core::v2::pmr */ 54 | 55 | #endif /* CORE_UNORDERED_SET_HPP */ 56 | -------------------------------------------------------------------------------- /include/core/vector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CORE_VECTOR_HPP 2 | #define CORE_VECTOR_HPP 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace core { 10 | inline namespace v2 { 11 | 12 | template 13 | void erase_if (::std::vector& v, Predicate pred) { 14 | v.erase(::core::remove_if(v, pred), end(v)); 15 | } 16 | 17 | }} /* namespace core::v2 */ 18 | 19 | namespace core { 20 | inline namespace v2 { 21 | namespace pmr { 22 | 23 | template using vector = ::std::vector>; 24 | 25 | }}} /* namespace core::v2::pmr */ 26 | 27 | #endif /* CORE_VECTOR_HPP */ 28 | -------------------------------------------------------------------------------- /include/cuckoohash_config.hh: -------------------------------------------------------------------------------- 1 | /** \file */ 2 | 3 | #ifndef _CUCKOOHASH_CONFIG_HH 4 | #define _CUCKOOHASH_CONFIG_HH 5 | 6 | #include 7 | #include 8 | 9 | namespace libcuckoo { 10 | 11 | //! The default maximum number of keys per bucket 12 | constexpr size_t DEFAULT_SLOT_PER_BUCKET = 4; 13 | 14 | //! The default number of elements in an empty hash table 15 | constexpr size_t DEFAULT_SIZE = 16 | (1U << 16) * DEFAULT_SLOT_PER_BUCKET; 17 | 18 | //! The default minimum load factor that the table allows for automatic 19 | //! expansion. It must be a number between 0.0 and 1.0. The table will throw 20 | //! load_factor_too_low if the load factor falls below this value 21 | //! during an automatic expansion. 22 | constexpr double DEFAULT_MINIMUM_LOAD_FACTOR = 0.05; 23 | 24 | //! An alias for the value that sets no limit on the maximum hashpower. If this 25 | //! value is set as the maximum hashpower limit, there will be no limit. This 26 | //! is also the default initial value for the maximum hashpower in a table. 27 | constexpr size_t NO_MAXIMUM_HASHPOWER = 28 | std::numeric_limits::max(); 29 | 30 | //! set LIBCUCKOO_DEBUG to 1 to enable debug output 31 | #define LIBCUCKOO_DEBUG 0 32 | 33 | } // namespace libcuckoo 34 | 35 | #endif // _CUCKOOHASH_CONFIG_HH 36 | -------------------------------------------------------------------------------- /include/dbg.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __DEBOUTPUT_H__ 2 | #define __DEBOUTPUT_H__ 3 | 4 | #include 5 | #include 6 | 7 | struct dbg { 8 | std::ostream& os_; 9 | std::ostringstream ss_; 10 | const bool flush_; 11 | 12 | dbg(std::ostream& os = std::cerr, bool flush = false) 13 | : os_(os), flush_(flush) 14 | { } 15 | ~dbg() { 16 | os_ << ss_.str(); 17 | if(flush_) 18 | os_ << std::flush; 19 | } 20 | }; 21 | 22 | template 23 | dbg& operator<<(dbg&& d, const T& x) { 24 | return d << x; 25 | } 26 | 27 | // template 28 | // dbg& operator<<(dbg d, const T& x) { 29 | // d.ss_ << x; 30 | // return d; 31 | // } 32 | 33 | template 34 | dbg& operator<<(dbg& d, const T& x) { 35 | d.ss_ << x; 36 | return d; 37 | } 38 | 39 | #endif /* __DEBOUTPUT_H__ */ 40 | -------------------------------------------------------------------------------- /include/default_hasher.hh: -------------------------------------------------------------------------------- 1 | #ifndef _DEFAULT_HASHER_HH 2 | #define _DEFAULT_HASHER_HH 3 | 4 | #include 5 | #include 6 | 7 | /*! DefaultHasher is the default hash class used in the table. It overloads a 8 | * few types that std::hash does badly on (namely integers), and falls back to 9 | * std::hash for anything else. */ 10 | template class DefaultHasher { 11 | std::hash fallback; 12 | 13 | public: 14 | template 15 | typename std::enable_if::value, size_t>::type 16 | operator()(const Key& k) const { 17 | // This constant is found in the CityHash code 18 | return k * 0x9ddfea08eb382d69ULL; 19 | } 20 | 21 | template 22 | typename std::enable_if::value, size_t>::type 23 | operator()(const Key& k) const { 24 | return fallback(k); 25 | } 26 | }; 27 | 28 | #endif // _DEFAULT_HASHER_HH 29 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Cholesky_Module Cholesky module 16 | * 17 | * 18 | * 19 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 20 | * Those decompositions are also accessible via the following methods: 21 | * - MatrixBase::llt() 22 | * - MatrixBase::ldlt() 23 | * - SelfAdjointView::llt() 24 | * - SelfAdjointView::ldlt() 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | */ 30 | 31 | #include "src/Cholesky/LLT.h" 32 | #include "src/Cholesky/LDLT.h" 33 | #ifdef EIGEN_USE_LAPACKE 34 | #include "src/misc/lapacke.h" 35 | #include "src/Cholesky/LLT_LAPACKE.h" 36 | #endif 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_CHOLESKY_MODULE_H 41 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 42 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/CholmodSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H 9 | #define EIGEN_CHOLMODSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup CholmodSupport_Module CholmodSupport module 21 | * 22 | * This module provides an interface to the Cholmod library which is part of the suitesparse package. 23 | * It provides the two following main factorization classes: 24 | * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. 25 | * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). 26 | * 27 | * For the sake of completeness, this module also propose the two following classes: 28 | * - class CholmodSimplicialLLT 29 | * - class CholmodSimplicialLDLT 30 | * Note that these classes does not bring any particular advantage compared to the built-in 31 | * SimplicialLLT and SimplicialLDLT factorization classes. 32 | * 33 | * \code 34 | * #include 35 | * \endcode 36 | * 37 | * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies. 38 | * The dependencies depend on how cholmod has been compiled. 39 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. 40 | * 41 | */ 42 | 43 | #include "src/CholmodSupport/CholmodSupport.h" 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H 48 | 49 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_EIGENVALUES_MODULE_H 9 | #define EIGEN_EIGENVALUES_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Cholesky" 16 | #include "Jacobi" 17 | #include "Householder" 18 | #include "LU" 19 | #include "Geometry" 20 | 21 | /** \defgroup Eigenvalues_Module Eigenvalues module 22 | * 23 | * 24 | * 25 | * This module mainly provides various eigenvalue solvers. 26 | * This module also provides some MatrixBase methods, including: 27 | * - MatrixBase::eigenvalues(), 28 | * - MatrixBase::operatorNorm() 29 | * 30 | * \code 31 | * #include 32 | * \endcode 33 | */ 34 | 35 | #include "src/misc/RealSvd2x2.h" 36 | #include "src/Eigenvalues/Tridiagonalization.h" 37 | #include "src/Eigenvalues/RealSchur.h" 38 | #include "src/Eigenvalues/EigenSolver.h" 39 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h" 40 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" 41 | #include "src/Eigenvalues/HessenbergDecomposition.h" 42 | #include "src/Eigenvalues/ComplexSchur.h" 43 | #include "src/Eigenvalues/ComplexEigenSolver.h" 44 | #include "src/Eigenvalues/RealQZ.h" 45 | #include "src/Eigenvalues/GeneralizedEigenSolver.h" 46 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h" 47 | #ifdef EIGEN_USE_LAPACKE 48 | #include "src/misc/lapacke.h" 49 | #include "src/Eigenvalues/RealSchur_LAPACKE.h" 50 | #include "src/Eigenvalues/ComplexSchur_LAPACKE.h" 51 | #include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h" 52 | #endif 53 | 54 | #include "src/Core/util/ReenableStupidWarnings.h" 55 | 56 | #endif // EIGEN_EIGENVALUES_MODULE_H 57 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 58 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/Householder: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 9 | #define EIGEN_HOUSEHOLDER_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Householder_Module Householder module 16 | * This module provides Householder transformations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/Householder/Householder.h" 24 | #include "src/Householder/HouseholderSequence.h" 25 | #include "src/Householder/BlockHouseholder.h" 26 | 27 | #include "src/Core/util/ReenableStupidWarnings.h" 28 | 29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 30 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 31 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 33 | 34 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/LU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_LU_MODULE_H 9 | #define EIGEN_LU_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup LU_Module LU module 16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 17 | * This module defines the following MatrixBase methods: 18 | * - MatrixBase::inverse() 19 | * - MatrixBase::determinant() 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/misc/Kernel.h" 27 | #include "src/misc/Image.h" 28 | #include "src/LU/FullPivLU.h" 29 | #include "src/LU/PartialPivLU.h" 30 | #ifdef EIGEN_USE_LAPACKE 31 | #include "src/misc/lapacke.h" 32 | #include "src/LU/PartialPivLU_LAPACKE.h" 33 | #endif 34 | #include "src/LU/Determinant.h" 35 | #include "src/LU/InverseImpl.h" 36 | 37 | // Use the SSE optimized version whenever possible. At the moment the 38 | // SSE version doesn't compile when AVX is enabled 39 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX 40 | #include "src/LU/arch/Inverse_SSE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_LU_MODULE_H 46 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 47 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 9 | #define EIGEN_PASTIXSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | #ifdef complex 21 | #undef complex 22 | #endif 23 | 24 | /** \ingroup Support_modules 25 | * \defgroup PaStiXSupport_Module PaStiXSupport module 26 | * 27 | * This module provides an interface to the PaSTiX library. 28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 29 | * It provides the two following main factorization classes: 30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | * 38 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. 39 | * The dependencies depend on how PaSTiX has been compiled. 40 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 41 | * 42 | */ 43 | 44 | #include "src/PaStiXSupport/PaStiXSupport.h" 45 | 46 | #include "src/Core/util/ReenableStupidWarnings.h" 47 | 48 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 49 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Cholesky" 16 | #include "Jacobi" 17 | #include "Householder" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #include "src/misc/lapacke.h" 40 | #include "src/QR/HouseholderQR_LAPACKE.h" 41 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 42 | #endif 43 | 44 | #include "src/Core/util/ReenableStupidWarnings.h" 45 | 46 | #endif // EIGEN_QR_MODULE_H 47 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 48 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(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 | memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 41 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 9 | #define EIGEN_SPQRSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SuiteSparseQR.hpp" 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup SPQRSupport_Module SuiteSparseQR module 19 | * 20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 28 | * 29 | */ 30 | 31 | #include "src/CholmodSupport/CholmodSupport.h" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/SVD: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SVD_MODULE_H 9 | #define EIGEN_SVD_MODULE_H 10 | 11 | #include "QR" 12 | #include "Householder" 13 | #include "Jacobi" 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | /** \defgroup SVD_Module SVD module 18 | * 19 | * 20 | * 21 | * This module provides SVD decomposition for matrices (both real and complex). 22 | * Two decomposition algorithms are provided: 23 | * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. 24 | * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. 25 | * These decompositions are accessible via the respective classes and following MatrixBase methods: 26 | * - MatrixBase::jacobiSvd() 27 | * - MatrixBase::bdcSvd() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/misc/RealSvd2x2.h" 35 | #include "src/SVD/UpperBidiagonalization.h" 36 | #include "src/SVD/SVDBase.h" 37 | #include "src/SVD/JacobiSVD.h" 38 | #include "src/SVD/BDCSVD.h" 39 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 40 | #include "src/misc/lapacke.h" 41 | #include "src/SVD/JacobiSVD_LAPACKE.h" 42 | #endif 43 | 44 | #include "src/Core/util/ReenableStupidWarnings.h" 45 | 46 | #endif // EIGEN_SVD_MODULE_H 47 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 48 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #ifndef EIGEN_MPL2_ONLY 29 | #include "SparseCholesky" 30 | #endif 31 | #include "SparseLU" 32 | #include "SparseQR" 33 | #include "IterativeLinearSolvers" 34 | 35 | #endif // EIGEN_SPARSE_MODULE_H 36 | 37 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #ifdef EIGEN_MPL2_ONLY 34 | #error The SparseCholesky module has nothing to offer in MPL2 only mode 35 | #endif 36 | 37 | #include "src/SparseCholesky/SimplicialCholesky.h" 38 | 39 | #ifndef EIGEN_MPL2_ONLY 40 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 46 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | // Ordering interface 24 | #include "OrderingMethods" 25 | 26 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 27 | 28 | #include "src/SparseLU/SparseLU_Structs.h" 29 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 30 | #include "src/SparseLU/SparseLUImpl.h" 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseLU/SparseLU_Memory.h" 33 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 34 | #include "src/SparseLU/SparseLU_relax_snode.h" 35 | #include "src/SparseLU/SparseLU_pivotL.h" 36 | #include "src/SparseLU/SparseLU_panel_dfs.h" 37 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 38 | #include "src/SparseLU/SparseLU_panel_bmod.h" 39 | #include "src/SparseLU/SparseLU_column_dfs.h" 40 | #include "src/SparseLU/SparseLU_column_bmod.h" 41 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 42 | #include "src/SparseLU/SparseLU_pruneL.h" 43 | #include "src/SparseLU/SparseLU_Utils.h" 44 | #include "src/SparseLU/SparseLU.h" 45 | 46 | #endif // EIGEN_SPARSELU_MODULE_H 47 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "OrderingMethods" 32 | #include "src/SparseCore/SparseColEtree.h" 33 | #include "src/SparseQR/SparseQR.h" 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (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 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (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 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (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 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup UmfPackSupport_Module UmfPackSupport module 21 | * 22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 23 | * It provides the following factorization class: 24 | * - class UmfPackLU: a multifrontal sequential LU factorization. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. 31 | * The dependencies depend on how umfpack has been compiled. 32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/UmfPackSupport/UmfPackSupport.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 41 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/Core/DiagonalProduct.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2007-2009 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_DIAGONALPRODUCT_H 12 | #define EIGEN_DIAGONALPRODUCT_H 13 | 14 | namespace Eigen { 15 | 16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 17 | */ 18 | template 19 | template 20 | inline const Product 21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 22 | { 23 | return Product(derived(),a_diagonal.derived()); 24 | } 25 | 26 | } // end namespace Eigen 27 | 28 | #endif // EIGEN_DIAGONALPRODUCT_H 29 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SELFCWISEBINARYOP_H 11 | #define EIGEN_SELFCWISEBINARYOP_H 12 | 13 | namespace Eigen { 14 | 15 | // TODO generalize the scalar type of 'other' 16 | 17 | template 18 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 19 | { 20 | typedef typename Derived::PlainObject PlainObject; 21 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 22 | return derived(); 23 | } 24 | 25 | template 26 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 27 | { 28 | typedef typename Derived::PlainObject PlainObject; 29 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op()); 30 | return derived(); 31 | } 32 | 33 | template 34 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other) 35 | { 36 | typedef typename Derived::PlainObject PlainObject; 37 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 38 | return derived(); 39 | } 40 | 41 | template 42 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 43 | { 44 | typedef typename Derived::PlainObject PlainObject; 45 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 46 | return derived(); 47 | } 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_SELFCWISEBINARYOP_H 52 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/Core/arch/AVX/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_AVX_H 11 | #define EIGEN_TYPE_CASTING_AVX_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // For now we use SSE to handle integers, so we can't use AVX instructions to cast 18 | // from int to float 19 | template <> 20 | struct type_casting_traits { 21 | enum { 22 | VectorizedCast = 0, 23 | SrcCoeffRatio = 1, 24 | TgtCoeffRatio = 1 25 | }; 26 | }; 27 | 28 | template <> 29 | struct type_casting_traits { 30 | enum { 31 | VectorizedCast = 0, 32 | SrcCoeffRatio = 1, 33 | TgtCoeffRatio = 1 34 | }; 35 | }; 36 | 37 | 38 | 39 | template<> EIGEN_STRONG_INLINE Packet8i pcast(const Packet8f& a) { 40 | return _mm256_cvtps_epi32(a); 41 | } 42 | 43 | template<> EIGEN_STRONG_INLINE Packet8f pcast(const Packet8i& a) { 44 | return _mm256_cvtepi32_ps(a); 45 | } 46 | 47 | } // end namespace internal 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_TYPE_CASTING_AVX_H 52 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 100 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/Core/arch/SSE/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_SSE_H 11 | #define EIGEN_TYPE_CASTING_SSE_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | template <> 18 | struct type_casting_traits { 19 | enum { 20 | VectorizedCast = 1, 21 | SrcCoeffRatio = 1, 22 | TgtCoeffRatio = 1 23 | }; 24 | }; 25 | 26 | template<> EIGEN_STRONG_INLINE Packet4i pcast(const Packet4f& a) { 27 | return _mm_cvttps_epi32(a); 28 | } 29 | 30 | 31 | template <> 32 | struct type_casting_traits { 33 | enum { 34 | VectorizedCast = 1, 35 | SrcCoeffRatio = 1, 36 | TgtCoeffRatio = 1 37 | }; 38 | }; 39 | 40 | template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet4i& a) { 41 | return _mm_cvtepi32_ps(a); 42 | } 43 | 44 | 45 | template <> 46 | struct type_casting_traits { 47 | enum { 48 | VectorizedCast = 1, 49 | SrcCoeffRatio = 2, 50 | TgtCoeffRatio = 1 51 | }; 52 | }; 53 | 54 | template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet2d& a, const Packet2d& b) { 55 | return _mm_shuffle_ps(_mm_cvtpd_ps(a), _mm_cvtpd_ps(b), (1 << 2) | (1 << 6)); 56 | } 57 | 58 | template <> 59 | struct type_casting_traits { 60 | enum { 61 | VectorizedCast = 1, 62 | SrcCoeffRatio = 1, 63 | TgtCoeffRatio = 2 64 | }; 65 | }; 66 | 67 | template<> EIGEN_STRONG_INLINE Packet2d pcast(const Packet4f& a) { 68 | // Simply discard the second half of the input 69 | return _mm_cvtps_pd(a); 70 | } 71 | 72 | 73 | } // end namespace internal 74 | 75 | } // end namespace Eigen 76 | 77 | #endif // EIGEN_TYPE_CASTING_SSE_H 78 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED 2 | #undef EIGEN_WARNINGS_DISABLED 3 | 4 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 5 | #ifdef _MSC_VER 6 | #pragma warning( pop ) 7 | #elif defined __INTEL_COMPILER 8 | #pragma warning pop 9 | #elif defined __clang__ 10 | #pragma clang diagnostic pop 11 | #elif defined __GNUC__ && __GNUC__>=6 12 | #pragma GCC diagnostic pop 13 | #endif 14 | 15 | #if defined __NVCC__ 16 | // Don't reenable the diagnostic messages, as it turns out these messages need 17 | // to be disabled at the point of the template instantiation (i.e the user code) 18 | // otherwise they'll be triggered by nvcc. 19 | // #pragma diag_default code_is_unreachable 20 | // #pragma diag_default initialization_not_reachable 21 | // #pragma diag_default 2651 22 | // #pragma diag_default 2653 23 | #endif 24 | 25 | #endif 26 | 27 | #endif // EIGEN_WARNINGS_DISABLED 28 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | template 17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 18 | { 19 | const typename internal::nested_eval::type actualA(derived()); 20 | typename internal::conditional::type, 22 | const PlainObject>::type actualB(other.derived()); 23 | 24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 25 | } 26 | 27 | } // end namespace Eigen 28 | 29 | #endif // EIGEN_SPARSE_FUZZY_H 30 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/SparseCore/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSEREDUX_H 11 | #define EIGEN_SPARSEREDUX_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | typename internal::traits::Scalar 17 | SparseMatrixBase::sum() const 18 | { 19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 20 | Scalar res(0); 21 | internal::evaluator thisEval(derived()); 22 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) 24 | res += iter.value(); 25 | return res; 26 | } 27 | 28 | template 29 | typename internal::traits >::Scalar 30 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 31 | { 32 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 33 | if(this->isCompressed()) 34 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 35 | else 36 | return Base::sum(); 37 | } 38 | 39 | template 40 | typename internal::traits >::Scalar 41 | SparseVector<_Scalar,_Options,_Index>::sum() const 42 | { 43 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 44 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 45 | } 46 | 47 | } // end namespace Eigen 48 | 49 | #endif // EIGEN_SPARSEREDUX_H 50 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/misc/RealSvd2x2.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Benoit Jacob 5 | // Copyright (C) 2013-2016 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_REALSVD2X2_H 12 | #define EIGEN_REALSVD2X2_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | template 19 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q, 20 | JacobiRotation *j_left, 21 | JacobiRotation *j_right) 22 | { 23 | using std::sqrt; 24 | using std::abs; 25 | Matrix m; 26 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)), 27 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q)); 28 | JacobiRotation rot1; 29 | RealScalar t = m.coeff(0,0) + m.coeff(1,1); 30 | RealScalar d = m.coeff(1,0) - m.coeff(0,1); 31 | 32 | if(abs(d) < (std::numeric_limits::min)()) 33 | { 34 | rot1.s() = RealScalar(0); 35 | rot1.c() = RealScalar(1); 36 | } 37 | else 38 | { 39 | // If d!=0, then t/d cannot overflow because the magnitude of the 40 | // entries forming d are not too small compared to the ones forming t. 41 | RealScalar u = t / d; 42 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u)); 43 | rot1.s() = RealScalar(1) / tmp; 44 | rot1.c() = u / tmp; 45 | } 46 | m.applyOnTheLeft(0,1,rot1); 47 | j_right->makeJacobi(m,0,1); 48 | *j_left = rot1 * j_right->transpose(); 49 | } 50 | 51 | } // end namespace internal 52 | 53 | } // end namespace Eigen 54 | 55 | #endif // EIGEN_REALSVD2X2_H 56 | -------------------------------------------------------------------------------- /include/eigen3/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /include/eigen3/signature_of_eigen3_matrix_library: -------------------------------------------------------------------------------- 1 | This file is just there as a signature to help identify directories containing Eigen3. When writing a script looking for Eigen3, just look for this file. This is especially useful to help disambiguate with Eigen2... 2 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/ArpackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_ARPACKSUPPORT_MODULE_H 10 | #define EIGEN_ARPACKSUPPORT_MODULE_H 11 | 12 | #include 13 | 14 | #include 15 | 16 | /** \defgroup ArpackSupport_Module Arpack support module 17 | * 18 | * This module provides a wrapper to Arpack, a library for sparse eigenvalue decomposition. 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | */ 24 | 25 | #include 26 | #include "src/Eigenvalues/ArpackSelfAdjointEigenSolver.h" 27 | 28 | #include 29 | 30 | #endif // EIGEN_ARPACKSUPPORT_MODULE_H 31 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 32 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/AutoDiff: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_AUTODIFF_MODULE 11 | #define EIGEN_AUTODIFF_MODULE 12 | 13 | namespace Eigen { 14 | 15 | /** 16 | * \defgroup AutoDiff_Module Auto Diff module 17 | * 18 | * This module features forward automatic differentation via a simple 19 | * templated scalar type wrapper AutoDiffScalar. 20 | * 21 | * Warning : this should NOT be confused with numerical differentiation, which 22 | * is a different method and has its own module in Eigen : \ref NumericalDiff_Module. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | */ 28 | //@{ 29 | 30 | } 31 | 32 | #include "src/AutoDiff/AutoDiffScalar.h" 33 | // #include "src/AutoDiff/AutoDiffVector.h" 34 | #include "src/AutoDiff/AutoDiffJacobian.h" 35 | 36 | namespace Eigen { 37 | //@} 38 | } 39 | 40 | #endif // EIGEN_AUTODIFF_MODULE 41 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/TensorSymmetry: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2013 Christian Seiler 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSORSYMMETRY_MODULE 11 | #define EIGEN_CXX11_TENSORSYMMETRY_MODULE 12 | 13 | #include 14 | 15 | #include 16 | 17 | #include "src/util/CXX11Meta.h" 18 | 19 | /** \defgroup CXX11_TensorSymmetry_Module Tensor Symmetry Module 20 | * 21 | * This module provides a classes that allow for the definition of 22 | * symmetries w.r.t. tensor indices. 23 | * 24 | * Including this module will implicitly include the Tensor module. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | */ 30 | 31 | #include "src/TensorSymmetry/util/TemplateGroupTheory.h" 32 | #include "src/TensorSymmetry/Symmetry.h" 33 | #include "src/TensorSymmetry/StaticSymmetry.h" 34 | #include "src/TensorSymmetry/DynamicSymmetry.h" 35 | 36 | #include 37 | 38 | #endif // EIGEN_CXX11_TENSORSYMMETRY_MODULE 39 | 40 | /* 41 | * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; 42 | */ 43 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/ThreadPool: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_MODULE 11 | #define EIGEN_CXX11_THREADPOOL_MODULE 12 | 13 | #include "../../../Eigen/Core" 14 | 15 | #include 16 | 17 | /** \defgroup CXX11_ThreadPool_Module C++11 ThreadPool Module 18 | * 19 | * This module provides 2 threadpool implementations 20 | * - a simple reference implementation 21 | * - a faster non blocking implementation 22 | * 23 | * This module requires C++11. 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | */ 29 | 30 | 31 | // The code depends on CXX11, so only include the module if the 32 | // compiler supports it. 33 | #if __cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #include "src/util/CXX11Meta.h" 49 | #include "src/util/MaxSizeVector.h" 50 | 51 | #include "src/ThreadPool/ThreadLocal.h" 52 | #include "src/ThreadPool/ThreadYield.h" 53 | #include "src/ThreadPool/EventCount.h" 54 | #include "src/ThreadPool/RunQueue.h" 55 | #include "src/ThreadPool/ThreadPoolInterface.h" 56 | #include "src/ThreadPool/ThreadEnvironment.h" 57 | #include "src/ThreadPool/SimpleThreadPool.h" 58 | #include "src/ThreadPool/NonBlockingThreadPool.h" 59 | 60 | #endif 61 | 62 | #include 63 | 64 | #endif // EIGEN_CXX11_THREADPOOL_MODULE 65 | 66 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionBlocking.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H 12 | 13 | 14 | namespace Eigen { 15 | namespace internal { 16 | 17 | enum { 18 | ShardByRow = 0, 19 | ShardByCol = 1 20 | }; 21 | 22 | 23 | // Default Blocking Strategy 24 | template 25 | class TensorContractionBlocking { 26 | public: 27 | 28 | typedef typename LhsMapper::Scalar LhsScalar; 29 | typedef typename RhsMapper::Scalar RhsScalar; 30 | 31 | EIGEN_DEVICE_FUNC TensorContractionBlocking(Index k, Index m, Index n, Index num_threads = 1) : 32 | kc_(k), mc_(m), nc_(n) 33 | { 34 | if (ShardingType == ShardByCol) { 35 | computeProductBlockingSizes(kc_, mc_, nc_, num_threads); 36 | } 37 | else { 38 | computeProductBlockingSizes(kc_, nc_, mc_, num_threads); 39 | } 40 | } 41 | 42 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index kc() const { return kc_; } 43 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index mc() const { return mc_; } 44 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index nc() const { return nc_; } 45 | 46 | private: 47 | Index kc_; 48 | Index mc_; 49 | Index nc_; 50 | }; 51 | 52 | 53 | } // end namespace internal 54 | } // end namespace Eigen 55 | 56 | #endif // EIGEN_CXX11_TENSOR_TENSOR_CONTRACTION_BLOCKING_H 57 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGlobalFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 12 | 13 | namespace Eigen { 14 | 15 | /** \cpp11 \returns an expression of the coefficient-wise betainc(\a x, \a a, \a b) to the given tensors. 16 | * 17 | * This function computes the regularized incomplete beta function (integral). 18 | * 19 | */ 20 | template 21 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const 22 | TensorCwiseTernaryOp, 23 | const ADerived, const BDerived, const XDerived> 24 | betainc(const ADerived& a, const BDerived& b, const XDerived& x) { 25 | return TensorCwiseTernaryOp< 26 | internal::scalar_betainc_op, const ADerived, 27 | const BDerived, const XDerived>( 28 | a, b, x, internal::scalar_betainc_op()); 29 | } 30 | 31 | } // end namespace Eigen 32 | 33 | #endif // EIGEN_CXX11_TENSOR_TENSOR_GLOBAL_FUNCTIONS_H 34 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_TENSOR_TENSOR_META_MACROS_H 11 | #define EIGEN_CXX11_TENSOR_TENSOR_META_MACROS_H 12 | 13 | 14 | /** use this macro in sfinae selection in templated functions 15 | * 16 | * template::value , int >::type = 0 18 | * > 19 | * void foo(){} 20 | * 21 | * becomes => 22 | * 23 | * template::value ) 25 | * > 26 | * void foo(){} 27 | */ 28 | 29 | // SFINAE requires variadic templates 30 | #ifndef __CUDACC__ 31 | #if EIGEN_HAS_VARIADIC_TEMPLATES 32 | // SFINAE doesn't work for gcc <= 4.7 33 | #ifdef EIGEN_COMP_GNUC 34 | #if EIGEN_GNUC_AT_LEAST(4,8) 35 | #define EIGEN_HAS_SFINAE 36 | #endif 37 | #else 38 | #define EIGEN_HAS_SFINAE 39 | #endif 40 | #endif 41 | #endif 42 | 43 | #define EIGEN_SFINAE_ENABLE_IF( __condition__ ) \ 44 | typename internal::enable_if< ( __condition__ ) , int >::type = 0 45 | 46 | 47 | #if EIGEN_HAS_CONSTEXPR 48 | #define EIGEN_CONSTEXPR constexpr 49 | #else 50 | #define EIGEN_CONSTEXPR 51 | #endif 52 | 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadEnvironment.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 12 | 13 | namespace Eigen { 14 | 15 | struct StlThreadEnvironment { 16 | struct Task { 17 | std::function f; 18 | }; 19 | 20 | // EnvThread constructor must start the thread, 21 | // destructor must join the thread. 22 | class EnvThread { 23 | public: 24 | EnvThread(std::function f) : thr_(std::move(f)) {} 25 | ~EnvThread() { thr_.join(); } 26 | 27 | private: 28 | std::thread thr_; 29 | }; 30 | 31 | EnvThread* CreateThread(std::function f) { return new EnvThread(std::move(f)); } 32 | Task CreateTask(std::function f) { return Task{std::move(f)}; } 33 | void ExecuteTask(const Task& t) { t.f(); } 34 | }; 35 | 36 | } // namespace Eigen 37 | 38 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_ENVIRONMENT_H 39 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_LOCAL_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_LOCAL_H 12 | 13 | // Try to come up with a portable implementation of thread local variables 14 | #if EIGEN_COMP_GNUC && EIGEN_GNUC_AT_MOST(4, 7) 15 | #define EIGEN_THREAD_LOCAL static __thread 16 | #elif EIGEN_COMP_CLANG 17 | #define EIGEN_THREAD_LOCAL static __thread 18 | #else 19 | #define EIGEN_THREAD_LOCAL static thread_local 20 | #endif 21 | 22 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_LOCAL_H 23 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadPoolInterface.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2014 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 12 | 13 | namespace Eigen { 14 | 15 | // This defines an interface that ThreadPoolDevice can take to use 16 | // custom thread pools underneath. 17 | class ThreadPoolInterface { 18 | public: 19 | virtual void Schedule(std::function fn) = 0; 20 | 21 | // Returns the number of threads in the pool. 22 | virtual int NumThreads() const = 0; 23 | 24 | // Returns a logical thread index between 0 and NumThreads() - 1 if called 25 | // from one of the threads in the pool. Returns -1 otherwise. 26 | virtual int CurrentThreadId() const = 0; 27 | 28 | virtual ~ThreadPoolInterface() {} 29 | }; 30 | 31 | } // namespace Eigen 32 | 33 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 34 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadYield.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 11 | #define EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 12 | 13 | // Try to come up with a portable way to yield 14 | #if EIGEN_COMP_GNUC && EIGEN_GNUC_AT_MOST(4, 7) 15 | #define EIGEN_THREAD_YIELD() sched_yield() 16 | #else 17 | #define EIGEN_THREAD_YIELD() std::this_thread::yield() 18 | #endif 19 | 20 | #endif // EIGEN_CXX11_THREADPOOL_THREAD_YIELD_H 21 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/EulerAngles: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Tal Hadad 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_EULERANGLES_MODULE_H 11 | #define EIGEN_EULERANGLES_MODULE_H 12 | 13 | 14 | #include "Eigen/Core" 15 | #include "Eigen/Geometry" 16 | 17 | #include "Eigen/src/Core/util/DisableStupidWarnings.h" 18 | 19 | namespace Eigen { 20 | 21 | /** 22 | * \defgroup EulerAngles_Module EulerAngles module 23 | * \brief This module provides generic euler angles rotation. 24 | * 25 | * Euler angles are a way to represent 3D rotation. 26 | * 27 | * In order to use this module in your code, include this header: 28 | * \code 29 | * #include 30 | * \endcode 31 | * 32 | * See \ref EulerAngles for more information. 33 | * 34 | */ 35 | 36 | } 37 | 38 | #include "src/EulerAngles/EulerSystem.h" 39 | #include "src/EulerAngles/EulerAngles.h" 40 | 41 | #include "Eigen/src/Core/util/ReenableStupidWarnings.h" 42 | 43 | #endif // EIGEN_EULERANGLES_MODULE_H 44 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/IterativeSolvers: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_ITERATIVE_SOLVERS_MODULE_H 11 | #define EIGEN_ITERATIVE_SOLVERS_MODULE_H 12 | 13 | #include 14 | 15 | /** 16 | * \defgroup IterativeSolvers_Module Iterative solvers module 17 | * This module aims to provide various iterative linear and non linear solver algorithms. 18 | * It currently provides: 19 | * - a constrained conjugate gradient 20 | * - a Householder GMRES implementation 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | //@{ 26 | 27 | #ifndef EIGEN_MPL2_ONLY 28 | #include "src/IterativeSolvers/IterationController.h" 29 | #include "src/IterativeSolvers/ConstrainedConjGrad.h" 30 | #endif 31 | 32 | #include "src/IterativeSolvers/IncompleteLU.h" 33 | #include "../../Eigen/Jacobi" 34 | #include "../../Eigen/Householder" 35 | #include "src/IterativeSolvers/GMRES.h" 36 | #include "src/IterativeSolvers/DGMRES.h" 37 | //#include "src/IterativeSolvers/SSORPreconditioner.h" 38 | #include "src/IterativeSolvers/MINRES.h" 39 | 40 | //@} 41 | 42 | #endif // EIGEN_ITERATIVE_SOLVERS_MODULE_H 43 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/KroneckerProduct: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_KRONECKER_PRODUCT_MODULE_H 10 | #define EIGEN_KRONECKER_PRODUCT_MODULE_H 11 | 12 | #include "../../Eigen/Core" 13 | 14 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 15 | 16 | #include "../../Eigen/src/SparseCore/SparseUtil.h" 17 | 18 | namespace Eigen { 19 | 20 | /** 21 | * \defgroup KroneckerProduct_Module KroneckerProduct module 22 | * 23 | * This module contains an experimental Kronecker product implementation. 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | */ 29 | 30 | } // namespace Eigen 31 | 32 | #include "src/KroneckerProduct/KroneckerTensorProduct.h" 33 | 34 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif // EIGEN_KRONECKER_PRODUCT_MODULE_H 37 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/LevenbergMarquardt: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Thomas Capricelli 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_LEVENBERGMARQUARDT_MODULE 11 | #define EIGEN_LEVENBERGMARQUARDT_MODULE 12 | 13 | // #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | /** 23 | * \defgroup LevenbergMarquardt_Module Levenberg-Marquardt module 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | * 29 | * 30 | */ 31 | 32 | #include "Eigen/SparseCore" 33 | #ifndef EIGEN_PARSED_BY_DOXYGEN 34 | 35 | #include "src/LevenbergMarquardt/LMqrsolv.h" 36 | #include "src/LevenbergMarquardt/LMcovar.h" 37 | #include "src/LevenbergMarquardt/LMpar.h" 38 | 39 | #endif 40 | 41 | #include "src/LevenbergMarquardt/LevenbergMarquardt.h" 42 | #include "src/LevenbergMarquardt/LMonestep.h" 43 | 44 | 45 | #endif // EIGEN_LEVENBERGMARQUARDT_MODULE 46 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/MoreVectorization: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_MOREVECTORIZATION_MODULE_H 10 | #define EIGEN_MOREVECTORIZATION_MODULE_H 11 | 12 | #include 13 | 14 | namespace Eigen { 15 | 16 | /** 17 | * \defgroup MoreVectorization More vectorization module 18 | */ 19 | 20 | } 21 | 22 | #include "src/MoreVectorization/MathFunctions.h" 23 | 24 | #endif // EIGEN_MOREVECTORIZATION_MODULE_H 25 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/NumericalDiff: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Thomas Capricelli 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_NUMERICALDIFF_MODULE 11 | #define EIGEN_NUMERICALDIFF_MODULE 12 | 13 | #include 14 | 15 | namespace Eigen { 16 | 17 | /** 18 | * \defgroup NumericalDiff_Module Numerical differentiation module 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | * 24 | * See http://en.wikipedia.org/wiki/Numerical_differentiation 25 | * 26 | * Warning : this should NOT be confused with automatic differentiation, which 27 | * is a different method and has its own module in Eigen : \ref 28 | * AutoDiff_Module. 29 | * 30 | * Currently only "Forward" and "Central" schemes are implemented. Those 31 | * are basic methods, and there exist some more elaborated way of 32 | * computing such approximates. They are implemented using both 33 | * proprietary and free software, and usually requires linking to an 34 | * external library. It is very easy for you to write a functor 35 | * using such software, and the purpose is quite orthogonal to what we 36 | * want to achieve with Eigen. 37 | * 38 | * This is why we will not provide wrappers for every great numerical 39 | * differentiation software that exist, but should rather stick with those 40 | * basic ones, that still are useful for testing. 41 | * 42 | * Also, the \ref NonLinearOptimization_Module needs this in order to 43 | * provide full features compatibility with the original (c)minpack 44 | * package. 45 | * 46 | */ 47 | } 48 | 49 | //@{ 50 | 51 | #include "src/NumericalDiff/NumericalDiff.h" 52 | 53 | //@} 54 | 55 | 56 | #endif // EIGEN_NUMERICALDIFF_MODULE 57 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/Skyline: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_SKYLINE_MODULE_H 10 | #define EIGEN_SKYLINE_MODULE_H 11 | 12 | 13 | #include "Eigen/Core" 14 | 15 | #include "Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | /** 23 | * \defgroup Skyline_Module Skyline module 24 | * 25 | * 26 | * 27 | * 28 | */ 29 | 30 | #include "src/Skyline/SkylineUtil.h" 31 | #include "src/Skyline/SkylineMatrixBase.h" 32 | #include "src/Skyline/SkylineStorage.h" 33 | #include "src/Skyline/SkylineMatrix.h" 34 | #include "src/Skyline/SkylineInplaceLU.h" 35 | #include "src/Skyline/SkylineProduct.h" 36 | 37 | #include "Eigen/src/Core/util/ReenableStupidWarnings.h" 38 | 39 | #endif // EIGEN_SKYLINE_MODULE_H 40 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/SparseExtra: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_EXTRA_MODULE_H 11 | #define EIGEN_SPARSE_EXTRA_MODULE_H 12 | 13 | #include "../../Eigen/Sparse" 14 | 15 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #ifdef EIGEN_GOOGLEHASH_SUPPORT 26 | #include 27 | #endif 28 | 29 | /** 30 | * \defgroup SparseExtra_Module SparseExtra module 31 | * 32 | * This module contains some experimental features extending the sparse module. 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | */ 38 | 39 | 40 | #include "src/SparseExtra/DynamicSparseMatrix.h" 41 | #include "src/SparseExtra/BlockOfDynamicSparseMatrix.h" 42 | #include "src/SparseExtra/RandomSetter.h" 43 | 44 | #include "src/SparseExtra/MarketIO.h" 45 | 46 | #if !defined(_WIN32) 47 | #include 48 | #include "src/SparseExtra/MatrixMarketIterator.h" 49 | #endif 50 | 51 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 52 | 53 | #endif // EIGEN_SPARSE_EXTRA_MODULE_H 54 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/SpecialFunctions: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPECIALFUNCTIONS_MODULE 11 | #define EIGEN_SPECIALFUNCTIONS_MODULE 12 | 13 | #include 14 | 15 | #include "../../Eigen/Core" 16 | 17 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 18 | 19 | namespace Eigen { 20 | 21 | /** 22 | * \defgroup SpecialFunctions_Module Special math functions module 23 | * 24 | * This module features additional coefficient-wise math functions available 25 | * within the numext:: namespace for the scalar version, and as method and/or free 26 | * functions of Array. Those include: 27 | * 28 | * - erf 29 | * - erfc 30 | * - lgamma 31 | * - igamma 32 | * - igammac 33 | * - digamma 34 | * - polygamma 35 | * - zeta 36 | * - betainc 37 | * 38 | * \code 39 | * #include 40 | * \endcode 41 | */ 42 | //@{ 43 | 44 | } 45 | 46 | #include "src/SpecialFunctions/SpecialFunctionsImpl.h" 47 | #include "src/SpecialFunctions/SpecialFunctionsPacketMath.h" 48 | #include "src/SpecialFunctions/SpecialFunctionsHalf.h" 49 | #include "src/SpecialFunctions/SpecialFunctionsFunctors.h" 50 | #include "src/SpecialFunctions/SpecialFunctionsArrayAPI.h" 51 | 52 | #if defined EIGEN_VECTORIZE_CUDA 53 | #include "src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h" 54 | #endif 55 | 56 | namespace Eigen { 57 | //@} 58 | } 59 | 60 | 61 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 62 | 63 | #endif // EIGEN_SPECIALFUNCTIONS_MODULE 64 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/Splines: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 20010-2011 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPLINES_MODULE_H 11 | #define EIGEN_SPLINES_MODULE_H 12 | 13 | namespace Eigen 14 | { 15 | /** 16 | * \defgroup Splines_Module Spline and spline fitting module 17 | * 18 | * This module provides a simple multi-dimensional spline class while 19 | * offering most basic functionality to fit a spline to point sets. 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | } 26 | 27 | #include "src/Splines/SplineFwd.h" 28 | #include "src/Splines/Spline.h" 29 | #include "src/Splines/SplineFitting.h" 30 | 31 | #endif // EIGEN_SPLINES_MODULE_H 32 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/src/NonLinearOptimization/chkder.h: -------------------------------------------------------------------------------- 1 | #define chkder_log10e 0.43429448190325182765 2 | #define chkder_factor 100. 3 | 4 | namespace Eigen { 5 | 6 | namespace internal { 7 | 8 | template 9 | void chkder( 10 | const Matrix< Scalar, Dynamic, 1 > &x, 11 | const Matrix< Scalar, Dynamic, 1 > &fvec, 12 | const Matrix< Scalar, Dynamic, Dynamic > &fjac, 13 | Matrix< Scalar, Dynamic, 1 > &xp, 14 | const Matrix< Scalar, Dynamic, 1 > &fvecp, 15 | int mode, 16 | Matrix< Scalar, Dynamic, 1 > &err 17 | ) 18 | { 19 | using std::sqrt; 20 | using std::abs; 21 | using std::log; 22 | 23 | typedef DenseIndex Index; 24 | 25 | const Scalar eps = sqrt(NumTraits::epsilon()); 26 | const Scalar epsf = chkder_factor * NumTraits::epsilon(); 27 | const Scalar epslog = chkder_log10e * log(eps); 28 | Scalar temp; 29 | 30 | const Index m = fvec.size(), n = x.size(); 31 | 32 | if (mode != 2) { 33 | /* mode = 1. */ 34 | xp.resize(n); 35 | for (Index j = 0; j < n; ++j) { 36 | temp = eps * abs(x[j]); 37 | if (temp == 0.) 38 | temp = eps; 39 | xp[j] = x[j] + temp; 40 | } 41 | } 42 | else { 43 | /* mode = 2. */ 44 | err.setZero(m); 45 | for (Index j = 0; j < n; ++j) { 46 | temp = abs(x[j]); 47 | if (temp == 0.) 48 | temp = 1.; 49 | err += temp * fjac.col(j); 50 | } 51 | for (Index i = 0; i < m; ++i) { 52 | temp = 1.; 53 | if (fvec[i] != 0. && fvecp[i] != 0. && abs(fvecp[i] - fvec[i]) >= epsf * abs(fvec[i])) 54 | temp = eps * abs((fvecp[i] - fvec[i]) / eps - err[i]) / (abs(fvec[i]) + abs(fvecp[i])); 55 | err[i] = 1.; 56 | if (temp > NumTraits::epsilon() && temp < eps) 57 | err[i] = (chkder_log10e * log(temp) - epslog) / epslog; 58 | if (temp >= eps) 59 | err[i] = 0.; 60 | } 61 | } 62 | } 63 | 64 | } // end namespace internal 65 | 66 | } // end namespace Eigen 67 | -------------------------------------------------------------------------------- /include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | // TODO : move this to GivensQR once there's such a thing in Eigen 6 | 7 | template 8 | void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector > &v_givens, const std::vector > &w_givens) 9 | { 10 | typedef DenseIndex Index; 11 | 12 | /* apply the first set of givens rotations to a. */ 13 | for (Index j = n-2; j>=0; --j) 14 | for (Index i = 0; i 6 | void rwupdt( 7 | Matrix< Scalar, Dynamic, Dynamic > &r, 8 | const Matrix< Scalar, Dynamic, 1> &w, 9 | Matrix< Scalar, Dynamic, 1> &b, 10 | Scalar alpha) 11 | { 12 | typedef DenseIndex Index; 13 | 14 | const Index n = r.cols(); 15 | eigen_assert(r.rows()>=n); 16 | std::vector > givens(n); 17 | 18 | /* Local variables */ 19 | Scalar temp, rowj; 20 | 21 | /* Function Body */ 22 | for (Index j = 0; j < n; ++j) { 23 | rowj = w[j]; 24 | 25 | /* apply the previous transformations to */ 26 | /* r(i,j), i=0,1,...,j-1, and to w(j). */ 27 | for (Index i = 0; i < j; ++i) { 28 | temp = givens[i].c() * r(i,j) + givens[i].s() * rowj; 29 | rowj = -givens[i].s() * r(i,j) + givens[i].c() * rowj; 30 | r(i,j) = temp; 31 | } 32 | 33 | /* determine a givens rotation which eliminates w(j). */ 34 | givens[j].makeGivens(-r(j,j), rowj); 35 | 36 | if (rowj == 0.) 37 | continue; // givens[j] is identity 38 | 39 | /* apply the current transformation to r(j,j), b(j), and alpha. */ 40 | r(j,j) = givens[j].c() * r(j,j) + givens[j].s() * rowj; 41 | temp = givens[j].c() * b[j] + givens[j].s() * alpha; 42 | alpha = -givens[j].s() * b[j] + givens[j].c() * alpha; 43 | b[j] = temp; 44 | } 45 | } 46 | 47 | } // end namespace internal 48 | 49 | } // end namespace Eigen 50 | -------------------------------------------------------------------------------- /include/make_unique.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __PRECXX14_MAKE_UNIQUE__ 2 | #define __PRECXX14_MAKE_UNIQUE__ 3 | 4 | #if __cplusplus >= 201402L 5 | #include 6 | using std::make_unique 7 | #else 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | template struct _Unique_if { typedef unique_ptr _Single_object; }; 15 | 16 | template struct _Unique_if { 17 | typedef unique_ptr _Unknown_bound; 18 | }; 19 | 20 | template struct _Unique_if { 21 | typedef void _Known_bound; 22 | }; 23 | 24 | template 25 | typename _Unique_if::_Single_object make_unique(Args&&... args) { 26 | return unique_ptr(new T(std::forward(args)...)); 27 | } 28 | 29 | template 30 | typename _Unique_if::_Unknown_bound make_unique(size_t n) { 31 | typedef typename remove_extent::type U; 32 | return unique_ptr(new U[n]()); 33 | } 34 | 35 | template 36 | typename _Unique_if::_Known_bound make_unique(Args&&...) = delete; 37 | 38 | #endif // C++11 39 | #endif //__PRECXX14_MAKE_UNIQUE__ 40 | -------------------------------------------------------------------------------- /include/parallel_hashmap/conanfile.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | from conans import ConanFile, tools 5 | import os 6 | 7 | class SparseppConan(ConanFile): 8 | name = "parallel_hashmap" 9 | version = "1.27" 10 | description = "A header-only, very fast and memory-friendly hash map" 11 | 12 | # Indicates License type of the packaged library 13 | license = "https://github.com/greg7mdp/parallel-hashmap/blob/master/LICENSE" 14 | 15 | # Packages the license for the conanfile.py 16 | exports = ["LICENSE"] 17 | 18 | # Custom attributes for Bincrafters recipe conventions 19 | source_subfolder = "source_subfolder" 20 | 21 | def source(self): 22 | source_url = "https://github.com/greg7mdp/parallel-hashmap" 23 | tools.get("{0}/archive/{1}.tar.gz".format(source_url, self.version)) 24 | extracted_dir = self.name + "-" + self.version 25 | 26 | #Rename to "source_folder" is a convention to simplify later steps 27 | os.rename(extracted_dir, self.source_subfolder) 28 | 29 | 30 | def package(self): 31 | include_folder = os.path.join(self.source_subfolder, "parallel_hashmap") 32 | self.copy(pattern="LICENSE") 33 | self.copy(pattern="*", dst="include/parallel_hashmap", src=include_folder) 34 | 35 | def package_id(self): 36 | self.info.header_only() 37 | -------------------------------------------------------------------------------- /include/radicl/RADHeader.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __RAD_HEADER__ 2 | #define __RAD_HEADER__ 3 | 4 | #include "radicl/BasicBinWriter.hpp" 5 | #include 6 | 7 | class RADHeader { 8 | private: 9 | 10 | bool is_paired_{false}; 11 | uint64_t ref_count_{0}; 12 | std::vector ref_names; 13 | uint64_t num_chunks_{0}; 14 | 15 | public: 16 | 17 | //bool from_file(); 18 | 19 | // adds n to the list of reference names and 20 | // returns the total number of reference names 21 | uint64_t add_refname(const std::string& n) { 22 | ref_names.emplace_back(n); 23 | ++ref_count_; 24 | return ref_count_; 25 | } 26 | 27 | bool is_paired() const { return is_paired_; } 28 | void is_paired(bool ip) { is_paired_ = ip; } 29 | 30 | bool dump_to_bin(BasicBinWriter& bw) { 31 | uint8_t p = is_paired_ ? 1 : 0; 32 | bw << p; 33 | bw << ref_count_; 34 | for (auto& n : ref_names) { 35 | bw << n; 36 | } 37 | bw << num_chunks_; 38 | return true; 39 | } 40 | }; 41 | 42 | #endif // __RAD_HEADER__ -------------------------------------------------------------------------------- /include/spdlog/details/log_msg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../common.h" 9 | #include "../details/os.h" 10 | 11 | 12 | #include 13 | #include 14 | 15 | namespace spdlog 16 | { 17 | namespace details 18 | { 19 | struct log_msg 20 | { 21 | log_msg() = default; 22 | log_msg(const std::string *loggers_name, level::level_enum lvl) : 23 | logger_name(loggers_name), 24 | level(lvl), 25 | msg_id(0) 26 | { 27 | #ifndef SPDLOG_NO_DATETIME 28 | time = os::now(); 29 | #endif 30 | 31 | #ifndef SPDLOG_NO_THREAD_ID 32 | thread_id = os::thread_id(); 33 | #endif 34 | } 35 | 36 | log_msg(const log_msg& other) = delete; 37 | log_msg& operator=(log_msg&& other) = delete; 38 | log_msg(log_msg&& other) = delete; 39 | 40 | 41 | const std::string *logger_name; 42 | level::level_enum level; 43 | log_clock::time_point time; 44 | size_t thread_id; 45 | fmt::MemoryWriter raw; 46 | fmt::MemoryWriter formatted; 47 | size_t msg_id; 48 | }; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /include/spdlog/details/null_mutex.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include 9 | // null, no cost dummy "mutex" and dummy "atomic" int 10 | 11 | namespace spdlog 12 | { 13 | namespace details 14 | { 15 | struct null_mutex 16 | { 17 | void lock() {} 18 | void unlock() {} 19 | bool try_lock() 20 | { 21 | return true; 22 | } 23 | }; 24 | 25 | struct null_atomic_int 26 | { 27 | int value; 28 | null_atomic_int() = default; 29 | 30 | null_atomic_int(int val):value(val) 31 | {} 32 | 33 | int load(std::memory_order) const 34 | { 35 | return value; 36 | } 37 | 38 | void store(int val) 39 | { 40 | value = val; 41 | } 42 | }; 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /include/spdlog/fmt/bundled/ostream.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Formatting library for C++ - std::ostream support 3 | 4 | Copyright (c) 2012 - 2016, Victor Zverovich 5 | All rights reserved. 6 | 7 | For the license information refer to format.h. 8 | */ 9 | 10 | #include "ostream.h" 11 | 12 | namespace fmt { 13 | 14 | namespace internal { 15 | FMT_FUNC void write(std::ostream &os, Writer &w) { 16 | const char *data = w.data(); 17 | typedef internal::MakeUnsigned::Type UnsignedStreamSize; 18 | UnsignedStreamSize size = w.size(); 19 | UnsignedStreamSize max_size = 20 | internal::to_unsigned((std::numeric_limits::max)()); 21 | do { 22 | UnsignedStreamSize n = size <= max_size ? size : max_size; 23 | os.write(data, static_cast(n)); 24 | data += n; 25 | size -= n; 26 | } while (size != 0); 27 | } 28 | } 29 | 30 | FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args) { 31 | MemoryWriter w; 32 | w.write(format_str, args); 33 | internal::write(os, w); 34 | } 35 | } // namespace fmt 36 | -------------------------------------------------------------------------------- /include/spdlog/fmt/bundled/printf.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Formatting library for C++ 3 | 4 | Copyright (c) 2012 - 2016, Victor Zverovich 5 | All rights reserved. 6 | 7 | For the license information refer to format.h. 8 | */ 9 | 10 | #include "format.h" 11 | #include "printf.h" 12 | 13 | namespace fmt { 14 | 15 | template 16 | void printf(BasicWriter &w, BasicCStringRef format, ArgList args); 17 | 18 | FMT_FUNC int fprintf(std::FILE *f, CStringRef format, ArgList args) { 19 | MemoryWriter w; 20 | printf(w, format, args); 21 | std::size_t size = w.size(); 22 | return std::fwrite(w.data(), 1, size, f) < size ? -1 : static_cast(size); 23 | } 24 | 25 | #ifndef FMT_HEADER_ONLY 26 | 27 | template void PrintfFormatter::format(CStringRef format); 28 | template void PrintfFormatter::format(WCStringRef format); 29 | 30 | #endif // FMT_HEADER_ONLY 31 | 32 | } // namespace fmt 33 | -------------------------------------------------------------------------------- /include/spdlog/fmt/fmt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // 9 | // Include a bundled header-only copy of fmtlib or an external one. 10 | // By default spdlog include its own copy. 11 | // 12 | 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #ifndef FMT_USE_WINDOWS_H 19 | #define FMT_USE_WINDOWS_H 0 20 | #endif 21 | #include "bundled/format.h" 22 | #if defined(SPDLOG_FMT_PRINTF) 23 | #include "bundled/printf.h" 24 | #endif 25 | 26 | #else //external fmtlib 27 | 28 | #include 29 | #if defined(SPDLOG_FMT_PRINTF) 30 | #include 31 | #endif 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /include/spdlog/fmt/ostr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // include external or bundled copy of fmtlib's ostream support 9 | // 10 | #if !defined(SPDLOG_FMT_EXTERNAL) 11 | #include "fmt.h" 12 | #include "bundled/ostream.h" 13 | #else 14 | #include 15 | #endif 16 | 17 | 18 | -------------------------------------------------------------------------------- /include/spdlog/formatter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "details/log_msg.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace spdlog 15 | { 16 | namespace details 17 | { 18 | class flag_formatter; 19 | } 20 | 21 | class formatter 22 | { 23 | public: 24 | virtual ~formatter() {} 25 | virtual void format(details::log_msg& msg) = 0; 26 | }; 27 | 28 | class pattern_formatter SPDLOG_FINAL : public formatter 29 | { 30 | 31 | public: 32 | explicit pattern_formatter(const std::string& pattern, pattern_time_type pattern_time = pattern_time_type::local); 33 | pattern_formatter(const pattern_formatter&) = delete; 34 | pattern_formatter& operator=(const pattern_formatter&) = delete; 35 | void format(details::log_msg& msg) override; 36 | private: 37 | const std::string _pattern; 38 | const pattern_time_type _pattern_time; 39 | std::vector> _formatters; 40 | std::tm get_time(details::log_msg& msg); 41 | void handle_flag(char flag); 42 | void compile_pattern(const std::string& pattern); 43 | }; 44 | } 45 | 46 | #include "details/pattern_formatter_impl.h" 47 | 48 | -------------------------------------------------------------------------------- /include/spdlog/sinks/base_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // base sink templated over a mutex (either dummy or real) 9 | // concrete implementation should only override the _sink_it method. 10 | // all locking is taken care of here so no locking needed by the implementers.. 11 | // 12 | 13 | #include "sink.h" 14 | #include "../formatter.h" 15 | #include "../common.h" 16 | #include "../details/log_msg.h" 17 | 18 | #include 19 | 20 | namespace spdlog 21 | { 22 | namespace sinks 23 | { 24 | template 25 | class base_sink:public sink 26 | { 27 | public: 28 | base_sink():_mutex() {} 29 | virtual ~base_sink() = default; 30 | 31 | base_sink(const base_sink&) = delete; 32 | base_sink& operator=(const base_sink&) = delete; 33 | 34 | void log(const details::log_msg& msg) SPDLOG_FINAL override 35 | { 36 | std::lock_guard lock(_mutex); 37 | _sink_it(msg); 38 | } 39 | void flush() SPDLOG_FINAL override 40 | { 41 | std::lock_guard lock(_mutex); 42 | _flush(); 43 | } 44 | 45 | protected: 46 | virtual void _sink_it(const details::log_msg& msg) = 0; 47 | virtual void _flush() = 0; 48 | Mutex _mutex; 49 | }; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /include/spdlog/sinks/dist_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2015 David Schury, Gabi Melman 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../details/log_msg.h" 9 | #include "../details/null_mutex.h" 10 | #include "base_sink.h" 11 | #include "sink.h" 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | // Distribution sink (mux). Stores a vector of sinks which get called when log is called 19 | 20 | namespace spdlog 21 | { 22 | namespace sinks 23 | { 24 | template 25 | class dist_sink: public base_sink 26 | { 27 | public: 28 | explicit dist_sink() :_sinks() {} 29 | dist_sink(const dist_sink&) = delete; 30 | dist_sink& operator=(const dist_sink&) = delete; 31 | virtual ~dist_sink() = default; 32 | 33 | protected: 34 | std::vector> _sinks; 35 | 36 | void _sink_it(const details::log_msg& msg) override 37 | { 38 | for (auto &sink : _sinks) 39 | { 40 | if( sink->should_log( msg.level)) 41 | { 42 | sink->log(msg); 43 | } 44 | } 45 | } 46 | 47 | void _flush() override 48 | { 49 | for (auto &sink : _sinks) 50 | sink->flush(); 51 | } 52 | 53 | public: 54 | 55 | 56 | void add_sink(std::shared_ptr sink) 57 | { 58 | std::lock_guard lock(base_sink::_mutex); 59 | _sinks.push_back(sink); 60 | } 61 | 62 | void remove_sink(std::shared_ptr sink) 63 | { 64 | std::lock_guard lock(base_sink::_mutex); 65 | _sinks.erase(std::remove(_sinks.begin(), _sinks.end(), sink), _sinks.end()); 66 | } 67 | }; 68 | 69 | typedef dist_sink dist_sink_mt; 70 | typedef dist_sink dist_sink_st; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /include/spdlog/sinks/msvc_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Alexander Dalshov. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #if defined(_WIN32) 9 | 10 | #include "base_sink.h" 11 | #include "../details/null_mutex.h" 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | namespace spdlog 19 | { 20 | namespace sinks 21 | { 22 | /* 23 | * MSVC sink (logging using OutputDebugStringA) 24 | */ 25 | template 26 | class msvc_sink : public base_sink < Mutex > 27 | { 28 | public: 29 | explicit msvc_sink() 30 | { 31 | } 32 | 33 | 34 | 35 | protected: 36 | void _sink_it(const details::log_msg& msg) override 37 | { 38 | OutputDebugStringA(msg.formatted.c_str()); 39 | } 40 | 41 | void _flush() override 42 | {} 43 | }; 44 | 45 | typedef msvc_sink msvc_sink_mt; 46 | typedef msvc_sink msvc_sink_st; 47 | 48 | } 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/spdlog/sinks/null_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "base_sink.h" 9 | #include "../details/null_mutex.h" 10 | 11 | #include 12 | 13 | namespace spdlog 14 | { 15 | namespace sinks 16 | { 17 | 18 | template 19 | class null_sink : public base_sink < Mutex > 20 | { 21 | protected: 22 | void _sink_it(const details::log_msg&) override 23 | {} 24 | 25 | void _flush() override 26 | {} 27 | 28 | }; 29 | typedef null_sink null_sink_st; 30 | typedef null_sink null_sink_mt; 31 | 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /include/spdlog/sinks/ostream_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../details/null_mutex.h" 9 | #include "base_sink.h" 10 | 11 | #include 12 | #include 13 | 14 | namespace spdlog 15 | { 16 | namespace sinks 17 | { 18 | template 19 | class ostream_sink: public base_sink 20 | { 21 | public: 22 | explicit ostream_sink(std::ostream& os, bool force_flush=false) :_ostream(os), _force_flush(force_flush) {} 23 | ostream_sink(const ostream_sink&) = delete; 24 | ostream_sink& operator=(const ostream_sink&) = delete; 25 | virtual ~ostream_sink() = default; 26 | 27 | protected: 28 | void _sink_it(const details::log_msg& msg) override 29 | { 30 | _ostream.write(msg.formatted.data(), msg.formatted.size()); 31 | if (_force_flush) 32 | _ostream.flush(); 33 | } 34 | 35 | void _flush() override 36 | { 37 | _ostream.flush(); 38 | } 39 | 40 | std::ostream& _ostream; 41 | bool _force_flush; 42 | }; 43 | 44 | typedef ostream_sink ostream_sink_mt; 45 | typedef ostream_sink ostream_sink_st; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /include/spdlog/sinks/sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | 7 | #pragma once 8 | 9 | #include "../details/log_msg.h" 10 | 11 | namespace spdlog 12 | { 13 | namespace sinks 14 | { 15 | class sink 16 | { 17 | public: 18 | sink() 19 | { 20 | _level = level::trace; 21 | } 22 | 23 | virtual ~sink() {} 24 | virtual void log(const details::log_msg& msg) = 0; 25 | virtual void flush() = 0; 26 | 27 | bool should_log(level::level_enum msg_level) const; 28 | void set_level(level::level_enum log_level); 29 | level::level_enum level() const; 30 | 31 | private: 32 | level_t _level; 33 | 34 | }; 35 | 36 | inline bool sink::should_log(level::level_enum msg_level) const 37 | { 38 | return msg_level >= _level.load(std::memory_order_relaxed); 39 | } 40 | 41 | inline void sink::set_level(level::level_enum log_level) 42 | { 43 | _level.store(log_level); 44 | } 45 | 46 | inline level::level_enum sink::level() const 47 | { 48 | return static_cast(_level.load(std::memory_order_relaxed)); 49 | } 50 | 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /include/spdlog/sinks/stdout_sinks.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include "../details/null_mutex.h" 9 | #include "base_sink.h" 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace spdlog 16 | { 17 | namespace sinks 18 | { 19 | 20 | template 21 | class stdout_sink SPDLOG_FINAL : public base_sink 22 | { 23 | using MyType = stdout_sink; 24 | public: 25 | stdout_sink() 26 | {} 27 | static std::shared_ptr instance() 28 | { 29 | static std::shared_ptr instance = std::make_shared(); 30 | return instance; 31 | } 32 | protected: 33 | void _sink_it(const details::log_msg& msg) override 34 | { 35 | fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), stdout); 36 | _flush(); 37 | } 38 | 39 | void _flush() override 40 | { 41 | fflush(stdout); 42 | } 43 | }; 44 | 45 | typedef stdout_sink stdout_sink_st; 46 | typedef stdout_sink stdout_sink_mt; 47 | 48 | 49 | template 50 | class stderr_sink SPDLOG_FINAL : public base_sink 51 | { 52 | using MyType = stderr_sink; 53 | public: 54 | stderr_sink() 55 | {} 56 | static std::shared_ptr instance() 57 | { 58 | static std::shared_ptr instance = std::make_shared(); 59 | return instance; 60 | } 61 | protected: 62 | void _sink_it(const details::log_msg& msg) override 63 | { 64 | fwrite(msg.formatted.data(), sizeof(char), msg.formatted.size(), stderr); 65 | _flush(); 66 | } 67 | 68 | void _flush() override 69 | { 70 | fflush(stderr); 71 | } 72 | }; 73 | 74 | typedef stderr_sink stderr_sink_mt; 75 | typedef stderr_sink stderr_sink_st; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /include/spdlog/sinks/windebug_sink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2017 Alexander Dalshov. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #if defined(_WIN32) 9 | 10 | #include "msvc_sink.h" 11 | 12 | namespace spdlog 13 | { 14 | namespace sinks 15 | { 16 | 17 | /* 18 | * Windows debug sink (logging using OutputDebugStringA, synonym for msvc_sink) 19 | */ 20 | template 21 | using windebug_sink = msvc_sink; 22 | 23 | typedef msvc_sink_mt windebug_sink_mt; 24 | typedef msvc_sink_st windebug_sink_st; 25 | 26 | } 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /sample_data.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/COMBINE-lab/salmon/a2f6912b3f9f9af91e3a4b0d74adcb3bdc4c9a32/sample_data.tgz -------------------------------------------------------------------------------- /scripts/AddHeaders.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage() 4 | { 5 | cat << EOF 6 | usage: $0 options 7 | 8 | This script adds a header to all files matching the provided pattern in the given directory 9 | 10 | OPTIONS: 11 | -h Show this message 12 | -l license file 13 | -d directory to search 14 | -p file pattern to match 15 | EOF 16 | } 17 | 18 | license= 19 | pattern= 20 | directory= 21 | while getopts "hl:p:d:" OPTION 22 | do 23 | case $OPTION in 24 | h) 25 | usage 26 | exit 1 27 | ;; 28 | l) 29 | license=$OPTARG 30 | ;; 31 | p) 32 | pattern=$OPTARG 33 | ;; 34 | d) 35 | directory=$OPTARG 36 | ;; 37 | ?) 38 | usage 39 | exit 40 | ;; 41 | esac 42 | done 43 | 44 | echo "Prepending ${license} to files with pattern ${pattern} in directory ${directory}" 45 | 46 | for i in ${directory}/${pattern} 47 | do 48 | if ! grep -q Copyright $i 49 | then 50 | cat ${license} $i >$i.new && mv $i.new $i 51 | fi 52 | done 53 | -------------------------------------------------------------------------------- /scripts/ComputeMutationRate.py: -------------------------------------------------------------------------------- 1 | """Compute Mutation Rate 2 | 3 | Usage: 4 | ComputeMutationRate.py 5 | 6 | 7 | Options: 8 | -h --help Show this message. 9 | """ 10 | from docopt import docopt 11 | from Bio import SeqIO 12 | import itertools 13 | 14 | 15 | class bcolors: 16 | HEADER = '\033[95m' 17 | OKBLUE = '\033[94m' 18 | OKGREEN = '\033[92m' 19 | WARNING = '\033[93m' 20 | FAIL = '\033[91m' 21 | ENDC = '\033[0m' 22 | 23 | def disable(self): 24 | self.HEADER = '' 25 | self.OKBLUE = '' 26 | self.OKGREEN = '' 27 | self.WARNING = '' 28 | self.FAIL = '' 29 | self.ENDC = '' 30 | 31 | def main(args): 32 | in1 = args[''] 33 | in2 = args[''] 34 | 35 | seq1 = SeqIO.parse(in1, 'fasta') 36 | seq2 = SeqIO.parse(in2, 'fasta') 37 | nMut = 0 38 | totLen = 0 39 | i = 0 40 | 41 | for s1, s2 in itertools.izip(seq1, seq2): 42 | o1 = "" 43 | o2 = "" 44 | newMut = True 45 | assert(s1.name == s2.name) 46 | totLen += len(s1.seq) 47 | for a,b in itertools.izip(s1.seq, s2.seq): 48 | if a != b: 49 | nMut+= 1 50 | newMut = True 51 | o1 += bcolors.OKGREEN + a + bcolors.ENDC 52 | o2 += bcolors.FAIL + b + bcolors.ENDC 53 | else: 54 | if newMut: 55 | o1 += "***" 56 | o2 += "***" 57 | newMut = False 58 | 59 | i += 1 60 | print(o1) 61 | print(o2) 62 | if i % 1000 == 0: 63 | print("There were {} mutations in {} bases; total rate = {:0.2f}\r\r".format(\ 64 | nMut, totLen, (100.0 * nMut) / totLen)) 65 | print("There were {} mutations in {} bases; total rate = {:0.2f}\r\r".format(\ 66 | nMut, totLen, (100.0 * nMut) / totLen)) 67 | 68 | if __name__ == "__main__": 69 | args = docopt(__doc__, version="Compute Mutation Rate v1.0") 70 | main(args) 71 | -------------------------------------------------------------------------------- /scripts/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM combinelab/holy-build-box-64:latest_working 2 | 3 | RUN set -x 4 | 5 | # Install things we need 6 | RUN yum install -y --quiet wget 7 | RUN wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm 8 | RUN rpm -i --quiet epel-release-5-4.noarch.rpm 9 | #yum install -y --quiet git 10 | RUN yum install -y --quiet unzip 11 | RUN yum install -y --quiet bzip2-devel.x86_64 12 | RUN yum install -y --quiet xz-devel.x86_64 13 | RUN yum install -y --quiet git 14 | 15 | RUN wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz 16 | RUN tar xzf boost_1_59_0.tar.gz 17 | WORKDIR "/boost_1_59_0" 18 | RUN source /hbb_exe/activate && ./bootstrap.sh --prefix=/usr --with-libraries=iostreams,atomic,chrono,container,date_time,exception,filesystem,graph,graph_parallel,math,program_options,system,thread,timer,serialization 19 | RUN source /hbb_exe/activate && ./b2 -d0 -j10 cxxflags=-std=c++11 link=static install 20 | WORKDIR "/" 21 | RUN rm boost_1_59_0.tar.gz 22 | RUN rm -fr "/boost_1_59_0" 23 | RUN wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh 24 | RUN bash Miniconda2-latest-Linux-x86_64.sh -b 25 | RUN source /hbb_exe/activate && PYTHONPATH=/root/miniconda2/lib/python2.7/site-packages PATH=/root/miniconda2/bin:$PATH pip install pandas scipy numpy 26 | #matplotlib seaborn 27 | 28 | # java 29 | RUN wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jre-8u60-linux-x64.rpm" -O jre-8u60-linux-x64.rpm 30 | RUN yum localinstall --nogpgcheck -y --quiet jre-8u60-linux-x64.rpm 31 | RUN rm jre-8u60-linux-x64.rpm 32 | 33 | # and nextflow 34 | RUN curl -fsSL get.nextflow.io | bash 35 | RUN mv nextflow /usr/local/bin/ 36 | 37 | RUN yum install -y --quiet shasum 38 | -------------------------------------------------------------------------------- /scripts/build_docker_binary.sh: -------------------------------------------------------------------------------- 1 | #~/bin/bash 2 | 3 | echo "building pre-compiled linux release for Salmon $1" 4 | 5 | docker run -t -i --rm -v `pwd`:/io phusion/holy-build-box-64:latest bash /io/compile.sh develop $1 6 | -------------------------------------------------------------------------------- /scripts/bump_version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | HERE="$( cd "$(dirname "$0")" ; pwd -P )" 4 | 5 | major_v=`${HERE}/../build/src/salmon -v | cut -d ' ' -f 2 | cut -d '.' -f 1` 6 | minor_v=`${HERE}/../build/src/salmon -v | cut -d ' ' -f 2 | cut -d '.' -f 2` 7 | patch_v=`${HERE}/../build/src/salmon -v | cut -d ' ' -f 2 | cut -d '.' -f 3` 8 | 9 | echo "VERSION : ${major_v}.${minor_v}.${patch_v}" 10 | 11 | # update docker file 12 | awk -v majv=${major_v} -v minv=${minor_v} -v patchv=${patch_v} '{ if ($0 ~ /ENV SALMON_VERSION/) { print "ENV SALMON_VERSION " majv"."minv"."patchv; } else { print $0; }}' \ 13 | ${HERE}/../docker/Dockerfile > ${HERE}/../docker/Dockerfile.new && mv ${HERE}/../docker/Dockerfile.new ${HERE}/../docker/Dockerfile 14 | 15 | # update docker build script 16 | awk -v majv=${major_v} -v minv=${minor_v} -v patchv=${patch_v} '{ if ($0 ~ /SALMON_VERSION=/) { print "SALMON_VERSION="majv"."minv"."patchv; } else { print $0; }}' \ 17 | ${HERE}/../docker/build_test.sh > ${HERE}/../docker/build_test.sh.new && mv ${HERE}/../docker/build_test.sh.new ${HERE}/../docker/build_test.sh 18 | 19 | # update version file (which feeds cmake) 20 | echo -e "VERSION_MAJOR ${major_v}\nVERSION_MINOR ${minor_v}\nVERSION_PATCH ${patch_v}" > ${HERE}/../current_version.txt 21 | 22 | # update conf.py 23 | awk -v majv=${major_v} -v minv=${minor_v} -v patchv=${patch_v} \ 24 | '{ if ($0 ~ /version = /) { print "version = '\''" majv"."minv"'\''"; } else if ($0 ~ /release = /) { print "release = '\''" majv"."minv"."patchv"'\''"; } else { print $0; }}' \ 25 | ${HERE}/../doc/source/conf.py > ${HERE}/../doc/source/conf.py.new && mv ${HERE}/../doc/source/conf.py.new ${HERE}/../doc/source/conf.py 26 | -------------------------------------------------------------------------------- /scripts/check_shasum.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exists() 4 | { 5 | command -v "$1" >/dev/null 2>&1 6 | } 7 | 8 | sum=$1 9 | fname=$2 10 | 11 | hashcheck="" 12 | if exists sha256sum; then 13 | hashcheck="sha256sum" 14 | elif exists shasum; then 15 | hashcheck="shasum -a256" 16 | else 17 | unset hashcheck 18 | fi 19 | 20 | if [ -z "${hashcheck-}" ]; then 21 | echo "Couldn't find shasum command; can't verify contents of ${fname}"; 22 | else 23 | echo "${sum} ${fname}" | ${hashcheck} -c - || { echo "${fname} did not match expected SHA256! Exiting."; exit 1; } 24 | fi 25 | 26 | 27 | -------------------------------------------------------------------------------- /scripts/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | branch=$1 5 | version=$2 6 | 7 | echo "Building salmon [branch = ${branch}]. Tagging version as ${version}" 8 | 9 | # Activate Holy Build Box environment. 10 | source /hbb_exe/activate 11 | 12 | set -x 13 | 14 | # Install things we need 15 | yum install -y --quiet wget 16 | wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm 17 | rpm -i --quiet epel-release-5-4.noarch.rpm 18 | #yum install -y --quiet git 19 | yum install -y --quiet unzip 20 | yum install -y --quiet bzip2-devel.x86_64 21 | yum install -y --quiet xz-devel.x86_64 22 | 23 | curl -k -L https://github.com/COMBINE-lab/salmon/archive/${branch}.zip -o ${branch}.zip 24 | unzip ${branch}.zip 25 | mv salmon-${branch} salmon 26 | cd salmon 27 | mkdir build 28 | cd build 29 | cmake -DFETCH_BOOST=TRUE .. 30 | make 31 | make install 32 | make test 33 | cd ../scripts 34 | bash make-release.sh -v ${version} -n linux_x86_64 35 | cd ../RELEASES 36 | cp *.tar.gz /io/ 37 | -------------------------------------------------------------------------------- /scripts/cpld.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author : Hemanth.HM 3 | # Email : hemanth[dot]hm[at]gmail[dot]com 4 | # License : GNU GPLv3 5 | # 6 | 7 | function useage() 8 | { 9 | cat << EOU 10 | Useage: bash $0 11 | EOU 12 | exit 1 13 | } 14 | 15 | #Validate the inputs 16 | [[ $# < 2 ]] && useage 17 | 18 | #Check if the paths are vaild 19 | [[ ! -e $1 ]] && echo "Not a vaild input $1" && exit 1 20 | [[ -d $2 ]] || echo "No such directory $2 creating..."&& mkdir -p "$2" 21 | 22 | #Get the library dependencies 23 | echo "Collecting the shared library dependencies for $1..." 24 | deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1~/^\//{print $1}$3~/^\//{print $3}' | sed 's/,$/\n/') 25 | echo "Copying the dependencies to $2" 26 | 27 | #Copy the deps 28 | for dep in $deps 29 | do 30 | echo "Copying $dep to $2" 31 | cp "$dep" "$2" 32 | done 33 | 34 | echo "Done!" 35 | 36 | -------------------------------------------------------------------------------- /scripts/lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # cmakelint 5 | # https://github.com/richq/cmake-lint 6 | 7 | if ! which cmakelint; then 8 | echo "Install cmakelint." 1>&2 9 | exit 1 10 | fi 11 | cmake_files=$(find . -name CMakeLists.txt -o -name "*.cmake") 12 | cmakelint --config=.cmakelintrc ${cmake_files} 13 | -------------------------------------------------------------------------------- /scripts/merge_into_develop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -eq 0 ] 4 | then 5 | echo "No input arguments provided. Usage is merge_into_develop.sh " 6 | exit 1 7 | fi 8 | 9 | feature=$1 10 | 11 | # from https://stackoverflow.com/questions/173919/is-there-a-theirs-version-of-git-merge-s-ours 12 | # in case branchA is not our current branch 13 | git checkout develop 14 | 15 | # make merge commit but without conflicts!! 16 | # the contents of 'ours' will be discarded later 17 | git merge -s ours ${feature} 18 | 19 | # make temporary branch to merged commit 20 | git branch branchTEMP 21 | 22 | # get contents of working tree and index to the one of branchB 23 | git reset --hard ${feature} 24 | 25 | # reset to our merged commit but 26 | # keep contents of working tree and index 27 | git reset --soft branchTEMP 28 | 29 | # change the contents of the merged commit 30 | # with the contents of branchB 31 | git commit --amend 32 | 33 | # get rid off our temporary branch 34 | git branch -D branchTEMP 35 | 36 | # verify that the merge commit contains only contents of branchB 37 | git diff HEAD ${feature} 38 | -------------------------------------------------------------------------------- /scripts/merge_into_master.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -eq 0 ] 4 | then 5 | echo "No input arguments provided. Usage is merge_into_master.sh " 6 | exit 1 7 | fi 8 | 9 | feature=$1 10 | 11 | # from https://stackoverflow.com/questions/173919/is-there-a-theirs-version-of-git-merge-s-ours 12 | # in case branchA is not our current branch 13 | git checkout master 14 | 15 | # make merge commit but without conflicts!! 16 | # the contents of 'ours' will be discarded later 17 | git merge -s ours ${feature} 18 | 19 | # make temporary branch to merged commit 20 | git branch branchTEMP 21 | 22 | # get contents of working tree and index to the one of branchB 23 | git reset --hard ${feature} 24 | 25 | # reset to our merged commit but 26 | # keep contents of working tree and index 27 | git reset --soft branchTEMP 28 | 29 | # change the contents of the merged commit 30 | # with the contents of branchB 31 | git commit --amend 32 | 33 | # get rid off our temporary branch 34 | git branch -D branchTEMP 35 | 36 | # verify that the merge commit contains only contents of branchB 37 | git diff HEAD ${feature} 38 | -------------------------------------------------------------------------------- /scripts/runner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cmd="$@" 4 | interleaved_file=`echo $cmd | sed -n 's/.*--interleaved\s\+\(\S\+\)\s\+.*/\1/p'` 5 | 6 | if [ -z "$interleaved_file" ] 7 | then 8 | #Run normally in this branch 9 | ${@} 10 | else 11 | new_cmd=`echo $cmd | sed 's/--interleaved\s\+\S\+\s\+//'` 12 | tmpdir=$(mktemp -d) 13 | # Cleanup on exit 14 | trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP 15 | p1="$tmpdir/p1.fq" 16 | p2="$tmpdir/p2.fq" 17 | mkfifo $p1 18 | mkfifo $p2 19 | # The following interleaved to split conversion is courtesy of 20 | # https://gist.github.com/nathanhaigh/3521724 21 | (paste - - - - - - - - | tee >(cut -f 1-4 | tr '\t' '\n' > $p1) | cut -f 5-8 | tr '\t' '\n' > $p2) < $interleaved_file & 22 | echo "Running command [${new_cmd} -1 $p1 -2 $p2]" 23 | ${new_cmd} -1 $p1 -2 $p2 24 | fi -------------------------------------------------------------------------------- /scripts/test_sim_corr.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import errno 3 | import os 4 | 5 | 6 | def mkdir_p(path): 7 | """ 8 | http://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python 9 | """ 10 | try: 11 | os.makedirs(path) 12 | except OSError as exc: # Python >2.5 13 | if exc.errno == errno.EEXIST and os.path.isdir(path): 14 | pass 15 | else: 16 | raise 17 | 18 | def computeSimMetrics(args): 19 | import pandas as pd 20 | import json 21 | simFile = args.sim 22 | estFile = args.est 23 | sd = pd.read_table(simFile).set_index('Name') 24 | ed = pd.read_table(estFile).set_index('Name') 25 | d = sd.join(ed, rsuffix='_est') 26 | 27 | res = {} 28 | res['pearson'] = d['TPM'].corr(d['TPM_est']) 29 | res['spearman'] = d['TPM'].corr(d['TPM_est'], method='spearman') 30 | 31 | import os.path 32 | pdir = os.path.dirname(args.out) 33 | if not os.path.exists(pdir): 34 | mkdir_p(pdir) 35 | 36 | with open(args.out, 'w') as outfile: 37 | json.dump(res, outfile) 38 | 39 | 40 | if __name__ == "__main__": 41 | parser = argparse.ArgumentParser(description='Test simulated accuracy') 42 | parser.add_argument('--sim', type=str, help='path to simulated tpm') 43 | parser.add_argument('--est', type=str, help='path to estimated tpm') 44 | parser.add_argument('--out', type=str, help='where to write the output') 45 | args = parser.parse_args() 46 | computeSimMetrics(args) 47 | 48 | 49 | -------------------------------------------------------------------------------- /scripts/v1_10x/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cmd="$@" 4 | base=`echo $cmd | grep -Po -- '-b\s+\K[^ ]+'` 5 | new_cmd=`echo $cmd | sed 's/-b[[:space:]][[:graph:]]\+//'` 6 | 7 | tmpdir=$(mktemp -d) 8 | echo "TEMPDIR is $tmpdir" 9 | # Cleanup on exit 10 | trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP 11 | p1="$tmpdir/p1.fa" 12 | p2="$tmpdir/p2.fa" 13 | mkfifo $p1 14 | mkfifo $p2 15 | 16 | i1=`ls $base/*I1*` 17 | wrapper <(cat $base/*I1*) <(cat $base/*RA*) >> $p1 2>> $p2 & 18 | 19 | echo "Running command [${new_cmd} -1 $p1 -2 $p2 -r $i1]" 20 | ${new_cmd} -1 $p1 -2 $p2 -r $i1 21 | -------------------------------------------------------------------------------- /scripts/v1_10x/wrapper.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" { 4 | #include "kseq.h" 5 | } 6 | 7 | #include 8 | 9 | // STEP 1: declare the type of file handler and the read() function 10 | KSEQ_INIT(gzFile, gzread) 11 | 12 | namespace v1Converter { 13 | 14 | struct ReadSeq { 15 | std::string seq; 16 | std::string name; 17 | ~ReadSeq() {} 18 | }; 19 | 20 | inline void copyRecord(kseq_t* seq, ReadSeq* s) { 21 | // Copy over the sequence and read name 22 | s->seq.assign(seq->seq.s, seq->seq.l); 23 | s->name.assign(seq->name.s, seq->name.l); 24 | } 25 | } 26 | 27 | int main(int argc, char* argv[]) { 28 | using namespace v1Converter; 29 | // open the file and init the parser 30 | auto fp = gzopen(argv[1], "r"); 31 | auto fp2 = gzopen(argv[2], "r"); 32 | 33 | ReadSeq bc; 34 | ReadSeq seqFrag; 35 | ReadSeq umi; 36 | 37 | auto* seq = kseq_init(fp); 38 | auto* seq2 = kseq_init(fp2); 39 | 40 | int ksv = kseq_read(seq); 41 | int ksv2 = kseq_read(seq2); 42 | while (ksv >= 0 and ksv2 >= 0) { 43 | // The right read becomes the read 44 | copyRecord(seq2, &seqFrag); 45 | ksv2 = kseq_read(seq2); 46 | if (ksv2 >= 0) { 47 | // The left read becomes the barcode + umi 48 | bc.name.assign(seq->name.s, seq->name.l); 49 | bc.seq.assign(seq->seq.s, seq->seq.l); 50 | bc.seq.insert(seq->seq.l, seq2->seq.s, seq2->seq.l); 51 | } else { 52 | break; 53 | } 54 | 55 | 56 | std::cout << '>' << bc.name << "\n"; 57 | std::cout << bc.seq<< "\n"; 58 | 59 | std::cerr << '>' << seqFrag.name << "\n"; 60 | std::cerr << seqFrag.seq << "\n"; 61 | 62 | ksv = kseq_read(seq); 63 | ksv2 = kseq_read(seq2); 64 | } 65 | // destroy the parser and close the file 66 | kseq_destroy(seq); 67 | gzclose(fp); 68 | kseq_destroy(seq2); 69 | gzclose(fp2); 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /src/EffectiveLengthStats.cpp: -------------------------------------------------------------------------------- 1 | #include "EffectiveLengthStats.hpp" 2 | #include "SalmonMath.hpp" 3 | 4 | EffectiveLengthStats::EffectiveLengthStats(size_t numTxps) 5 | : numTxps_(numTxps), lengths_(numTxps), weights_(numTxps), 6 | counts_(numTxps) { 7 | for (size_t i = 0; i < numTxps_; ++i) { 8 | lengths_(i) = salmon::math::LOG_0; 9 | weights_(i) = salmon::math::LOG_0; 10 | counts_(i) = 0; 11 | } 12 | } 13 | 14 | void EffectiveLengthStats::addFragment(uint32_t txID, uint32_t len, 15 | double logMass) { 16 | len = (len >= 1) ? len : 1; 17 | const double logLen = std::log(static_cast(len)); 18 | lengths_(txID) = salmon::math::logAdd(lengths_(txID), logLen + logMass); 19 | weights_(txID) = salmon::math::logAdd(weights_(txID), logMass); 20 | ++counts_(txID); 21 | } 22 | 23 | uint32_t EffectiveLengthStats::getObservedCount(uint32_t txID) { 24 | return counts_(txID); 25 | } 26 | 27 | double EffectiveLengthStats::getExpectedEffectiveLength(uint32_t txID) { 28 | return (!salmon::math::isLog0(weights_(txID))) 29 | ? std::exp(lengths_(txID) - weights_(txID)) 30 | : 0.01; 31 | // return (weights_(txID) > 0) ? static_cast(lengths_(txID)) / 32 | // weights_(txID) : 0.01; 33 | } 34 | 35 | Eigen::VectorXd EffectiveLengthStats::getExpectedEffectiveLengths() { 36 | // expected effective lengths 37 | Eigen::VectorXd eel(numTxps_); 38 | eel.setZero(); 39 | for (size_t i = 0; i < numTxps_; ++i) { 40 | eel(i) = getExpectedEffectiveLength(i); 41 | } 42 | return eel; 43 | } 44 | 45 | void EffectiveLengthStats::merge(const EffectiveLengthStats& other) { 46 | for (decltype(weights_.size()) i = 0; i < weights_.size(); ++i) { 47 | lengths_(i) = salmon::math::logAdd(lengths_(i), other.lengths_(i)); 48 | weights_(i) = salmon::math::logAdd(weights_(i), other.weights_(i)); 49 | counts_(i) = other.counts_(i); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/SalmonExceptions.cpp: -------------------------------------------------------------------------------- 1 | #include "SalmonExceptions.hpp" 2 | 3 | InsufficientAssignedFragments::InsufficientAssignedFragments( 4 | uint64_t numAssigned, uint64_t numRequired) noexcept 5 | : std::runtime_error(""), numAssigned_(numAssigned), 6 | numRequired_(numRequired) { 7 | cnvt.str(""); 8 | cnvt 9 | << "salmon was only able to assign " << numAssigned_ 10 | << " fragments to transcripts in the index, " 11 | "but the minimum number of required assigned fragments " 12 | "(--minAssignedFrags) " 13 | "was " 14 | << numRequired_ 15 | << ". This could be indicative of a mismatch between the reference and " 16 | "sample, or a very bad sample. You can change the --minAssignedFrags " 17 | "parameter to force salmon to quantify with fewer assigned fragments " 18 | "(must have at least 1)."; 19 | msg_ = cnvt.str(); 20 | } 21 | 22 | InsufficientAssignedFragments::InsufficientAssignedFragments( 23 | InsufficientAssignedFragments&& other) 24 | : std::runtime_error("") { 25 | // cnvt = other.cnvt; 26 | msg_ = other.msg_; 27 | numAssigned_ = other.numAssigned_; 28 | numRequired_ = other.numRequired_; 29 | } 30 | 31 | const char* InsufficientAssignedFragments::what() const throw() { 32 | return msg_.c_str(); 33 | } 34 | -------------------------------------------------------------------------------- /src/SalmonStringUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "pufferfish/ProgOpts.hpp" 2 | #include "SalmonStringUtils.hpp" 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | std::vector salmon::stringtools::encodeSequenceInSAM(const char* src, size_t len) { 9 | //uint8_t* target = new uint8_t[static_cast(ceil(len / 2.0))](); 10 | std::vector target(static_cast(ceil(len / 2.0)), 0); 11 | for (size_t i = 0; i < len; ++i) { 12 | size_t byte = i >> 1; 13 | size_t nibble = i & 0x1; 14 | if (nibble) { 15 | target[byte] |= charToSamEncode[static_cast(src[i])]; 16 | } else { 17 | target[byte] |= (charToSamEncode[static_cast(src[i])] << 4); 18 | } 19 | } 20 | return target; 21 | } 22 | -------------------------------------------------------------------------------- /src/SingleCellProtocols.cpp: -------------------------------------------------------------------------------- 1 | #include "SingleCellProtocols.hpp" 2 | 3 | 4 | namespace alevin{ 5 | namespace protocols { 6 | 7 | std::ostream& operator<<(std::ostream& os, const TagGeometry& tg) { 8 | 9 | os << "Tag geometry description :: [\n"; 10 | if (tg.uses_r1()) { 11 | os << "\tRead Num : 1 \n\t["; 12 | for (size_t i = 0; i < tg.substr_locs1.size(); ++i) { 13 | os << " [ p:" << tg.substr_locs1[i].first 14 | << ", l:" << tg.substr_locs1[i].second << ")"; 15 | } 16 | os << "\t]\n"; 17 | } 18 | if (tg.uses_r1()) { 19 | os << "\tRead Num : 2 \n\t["; 20 | for (size_t i = 0; i < tg.substr_locs2.size(); ++i) { 21 | os << " [ p:" << tg.substr_locs2[i].first 22 | << ", l:" << tg.substr_locs2[i].second << ")"; 23 | } 24 | os << "\t]\n"; 25 | } 26 | os << "\tTotal Length : " << tg.length1 + tg.length2; 27 | os << "]\n"; 28 | return os; 29 | } 30 | 31 | }// protocols 32 | }//alevin -------------------------------------------------------------------------------- /src/StadenUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "StadenUtils.hpp" 2 | 3 | namespace staden { 4 | namespace utils { 5 | 6 | bam_seq_t* bam_init() { 7 | return reinterpret_cast(calloc(1, sizeof(bam_seq_t))); 8 | } 9 | 10 | void bam_destroy(bam_seq_t* b) { 11 | if (b == 0) { 12 | return; 13 | } 14 | free(b); 15 | } 16 | 17 | } // namespace utils 18 | } // namespace staden 19 | -------------------------------------------------------------------------------- /src/TranscriptGroup.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "SalmonMath.hpp" 5 | #include "TranscriptGroup.hpp" 6 | #include "xxhash.h" 7 | 8 | TranscriptGroup::TranscriptGroup() : hash(0) {} 9 | 10 | TranscriptGroup::TranscriptGroup(std::vector txpsIn) 11 | : txps(txpsIn), valid(true) { 12 | size_t seed{0}; 13 | hash = XXH64(static_cast(txps.data()), txps.size() * sizeof(uint32_t), 14 | seed); 15 | } 16 | 17 | TranscriptGroup::TranscriptGroup(std::vector txpsIn, size_t hashIn) 18 | : txps(txpsIn), hash(hashIn), valid(true) {} 19 | 20 | TranscriptGroup::TranscriptGroup(const TranscriptGroup& other) { 21 | txps = other.txps; 22 | hash = other.hash; 23 | valid = other.valid; 24 | } 25 | 26 | TranscriptGroup& TranscriptGroup::operator=(const TranscriptGroup& other) { 27 | txps = other.txps; 28 | hash = other.hash; 29 | valid = other.valid; 30 | return *this; 31 | } 32 | 33 | TranscriptGroup::TranscriptGroup(TranscriptGroup&& other) { 34 | txps = std::move(other.txps); 35 | hash = other.hash; 36 | valid = other.valid; 37 | } 38 | 39 | void TranscriptGroup::setValid(bool b) const { valid = b; } 40 | 41 | TranscriptGroup& TranscriptGroup::operator=(TranscriptGroup&& other) { 42 | txps = std::move(other.txps); 43 | hash = other.hash; 44 | valid = other.valid; 45 | return *this; 46 | } 47 | 48 | bool operator==(const TranscriptGroup& lhs, const TranscriptGroup& rhs) { 49 | return lhs.txps == rhs.txps; 50 | }; 51 | -------------------------------------------------------------------------------- /src/VersionChecker.cpp: -------------------------------------------------------------------------------- 1 | #include "VersionChecker.hpp" 2 | #include "SalmonConfig.hpp" 3 | #include "httplib.hpp" 4 | 5 | std::string getVersionMessage() { 6 | std::stringstream ss; 7 | try { 8 | // NOTE: getaddrinfo / freeaddrinfo will cause a "memory leak" 9 | // once per address, program pair. This is a known issue 10 | // https://lists.debian.org/debian-glibc/2016/03/msg00243.html. 11 | // If valgrind leads you here, best not to worry about it. 12 | httplib::Client cli("combine-lab.github.io"); 13 | std::string path{"/salmon/version_info/"}; 14 | path += salmon::version; 15 | cli.set_timeout_sec(2); // timeouts in 2 seconds 16 | auto res = cli.Get(path.c_str()); 17 | if (res) { // non-null response 18 | if (res->status == 200) { // response OK 19 | ss << "Version Info: " << res->body; 20 | } else { // response something else 21 | ss << "Version Server Response: " << httplib::detail::status_message(res->status) << "\n"; 22 | } 23 | } else { // null response 24 | ss << "Version Info Exception: server did not respond before timeout\n"; 25 | } 26 | } catch (std::exception& e) { 27 | ss << "Version Info Exception: " << e.what() << "\n"; 28 | } 29 | 30 | return ss.str(); 31 | } 32 | -------------------------------------------------------------------------------- /src/backtrace.cc: -------------------------------------------------------------------------------- 1 | /* This file is part of Jellyfish. 2 | 3 | This work is dual-licensed under 3-Clause BSD License or GPL 3.0. 4 | You can choose between one of them if you use this work. 5 | 6 | `SPDX-License-Identifier: BSD-3-Clause OR GPL-3.0` 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | void print_backtrace() { 17 | void *trace_elems[20]; 18 | int trace_elem_count(backtrace(trace_elems, 20)); 19 | backtrace_symbols_fd(trace_elems, trace_elem_count, 2); 20 | } 21 | 22 | static void handler() { 23 | // Display message of last thrown exception if any 24 | try { throw; } 25 | catch(const std::exception& e) { 26 | int status; 27 | size_t n = 0; 28 | char *name = abi::__cxa_demangle(typeid(e).name(), 0, &n, &status); 29 | std::cerr << "terminate called after throwing an instance of '" 30 | << (status < 0 ? "UNKNOWN" : name) 31 | << "'\n what(): " << e.what() << "\n"; 32 | if(n) 33 | free(name); 34 | } 35 | catch(...) {} 36 | 37 | print_backtrace(); 38 | abort(); 39 | } 40 | 41 | void show_backtrace() { 42 | std::set_terminate(handler); 43 | } 44 | -------------------------------------------------------------------------------- /src/jellyfish/mer_dna.cc: -------------------------------------------------------------------------------- 1 | /* This file is part of Jellyfish. 2 | 3 | Jellyfish is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | Jellyfish is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with Jellyfish. If not, see . 15 | */ 16 | 17 | 18 | #include 19 | 20 | namespace jellyfish { namespace mer_dna_ns { 21 | const char* const error_different_k = "Length of k-mers are different"; 22 | const char* const error_short_string = "Input string is to short"; 23 | } } // namespace jellyfish { namespace mer_dna_ns 24 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # How to run unit test 2 | ``` 3 | ./run.sh 4 | ``` 5 | # Contents of unit_test_data.tar.gz 6 | 7 | * *alevin* 8 | * __alevin.log__: logs of a run of salmon with the test data 9 | * __counts.mat__: Cell(row)xGene(Column) counts 10 | * __eq_classes.txt__: Global eqClass 11 | * *cell* 12 | * __cell__eq_classes.txt__: EqClass for one Cell 13 | * __quant.sf__: Abundance of one cell 14 | 15 | * *src-py* 16 | * __get_correlation.py__: python script to get correlation of one cell 17 | -------------------------------------------------------------------------------- /tests/UnitTests.cpp: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file 2 | #include "catch.hpp" 3 | 4 | bool verbose=false; // Apparently, we *need* this (OSX) 5 | //#include "GCSampleTests.cpp" 6 | //#include "LibraryTypeTests.cpp" 7 | //#include "KmerHistTests.cpp" 8 | 9 | -------------------------------------------------------------------------------- /tests/alevin_test_data.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/COMBINE-lab/salmon/a2f6912b3f9f9af91e3a4b0d74adcb3bdc4c9a32/tests/alevin_test_data.tar.gz -------------------------------------------------------------------------------- /tests/basic_alevin_test.sh: -------------------------------------------------------------------------------- 1 | ALVBIN=$1 #"/mnt/scratch6/salmon_ci/COMBINE-lab/salmon/master/build/salmon-latest_linux_x86_64/bin/salmon" 2 | BASEDIR="/mnt/scratch6/avi/alevin/alevin" 3 | OUT=$PWD 4 | 5 | tfile=$(mktemp /tmp/foo.XXXXXXXXX) 6 | 7 | /usr/bin/time -o $tfile $ALVBIN alevin -lISR --chromium -1 ${BASEDIR}/data/10x/v2/mohu/100/all_bcs.fq.gz -2 ${BASEDIR}/data/10x/v2/mohu/100/all_reads.fq.gz -o $OUT/prediction -i ${BASEDIR}/data/mohu/salmon_index -p 20 --tgMap ${BASEDIR}/data/mohu/gtf/txp2gene.tsv --dumpMtx --no-version-check --dumpFeatures --dumpArborescence --writeMappings=$OUT/prediction/with_bug.sam #--whitelist ./alevin_test_data/alevin/quants_mat_rows.txt 8 | #--dumpBfh --whitelist /mnt/scratch5/avi/alevin/bin/salmon/tests/whitelist.txt 9 | #--dumpUmiGraph --numCellBootstraps 100 --dumpBfh --dumpBarcodeEq --dumpMtx --expectCells 1001 --end 6 --umiLength 10 --barcodeLength 16 10 | 11 | cat $tfile 12 | 13 | tar -xvzf alevin_test_data.tar.gz 14 | 15 | echo "Barcodes" 16 | sort prediction/alevin/quants_mat_rows.txt > 1.txt 17 | sort alevin_test_data/alevin/quants_mat_rows.txt > 2.txt 18 | diff 1.txt 2.txt > diff.txt 19 | wc -l diff.txt 20 | echo "FAILED if above line > Zero" 21 | 22 | echo "features" 23 | sort prediction/alevin/featureDump.txt > 1.txt 24 | sort alevin_test_data/alevin/featureDump.txt > 2.txt 25 | diff 1.txt 2.txt > diff.txt 26 | wc -l diff.txt 27 | echo "FAILED if above line > Zero" 28 | 29 | echo "whitelist.txt" 30 | sort prediction/alevin/whitelist.txt > 1.txt 31 | sort alevin_test_data/alevin/whitelist.txt > 2.txt 32 | diff 1.txt 2.txt > diff.txt 33 | wc -l diff.txt 34 | echo "FAILED if above line > Zero" 35 | 36 | rm 1.txt 2.txt diff.txt 37 | python alevin_test_data/src-py/alevin.py --one prediction/ --two alevin_test_data/ 38 | -------------------------------------------------------------------------------- /tests/compile_tests/int128_numeric_limits.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // adopted from https://github.com/gmarcais/Jellyfish/blob/ab0f0f2ac8996ad397db89c9baf8b6c80a4c652a/configure.ac 5 | template struct StaticAssert; 6 | template<> struct StaticAssert { static void assert() { } }; 7 | 8 | int main(int argc, char* argv[]) { 9 | StaticAssert::is_specialized>::assert(); 10 | return 0; 11 | } 12 | --------------------------------------------------------------------------------