├── .clang-format ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── bench ├── CMakeLists.txt ├── benchmarks.cpp ├── ckks_bm.cpp ├── mod_arith_bm.cpp └── ntt_bm.cpp ├── cmake ├── Catch.cmake ├── CatchAddTests.cmake └── ParseAndAddCatchTests.cmake ├── doc └── wechat.jpeg ├── examples ├── CMakeLists.txt └── ckks_example.cpp ├── src ├── CMakeLists.txt ├── circuits │ ├── CMakeLists.txt │ ├── cc_non_poly.h │ ├── ckks_boot.h │ ├── fp_non_poly.h │ ├── linear_algebra.cpp │ └── linear_algebra.h └── fhe │ ├── CMakeLists.txt │ ├── bgv │ ├── CMakeLists.txt │ ├── arith.cpp │ ├── basics.cpp │ ├── bgv.h │ └── mod_switch.cpp │ ├── ckks │ ├── CMakeLists.txt │ ├── arith.cpp │ ├── basics.cpp │ ├── ckks.h │ └── rescaling.cpp │ ├── common │ ├── CMakeLists.txt │ ├── allocator.h │ ├── bigint.cpp │ ├── bigint.h │ ├── mod_arith.cpp │ ├── mod_arith.h │ ├── ntt.cpp │ ├── ntt.h │ ├── permutation.cpp │ ├── permutation.h │ ├── primelists.cpp │ ├── primelists.h │ ├── rns.cpp │ ├── rns.h │ ├── rns_transform.cpp │ ├── rns_transform.h │ ├── sampling.cpp │ ├── sampling.h │ └── type_defs.h │ ├── primitives │ ├── CMakeLists.txt │ ├── keys.cpp │ ├── keys.h │ ├── lwe.h │ ├── rgsw.cpp │ ├── rgsw.h │ ├── rlwe.cpp │ └── rlwe.h │ └── tfhe │ ├── CMakeLists.txt │ ├── func_boot.cpp │ └── func_boot.h ├── tests ├── CMakeLists.txt ├── bgv_t.cpp ├── bigint_t.cpp ├── ckks_t.cpp ├── common_t.cpp ├── lin_alg_t.cpp ├── mod_arith_t.cpp ├── ntt_t.cpp ├── rlwe_t.cpp └── tests.cpp └── third-party ├── Eigen ├── AccelerateSupport ├── Cholesky ├── CholmodSupport ├── Core ├── Dense ├── Eigen ├── Eigenvalues ├── Geometry ├── Householder ├── IterativeLinearSolvers ├── Jacobi ├── KLUSupport ├── LU ├── MetisSupport ├── OrderingMethods ├── PaStiXSupport ├── PardisoSupport ├── QR ├── QtAlignedMalloc ├── SPQRSupport ├── SVD ├── Sparse ├── SparseCholesky ├── SparseCore ├── SparseLU ├── SparseQR ├── StdDeque ├── StdList ├── StdVector ├── SuperLUSupport ├── UmfPackSupport └── src │ ├── AccelerateSupport │ ├── AccelerateSupport.h │ └── InternalHeaderCheck.h │ ├── Cholesky │ ├── InternalHeaderCheck.h │ ├── LDLT.h │ ├── LLT.h │ └── LLT_LAPACKE.h │ ├── CholmodSupport │ ├── CholmodSupport.h │ └── InternalHeaderCheck.h │ ├── Core │ ├── ArithmeticSequence.h │ ├── Array.h │ ├── ArrayBase.h │ ├── ArrayWrapper.h │ ├── Assign.h │ ├── AssignEvaluator.h │ ├── Assign_MKL.h │ ├── BandMatrix.h │ ├── Block.h │ ├── BooleanRedux.h │ ├── CommaInitializer.h │ ├── ConditionEstimator.h │ ├── CoreEvaluators.h │ ├── CoreIterators.h │ ├── CwiseBinaryOp.h │ ├── CwiseNullaryOp.h │ ├── CwiseTernaryOp.h │ ├── CwiseUnaryOp.h │ ├── CwiseUnaryView.h │ ├── DenseBase.h │ ├── DenseCoeffsBase.h │ ├── DenseStorage.h │ ├── Diagonal.h │ ├── DiagonalMatrix.h │ ├── DiagonalProduct.h │ ├── Dot.h │ ├── EigenBase.h │ ├── ForceAlignedAccess.h │ ├── Fuzzy.h │ ├── GeneralProduct.h │ ├── GenericPacketMath.h │ ├── GlobalFunctions.h │ ├── IO.h │ ├── IndexedView.h │ ├── InternalHeaderCheck.h │ ├── Inverse.h │ ├── Map.h │ ├── MapBase.h │ ├── MathFunctions.h │ ├── MathFunctionsImpl.h │ ├── Matrix.h │ ├── MatrixBase.h │ ├── NestByValue.h │ ├── NoAlias.h │ ├── NumTraits.h │ ├── PartialReduxEvaluator.h │ ├── PermutationMatrix.h │ ├── PlainObjectBase.h │ ├── Product.h │ ├── ProductEvaluators.h │ ├── Random.h │ ├── Redux.h │ ├── Ref.h │ ├── Replicate.h │ ├── Reshaped.h │ ├── ReturnByValue.h │ ├── Reverse.h │ ├── Select.h │ ├── SelfAdjointView.h │ ├── SelfCwiseBinaryOp.h │ ├── SkewSymmetricMatrix3.h │ ├── Solve.h │ ├── SolveTriangular.h │ ├── SolverBase.h │ ├── StableNorm.h │ ├── StlIterators.h │ ├── Stride.h │ ├── Swap.h │ ├── Transpose.h │ ├── Transpositions.h │ ├── TriangularMatrix.h │ ├── VectorBlock.h │ ├── VectorwiseOp.h │ ├── Visitor.h │ ├── arch │ │ ├── AVX │ │ │ ├── Complex.h │ │ │ ├── MathFunctions.h │ │ │ ├── PacketMath.h │ │ │ └── TypeCasting.h │ │ ├── AVX512 │ │ │ ├── Complex.h │ │ │ ├── GemmKernel.h │ │ │ ├── MathFunctions.h │ │ │ ├── PacketMath.h │ │ │ ├── PacketMathFP16.h │ │ │ ├── TrsmKernel.h │ │ │ ├── TrsmUnrolls.inc │ │ │ └── TypeCasting.h │ │ ├── AltiVec │ │ │ ├── Complex.h │ │ │ ├── MathFunctions.h │ │ │ ├── MatrixProduct.h │ │ │ ├── MatrixProductCommon.h │ │ │ ├── MatrixProductMMA.h │ │ │ ├── MatrixProductMMAbfloat16.h │ │ │ ├── MatrixVectorProduct.h │ │ │ └── PacketMath.h │ │ ├── Default │ │ │ ├── BFloat16.h │ │ │ ├── ConjHelper.h │ │ │ ├── GenericPacketMathFunctions.h │ │ │ ├── GenericPacketMathFunctionsFwd.h │ │ │ ├── Half.h │ │ │ ├── Settings.h │ │ │ └── TypeCasting.h │ │ ├── GPU │ │ │ ├── Complex.h │ │ │ ├── MathFunctions.h │ │ │ ├── PacketMath.h │ │ │ ├── Tuple.h │ │ │ └── TypeCasting.h │ │ ├── HIP │ │ │ └── hcc │ │ │ │ └── math_constants.h │ │ ├── MSA │ │ │ ├── Complex.h │ │ │ ├── MathFunctions.h │ │ │ └── PacketMath.h │ │ ├── NEON │ │ │ ├── Complex.h │ │ │ ├── GeneralBlockPanelKernel.h │ │ │ ├── MathFunctions.h │ │ │ ├── PacketMath.h │ │ │ ├── TypeCasting.h │ │ │ └── UnaryFunctors.h │ │ ├── SSE │ │ │ ├── Complex.h │ │ │ ├── MathFunctions.h │ │ │ ├── PacketMath.h │ │ │ └── TypeCasting.h │ │ ├── SVE │ │ │ ├── MathFunctions.h │ │ │ ├── PacketMath.h │ │ │ └── TypeCasting.h │ │ ├── SYCL │ │ │ ├── InteropHeaders.h │ │ │ ├── MathFunctions.h │ │ │ ├── PacketMath.h │ │ │ ├── SyclMemoryModel.h │ │ │ └── TypeCasting.h │ │ └── ZVector │ │ │ ├── Complex.h │ │ │ ├── MathFunctions.h │ │ │ └── PacketMath.h │ ├── functors │ │ ├── AssignmentFunctors.h │ │ ├── BinaryFunctors.h │ │ ├── NullaryFunctors.h │ │ ├── StlFunctors.h │ │ ├── TernaryFunctors.h │ │ └── UnaryFunctors.h │ ├── products │ │ ├── GeneralBlockPanelKernel.h │ │ ├── GeneralMatrixMatrix.h │ │ ├── GeneralMatrixMatrixTriangular.h │ │ ├── GeneralMatrixMatrixTriangular_BLAS.h │ │ ├── GeneralMatrixMatrix_BLAS.h │ │ ├── GeneralMatrixVector.h │ │ ├── GeneralMatrixVector_BLAS.h │ │ ├── Parallelizer.h │ │ ├── SelfadjointMatrixMatrix.h │ │ ├── SelfadjointMatrixMatrix_BLAS.h │ │ ├── SelfadjointMatrixVector.h │ │ ├── SelfadjointMatrixVector_BLAS.h │ │ ├── SelfadjointProduct.h │ │ ├── SelfadjointRank2Update.h │ │ ├── TriangularMatrixMatrix.h │ │ ├── TriangularMatrixMatrix_BLAS.h │ │ ├── TriangularMatrixVector.h │ │ ├── TriangularMatrixVector_BLAS.h │ │ ├── TriangularSolverMatrix.h │ │ ├── TriangularSolverMatrix_BLAS.h │ │ └── TriangularSolverVector.h │ └── util │ │ ├── BlasUtil.h │ │ ├── ConfigureVectorization.h │ │ ├── Constants.h │ │ ├── DisableStupidWarnings.h │ │ ├── ForwardDeclarations.h │ │ ├── IndexedViewHelper.h │ │ ├── IntegralConstant.h │ │ ├── MKL_support.h │ │ ├── Macros.h │ │ ├── Memory.h │ │ ├── Meta.h │ │ ├── NonMPL2.h │ │ ├── ReenableStupidWarnings.h │ │ ├── ReshapedHelper.h │ │ ├── Serializer.h │ │ ├── StaticAssert.h │ │ ├── SymbolicIndex.h │ │ └── XprHelper.h │ ├── Eigenvalues │ ├── ComplexEigenSolver.h │ ├── ComplexSchur.h │ ├── ComplexSchur_LAPACKE.h │ ├── EigenSolver.h │ ├── GeneralizedEigenSolver.h │ ├── GeneralizedSelfAdjointEigenSolver.h │ ├── HessenbergDecomposition.h │ ├── InternalHeaderCheck.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 │ ├── InternalHeaderCheck.h │ ├── OrthoMethods.h │ ├── ParametrizedLine.h │ ├── Quaternion.h │ ├── Rotation2D.h │ ├── RotationBase.h │ ├── Scaling.h │ ├── Transform.h │ ├── Translation.h │ ├── Umeyama.h │ └── arch │ │ └── Geometry_SIMD.h │ ├── Householder │ ├── BlockHouseholder.h │ ├── Householder.h │ ├── HouseholderSequence.h │ └── InternalHeaderCheck.h │ ├── IterativeLinearSolvers │ ├── BasicPreconditioners.h │ ├── BiCGSTAB.h │ ├── ConjugateGradient.h │ ├── IncompleteCholesky.h │ ├── IncompleteLUT.h │ ├── InternalHeaderCheck.h │ ├── IterativeSolverBase.h │ ├── LeastSquareConjugateGradient.h │ └── SolveWithGuess.h │ ├── Jacobi │ ├── InternalHeaderCheck.h │ └── Jacobi.h │ ├── KLUSupport │ ├── InternalHeaderCheck.h │ └── KLUSupport.h │ ├── LU │ ├── Determinant.h │ ├── FullPivLU.h │ ├── InternalHeaderCheck.h │ ├── InverseImpl.h │ ├── PartialPivLU.h │ ├── PartialPivLU_LAPACKE.h │ └── arch │ │ └── InverseSize4.h │ ├── MetisSupport │ ├── InternalHeaderCheck.h │ └── MetisSupport.h │ ├── OrderingMethods │ ├── Amd.h │ ├── Eigen_Colamd.h │ ├── InternalHeaderCheck.h │ └── Ordering.h │ ├── PaStiXSupport │ ├── InternalHeaderCheck.h │ └── PaStiXSupport.h │ ├── PardisoSupport │ ├── InternalHeaderCheck.h │ └── PardisoSupport.h │ ├── QR │ ├── ColPivHouseholderQR.h │ ├── ColPivHouseholderQR_LAPACKE.h │ ├── CompleteOrthogonalDecomposition.h │ ├── FullPivHouseholderQR.h │ ├── HouseholderQR.h │ ├── HouseholderQR_LAPACKE.h │ └── InternalHeaderCheck.h │ ├── SPQRSupport │ ├── InternalHeaderCheck.h │ └── SuiteSparseQRSupport.h │ ├── SVD │ ├── BDCSVD.h │ ├── BDCSVD_LAPACKE.h │ ├── InternalHeaderCheck.h │ ├── JacobiSVD.h │ ├── JacobiSVD_LAPACKE.h │ ├── SVDBase.h │ └── UpperBidiagonalization.h │ ├── SparseCholesky │ ├── InternalHeaderCheck.h │ ├── SimplicialCholesky.h │ └── SimplicialCholesky_impl.h │ ├── SparseCore │ ├── AmbiVector.h │ ├── CompressedStorage.h │ ├── ConservativeSparseSparseProduct.h │ ├── InternalHeaderCheck.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 │ ├── InternalHeaderCheck.h │ ├── 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 │ ├── InternalHeaderCheck.h │ └── SparseQR.h │ ├── StlSupport │ ├── StdDeque.h │ ├── StdList.h │ ├── StdVector.h │ └── details.h │ ├── SuperLUSupport │ ├── InternalHeaderCheck.h │ └── SuperLUSupport.h │ ├── UmfPackSupport │ ├── InternalHeaderCheck.h │ └── UmfPackSupport.h │ ├── misc │ ├── Image.h │ ├── InternalHeaderCheck.h │ ├── Kernel.h │ ├── RealSvd2x2.h │ ├── blas.h │ ├── lapack.h │ ├── lapacke.h │ ├── lapacke_helpers.h │ └── lapacke_mangling.h │ └── plugins │ ├── ArrayCwiseBinaryOps.h │ ├── ArrayCwiseUnaryOps.h │ ├── BlockMethods.h │ ├── CommonCwiseBinaryOps.h │ ├── CommonCwiseUnaryOps.h │ ├── IndexedViewMethods.h │ ├── InternalHeaderCheck.h │ ├── MatrixCwiseBinaryOps.h │ ├── MatrixCwiseUnaryOps.h │ └── ReshapedMethods.h ├── catch2 └── catch.hpp ├── nanobench.h └── range-v3 ├── concepts ├── compare.hpp ├── concepts.hpp ├── swap.hpp └── type_traits.hpp ├── meta ├── meta.hpp └── meta_fwd.hpp ├── range └── v3 │ ├── action.hpp │ ├── action │ ├── action.hpp │ ├── adjacent_remove_if.hpp │ ├── concepts.hpp │ ├── drop.hpp │ ├── drop_while.hpp │ ├── erase.hpp │ ├── insert.hpp │ ├── join.hpp │ ├── push_back.hpp │ ├── push_front.hpp │ ├── remove.hpp │ ├── remove_if.hpp │ ├── reverse.hpp │ ├── shuffle.hpp │ ├── slice.hpp │ ├── sort.hpp │ ├── split.hpp │ ├── split_when.hpp │ ├── stable_sort.hpp │ ├── stride.hpp │ ├── take.hpp │ ├── take_while.hpp │ ├── transform.hpp │ ├── unique.hpp │ └── unstable_remove_if.hpp │ ├── algorithm.hpp │ ├── algorithm │ ├── adjacent_find.hpp │ ├── adjacent_remove_if.hpp │ ├── all_of.hpp │ ├── any_of.hpp │ ├── aux_ │ │ ├── equal_range_n.hpp │ │ ├── lower_bound_n.hpp │ │ ├── merge_n.hpp │ │ ├── merge_n_with_buffer.hpp │ │ ├── partition_point_n.hpp │ │ ├── sort_n_with_buffer.hpp │ │ └── upper_bound_n.hpp │ ├── binary_search.hpp │ ├── contains.hpp │ ├── copy.hpp │ ├── copy_backward.hpp │ ├── copy_if.hpp │ ├── copy_n.hpp │ ├── count.hpp │ ├── count_if.hpp │ ├── ends_with.hpp │ ├── equal.hpp │ ├── equal_range.hpp │ ├── fill.hpp │ ├── fill_n.hpp │ ├── find.hpp │ ├── find_end.hpp │ ├── find_first_of.hpp │ ├── find_if.hpp │ ├── find_if_not.hpp │ ├── fold.hpp │ ├── fold_left.hpp │ ├── fold_right.hpp │ ├── for_each.hpp │ ├── for_each_n.hpp │ ├── generate.hpp │ ├── generate_n.hpp │ ├── heap_algorithm.hpp │ ├── inplace_merge.hpp │ ├── is_partitioned.hpp │ ├── is_sorted.hpp │ ├── is_sorted_until.hpp │ ├── lexicographical_compare.hpp │ ├── lower_bound.hpp │ ├── max.hpp │ ├── max_element.hpp │ ├── merge.hpp │ ├── min.hpp │ ├── min_element.hpp │ ├── minmax.hpp │ ├── minmax_element.hpp │ ├── mismatch.hpp │ ├── move.hpp │ ├── move_backward.hpp │ ├── none_of.hpp │ ├── nth_element.hpp │ ├── partial_sort.hpp │ ├── partial_sort_copy.hpp │ ├── partition.hpp │ ├── partition_copy.hpp │ ├── partition_point.hpp │ ├── permutation.hpp │ ├── remove.hpp │ ├── remove_copy.hpp │ ├── remove_copy_if.hpp │ ├── remove_if.hpp │ ├── replace.hpp │ ├── replace_copy.hpp │ ├── replace_copy_if.hpp │ ├── replace_if.hpp │ ├── result_types.hpp │ ├── reverse.hpp │ ├── reverse_copy.hpp │ ├── rotate.hpp │ ├── rotate_copy.hpp │ ├── sample.hpp │ ├── search.hpp │ ├── search_n.hpp │ ├── set_algorithm.hpp │ ├── shuffle.hpp │ ├── sort.hpp │ ├── stable_partition.hpp │ ├── stable_sort.hpp │ ├── starts_with.hpp │ ├── swap_ranges.hpp │ ├── tagspec.hpp │ ├── transform.hpp │ ├── unique.hpp │ ├── unique_copy.hpp │ ├── unstable_remove_if.hpp │ └── upper_bound.hpp │ ├── all.hpp │ ├── at.hpp │ ├── back.hpp │ ├── begin_end.hpp │ ├── compare.hpp │ ├── core.hpp │ ├── data.hpp │ ├── detail │ ├── adl_get.hpp │ ├── config.hpp │ ├── epilogue.hpp │ ├── prologue.hpp │ ├── range_access.hpp │ ├── satisfy_boost_range.hpp │ ├── variant.hpp │ └── with_braced_init_args.hpp │ ├── distance.hpp │ ├── empty.hpp │ ├── experimental │ ├── utility │ │ └── generator.hpp │ └── view │ │ └── shared.hpp │ ├── front.hpp │ ├── functional.hpp │ ├── functional │ ├── arithmetic.hpp │ ├── bind.hpp │ ├── bind_back.hpp │ ├── comparisons.hpp │ ├── compose.hpp │ ├── concepts.hpp │ ├── identity.hpp │ ├── indirect.hpp │ ├── invoke.hpp │ ├── not_fn.hpp │ ├── on.hpp │ ├── overload.hpp │ ├── pipeable.hpp │ └── reference_wrapper.hpp │ ├── getlines.hpp │ ├── index.hpp │ ├── istream_range.hpp │ ├── iterator.hpp │ ├── iterator │ ├── access.hpp │ ├── basic_iterator.hpp │ ├── common_iterator.hpp │ ├── concepts.hpp │ ├── counted_iterator.hpp │ ├── default_sentinel.hpp │ ├── diffmax_t.hpp │ ├── insert_iterators.hpp │ ├── move_iterators.hpp │ ├── operations.hpp │ ├── reverse_iterator.hpp │ ├── stream_iterators.hpp │ ├── traits.hpp │ └── unreachable_sentinel.hpp │ ├── iterator_range.hpp │ ├── numeric.hpp │ ├── numeric │ ├── accumulate.hpp │ ├── adjacent_difference.hpp │ ├── inner_product.hpp │ ├── iota.hpp │ └── partial_sum.hpp │ ├── range.hpp │ ├── range │ ├── access.hpp │ ├── concepts.hpp │ ├── conversion.hpp │ ├── dangling.hpp │ ├── operations.hpp │ ├── primitives.hpp │ └── traits.hpp │ ├── range_access.hpp │ ├── range_concepts.hpp │ ├── range_for.hpp │ ├── range_fwd.hpp │ ├── range_traits.hpp │ ├── size.hpp │ ├── span.hpp │ ├── to_container.hpp │ ├── utility.hpp │ ├── utility │ ├── addressof.hpp │ ├── any.hpp │ ├── associated_types.hpp │ ├── basic_iterator.hpp │ ├── box.hpp │ ├── common_iterator.hpp │ ├── common_tuple.hpp │ ├── common_type.hpp │ ├── compressed_pair.hpp │ ├── concepts.hpp │ ├── copy.hpp │ ├── counted_iterator.hpp │ ├── dangling.hpp │ ├── functional.hpp │ ├── get.hpp │ ├── in_place.hpp │ ├── infinity.hpp │ ├── invoke.hpp │ ├── iterator.hpp │ ├── iterator_concepts.hpp │ ├── iterator_traits.hpp │ ├── memory.hpp │ ├── move.hpp │ ├── nullptr_v.hpp │ ├── optional.hpp │ ├── polymorphic_cast.hpp │ ├── random.hpp │ ├── scope_exit.hpp │ ├── semiregular.hpp │ ├── semiregular_box.hpp │ ├── static_const.hpp │ ├── swap.hpp │ ├── tagged_pair.hpp │ ├── tagged_tuple.hpp │ ├── tuple_algorithm.hpp │ ├── unreachable.hpp │ └── variant.hpp │ ├── version.hpp │ ├── view.hpp │ ├── view │ ├── adaptor.hpp │ ├── addressof.hpp │ ├── adjacent_filter.hpp │ ├── adjacent_remove_if.hpp │ ├── all.hpp │ ├── any_view.hpp │ ├── bounded.hpp │ ├── c_str.hpp │ ├── cache1.hpp │ ├── cartesian_product.hpp │ ├── chunk.hpp │ ├── chunk_by.hpp │ ├── common.hpp │ ├── concat.hpp │ ├── const.hpp │ ├── counted.hpp │ ├── cycle.hpp │ ├── delimit.hpp │ ├── drop.hpp │ ├── drop_exactly.hpp │ ├── drop_last.hpp │ ├── drop_while.hpp │ ├── empty.hpp │ ├── enumerate.hpp │ ├── exclusive_scan.hpp │ ├── facade.hpp │ ├── filter.hpp │ ├── for_each.hpp │ ├── generate.hpp │ ├── generate_n.hpp │ ├── getlines.hpp │ ├── group_by.hpp │ ├── indices.hpp │ ├── indirect.hpp │ ├── interface.hpp │ ├── intersperse.hpp │ ├── iota.hpp │ ├── istream.hpp │ ├── join.hpp │ ├── linear_distribute.hpp │ ├── map.hpp │ ├── move.hpp │ ├── partial_sum.hpp │ ├── ref.hpp │ ├── remove.hpp │ ├── remove_if.hpp │ ├── repeat.hpp │ ├── repeat_n.hpp │ ├── replace.hpp │ ├── replace_if.hpp │ ├── reverse.hpp │ ├── sample.hpp │ ├── set_algorithm.hpp │ ├── single.hpp │ ├── slice.hpp │ ├── sliding.hpp │ ├── span.hpp │ ├── split.hpp │ ├── split_when.hpp │ ├── stride.hpp │ ├── subrange.hpp │ ├── tail.hpp │ ├── take.hpp │ ├── take_exactly.hpp │ ├── take_last.hpp │ ├── take_while.hpp │ ├── tokenize.hpp │ ├── transform.hpp │ ├── trim.hpp │ ├── unbounded.hpp │ ├── unique.hpp │ ├── view.hpp │ ├── zip.hpp │ └── zip_with.hpp │ ├── view_adaptor.hpp │ ├── view_facade.hpp │ └── view_interface.hpp └── std ├── detail └── associated_types.hpp └── iterator /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | AccessModifierOffset: -4 3 | IndentWidth: 4 4 | ReflowComments: true 5 | 6 | ... 7 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build-and-test: 11 | name: Testing on ${{ matrix.os }} 12 | runs-on: ${{ matrix.os }} 13 | strategy: 14 | matrix: 15 | os: [ubuntu-latest, macos-latest, windows-latest] 16 | 17 | steps: 18 | - uses: actions/checkout@v3 19 | 20 | - name: make build directory 21 | run: cmake -E make_directory ${{runner.workspace}}/build 22 | 23 | - name: configure cmake 24 | shell: bash 25 | working-directory: ${{runner.workspace}}/build 26 | run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug 27 | 28 | - name: build 29 | shell: bash 30 | working-directory: ${{runner.workspace}}/build 31 | run: cmake --build . 32 | 33 | - name: run tests 34 | shell: bash 35 | working-directory: ${{runner.workspace}}/build 36 | run: ctest --output-on-failure 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # Local directories 35 | build 36 | .vscode 37 | Testing 38 | CMakeFiles -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | # Set a name and a version number for your project: 4 | project(hehub VERSION 0.1 LANGUAGES CXX) 5 | 6 | # this needs to be in the top level CMakeLists.txt to enable tests 7 | include(CTest) 8 | 9 | set(CMAKE_VERBOSE_MAKEFILE OFF) 10 | 11 | Option(HEHUB_DEBUG OFF) 12 | if(CMAKE_BUILD_TYPE STREQUAL Debug) 13 | set(HEHUB_DEBUG ON) 14 | endif() 15 | if(HEHUB_DEBUG) 16 | add_compile_definitions(HEHUB_DEBUG) 17 | endif() 18 | 19 | # compile the libraries 20 | add_subdirectory(src) 21 | 22 | # compile the tests 23 | add_subdirectory(tests) 24 | 25 | # compile the benchmarks 26 | add_subdirectory(bench) 27 | 28 | # compile the examples 29 | add_subdirectory(examples) 30 | 31 | # optionally add doxygen target to generate documentation 32 | option(BUILD_DOCS "Enable building of documentation (requires Doxygen)" OFF) 33 | if(BUILD_DOCS) 34 | find_package(Doxygen REQUIRED) 35 | set(DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_SOURCE_DIR}/third-party/*") 36 | doxygen_add_docs(doxygen 37 | ${CMAKE_SOURCE_DIR} 38 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 39 | ) 40 | endif() -------------------------------------------------------------------------------- /bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(benchmarks benchmarks.cpp mod_arith_bm.cpp ntt_bm.cpp ckks_bm.cpp) 2 | add_definitions(-DCATCH_CONFIG_ENABLE_BENCHMARKING) 3 | target_link_libraries(benchmarks PUBLIC hehub) 4 | target_include_directories(benchmarks PUBLIC ${PROJECT_SOURCE_DIR}/src) 5 | target_include_directories(benchmarks PUBLIC ${PROJECT_SOURCE_DIR}/third-party) 6 | -------------------------------------------------------------------------------- /bench/benchmarks.cpp: -------------------------------------------------------------------------------- 1 | // #define CATCH_CONFIG_MAIN 2 | // #include "catch2/catch.hpp" 3 | 4 | #define ANKERL_NANOBENCH_IMPLEMENT 5 | #include "nanobench.h" 6 | #include "fhe/common/ntt.h" 7 | #include "fhe/ckks/ckks.h" 8 | 9 | using namespace hehub; 10 | using namespace std; 11 | 12 | int main() { 13 | // double d = 1.0; 14 | // ankerl::nanobench::Bench().run("some double ops", [&] { 15 | // d += 1.0 / d; 16 | // if (d > 5.0) { 17 | // d -= 5.0; 18 | // } 19 | // ankerl::nanobench::doNotOptimizeAway(d); 20 | // }); 21 | for (auto [LOGN, scaling_bits] : 22 | {pair{12, 36}, pair{13, 43}, pair{14, 48}, pair{15, 55}}) { 23 | u64 N = 1 << LOGN; 24 | auto params = ckks::create_params(N, scaling_bits); 25 | cache_ntt_factors_strict(LOGN, params.moduli); 26 | 27 | CkksSk sk(params); 28 | auto rot_key = get_rot_key(sk, params.additional_mod, 1); 29 | std::vector data(N / 2); 30 | auto ct = ckks::encrypt(ckks::simd_encode(data, params), sk); 31 | ankerl::nanobench::Bench().timeUnit(1ms, "ms") 32 | .run(string("CKKS rotation / N=") + to_string(N) + 33 | string(" / scaling=2^") + to_string(scaling_bits), [&] { 34 | auto ct_rotated = ckks::rotate(ct, rot_key, 1); 35 | ankerl::nanobench::doNotOptimizeAway(ct_rotated); 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /bench/ckks_bm.cpp: -------------------------------------------------------------------------------- 1 | // #include "catch2/catch.hpp" 2 | // #include "fhe/ckks/ckks.h" 3 | // #include "fhe/common/ntt.h" 4 | 5 | // using namespace hehub; 6 | // using namespace std; 7 | 8 | // TEST_CASE("benchmark ckks") { 9 | // for (auto [LOGN, scaling_bits] : 10 | // {pair{12, 36}, pair{13, 43}, pair{14, 48}, pair{15, 55}}) { 11 | // u64 N = 1 << LOGN; 12 | // auto params = ckks::create_params(N, scaling_bits); 13 | // cache_ntt_factors_strict(LOGN, params.moduli); 14 | 15 | // CkksSk sk(params); 16 | // std::vector data(N / 2); 17 | // BENCHMARK(string("CKKS encode+encrypt / N=") + to_string(N) + 18 | // string(" / scaling=2^") + to_string(scaling_bits)) { 19 | // return ckks::encrypt(ckks::simd_encode(data, params), sk); 20 | // }; 21 | // } 22 | 23 | // for (auto [LOGN, scaling_bits] : 24 | // {pair{12, 36}, pair{13, 43}, pair{14, 48}, pair{15, 55}}) { 25 | // u64 N = 1 << LOGN; 26 | // auto params = ckks::create_params(N, scaling_bits); 27 | // cache_ntt_factors_strict(LOGN, params.moduli); 28 | 29 | // CkksSk sk(params); 30 | // std::vector data(N / 2); 31 | // auto ct = ckks::encrypt(ckks::simd_encode(data, params), sk); 32 | // BENCHMARK(string("CKKS decrypt+decode / N=") + to_string(N) + 33 | // string(" / scaling=2^") + to_string(scaling_bits)) { 34 | // return ckks::simd_decode(ckks::decrypt(ct, sk)); 35 | // }; 36 | // } 37 | // } 38 | -------------------------------------------------------------------------------- /bench/mod_arith_bm.cpp: -------------------------------------------------------------------------------- 1 | // #include "catch2/catch.hpp" 2 | // #include "fhe/common/mod_arith.h" 3 | 4 | // using namespace hehub; 5 | 6 | // TEST_CASE("BM reductions") { 7 | // const u64 modulus = 1234567890111111111; 8 | // const size_t vec_len = 8192; 9 | 10 | // u64 seed = 42; 11 | // u64 f[vec_len], g[vec_len], h[vec_len], k[vec_len]; 12 | // for (size_t i = 0; i < vec_len; i++) { 13 | // seed = seed * 65968279837582827 ^ 3948528936546489545; 14 | // f[i] = seed % modulus; 15 | // seed = seed * 43534547657678213 ^ 7955436776934235466; 16 | // g[i] = seed % modulus; 17 | // seed = (seed ^ 39857467872338747) * 65536 + 394866313; 18 | // h[i] = seed; 19 | // seed = (seed ^ 39857467872338747) * 65536 + 394866313; 20 | // k[i] = seed; 21 | // } 22 | 23 | // BENCHMARK("batched_barrett_lazy 8192") { 24 | // return batched_barrett_lazy(modulus, vec_len, h); 25 | // }; 26 | 27 | // BENCHMARK("batched_barrett 8192") { 28 | // return batched_barrett(modulus, vec_len, k); 29 | // }; 30 | 31 | // BENCHMARK("batched_mul_mod_hybrid_lazy 8192") { 32 | // return batched_mul_mod_hybrid_lazy(modulus, vec_len, f, g, h); 33 | // }; 34 | 35 | // BENCHMARK("batched_mul_mod_barrett_lazy 8192") { 36 | // return batched_mul_mod_barrett_lazy(modulus, vec_len, f, g, h); 37 | // }; 38 | 39 | // BENCHMARK("batched_mul_mod_hybrid 8192") { 40 | // return batched_mul_mod_hybrid(modulus, vec_len, f, g, h); 41 | // }; 42 | 43 | // BENCHMARK("batched_mul_mod_barrett 8192") { 44 | // return batched_mul_mod_barrett(modulus, vec_len, f, g, h); 45 | // }; 46 | // } 47 | -------------------------------------------------------------------------------- /bench/ntt_bm.cpp: -------------------------------------------------------------------------------- 1 | // #include "catch2/catch.hpp" 2 | // #include "fhe/common/ntt.h" 3 | // #include "fhe/common/rns.h" 4 | // #include 5 | 6 | // using namespace hehub; 7 | 8 | // TEST_CASE("benchmark ntt and intt") { 9 | // u64 Q = 576460752272228353ULL; 10 | 11 | // std::random_device rd; 12 | // std::default_random_engine generator(rd()); 13 | // std::uniform_int_distribution distribution(0, Q - 1); 14 | 15 | // for (auto LOGN: {10, 11, 12, 13, 14, 15}) { 16 | // u64 N = 1 << LOGN; 17 | // cache_ntt_factors_strict(LOGN, std::vector{Q}); 18 | 19 | // u64 poly[N]; 20 | // for (int i = 0; i < N; i++) { 21 | // poly[i] = distribution(generator); 22 | // } 23 | 24 | // BENCHMARK(std::string("NTT / len=") + std::to_string(N)) { 25 | // return ntt_negacyclic_inplace_lazy(LOGN, Q, poly); 26 | // }; 27 | // } 28 | 29 | // for (auto LOGN: {10, 11, 12, 13, 14, 15}) { 30 | // u64 N = 1 << LOGN; 31 | 32 | // u64 poly[N]; 33 | // for (int i = 0; i < N; i++) { 34 | // poly[i] = distribution(generator); 35 | // } 36 | 37 | // BENCHMARK(std::string("INTT / len=") + std::to_string(N)) { 38 | // return intt_negacyclic_inplace_lazy(LOGN, Q, poly); 39 | // }; 40 | // } 41 | // } 42 | -------------------------------------------------------------------------------- /doc/wechat.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/primihub/hehub/8d1d4bd06e276e69f184b9b6a832f78e54f80f0c/doc/wechat.jpeg -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(ckks_example ckks_example.cpp) 2 | target_link_libraries(ckks_example PUBLIC hehub) 3 | -------------------------------------------------------------------------------- /examples/ckks_example.cpp: -------------------------------------------------------------------------------- 1 | #include "fhe/ckks/ckks.h" 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace hehub; 7 | 8 | int main() { 9 | int precision_bits = 30; 10 | auto params = ckks::create_params(4096, precision_bits); 11 | CkksSk sk(params); 12 | auto relin_key = get_relin_key(sk, params.additional_mod); 13 | 14 | CkksCt ct_sum; 15 | for (int i = 1; i <= 10000; i++) { 16 | auto pt = ckks::encode(1.0 / i, params); 17 | auto ct = ckks::encrypt(pt, sk); 18 | auto ct_squared = ckks::mult(ct, ct, relin_key); 19 | 20 | if (i == 1) { 21 | ct_sum = ct_squared; 22 | } else { 23 | ct_sum = ckks::add(ct_sum, ct_squared); 24 | } 25 | } 26 | 27 | double sum = ckks::decode(ckks::decrypt(ct_sum, sk)); 28 | std::cout << "(" << sum << ", " << M_PI * M_PI / 6 << ")" << std::endl; 29 | } 30 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(fhe) 2 | add_subdirectory(circuits) 3 | 4 | INSTALL(TARGETS ${PROJECT_NAME} 5 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 6 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 7 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 8 | ) 9 | install(DIRECTORY fhe 10 | DESTINATION include 11 | FILES_MATCHING PATTERN "*.h") 12 | install(DIRECTORY circuits 13 | DESTINATION include 14 | FILES_MATCHING PATTERN "*.h") 15 | -------------------------------------------------------------------------------- /src/circuits/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(${PROJECT_NAME}-circuits SHARED linear_algebra.cpp) 2 | # require at least c++17 3 | target_compile_features(${PROJECT_NAME}-circuits PUBLIC cxx_std_17) 4 | 5 | set(THIRD_PARTY_DIR ${PROJECT_SOURCE_DIR}/third-party) 6 | 7 | target_include_directories(${PROJECT_NAME}-circuits PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 8 | target_include_directories(${PROJECT_NAME}-circuits PUBLIC ${THIRD_PARTY_DIR}/range-v3) 9 | target_link_libraries(${PROJECT_NAME}-circuits PUBLIC ${PROJECT_NAME}) 10 | 11 | -------------------------------------------------------------------------------- /src/circuits/cc_non_poly.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/primihub/hehub/8d1d4bd06e276e69f184b9b6a832f78e54f80f0c/src/circuits/cc_non_poly.h -------------------------------------------------------------------------------- /src/circuits/ckks_boot.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/primihub/hehub/8d1d4bd06e276e69f184b9b6a832f78e54f80f0c/src/circuits/ckks_boot.h -------------------------------------------------------------------------------- /src/circuits/fp_non_poly.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/primihub/hehub/8d1d4bd06e276e69f184b9b6a832f78e54f80f0c/src/circuits/fp_non_poly.h -------------------------------------------------------------------------------- /src/circuits/linear_algebra.cpp: -------------------------------------------------------------------------------- 1 | #include "linear_algebra.h" -------------------------------------------------------------------------------- /src/fhe/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(${PROJECT_NAME}) 2 | # require at least c++17 3 | target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) 4 | 5 | set(THIRD_PARTY_DIR ${PROJECT_SOURCE_DIR}/third-party) 6 | 7 | target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/src) 8 | target_include_directories(${PROJECT_NAME} PUBLIC ${THIRD_PARTY_DIR}) 9 | target_include_directories(${PROJECT_NAME} PUBLIC ${THIRD_PARTY_DIR}/range-v3) 10 | target_include_directories(${PROJECT_NAME} PUBLIC ${THIRD_PARTY_DIR}/MemoryPool) 11 | 12 | Option(HEHUB_DEBUG_FHE OFF) 13 | if(HEHUB_DEBUG) 14 | set(HEHUB_DEBUG_FHE ON) 15 | endif() 16 | if(HEHUB_DEBUG_FHE) 17 | target_compile_definitions(${PROJECT_NAME} PUBLIC HEHUB_DEBUG_FHE) 18 | endif() 19 | 20 | Option(HEHUB_DEBUG_RLWE_ZERO_C1 OFF) 21 | Option(HEHUB_DEBUG_RLWE_ZERO_E OFF) 22 | if(HEHUB_DEBUG_RLWE_ZERO_C1) 23 | target_compile_definitions(${PROJECT_NAME} PUBLIC HEHUB_DEBUG_RLWE_ZERO_C1) 24 | endif() 25 | if(HEHUB_DEBUG_RLWE_ZERO_E) 26 | target_compile_definitions(${PROJECT_NAME} PUBLIC HEHUB_DEBUG_RLWE_ZERO_E) 27 | endif() 28 | 29 | add_subdirectory(common) 30 | add_subdirectory(primitives) 31 | add_subdirectory(bgv) 32 | add_subdirectory(ckks) 33 | add_subdirectory(tfhe) 34 | -------------------------------------------------------------------------------- /src/fhe/bgv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | target_sources(${PROJECT_NAME} PUBLIC 2 | ${CMAKE_CURRENT_SOURCE_DIR}/arith.cpp 3 | ${CMAKE_CURRENT_SOURCE_DIR}/basics.cpp 4 | ${CMAKE_CURRENT_SOURCE_DIR}/mod_switch.cpp) -------------------------------------------------------------------------------- /src/fhe/ckks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | target_sources(${PROJECT_NAME} PUBLIC 2 | ${CMAKE_CURRENT_SOURCE_DIR}/basics.cpp 3 | ${CMAKE_CURRENT_SOURCE_DIR}/arith.cpp 4 | ${CMAKE_CURRENT_SOURCE_DIR}/rescaling.cpp) -------------------------------------------------------------------------------- /src/fhe/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | target_sources(${PROJECT_NAME} PUBLIC 2 | ${CMAKE_CURRENT_SOURCE_DIR}/rns.cpp 3 | ${CMAKE_CURRENT_SOURCE_DIR}/bigint.cpp 4 | ${CMAKE_CURRENT_SOURCE_DIR}/mod_arith.cpp 5 | ${CMAKE_CURRENT_SOURCE_DIR}/ntt.cpp 6 | ${CMAKE_CURRENT_SOURCE_DIR}/rns_transform.cpp 7 | ${CMAKE_CURRENT_SOURCE_DIR}/sampling.cpp 8 | ${CMAKE_CURRENT_SOURCE_DIR}/permutation.cpp 9 | ${CMAKE_CURRENT_SOURCE_DIR}/primelists.cpp 10 | ) 11 | -------------------------------------------------------------------------------- /src/fhe/common/primelists.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file primelists.h 3 | * @brief TODO 4 | * 5 | */ 6 | 7 | #include "type_defs.h" 8 | #include 9 | 10 | namespace hehub { 11 | 12 | /// @brief TODO 13 | extern const std::vector> prime_lists; 14 | 15 | } // namespace hehub 16 | -------------------------------------------------------------------------------- /src/fhe/common/rns_transform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "rns.h" 4 | 5 | namespace hehub { 6 | 7 | /** 8 | * @brief TODO 9 | * @note Currently this function accepts input of type RnsPolynomial, which can 10 | * be generalized to RnsIntVec if useful. 11 | * @param input_poly 12 | * @param new_moduli 13 | * @return RnsPolynomial 14 | */ 15 | RnsPolynomial rns_base_transform(RnsPolynomial input_poly, 16 | const std::vector &new_moduli); 17 | 18 | } // namespace hehub 19 | -------------------------------------------------------------------------------- /src/fhe/common/sampling.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file sampling.h 3 | * @brief Generate random polynomials. 4 | */ 5 | 6 | #include "rns.h" 7 | 8 | namespace hehub { 9 | 10 | /** 11 | * @brief Get a random ternary RnsPolynomial object with specified dimensions, 12 | * which represents a polynomial with coefficients uniform from {-1, 0, 1}. The 13 | * result will be in NTT form. 14 | * @param params Polynomial dimensions for initializing the RnsPolynomial. 15 | * @return RnsPolynomial 16 | */ 17 | RnsPolynomial get_rand_ternary_poly(const RnsPolyParams ¶ms); 18 | 19 | /** 20 | * @brief Get a random uniform RnsPolynomial object with specified dimensions, 21 | * where the k-th component polynomial's coefficients will be uniform from {0, 22 | * ..., moduli[k] - 1}. 23 | * @param params Polynomial dimensions for initializing the RnsPolynomial. 24 | * @param form Required representation form of the resulting polynomial. 25 | * @return RnsPolynomial 26 | */ 27 | RnsPolynomial get_rand_uniform_poly(const RnsPolyParams ¶ms, 28 | PolyRepForm form = PolyRepForm::coeff); 29 | 30 | /** 31 | * @brief Get a random gaussian RnsPolynomial object with specified dimensions, 32 | * which represents a polynomial with coefficients sampled (and rounded) from 33 | * a gaussian distribution. The result will be in NTT form. 34 | * @param params Polynomial dimensions for initializing the RnsPolynomial. 35 | * @param std_dev Standard deviation of the gaussian distribution. 36 | * @return RnsPolynomial 37 | */ 38 | RnsPolynomial get_rand_gaussian_poly(const RnsPolyParams ¶ms, 39 | double std_dev = 3.2); 40 | 41 | /** 42 | * @brief TODO 43 | * 44 | * @param params 45 | * @param form 46 | * @return RnsPolynomial 47 | */ 48 | RnsPolynomial get_zero_poly(const RnsPolyParams ¶ms, 49 | PolyRepForm form = PolyRepForm::value); 50 | 51 | } // namespace hehub 52 | -------------------------------------------------------------------------------- /src/fhe/common/type_defs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file type_defs.h 3 | * @brief Define short alias for common integer types. 4 | * 5 | */ 6 | #pragma once 7 | #include 8 | #include 9 | 10 | namespace hehub { 11 | 12 | using i8 = __int8_t; 13 | using i16 = __int16_t; 14 | using i32 = __int32_t; 15 | using i64 = __int64_t; 16 | using i128 = __int128_t; 17 | 18 | using u8 = __uint8_t; 19 | using u16 = __uint16_t; 20 | using u32 = __uint32_t; 21 | using u64 = __uint64_t; 22 | using u128 = __uint128_t; 23 | 24 | using cc_double = std::complex; 25 | using cc_long_double = std::complex; 26 | 27 | } // namespace hehub 28 | -------------------------------------------------------------------------------- /src/fhe/primitives/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | target_sources(${PROJECT_NAME} PUBLIC 2 | ${CMAKE_CURRENT_SOURCE_DIR}/rlwe.cpp 3 | ${CMAKE_CURRENT_SOURCE_DIR}/rgsw.cpp 4 | ${CMAKE_CURRENT_SOURCE_DIR}/keys.cpp) 5 | -------------------------------------------------------------------------------- /src/fhe/primitives/keys.cpp: -------------------------------------------------------------------------------- 1 | #include "keys.h" 2 | #include "fhe/common/mod_arith.h" 3 | #include "fhe/common/ntt.h" 4 | #include "fhe/common/rns_transform.h" 5 | 6 | namespace hehub { 7 | 8 | RlweKsk::RlweKsk(const RlweSk &sk_curr, const RlweSk &sk_orig, 9 | const u64 additional_mod) { 10 | auto sk_curr_extended = sk_curr; 11 | sk_curr_extended.add_components({additional_mod}); 12 | // no need to set 0 manually unless debugging mem since will be mult'd by p 13 | #ifdef HEHUB_DEBUG 14 | std::fill(sk_curr_extended.last()->begin(), sk_curr_extended.last()->end(), 15 | (u64)0); 16 | #endif 17 | 18 | // To encapsulate 19 | auto extended_moduli = sk_orig.modulus_vec(); 20 | extended_moduli.push_back(additional_mod); 21 | auto sk_orig_extended(sk_orig); 22 | intt_negacyclic_inplace_lazy(sk_orig_extended); 23 | auto extended_part = rns_base_transform(sk_orig_extended, {additional_mod}); 24 | sk_orig_extended.add_components({additional_mod}); 25 | *sk_orig_extended.last() = std::move(extended_part[0]); 26 | ntt_negacyclic_inplace_lazy(sk_orig_extended); 27 | 28 | auto orig_components = sk_orig.component_count(); 29 | std::vector> rns_composition_basis(orig_components); 30 | for (size_t i = 0; i < orig_components; i++) { 31 | rns_composition_basis[i].resize(orig_components + 1, 0); 32 | rns_composition_basis[i][i] = additional_mod % extended_moduli[i]; 33 | } 34 | *this = RgswCt(rgsw_encrypt_montgomery(sk_curr_extended, sk_orig_extended, 35 | rns_composition_basis)); 36 | } 37 | 38 | } // namespace hehub 39 | -------------------------------------------------------------------------------- /src/fhe/primitives/lwe.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lwe.h 3 | * @brief TODO 4 | * 5 | */ 6 | 7 | namespace hehub 8 | { 9 | 10 | struct LweCt; 11 | 12 | } // namespace hehub 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/fhe/primitives/rgsw.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file rgsw.h 3 | * @brief TODO 4 | */ 5 | 6 | #pragma once 7 | 8 | #include "fhe/common/rns.h" 9 | #include "rlwe.h" 10 | #include 11 | 12 | namespace hehub { 13 | 14 | /** 15 | * @brief TODO 16 | * 17 | */ 18 | struct RgswSpec {}; 19 | 20 | using RgswCt = std::vector; 21 | 22 | /** 23 | * @brief TODO 24 | * 25 | * @param pt_ntt 26 | * @param sk 27 | * @param decomp_basis 28 | * @return RgswCt 29 | */ 30 | RgswCt rgsw_encrypt(const RlwePt &pt_ntt, const RlweSk &sk, 31 | const std::vector> &decomp_basis); 32 | 33 | /** 34 | * @brief TODO 35 | * 36 | * @param pt_ntt 37 | * @param sk 38 | * @param decomp_basis 39 | * @return RgswCt 40 | */ 41 | RgswCt rgsw_encrypt_montgomery(const RlwePt &pt_ntt, const RlweSk &sk, 42 | const std::vector> &decomp_basis); 43 | 44 | /** 45 | * @brief TODO 46 | * 47 | * @param pt 48 | * @param rgsw 49 | * @return RlweCt 50 | */ 51 | RlweCt ext_prod_montgomery(const RlwePt &pt, const RgswCt &rgsw); 52 | 53 | } // namespace hehub 54 | -------------------------------------------------------------------------------- /src/fhe/tfhe/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | target_sources(${PROJECT_NAME} PUBLIC 2 | ${CMAKE_CURRENT_SOURCE_DIR}/func_boot.cpp) 3 | -------------------------------------------------------------------------------- /src/fhe/tfhe/func_boot.cpp: -------------------------------------------------------------------------------- 1 | #include "func_boot.h" 2 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(tests tests.cpp common_t.cpp bigint_t.cpp 2 | mod_arith_t.cpp ntt_t.cpp rlwe_t.cpp bgv_t.cpp ckks_t.cpp lin_alg_t.cpp) 3 | target_link_libraries(tests PUBLIC hehub) 4 | target_link_libraries(tests PUBLIC hehub-circuits) 5 | target_include_directories(tests PUBLIC ${PROJECT_SOURCE_DIR}/third-party) 6 | 7 | # allow user to run tests with `make test` or `ctest` 8 | include(../cmake/Catch.cmake) 9 | catch_discover_tests(tests) 10 | -------------------------------------------------------------------------------- /tests/rlwe_t.cpp: -------------------------------------------------------------------------------- 1 | #include "catch2/catch.hpp" 2 | #include "fhe/primitives/rlwe.h" 3 | #include 4 | 5 | using namespace hehub; 6 | 7 | TEST_CASE("rlwe") { 8 | RnsPolyParams params = create_params(4096, {30, 30}); 9 | RlwePt pt(params); 10 | RlweSk sk(params); 11 | 12 | // plaintext data 13 | const i64 DATUM_TEST = 123456; 14 | for (auto &component_poly : pt) { 15 | for (auto &datum : component_poly) { 16 | datum = DATUM_TEST; 17 | } 18 | } 19 | 20 | // encrypt & decrypt 21 | RlweCt ct = encrypt_core(pt, sk); 22 | RlwePt pt_recovered = decrypt_core(ct, sk); 23 | 24 | // check 25 | auto component_count = pt.component_count(); 26 | REQUIRE(pt_recovered.component_count() == component_count); 27 | auto check_if_close = [=](auto status, auto coeff) { 28 | return status && (std::abs(i64(coeff) - DATUM_TEST) < 20); 29 | }; 30 | for (auto &component_poly : pt_recovered) { 31 | REQUIRE(std::accumulate(component_poly.begin(), component_poly.end(), 32 | true, check_if_close)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tests/tests.cpp: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN 2 | #include "catch2/catch.hpp" 3 | -------------------------------------------------------------------------------- /third-party/Eigen/AccelerateSupport: -------------------------------------------------------------------------------- 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_ACCELERATESUPPORT_MODULE_H 9 | #define EIGEN_ACCELERATESUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \ingroup Support_modules 16 | * \defgroup AccelerateSupport_Module AccelerateSupport module 17 | * 18 | * This module provides an interface to the Apple Accelerate library. 19 | * It provides the seven following main factorization classes: 20 | * - class AccelerateLLT: a Cholesky (LL^T) factorization. 21 | * - class AccelerateLDLT: the default LDL^T factorization. 22 | * - class AccelerateLDLTUnpivoted: a Cholesky-like LDL^T factorization with only 1x1 pivots and no pivoting 23 | * - class AccelerateLDLTSBK: an LDL^T factorization with Supernode Bunch-Kaufman and static pivoting 24 | * - class AccelerateLDLTTPP: an LDL^T factorization with full threshold partial pivoting 25 | * - class AccelerateQR: a QR factorization 26 | * - class AccelerateCholeskyAtA: a QR factorization without storing Q (equivalent to A^TA = R^T R) 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | * 32 | * In order to use this module, the Accelerate headers must be accessible from 33 | * the include paths, and your binary must be linked to the Accelerate framework. 34 | * The Accelerate library is only available on Apple hardware. 35 | * 36 | * Note that many of the algorithms can be influenced by the UpLo template 37 | * argument. All matrices are assumed to be symmetric. For example, the following 38 | * creates an LDLT factorization where your matrix is symmetric (implicit) and 39 | * uses the lower triangle: 40 | * 41 | * \code 42 | * AccelerateLDLT, Lower> ldlt; 43 | * \endcode 44 | */ 45 | 46 | #include "src/AccelerateSupport/AccelerateSupport.h" 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_ACCELERATESUPPORT_MODULE_H 51 | -------------------------------------------------------------------------------- /third-party/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | #include "Jacobi" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** \defgroup Cholesky_Module Cholesky module 17 | * 18 | * 19 | * 20 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 21 | * Those decompositions are also accessible via the following methods: 22 | * - MatrixBase::llt() 23 | * - MatrixBase::ldlt() 24 | * - SelfAdjointView::llt() 25 | * - SelfAdjointView::ldlt() 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | */ 31 | 32 | #include "src/Cholesky/LLT.h" 33 | #include "src/Cholesky/LDLT.h" 34 | #ifdef EIGEN_USE_LAPACKE 35 | #include "src/misc/lapacke_helpers.h" 36 | #include "src/Cholesky/LLT_LAPACKE.h" 37 | #endif 38 | 39 | #include "src/Core/util/ReenableStupidWarnings.h" 40 | 41 | #endif // EIGEN_CHOLESKY_MODULE_H 42 | -------------------------------------------------------------------------------- /third-party/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 CholmodDecomposition: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). 26 | * 27 | * For the sake of completeness, this module also propose the two following classes: 28 | * - class CholmodSimplicialLLT 29 | * - class CholmodSimplicialLDLT 30 | * Note that these classes does not bring any particular advantage compared to the built-in 31 | * SimplicialLLT and SimplicialLDLT factorization classes. 32 | * 33 | * \code 34 | * #include 35 | * \endcode 36 | * 37 | * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies. 38 | * The dependencies depend on how cholmod has been compiled. 39 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. 40 | * 41 | */ 42 | 43 | #include "src/CholmodSupport/CholmodSupport.h" 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H 48 | 49 | -------------------------------------------------------------------------------- /third-party/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /third-party/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /third-party/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_EIGENVALUES_MODULE_H 9 | #define EIGEN_EIGENVALUES_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | #include "LU" 17 | #include "Geometry" 18 | 19 | #include "src/Core/util/DisableStupidWarnings.h" 20 | 21 | /** \defgroup Eigenvalues_Module Eigenvalues module 22 | * 23 | * 24 | * 25 | * This module mainly provides various eigenvalue solvers. 26 | * This module also provides some MatrixBase methods, including: 27 | * - MatrixBase::eigenvalues(), 28 | * - MatrixBase::operatorNorm() 29 | * 30 | * \code 31 | * #include 32 | * \endcode 33 | */ 34 | 35 | #include "src/misc/RealSvd2x2.h" 36 | #include "src/Eigenvalues/Tridiagonalization.h" 37 | #include "src/Eigenvalues/RealSchur.h" 38 | #include "src/Eigenvalues/EigenSolver.h" 39 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h" 40 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" 41 | #include "src/Eigenvalues/HessenbergDecomposition.h" 42 | #include "src/Eigenvalues/ComplexSchur.h" 43 | #include "src/Eigenvalues/ComplexEigenSolver.h" 44 | #include "src/Eigenvalues/RealQZ.h" 45 | #include "src/Eigenvalues/GeneralizedEigenSolver.h" 46 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h" 47 | #ifdef EIGEN_USE_LAPACKE 48 | #ifdef EIGEN_USE_MKL 49 | #include "mkl_lapacke.h" 50 | #else 51 | #include "src/misc/lapacke.h" 52 | #endif 53 | #include "src/Eigenvalues/RealSchur_LAPACKE.h" 54 | #include "src/Eigenvalues/ComplexSchur_LAPACKE.h" 55 | #include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h" 56 | #endif 57 | 58 | #include "src/Core/util/ReenableStupidWarnings.h" 59 | 60 | #endif // EIGEN_EIGENVALUES_MODULE_H 61 | -------------------------------------------------------------------------------- /third-party/Eigen/Geometry: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_GEOMETRY_MODULE_H 9 | #define EIGEN_GEOMETRY_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "SVD" 14 | #include "LU" 15 | #include 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup Geometry_Module Geometry module 20 | * 21 | * This module provides support for: 22 | * - fixed-size homogeneous transformations 23 | * - translation, scaling, 2D and 3D rotations 24 | * - \link Quaternion quaternions \endlink 25 | * - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3) 26 | * - orthognal vector generation (\ref MatrixBase::unitOrthogonal) 27 | * - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink 28 | * - \link AlignedBox axis aligned bounding boxes \endlink 29 | * - \link umeyama least-square transformation fitting \endlink 30 | * 31 | * \code 32 | * #include 33 | * \endcode 34 | */ 35 | 36 | #include "src/Geometry/OrthoMethods.h" 37 | #include "src/Geometry/EulerAngles.h" 38 | 39 | #include "src/Geometry/Homogeneous.h" 40 | #include "src/Geometry/RotationBase.h" 41 | #include "src/Geometry/Rotation2D.h" 42 | #include "src/Geometry/Quaternion.h" 43 | #include "src/Geometry/AngleAxis.h" 44 | #include "src/Geometry/Transform.h" 45 | #include "src/Geometry/Translation.h" 46 | #include "src/Geometry/Scaling.h" 47 | #include "src/Geometry/Hyperplane.h" 48 | #include "src/Geometry/ParametrizedLine.h" 49 | #include "src/Geometry/AlignedBox.h" 50 | #include "src/Geometry/Umeyama.h" 51 | 52 | // Use the SSE optimized version whenever possible. 53 | #if (defined EIGEN_VECTORIZE_SSE) || (defined EIGEN_VECTORIZE_NEON) 54 | #include "src/Geometry/arch/Geometry_SIMD.h" 55 | #endif 56 | 57 | #include "src/Core/util/ReenableStupidWarnings.h" 58 | 59 | #endif // EIGEN_GEOMETRY_MODULE_H 60 | -------------------------------------------------------------------------------- /third-party/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 | -------------------------------------------------------------------------------- /third-party/Eigen/IterativeLinearSolvers: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 9 | #define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** 17 | * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module 18 | * 19 | * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse. 20 | * Those solvers are accessible via the following classes: 21 | * - ConjugateGradient for selfadjoint (hermitian) matrices, 22 | * - LeastSquaresConjugateGradient for rectangular least-square problems, 23 | * - BiCGSTAB for general square matrices. 24 | * 25 | * These iterative solvers are associated with some preconditioners: 26 | * - IdentityPreconditioner - not really useful 27 | * - DiagonalPreconditioner - also called Jacobi preconditioner, work very well on diagonal dominant matrices. 28 | * - IncompleteLUT - incomplete LU factorization with dual thresholding 29 | * 30 | * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport, AccelerateSupport. 31 | * 32 | \code 33 | #include 34 | \endcode 35 | */ 36 | 37 | #include "src/IterativeLinearSolvers/SolveWithGuess.h" 38 | #include "src/IterativeLinearSolvers/IterativeSolverBase.h" 39 | #include "src/IterativeLinearSolvers/BasicPreconditioners.h" 40 | #include "src/IterativeLinearSolvers/ConjugateGradient.h" 41 | #include "src/IterativeLinearSolvers/LeastSquareConjugateGradient.h" 42 | #include "src/IterativeLinearSolvers/BiCGSTAB.h" 43 | #include "src/IterativeLinearSolvers/IncompleteLUT.h" 44 | #include "src/IterativeLinearSolvers/IncompleteCholesky.h" 45 | 46 | #include "src/Core/util/ReenableStupidWarnings.h" 47 | 48 | #endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 49 | -------------------------------------------------------------------------------- /third-party/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | 33 | -------------------------------------------------------------------------------- /third-party/Eigen/KLUSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_KLUSUPPORT_MODULE_H 9 | #define EIGEN_KLUSUPPORT_MODULE_H 10 | 11 | #include 12 | 13 | #include 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup KLUSupport_Module KLUSupport module 22 | * 23 | * This module provides an interface to the KLU library which is part of the suitesparse package. 24 | * It provides the following factorization class: 25 | * - class KLU: a sparse LU factorization, well-suited for circuit simulation. 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | * 31 | * In order to use this module, the klu and btf headers must be accessible from the include paths, and your binary must be linked to the klu library and its dependencies. 32 | * The dependencies depend on how umfpack has been compiled. 33 | * For a cmake based project, you can use our FindKLU.cmake module to help you in this task. 34 | * 35 | */ 36 | 37 | #include "src/KLUSupport/KLUSupport.h" 38 | 39 | #include 40 | 41 | #endif // EIGEN_KLUSUPPORT_MODULE_H 42 | -------------------------------------------------------------------------------- /third-party/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_helpers.h" 32 | #include "src/LU/PartialPivLU_LAPACKE.h" 33 | #endif 34 | #include "src/LU/Determinant.h" 35 | #include "src/LU/InverseImpl.h" 36 | 37 | #if defined EIGEN_VECTORIZE_SSE || defined EIGEN_VECTORIZE_NEON 38 | #include "src/LU/arch/InverseSize4.h" 39 | #endif 40 | 41 | #include "src/Core/util/ReenableStupidWarnings.h" 42 | 43 | #endif // EIGEN_LU_MODULE_H 44 | -------------------------------------------------------------------------------- /third-party/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /third-party/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 9 | #define EIGEN_PASTIXSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | #ifdef complex 21 | #undef complex 22 | #endif 23 | 24 | /** \ingroup Support_modules 25 | * \defgroup PaStiXSupport_Module PaStiXSupport module 26 | * 27 | * This module provides an interface to the PaSTiX library. 28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 29 | * It provides the two following main factorization classes: 30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | * 38 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. 39 | * This wrapper resuires PaStiX version 5.x compiled without MPI support. 40 | * The dependencies depend on how PaSTiX has been compiled. 41 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 42 | * 43 | */ 44 | 45 | #include "src/PaStiXSupport/PaStiXSupport.h" 46 | 47 | #include "src/Core/util/ReenableStupidWarnings.h" 48 | 49 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 50 | -------------------------------------------------------------------------------- /third-party/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /third-party/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #include "src/misc/lapacke_helpers.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 | -------------------------------------------------------------------------------- /third-party/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(std::size_t size) 18 | { 19 | return Eigen::internal::aligned_malloc(size); 20 | } 21 | 22 | void qFree(void *ptr) 23 | { 24 | Eigen::internal::aligned_free(ptr); 25 | } 26 | 27 | void *qRealloc(void *ptr, std::size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | std::memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | -------------------------------------------------------------------------------- /third-party/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 "Eigen/CholmodSupport" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /third-party/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 | #ifdef EIGEN_USE_LAPACKE 40 | #ifdef EIGEN_USE_MKL 41 | #include "mkl_lapacke.h" 42 | #else 43 | #include "src/misc/lapacke.h" 44 | #endif 45 | #ifndef EIGEN_USE_LAPACKE_STRICT 46 | #include "src/SVD/JacobiSVD_LAPACKE.h" 47 | #endif 48 | #include "src/SVD/BDCSVD_LAPACKE.h" 49 | #endif 50 | 51 | #include "src/Core/util/ReenableStupidWarnings.h" 52 | 53 | #endif // EIGEN_SVD_MODULE_H 54 | -------------------------------------------------------------------------------- /third-party/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #include "SparseCholesky" 29 | #include "SparseLU" 30 | #include "SparseQR" 31 | #include "IterativeLinearSolvers" 32 | 33 | #endif // EIGEN_SPARSE_MODULE_H 34 | 35 | -------------------------------------------------------------------------------- /third-party/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #include "src/SparseCholesky/SimplicialCholesky.h" 34 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 38 | -------------------------------------------------------------------------------- /third-party/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | // Ordering interface 24 | #include "OrderingMethods" 25 | 26 | #include "src/Core/util/DisableStupidWarnings.h" 27 | 28 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 29 | 30 | #include "src/SparseLU/SparseLU_Structs.h" 31 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 32 | #include "src/SparseLU/SparseLUImpl.h" 33 | #include "src/SparseCore/SparseColEtree.h" 34 | #include "src/SparseLU/SparseLU_Memory.h" 35 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 36 | #include "src/SparseLU/SparseLU_relax_snode.h" 37 | #include "src/SparseLU/SparseLU_pivotL.h" 38 | #include "src/SparseLU/SparseLU_panel_dfs.h" 39 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 40 | #include "src/SparseLU/SparseLU_panel_bmod.h" 41 | #include "src/SparseLU/SparseLU_column_dfs.h" 42 | #include "src/SparseLU/SparseLU_column_bmod.h" 43 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 44 | #include "src/SparseLU/SparseLU_pruneL.h" 45 | #include "src/SparseLU/SparseLU_Utils.h" 46 | #include "src/SparseLU/SparseLU.h" 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SPARSELU_MODULE_H 51 | -------------------------------------------------------------------------------- /third-party/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseQR/SparseQR.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /third-party/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 | -------------------------------------------------------------------------------- /third-party/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 | -------------------------------------------------------------------------------- /third-party/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 | -------------------------------------------------------------------------------- /third-party/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup UmfPackSupport_Module UmfPackSupport module 21 | * 22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 23 | * It provides the following factorization class: 24 | * - class UmfPackLU: a multifrontal sequential LU factorization. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. 31 | * The dependencies depend on how umfpack has been compiled. 32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/UmfPackSupport/UmfPackSupport.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 41 | -------------------------------------------------------------------------------- /third-party/Eigen/src/AccelerateSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ACCELERATESUPPORT_MODULE_H 2 | #error "Please include Eigen/AccelerateSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Cholesky/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CHOLESKY_MODULE_H 2 | #error "Please include Eigen/Cholesky instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/CholmodSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H 2 | #error "Please include Eigen/CholmodSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/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 | #include "./InternalHeaderCheck.h" 15 | 16 | namespace Eigen { 17 | 18 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 19 | */ 20 | template 21 | template 22 | EIGEN_DEVICE_FUNC inline const Product 23 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 24 | { 25 | return Product(derived(),a_diagonal.derived()); 26 | } 27 | 28 | } // end namespace Eigen 29 | 30 | #endif // EIGEN_DIAGONALPRODUCT_H 31 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CORE_MODULE_H 2 | #error "Please include Eigen/Core instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/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 | #include "./InternalHeaderCheck.h" 14 | 15 | namespace Eigen { 16 | 17 | // TODO generalize the scalar type of 'other' 18 | 19 | template 20 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 21 | { 22 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 23 | return derived(); 24 | } 25 | 26 | template 27 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 28 | { 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 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 37 | return derived(); 38 | } 39 | 40 | template 41 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 42 | { 43 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 44 | return derived(); 45 | } 46 | 47 | } // end namespace Eigen 48 | 49 | #endif // EIGEN_SELFCWISEBINARYOP_H 50 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 110 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/arch/HIP/hcc/math_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * math_constants.h - 3 | * HIP equivalent of the CUDA header of the same name 4 | */ 5 | 6 | #ifndef __MATH_CONSTANTS_H__ 7 | #define __MATH_CONSTANTS_H__ 8 | 9 | /* single precision constants */ 10 | 11 | #define HIPRT_INF_F __int_as_float(0x7f800000) 12 | #define HIPRT_NAN_F __int_as_float(0x7fffffff) 13 | #define HIPRT_MIN_DENORM_F __int_as_float(0x00000001) 14 | #define HIPRT_MAX_NORMAL_F __int_as_float(0x7f7fffff) 15 | #define HIPRT_NEG_ZERO_F __int_as_float(0x80000000) 16 | #define HIPRT_ZERO_F 0.0f 17 | #define HIPRT_ONE_F 1.0f 18 | 19 | /* double precision constants */ 20 | #define HIPRT_INF __hiloint2double(0x7ff00000, 0x00000000) 21 | #define HIPRT_NAN __hiloint2double(0xfff80000, 0x00000000) 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/arch/NEON/UnaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_NEON_UNARY_FUNCTORS_H 9 | #define EIGEN_NEON_UNARY_FUNCTORS_H 10 | 11 | #include "../../InternalHeaderCheck.h" 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | #if EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 18 | /** \internal 19 | * \brief Template specialization of the logistic function for Eigen::half. 20 | */ 21 | template <> 22 | struct scalar_logistic_op { 23 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 24 | Eigen::half operator()(const Eigen::half& x) const { 25 | // Convert to float and call scalar_logistic_op. 26 | const scalar_logistic_op float_op; 27 | return Eigen::half(float_op(float(x))); 28 | } 29 | 30 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 31 | Eigen::half packetOp(const Eigen::half& x) const { 32 | return this->operator()(x); 33 | } 34 | 35 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 36 | Packet4hf packetOp(const Packet4hf& x) const { 37 | const scalar_logistic_op float_op; 38 | return vcvt_f16_f32(float_op.packetOp(vcvt_f32_f16(x))); 39 | } 40 | 41 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 42 | Packet8hf packetOp(const Packet8hf& x) const { 43 | const scalar_logistic_op float_op; 44 | return vcombine_f16( 45 | vcvt_f16_f32(float_op.packetOp(vcvt_f32_f16(vget_low_f16(x)))), 46 | vcvt_f16_f32(float_op.packetOp(vcvt_high_f32_f16(x)))); 47 | } 48 | }; 49 | 50 | template<> 51 | struct functor_traits> { 52 | enum { 53 | Cost = functor_traits>::Cost, 54 | PacketAccess = functor_traits>::PacketAccess, 55 | }; 56 | }; 57 | #endif // EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 58 | 59 | } // end namespace internal 60 | 61 | } // end namespace Eigen 62 | 63 | #endif // EIGEN_NEON_UNARY_FUNCTORS_H 64 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/arch/SVE/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MATH_FUNCTIONS_SVE_H 11 | #define EIGEN_MATH_FUNCTIONS_SVE_H 12 | 13 | #include "../../InternalHeaderCheck.h" 14 | 15 | namespace Eigen { 16 | namespace internal { 17 | 18 | template <> 19 | EIGEN_STRONG_INLINE PacketXf pexp(const PacketXf& x) { 20 | return pexp_float(x); 21 | } 22 | 23 | template <> 24 | EIGEN_STRONG_INLINE PacketXf plog(const PacketXf& x) { 25 | return plog_float(x); 26 | } 27 | 28 | template <> 29 | EIGEN_STRONG_INLINE PacketXf psin(const PacketXf& x) { 30 | return psin_float(x); 31 | } 32 | 33 | template <> 34 | EIGEN_STRONG_INLINE PacketXf pcos(const PacketXf& x) { 35 | return pcos_float(x); 36 | } 37 | 38 | // Hyperbolic Tangent function. 39 | template <> 40 | EIGEN_STRONG_INLINE PacketXf ptanh(const PacketXf& x) { 41 | return internal::generic_fast_tanh_float(x); 42 | } 43 | } // end namespace internal 44 | } // end namespace Eigen 45 | 46 | #endif // EIGEN_MATH_FUNCTIONS_SVE_H 47 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/arch/SVE/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2020, Arm Limited and Contributors 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_SVE_H 11 | #define EIGEN_TYPE_CASTING_SVE_H 12 | 13 | #include "../../InternalHeaderCheck.h" 14 | 15 | namespace Eigen { 16 | namespace internal { 17 | 18 | template <> 19 | struct type_casting_traits { 20 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 21 | }; 22 | 23 | template <> 24 | struct type_casting_traits { 25 | enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 }; 26 | }; 27 | 28 | template <> 29 | EIGEN_STRONG_INLINE PacketXf pcast(const PacketXi& a) { 30 | return svcvt_f32_s32_z(svptrue_b32(), a); 31 | } 32 | 33 | template <> 34 | EIGEN_STRONG_INLINE PacketXi pcast(const PacketXf& a) { 35 | return svcvt_s32_f32_z(svptrue_b32(), a); 36 | } 37 | 38 | template <> 39 | EIGEN_STRONG_INLINE PacketXf preinterpret(const PacketXi& a) { 40 | return svreinterpret_f32_s32(a); 41 | } 42 | 43 | template <> 44 | EIGEN_STRONG_INLINE PacketXi preinterpret(const PacketXf& a) { 45 | return svreinterpret_s32_f32(a); 46 | } 47 | 48 | } // namespace internal 49 | } // namespace Eigen 50 | 51 | #endif // EIGEN_TYPE_CASTING_SVE_H 52 | -------------------------------------------------------------------------------- /third-party/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 | #include "../InternalHeaderCheck.h" 14 | 15 | namespace Eigen { 16 | 17 | namespace internal { 18 | 19 | //---------- associative ternary functors ---------- 20 | 21 | 22 | 23 | } // end namespace internal 24 | 25 | } // end namespace Eigen 26 | 27 | #endif // EIGEN_TERNARY_FUNCTORS_H 28 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED_2 2 | // "DisableStupidWarnings.h" was included twice recursively: Do not re-enable warnings yet! 3 | # undef EIGEN_WARNINGS_DISABLED_2 4 | 5 | #elif defined(EIGEN_WARNINGS_DISABLED) 6 | #undef EIGEN_WARNINGS_DISABLED 7 | 8 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 9 | #ifdef _MSC_VER 10 | #pragma warning( pop ) 11 | #elif defined __INTEL_COMPILER 12 | #pragma warning pop 13 | #elif defined __clang__ 14 | #pragma clang diagnostic pop 15 | #elif defined __GNUC__ && !defined(__FUJITSU) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 16 | #pragma GCC diagnostic pop 17 | #endif 18 | 19 | #if defined __NVCC__ 20 | // Don't re-enable the diagnostic messages, as it turns out these messages need 21 | // to be disabled at the point of the template instantiation (i.e the user code) 22 | // otherwise they'll be triggered by nvcc. 23 | // #define EIGEN_MAKE_PRAGMA(X) _Pragma(#X) 24 | // #if __NVCC_DIAG_PRAGMA_SUPPORT__ 25 | // #define EIGEN_NV_DIAG_DEFAULT(X) EIGEN_MAKE_PRAGMA(nv_diag_default X) 26 | // #else 27 | // #define EIGEN_NV_DIAG_DEFAULT(X) EIGEN_MAKE_PRAGMA(diag_default X) 28 | // #endif 29 | // EIGEN_NV_DIAG_DEFAULT(code_is_unreachable) 30 | // EIGEN_NV_DIAG_DEFAULT(initialization_not_reachable) 31 | // EIGEN_NV_DIAG_DEFAULT(2651) 32 | // EIGEN_NV_DIAG_DEFAULT(2653) 33 | // #undef EIGEN_NV_DIAG_DEFAULT 34 | // #undef EIGEN_MAKE_PRAGMA 35 | #endif 36 | 37 | #endif 38 | 39 | #endif // EIGEN_WARNINGS_DISABLED 40 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Core/util/ReshapedHelper.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2017 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | 11 | #ifndef EIGEN_RESHAPED_HELPER_H 12 | #define EIGEN_RESHAPED_HELPER_H 13 | 14 | #include "../InternalHeaderCheck.h" 15 | 16 | namespace Eigen { 17 | 18 | enum AutoSize_t { AutoSize }; 19 | const int AutoOrder = 2; 20 | 21 | namespace internal { 22 | 23 | template 24 | struct get_compiletime_reshape_size { 25 | enum { value = get_fixed_value::value }; 26 | }; 27 | 28 | template 29 | Index get_runtime_reshape_size(SizeType size, Index /*other*/, Index /*total*/) { 30 | return internal::get_runtime_value(size); 31 | } 32 | 33 | template 34 | struct get_compiletime_reshape_size { 35 | enum { 36 | other_size = get_fixed_value::value, 37 | value = (TotalSize==Dynamic || other_size==Dynamic) ? Dynamic : TotalSize / other_size }; 38 | }; 39 | 40 | inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index total) { 41 | return total/other; 42 | } 43 | 44 | constexpr inline int get_compiletime_reshape_order(int flags, int order) { 45 | return order == AutoOrder ? flags & RowMajorBit : order; 46 | } 47 | 48 | } 49 | 50 | } // end namespace Eigen 51 | 52 | #endif // EIGEN_RESHAPED_HELPER_H 53 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Eigenvalues/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_EIGENVALUES_MODULE_H 2 | #error "Please include Eigen/Eigenvalues instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Geometry/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_GEOMETRY_MODULE_H 2 | #error "Please include Eigen/Geometry instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Householder/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 2 | #error "Please include Eigen/Householder instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 2 | #error "Please include Eigen/IterativeLinearSolvers instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/Jacobi/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_JACOBI_MODULE_H 2 | #error "Please include Eigen/Jacobi instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/KLUSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_KLUSUPPORT_MODULE_H 2 | #error "Please include Eigen/KLUSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/LU/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_LU_MODULE_H 2 | #error "Please include Eigen/LU instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/MetisSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_METISSUPPORT_MODULE_H 2 | #error "Please include Eigen/MetisSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/OrderingMethods/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ORDERINGMETHODS_MODULE_H 2 | #error "Please include Eigen/OrderingMethods instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/PaStiXSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 2 | #error "Please include Eigen/PaStiXSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/PardisoSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 2 | #error "Please include Eigen/PardisoSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/QR/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_QR_MODULE_H 2 | #error "Please include Eigen/QR instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/SPQRSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 2 | #error "Please include Eigen/SPQRSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/SVD/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SVD_MODULE_H 2 | #error "Please include Eigen/SVD instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/SparseCholesky/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 2 | #error "Please include Eigen/SparseCholesky instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/SparseCore/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSECORE_MODULE_H 2 | #error "Please include Eigen/SparseCore instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/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 | #include "./InternalHeaderCheck.h" 14 | 15 | namespace Eigen { 16 | 17 | template 18 | template 19 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 20 | { 21 | const typename internal::nested_eval::type actualA(derived()); 22 | std::conditional_t::type, 24 | const PlainObject> actualB(other.derived()); 25 | 26 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 27 | } 28 | 29 | } // end namespace Eigen 30 | 31 | #endif // EIGEN_SPARSE_FUZZY_H 32 | -------------------------------------------------------------------------------- /third-party/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 | #include "./InternalHeaderCheck.h" 14 | 15 | namespace Eigen { 16 | 17 | template 18 | typename internal::traits::Scalar 19 | SparseMatrixBase::sum() const 20 | { 21 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 22 | Scalar res(0); 23 | internal::evaluator thisEval(derived()); 24 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) 26 | res += iter.value(); 27 | return res; 28 | } 29 | 30 | template 31 | typename internal::traits >::Scalar 32 | SparseMatrix::sum() const 33 | { 34 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 35 | if(this->isCompressed()) 36 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 37 | else 38 | return Base::sum(); 39 | } 40 | 41 | template 42 | typename internal::traits >::Scalar 43 | SparseVector::sum() const 44 | { 45 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 46 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 47 | } 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_SPARSEREDUX_H 52 | -------------------------------------------------------------------------------- /third-party/Eigen/src/SparseLU/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSELU_MODULE_H 2 | #error "Please include Eigen/SparseLU instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/SparseQR/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSEQR_MODULE_H 2 | #error "Please include Eigen/SparseQR instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/StlSupport/StdDeque.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_H 12 | #define EIGEN_STDDEQUE_H 13 | 14 | #ifndef EIGEN_STDDEQUE_MODULE_H 15 | #error "Please include Eigen/StdDeque instead of including this file directly." 16 | #endif 17 | 18 | #include "details.h" 19 | 20 | /** 21 | * This section contains a convenience MACRO which allows an easy specialization of 22 | * std::deque such that for data types with alignment issues the correct allocator 23 | * is used automatically. 24 | */ 25 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) \ 26 | namespace std \ 27 | { \ 28 | template<> \ 29 | class deque<__VA_ARGS__, std::allocator<__VA_ARGS__> > \ 30 | : public deque<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > \ 31 | { \ 32 | typedef deque<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > deque_base; \ 33 | public: \ 34 | typedef __VA_ARGS__ value_type; \ 35 | typedef deque_base::allocator_type allocator_type; \ 36 | typedef deque_base::size_type size_type; \ 37 | typedef deque_base::iterator iterator; \ 38 | explicit deque(const allocator_type& a = allocator_type()) : deque_base(a) {} \ 39 | template \ 40 | deque(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) : deque_base(first, last, a) {} \ 41 | deque(const deque& c) : deque_base(c) {} \ 42 | explicit deque(size_type num, const value_type& val = value_type()) : deque_base(num, val) {} \ 43 | deque(iterator start_, iterator end_) : deque_base(start_, end_) {} \ 44 | deque& operator=(const deque& x) { \ 45 | deque_base::operator=(x); \ 46 | return *this; \ 47 | } \ 48 | }; \ 49 | } 50 | 51 | #endif // EIGEN_STDDEQUE_H 52 | -------------------------------------------------------------------------------- /third-party/Eigen/src/StlSupport/StdList.h: -------------------------------------------------------------------------------- 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_H 11 | #define EIGEN_STDLIST_H 12 | 13 | #ifndef EIGEN_STDLIST_MODULE_H 14 | #error "Please include Eigen/StdList instead of including this file directly." 15 | #endif 16 | 17 | #include "details.h" 18 | 19 | /** 20 | * This section contains a convenience MACRO which allows an easy specialization of 21 | * std::list such that for data types with alignment issues the correct allocator 22 | * is used automatically. 23 | */ 24 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) \ 25 | namespace std \ 26 | { \ 27 | template<> \ 28 | class list<__VA_ARGS__, std::allocator<__VA_ARGS__> > \ 29 | : public list<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > \ 30 | { \ 31 | typedef list<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > list_base; \ 32 | public: \ 33 | typedef __VA_ARGS__ value_type; \ 34 | typedef list_base::allocator_type allocator_type; \ 35 | typedef list_base::size_type size_type; \ 36 | typedef list_base::iterator iterator; \ 37 | explicit list(const allocator_type& a = allocator_type()) : list_base(a) {} \ 38 | template \ 39 | list(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) : list_base(first, last, a) {} \ 40 | list(const list& c) : list_base(c) {} \ 41 | explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \ 42 | list(iterator start_, iterator end_) : list_base(start_, end_) {} \ 43 | list& operator=(const list& x) { \ 44 | list_base::operator=(x); \ 45 | return *this; \ 46 | } \ 47 | }; \ 48 | } 49 | 50 | #endif // EIGEN_STDLIST_H 51 | -------------------------------------------------------------------------------- /third-party/Eigen/src/StlSupport/StdVector.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_H 12 | #define EIGEN_STDVECTOR_H 13 | 14 | #ifndef EIGEN_STDVECTOR_MODULE_H 15 | #error "Please include Eigen/StdVector instead of including this file directly." 16 | #endif 17 | 18 | #include "details.h" 19 | 20 | /** 21 | * This section contains a convenience MACRO which allows an easy specialization of 22 | * std::vector such that for data types with alignment issues the correct allocator 23 | * is used automatically. 24 | */ 25 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) \ 26 | namespace std \ 27 | { \ 28 | template<> \ 29 | class vector<__VA_ARGS__, std::allocator<__VA_ARGS__> > \ 30 | : public vector<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > \ 31 | { \ 32 | typedef vector<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > vector_base; \ 33 | public: \ 34 | typedef __VA_ARGS__ value_type; \ 35 | typedef vector_base::allocator_type allocator_type; \ 36 | typedef vector_base::size_type size_type; \ 37 | typedef vector_base::iterator iterator; \ 38 | explicit vector(const allocator_type& a = allocator_type()) : vector_base(a) {} \ 39 | template \ 40 | vector(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) : vector_base(first, last, a) {} \ 41 | vector(const vector& c) : vector_base(c) {} \ 42 | explicit vector(size_type num, const value_type& val = value_type()) : vector_base(num, val) {} \ 43 | vector(iterator start_, iterator end_) : vector_base(start_, end_) {} \ 44 | vector& operator=(const vector& x) { \ 45 | vector_base::operator=(x); \ 46 | return *this; \ 47 | } \ 48 | }; \ 49 | } 50 | 51 | #endif // EIGEN_STDVECTOR_H 52 | -------------------------------------------------------------------------------- /third-party/Eigen/src/SuperLUSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SUPERLUSUPPORT_MODULE_H 2 | #error "Please include Eigen/SuperLUSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/UmfPackSupport/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 2 | #error "Please include Eigen/UmfPackSupport instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/Eigen/src/misc/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CORE_MODULE_H 2 | #error "Please include Eigen/Core instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/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 | #include "./InternalHeaderCheck.h" 15 | 16 | namespace Eigen { 17 | 18 | namespace internal { 19 | 20 | template 21 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q, 22 | JacobiRotation *j_left, 23 | JacobiRotation *j_right) 24 | { 25 | using std::sqrt; 26 | using std::abs; 27 | Matrix m; 28 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)), 29 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q)); 30 | JacobiRotation rot1; 31 | RealScalar t = m.coeff(0,0) + m.coeff(1,1); 32 | RealScalar d = m.coeff(1,0) - m.coeff(0,1); 33 | 34 | if(abs(d) < (std::numeric_limits::min)()) 35 | { 36 | rot1.s() = RealScalar(0); 37 | rot1.c() = RealScalar(1); 38 | } 39 | else 40 | { 41 | // If d!=0, then t/d cannot overflow because the magnitude of the 42 | // entries forming d are not too small compared to the ones forming t. 43 | RealScalar u = t / d; 44 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u)); 45 | rot1.s() = RealScalar(1) / tmp; 46 | rot1.c() = u / tmp; 47 | } 48 | m.applyOnTheLeft(0,1,rot1); 49 | j_right->makeJacobi(m,0,1); 50 | *j_left = rot1 * j_right->transpose(); 51 | } 52 | 53 | } // end namespace internal 54 | 55 | } // end namespace Eigen 56 | 57 | #endif // EIGEN_REALSVD2X2_H 58 | -------------------------------------------------------------------------------- /third-party/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /third-party/Eigen/src/plugins/InternalHeaderCheck.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CORE_MODULE_H 2 | #error "Please include Eigen/plugins instead of including headers inside the src directory directly." 3 | #endif 4 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2014-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_HPP 15 | #define RANGES_V3_ACTION_HPP 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/drop.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_DROP_HPP 15 | #define RANGES_V3_ACTION_DROP_HPP 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace ranges 30 | { 31 | /// \addtogroup group-actions 32 | /// @{ 33 | namespace actions 34 | { 35 | struct drop_fn 36 | { 37 | template(typename Int)( 38 | requires detail::integer_like_) 39 | constexpr auto operator()(Int n) const 40 | { 41 | RANGES_EXPECT(n >= Int(0)); 42 | return make_action_closure(bind_back(drop_fn{}, n)); 43 | } 44 | 45 | template(typename Rng)( 46 | requires forward_range AND 47 | erasable_range, iterator_t>) 48 | Rng operator()(Rng && rng, range_difference_t n) const 49 | { 50 | RANGES_EXPECT(n >= 0); 51 | ranges::actions::erase( 52 | rng, begin(rng), ranges::next(begin(rng), n, end(rng))); 53 | return static_cast(rng); 54 | } 55 | }; 56 | 57 | /// \relates actions::drop_fn 58 | RANGES_INLINE_VARIABLE(drop_fn, drop) 59 | } // namespace actions 60 | /// @} 61 | } // namespace ranges 62 | 63 | #include 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/drop_while.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_DROP_WHILE_HPP 15 | #define RANGES_V3_ACTION_DROP_WHILE_HPP 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace ranges 30 | { 31 | /// \addtogroup group-actions 32 | /// @{ 33 | namespace actions 34 | { 35 | struct drop_while_fn 36 | { 37 | template(typename Fun)( 38 | requires (!range)) 39 | constexpr auto operator()(Fun fun) const 40 | { 41 | return make_action_closure(bind_back(drop_while_fn{}, std::move(fun))); 42 | } 43 | 44 | template(typename Rng, typename Fun)( 45 | requires forward_range AND 46 | indirect_unary_predicate> AND 47 | erasable_range, iterator_t>) 48 | Rng operator()(Rng && rng, Fun fun) const 49 | { 50 | ranges::actions::erase( 51 | rng, begin(rng), find_if_not(begin(rng), end(rng), std::move(fun))); 52 | return static_cast(rng); 53 | } 54 | }; 55 | 56 | /// \relates actions::drop_while_fn 57 | RANGES_INLINE_VARIABLE(drop_while_fn, drop_while) 58 | } // namespace actions 59 | /// @} 60 | } // namespace ranges 61 | 62 | #include 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/join.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_JOIN_HPP 15 | #define RANGES_V3_ACTION_JOIN_HPP 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | namespace ranges 33 | { 34 | /// \addtogroup group-actions 35 | /// @{ 36 | namespace actions 37 | { 38 | template 39 | using join_action_value_t_ = 40 | meta::if_c<(bool)ranges::container>, // 41 | range_value_t, // 42 | std::vector>>>; 43 | 44 | struct join_fn 45 | { 46 | template(typename Rng)( 47 | requires input_range AND input_range> AND 48 | semiregular>) 49 | join_action_value_t_ operator()(Rng && rng) const 50 | { 51 | join_action_value_t_ ret; 52 | auto last = ranges::end(rng); 53 | for(auto it = begin(rng); it != last; ++it) 54 | push_back(ret, *it); 55 | return ret; 56 | } 57 | }; 58 | 59 | /// \relates actions::join_fn 60 | /// \sa action_closure 61 | RANGES_INLINE_VARIABLE(action_closure, join) 62 | } // namespace actions 63 | /// @} 64 | } // namespace ranges 65 | 66 | #include 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/reverse.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // Copyright Gonzalo Brito Gadeschi 2017 6 | // 7 | // Use, modification and distribution is subject to the 8 | // Boost Software License, Version 1.0. (See accompanying 9 | // file LICENSE_1_0.txt or copy at 10 | // http://www.boost.org/LICENSE_1_0.txt) 11 | // 12 | // Project home: https://github.com/ericniebler/range-v3 13 | // 14 | 15 | #ifndef RANGES_V3_ACTION_REVERSE_HPP 16 | #define RANGES_V3_ACTION_REVERSE_HPP 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace ranges 29 | { 30 | /// \addtogroup group-actions 31 | /// @{ 32 | namespace actions 33 | { 34 | /// Reversed the source range in-place. 35 | struct reverse_fn 36 | { 37 | template(typename Rng)( 38 | requires bidirectional_range AND permutable>) 39 | Rng operator()(Rng && rng) const 40 | { 41 | ranges::reverse(rng); 42 | return static_cast(rng); 43 | } 44 | }; 45 | 46 | /// \relates actions::reverse_fn 47 | /// \sa action_closure 48 | RANGES_INLINE_VARIABLE(action_closure, reverse) 49 | } // namespace actions 50 | /// @} 51 | } // namespace ranges 52 | 53 | #include 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/sort.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_SORT_HPP 15 | #define RANGES_V3_ACTION_SORT_HPP 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | namespace ranges 31 | { 32 | /// \addtogroup group-actions 33 | /// @{ 34 | namespace actions 35 | { 36 | struct sort_fn 37 | { 38 | template(typename C, typename P = identity)( 39 | requires (!range)) 40 | constexpr auto operator()(C pred, P proj = {}) const 41 | { 42 | return make_action_closure( 43 | bind_back(sort_fn{}, std::move(pred), std::move(proj))); 44 | } 45 | 46 | template(typename Rng, typename C = less, typename P = identity)( 47 | requires forward_range AND sortable, C, P>) 48 | Rng operator()(Rng && rng, C pred = {}, P proj = {}) const 49 | { 50 | ranges::sort(rng, std::move(pred), std::move(proj)); 51 | return static_cast(rng); 52 | } 53 | }; 54 | 55 | /// \relates actions::sort_fn 56 | /// \sa action_closure 57 | RANGES_INLINE_VARIABLE(action_closure, sort) 58 | } // namespace actions 59 | /// @} 60 | } // namespace ranges 61 | 62 | #include 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/stable_sort.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_STABLE_SORT_HPP 15 | #define RANGES_V3_ACTION_STABLE_SORT_HPP 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | namespace ranges 31 | { 32 | /// \addtogroup group-actions 33 | /// @{ 34 | namespace actions 35 | { 36 | struct stable_sort_fn 37 | { 38 | template(typename C, typename P = identity)( 39 | requires (!range)) 40 | constexpr auto operator()(C pred, P proj = P{}) const 41 | { 42 | return make_action_closure( 43 | bind_back(stable_sort_fn{}, std::move(pred), std::move(proj))); 44 | } 45 | 46 | template(typename Rng, typename C = less, typename P = identity)( 47 | requires forward_range AND sortable, C, P>) 48 | Rng operator()(Rng && rng, C pred = C{}, P proj = P{}) const 49 | { 50 | ranges::stable_sort(rng, std::move(pred), std::move(proj)); 51 | return static_cast(rng); 52 | } 53 | }; 54 | 55 | /// \relates actions::stable_sort_fn 56 | /// \sa action_closure 57 | RANGES_INLINE_VARIABLE(action_closure, stable_sort) 58 | } // namespace actions 59 | /// @} 60 | } // namespace ranges 61 | 62 | #include 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/take.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_TAKE_HPP 15 | #define RANGES_V3_ACTION_TAKE_HPP 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace ranges 30 | { 31 | /// \addtogroup group-actions 32 | /// @{ 33 | namespace actions 34 | { 35 | struct take_fn 36 | { 37 | template(typename Int)( 38 | requires detail::integer_like_) 39 | constexpr auto operator()(Int n) const 40 | { 41 | return make_action_closure(bind_back(take_fn{}, n)); 42 | } 43 | 44 | template(typename Rng)( 45 | requires forward_range AND 46 | erasable_range, sentinel_t>) 47 | Rng operator()(Rng && rng, range_difference_t n) const 48 | { 49 | RANGES_EXPECT(n >= 0); 50 | ranges::actions::erase( 51 | rng, ranges::next(begin(rng), n, end(rng)), end(rng)); 52 | return static_cast(rng); 53 | } 54 | }; 55 | 56 | /// \relates actions::take_fn 57 | RANGES_INLINE_VARIABLE(take_fn, take) 58 | } // namespace actions 59 | /// @} 60 | } // namespace ranges 61 | 62 | #include 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/take_while.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_TAKE_WHILE_HPP 15 | #define RANGES_V3_ACTION_TAKE_WHILE_HPP 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace ranges 30 | { 31 | /// \addtogroup group-actions 32 | /// @{ 33 | namespace actions 34 | { 35 | struct take_while_fn 36 | { 37 | template(typename Fun)( 38 | requires (!range)) 39 | constexpr auto operator()(Fun fun) const 40 | { 41 | return make_action_closure(bind_back(take_while_fn{}, std::move(fun))); 42 | } 43 | 44 | template(typename Rng, typename Fun)( 45 | requires forward_range AND 46 | erasable_range, sentinel_t> AND 47 | indirect_unary_predicate>) 48 | Rng operator()(Rng && rng, Fun fun) const 49 | { 50 | ranges::actions::erase( 51 | rng, find_if_not(begin(rng), end(rng), std::move(fun)), end(rng)); 52 | return static_cast(rng); 53 | } 54 | }; 55 | 56 | /// \relates actions::take_while_fn 57 | RANGES_INLINE_VARIABLE(take_while_fn, take_while) 58 | } // namespace actions 59 | /// @} 60 | } // namespace ranges 61 | 62 | #include 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/action/transform.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ACTION_TRANSFORM_HPP 15 | #define RANGES_V3_ACTION_TRANSFORM_HPP 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace ranges 30 | { 31 | /// \addtogroup group-actions 32 | /// @{ 33 | namespace actions 34 | { 35 | struct transform_fn 36 | { 37 | template(typename F, typename P = identity)( 38 | requires (!range)) 39 | constexpr auto operator()(F fun, P proj = P{}) const 40 | { 41 | return make_action_closure( 42 | bind_back(transform_fn{}, std::move(fun), std::move(proj))); 43 | } 44 | 45 | template(typename Rng, typename F, typename P = identity)( 46 | requires input_range AND copy_constructible AND 47 | indirectly_writable< 48 | iterator_t, 49 | indirect_result_t, P>>>) 50 | Rng operator()(Rng && rng, F fun, P proj = P{}) const 51 | { 52 | ranges::transform(rng, begin(rng), std::move(fun), std::move(proj)); 53 | return static_cast(rng); 54 | } 55 | }; 56 | 57 | /// \relates actions::transform_fn 58 | RANGES_INLINE_VARIABLE(transform_fn, transform) 59 | } // namespace actions 60 | /// @} 61 | } // namespace ranges 62 | 63 | #include 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/all_of.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Andrew Sutton 2014 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_ALGORITHM_ALL_OF_HPP 14 | #define RANGES_V3_ALGORITHM_ALL_OF_HPP 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | namespace ranges 32 | { 33 | /// \addtogroup group-algorithms 34 | /// @{ 35 | RANGES_FUNC_BEGIN(all_of) 36 | 37 | /// \brief function template \c all_of 38 | template(typename I, typename S, typename F, typename P = identity)( 39 | requires input_iterator AND sentinel_for AND 40 | indirect_unary_predicate>) 41 | constexpr bool RANGES_FUNC(all_of)(I first, S last, F pred, P proj = P{}) // 42 | { 43 | for(; first != last; ++first) 44 | if(!invoke(pred, invoke(proj, *first))) 45 | break; 46 | return first == last; 47 | } 48 | 49 | /// \overload 50 | template(typename Rng, typename F, typename P = identity)( 51 | requires input_range AND 52 | indirect_unary_predicate, P>>) 53 | constexpr bool RANGES_FUNC(all_of)(Rng && rng, F pred, P proj = P{}) // 54 | { 55 | return (*this)(begin(rng), end(rng), std::move(pred), std::move(proj)); 56 | } 57 | 58 | RANGES_FUNC_END(all_of) 59 | 60 | namespace cpp20 61 | { 62 | using ranges::all_of; 63 | } 64 | /// @} 65 | } // namespace ranges 66 | 67 | #include 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/any_of.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Andrew Sutton 2014 5 | // Copyright Gonzalo Brito Gadeschi 2014 6 | // 7 | // Use, modification and distribution is subject to the 8 | // Boost Software License, Version 1.0. (See accompanying 9 | // file LICENSE_1_0.txt or copy at 10 | // http://www.boost.org/LICENSE_1_0.txt) 11 | // 12 | // Project home: https://github.com/ericniebler/range-v3 13 | // 14 | #ifndef RANGES_V3_ALGORITHM_ANY_OF_HPP 15 | #define RANGES_V3_ALGORITHM_ANY_OF_HPP 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | namespace ranges 33 | { 34 | /// \addtogroup group-algorithms 35 | /// @{ 36 | RANGES_FUNC_BEGIN(any_of) 37 | 38 | /// \brief function template \c any_of 39 | template(typename I, typename S, typename F, typename P = identity)( 40 | requires input_iterator AND sentinel_for AND 41 | indirect_unary_predicate>) 42 | constexpr bool RANGES_FUNC(any_of)(I first, S last, F pred, P proj = P{}) // 43 | { 44 | for(; first != last; ++first) 45 | if(invoke(pred, invoke(proj, *first))) 46 | return true; 47 | return false; 48 | } 49 | 50 | /// \overload 51 | template(typename Rng, typename F, typename P = identity)( 52 | requires input_range AND 53 | indirect_unary_predicate, P>>) 54 | constexpr bool RANGES_FUNC(any_of)(Rng && rng, F pred, P proj = P{}) // 55 | { 56 | return (*this)(begin(rng), end(rng), std::move(pred), std::move(proj)); 57 | } 58 | 59 | RANGES_FUNC_END(any_of) 60 | 61 | namespace cpp20 62 | { 63 | using ranges::any_of; 64 | } 65 | /// @} 66 | } // namespace ranges 67 | 68 | #include 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/aux_/partition_point_n.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2014-present 5 | // Copyright Casey Carter 2016 6 | // 7 | // Use, modification and distribution is subject to the 8 | // Boost Software License, Version 1.0. (See accompanying 9 | // file LICENSE_1_0.txt or copy at 10 | // http://www.boost.org/LICENSE_1_0.txt) 11 | // 12 | // Project home: https://github.com/ericniebler/range-v3 13 | // 14 | #ifndef RANGES_V3_ALGORITHM_AUX_PARTITION_POINT_N_HPP 15 | #define RANGES_V3_ALGORITHM_AUX_PARTITION_POINT_N_HPP 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | namespace ranges 27 | { 28 | namespace aux 29 | { 30 | struct partition_point_n_fn 31 | { 32 | template(typename I, typename C, typename P = identity)( 33 | requires forward_iterator AND 34 | indirect_unary_predicate>) 35 | constexpr I operator()(I first, 36 | iter_difference_t d, 37 | C pred, 38 | P proj = P{}) const // 39 | { 40 | if(0 < d) 41 | { 42 | do 43 | { 44 | auto half = d / 2; 45 | auto middle = next(uncounted(first), half); 46 | if(invoke(pred, invoke(proj, *middle))) 47 | { 48 | first = recounted(first, std::move(++middle), half + 1); 49 | d -= half + 1; 50 | } 51 | else 52 | d = half; 53 | } while(0 != d); 54 | } 55 | return first; 56 | } 57 | }; 58 | 59 | RANGES_INLINE_VARIABLE(partition_point_n_fn, partition_point_n) 60 | } // namespace aux 61 | } // namespace ranges 62 | 63 | #include 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/contains.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Johel Guerrero 2019 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_ALGORITHM_CONTAINS_HPP 14 | #define RANGES_V3_ALGORITHM_CONTAINS_HPP 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | namespace ranges 31 | { 32 | /// \addtogroup group-algorithms 33 | /// @{ 34 | RANGES_FUNC_BEGIN(contains) 35 | 36 | /// \brief function template \c contains 37 | template(typename I, typename S, typename T, typename P = identity)( 38 | requires input_iterator AND sentinel_for AND 39 | indirect_relation, const T *>) 40 | constexpr bool RANGES_FUNC(contains)(I first, S last, const T & val, P proj = {}) 41 | { 42 | return find(std::move(first), last, val, std::move(proj)) != last; 43 | } 44 | 45 | /// \overload 46 | template(typename Rng, typename T, typename P = identity)( 47 | requires input_range AND 48 | indirect_relation, P>, const T *>) 49 | constexpr bool RANGES_FUNC(contains)(Rng && rng, const T & val, P proj = {}) 50 | { 51 | return (*this)(begin(rng), end(rng), val, std::move(proj)); 52 | } 53 | 54 | RANGES_FUNC_END(contains) 55 | /// @} 56 | } // namespace ranges 57 | 58 | #include 59 | 60 | #endif // RANGES_V3_ALGORITHM_CONTAINS_HPP 61 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/copy_n.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2014-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_ALGORITHM_COPY_N_HPP 14 | #define RANGES_V3_ALGORITHM_COPY_N_HPP 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | namespace ranges 35 | { 36 | /// \addtogroup group-algorithms 37 | /// @{ 38 | template 39 | using copy_n_result = detail::in_out_result; 40 | 41 | RANGES_FUNC_BEGIN(copy_n) 42 | 43 | /// \brief function template \c copy_n 44 | template(typename I, typename O, typename P = identity)( 45 | requires input_iterator AND weakly_incrementable AND 46 | indirectly_copyable) 47 | constexpr copy_n_result RANGES_FUNC(copy_n)(I first, iter_difference_t n, O out) 48 | { 49 | RANGES_EXPECT(0 <= n); 50 | auto norig = n; 51 | auto b = uncounted(first); 52 | for(; n != 0; ++b, ++out, --n) 53 | *out = *b; 54 | return {recounted(first, b, norig), out}; 55 | } 56 | 57 | RANGES_FUNC_END(copy_n) 58 | 59 | namespace cpp20 60 | { 61 | using ranges::copy_n; 62 | using ranges::copy_n_result; 63 | } // namespace cpp20 64 | /// @} 65 | } // namespace ranges 66 | 67 | #include 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/fill.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_ALGORITHM_FILL_HPP 14 | #define RANGES_V3_ALGORITHM_FILL_HPP 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | namespace ranges 28 | { 29 | /// \addtogroup group-algorithms 30 | /// @{ 31 | RANGES_FUNC_BEGIN(fill) 32 | 33 | /// \brief function template \c fill 34 | template(typename O, typename S, typename V)( 35 | requires output_iterator AND sentinel_for) 36 | constexpr O RANGES_FUNC(fill)(O first, S last, V const & val) // 37 | { 38 | for(; first != last; ++first) 39 | *first = val; 40 | return first; 41 | } 42 | 43 | /// \overload 44 | template(typename Rng, typename V)( 45 | requires output_range) 46 | constexpr borrowed_iterator_t RANGES_FUNC(fill)(Rng && rng, V const & val) 47 | { 48 | return (*this)(begin(rng), end(rng), val); 49 | } 50 | 51 | RANGES_FUNC_END(fill) 52 | 53 | namespace cpp20 54 | { 55 | using ranges::fill; 56 | } 57 | /// @} 58 | } // namespace ranges 59 | 60 | #include 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/fill_n.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_ALGORITHM_FILL_N_HPP 14 | #define RANGES_V3_ALGORITHM_FILL_N_HPP 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace ranges 30 | { 31 | /// \addtogroup group-algorithms 32 | /// @{ 33 | RANGES_FUNC_BEGIN(fill_n) 34 | 35 | /// \brief function template \c equal 36 | template(typename O, typename V)( 37 | requires output_iterator) 38 | constexpr O RANGES_FUNC(fill_n)(O first, iter_difference_t n, V const & val) 39 | { 40 | RANGES_EXPECT(n >= 0); 41 | auto norig = n; 42 | auto b = uncounted(first); 43 | for(; n != 0; ++b, --n) 44 | *b = val; 45 | return recounted(first, b, norig); 46 | } 47 | 48 | RANGES_FUNC_END(fill_n) 49 | 50 | namespace cpp20 51 | { 52 | using ranges::fill_n; 53 | } 54 | /// @} 55 | } // namespace ranges 56 | 57 | #include 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/fold.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2021-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | 13 | #ifndef RANGES_V3_ALGORITHM_FOLD_HPP 14 | #define RANGES_V3_ALGORITHM_FOLD_HPP 15 | 16 | #include 17 | #include 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/generate_n.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2014-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_ALGORITHM_GENERATE_N_HPP 14 | #define RANGES_V3_ALGORITHM_GENERATE_N_HPP 15 | 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | namespace ranges 33 | { 34 | /// \addtogroup group-algorithms 35 | /// @{ 36 | template 37 | using generate_n_result = detail::out_fun_result; 38 | 39 | RANGES_FUNC_BEGIN(generate_n) 40 | 41 | /// \brief function template \c generate_n 42 | template(typename O, typename F)( 43 | requires invocable AND output_iterator>) 44 | constexpr generate_n_result // 45 | RANGES_FUNC(generate_n)(O first, iter_difference_t n, F fun) 46 | { 47 | RANGES_EXPECT(n >= 0); 48 | auto norig = n; 49 | auto b = uncounted(first); 50 | for(; 0 != n; ++b, --n) 51 | *b = invoke(fun); 52 | return {recounted(first, b, norig), detail::move(fun)}; 53 | } 54 | 55 | RANGES_FUNC_END(generate_n) 56 | 57 | namespace cpp20 58 | { 59 | using ranges::generate_n; 60 | using ranges::generate_n_result; 61 | } // namespace cpp20 62 | // @} 63 | } // namespace ranges 64 | 65 | #include 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/algorithm/tagspec.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | 12 | #ifndef RANGES_V3_ALGORITHM_TAGSPEC_HPP 13 | #define RANGES_V3_ALGORITHM_TAGSPEC_HPP 14 | 15 | #include 16 | 17 | #include 18 | 19 | RANGES_DEPRECATED_HEADER( 20 | "This file is deprecated. Please discontinue using the tag types defined here and " 21 | "define your own.") 22 | 23 | #include 24 | 25 | namespace ranges 26 | { 27 | /// \cond 28 | RANGES_DEFINE_TAG_SPECIFIER(in) 29 | RANGES_DEFINE_TAG_SPECIFIER(in1) 30 | RANGES_DEFINE_TAG_SPECIFIER(in2) 31 | RANGES_DEFINE_TAG_SPECIFIER(out) 32 | RANGES_DEFINE_TAG_SPECIFIER(out1) 33 | RANGES_DEFINE_TAG_SPECIFIER(out2) 34 | RANGES_DEFINE_TAG_SPECIFIER(fun) 35 | RANGES_DEFINE_TAG_SPECIFIER(min) 36 | RANGES_DEFINE_TAG_SPECIFIER(max) 37 | RANGES_DEFINE_TAG_SPECIFIER(begin) 38 | RANGES_DEFINE_TAG_SPECIFIER(end) 39 | 40 | RANGES_DEFINE_TAG_SPECIFIER(current) 41 | RANGES_DEFINE_TAG_SPECIFIER(engine) 42 | RANGES_DEFINE_TAG_SPECIFIER(range) 43 | RANGES_DEFINE_TAG_SPECIFIER(size) 44 | 45 | RANGES_DEFINE_TAG_SPECIFIER(first) 46 | RANGES_DEFINE_TAG_SPECIFIER(second) 47 | /// \endcond 48 | } // namespace ranges 49 | 50 | #include 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/all.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013,2014. 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ALL_HPP 15 | #define RANGES_V3_ALL_HPP 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/at.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // Copyright Gonzalo Brito Gadeschi 2017 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_AT_HPP 15 | #define RANGES_V3_AT_HPP 16 | 17 | #include 18 | RANGES_DEPRECATED_HEADER( 19 | "This header is deprecated. Please #include instead.") 20 | 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/back.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_BACK_HPP 14 | #define RANGES_V3_BACK_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/begin_end.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_BEGIN_END_HPP 14 | #define RANGES_V3_BEGIN_END_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/compare.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // CPP, the Concepts PreProcessor library 3 | // 4 | // Copyright Eric Niebler 2018-present 5 | // Copyright (c) 2020-present, Google LLC. 6 | // 7 | // Use, modification and distribution is subject to the 8 | // Boost Software License, Version 1.0. (See accompanying 9 | // file LICENSE_1_0.txt or copy at 10 | // http://www.boost.org/LICENSE_1_0.txt) 11 | // 12 | // This source code is licensed under the MIT license found in the 13 | // LICENSE file in the root directory of this source tree. 14 | // 15 | // Project home: https://github.com/ericniebler/range-v3 16 | // 17 | #ifndef RANGES_V3_COMPARE_HPP 18 | #define RANGES_V3_COMPARE_HPP 19 | 20 | #if __cplusplus > 201703L && __has_include() && \ 21 | defined(__cpp_concepts) && defined(__cpp_impl_three_way_comparison) 22 | 23 | #include 24 | #include 25 | 26 | namespace ranges 27 | { 28 | template 29 | struct common_comparison_category 30 | { 31 | using type = void; 32 | }; 33 | 34 | template 35 | requires ((std::is_same_v || 36 | std::is_same_v || 37 | std::is_same_v) && ...) 38 | struct common_comparison_category : std::common_type 39 | {}; 40 | 41 | template 42 | using common_comparison_category_t = typename common_comparison_category::type; 43 | } // namespace ranges 44 | 45 | #endif // __cplusplus 46 | #endif // RANGES_V3_COMPARE_HPP 47 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/core.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_CORE_HPP 15 | #define RANGES_V3_CORE_HPP 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/data.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Casey Carter 2016 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_DATA_HPP 14 | #define RANGES_V3_DATA_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif // RANGES_V3_DATA_HPP 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/detail/epilogue.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_PROLOGUE_INCLUDED 14 | #error "Including epilogue, but prologue not included!" 15 | #endif 16 | #undef RANGES_PROLOGUE_INCLUDED 17 | 18 | #undef template 19 | #undef AND 20 | #undef declval 21 | 22 | RANGES_DIAGNOSTIC_POP 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/detail/prologue.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_DETAIL_PROLOGUE_HPP 14 | #define RANGES_V3_DETAIL_PROLOGUE_HPP 15 | #include 16 | #endif 17 | 18 | #ifdef RANGES_PROLOGUE_INCLUDED 19 | #error "Prologue already included!" 20 | #endif 21 | #define RANGES_PROLOGUE_INCLUDED 22 | 23 | RANGES_DIAGNOSTIC_PUSH 24 | 25 | #ifdef RANGES_FEWER_WARNINGS 26 | RANGES_DIAGNOSTIC_IGNORE_UNDEFINED_INTERNAL 27 | RANGES_DIAGNOSTIC_IGNORE_INDENTATION 28 | RANGES_DIAGNOSTIC_IGNORE_CXX17_COMPAT 29 | #endif 30 | 31 | RANGES_DIAGNOSTIC_KEYWORD_MACRO 32 | 33 | #define template(...) \ 34 | CPP_PP_IGNORE_CXX2A_COMPAT_BEGIN \ 35 | template<__VA_ARGS__ CPP_TEMPLATE_AUX_ \ 36 | 37 | #define AND CPP_and 38 | 39 | /// \cond 40 | #if defined(__cpp_noexcept_function_type) && __cpp_noexcept_function_type >= 201510 41 | // noexcept is part of the type system 42 | #define declval(...) static_cast<__VA_ARGS__(*)() noexcept>(nullptr)() 43 | #else 44 | // noexcept is not part of the type system 45 | #define declval(...) static_cast<__VA_ARGS__(*)()>(nullptr)() 46 | #endif 47 | /// \cond 48 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/distance.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // Copyright Michel Morin 2014 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_DISTANCE_HPP 15 | #define RANGES_V3_DISTANCE_HPP 16 | 17 | #include 18 | RANGES_DEPRECATED_HEADER( 19 | "This header is deprecated. Please #include " 20 | "instead.") 21 | 22 | #include 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/empty.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_EMPTY_HPP 14 | #define RANGES_V3_EMPTY_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/front.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_FRONT_HPP 14 | #define RANGES_V3_FRONT_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/functional.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2019-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_FUNCTIONAL_HPP 15 | #define RANGES_V3_FUNCTIONAL_HPP 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/functional/identity.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_FUNCTIONAL_IDENTITY_HPP 14 | #define RANGES_V3_FUNCTIONAL_IDENTITY_HPP 15 | 16 | #include 17 | 18 | #include 19 | 20 | namespace ranges 21 | { 22 | /// \addtogroup group-functional 23 | /// @{ 24 | struct identity 25 | { 26 | template 27 | constexpr T && operator()(T && t) const noexcept 28 | { 29 | return (T &&) t; 30 | } 31 | using is_transparent = void; 32 | }; 33 | 34 | /// \cond 35 | using ident RANGES_DEPRECATED("Replace uses of ranges::ident with ranges::identity") = 36 | identity; 37 | /// \endcond 38 | 39 | namespace cpp20 40 | { 41 | using ranges::identity; 42 | } 43 | /// @} 44 | } // namespace ranges 45 | 46 | #include 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/functional/on.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_FUNCTIONAL_ON_HPP 14 | #define RANGES_V3_FUNCTIONAL_ON_HPP 15 | 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | namespace ranges 24 | { 25 | /// \addtogroup group-functional 26 | /// @{ 27 | template 28 | struct transformed 29 | { 30 | private: 31 | RANGES_NO_UNIQUE_ADDRESS 32 | Fn1 first_; 33 | RANGES_NO_UNIQUE_ADDRESS 34 | Fn2 second_; 35 | 36 | public: 37 | transformed() = default; 38 | constexpr transformed(Fn1 fn1, Fn2 fn2) 39 | : first_(static_cast(fn1)) 40 | , second_(static_cast(fn2)) 41 | {} 42 | // clang-format off 43 | template 44 | auto CPP_auto_fun(operator())(Args &&... args) 45 | ( 46 | return invoke(first_, invoke(second_, static_cast(args)...)) 47 | ) 48 | template 49 | auto CPP_auto_fun(operator())(Args &&... args)(const) 50 | ( 51 | return invoke((Fn1 const &)first_, 52 | invoke((Fn2 const &)second_, static_cast(args))...) 53 | ) 54 | // clang-format on 55 | }; 56 | 57 | struct on_fn 58 | { 59 | template 60 | constexpr transformed operator()(Fn1 fn1, Fn2 fn2) const 61 | { 62 | return transformed{detail::move(fn1), detail::move(fn2)}; 63 | } 64 | }; 65 | 66 | /// \ingroup group-functional 67 | /// \sa `on_fn` 68 | RANGES_INLINE_VARIABLE(on_fn, on) 69 | /// @} 70 | } // namespace ranges 71 | 72 | #include 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/getlines.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_GETLINES_HPP 14 | #define RANGES_V3_GETLINES_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/index.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // Copyright Gonzalo Brito Gadeschi 2017 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_INDEX_HPP 15 | #define RANGES_V3_INDEX_HPP 16 | 17 | #include 18 | RANGES_DEPRECATED_HEADER( 19 | "This header is deprecated. Please #include instead.") 20 | 21 | #include 22 | 23 | #endif // RANGES_V3_INDEX_HPP 24 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/istream_range.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_ISTREAM_RANGE_HPP 14 | #define RANGES_V3_ISTREAM_RANGE_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/iterator.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2019-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ITERATOR_HPP 15 | #define RANGES_V3_ITERATOR_HPP 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/iterator/default_sentinel.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2014-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_ITERATOR_DEFAULT_SENTINEL_HPP 14 | #define RANGES_V3_ITERATOR_DEFAULT_SENTINEL_HPP 15 | 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | namespace ranges 22 | { 23 | /// \addtogroup group-iterator 24 | /// @{ 25 | struct default_sentinel_t 26 | {}; 27 | 28 | // Default sentinel 29 | RANGES_INLINE_VARIABLE(default_sentinel_t, default_sentinel) 30 | 31 | namespace cpp20 32 | { 33 | using ranges::default_sentinel; 34 | using ranges::default_sentinel_t; 35 | } // namespace cpp20 36 | /// @} 37 | } // namespace ranges 38 | 39 | #include 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/iterator/unreachable_sentinel.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2014-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_ITERATOR_UNREACHABLE_SENTINEL_HPP 14 | #define RANGES_V3_ITERATOR_UNREACHABLE_SENTINEL_HPP 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | 22 | namespace ranges 23 | { 24 | /// \addtogroup group-iterator 25 | /// @{ 26 | struct unreachable_sentinel_t 27 | { 28 | template 29 | friend constexpr auto operator==(I const &, unreachable_sentinel_t) noexcept 30 | -> CPP_broken_friend_ret(bool)( 31 | requires weakly_incrementable) 32 | { 33 | return false; 34 | } 35 | template 36 | friend constexpr auto operator==(unreachable_sentinel_t, I const &) noexcept 37 | -> CPP_broken_friend_ret(bool)( 38 | requires weakly_incrementable) 39 | { 40 | return false; 41 | } 42 | template 43 | friend constexpr auto operator!=(I const &, unreachable_sentinel_t) noexcept 44 | -> CPP_broken_friend_ret(bool)( 45 | requires weakly_incrementable) 46 | { 47 | return true; 48 | } 49 | template 50 | friend constexpr auto operator!=(unreachable_sentinel_t, I const &) noexcept 51 | -> CPP_broken_friend_ret(bool)( 52 | requires weakly_incrementable) 53 | { 54 | return true; 55 | } 56 | }; 57 | 58 | RANGES_INLINE_VARIABLE(unreachable_sentinel_t, unreachable) 59 | 60 | namespace cpp20 61 | { 62 | using ranges::unreachable; 63 | using ranges::unreachable_sentinel_t; 64 | } // namespace cpp20 65 | /// @} 66 | } // namespace ranges 67 | 68 | #include 69 | 70 | #endif // RANGES_V3_ITERATOR_UNREACHABLE_SENTINEL_HPP 71 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/numeric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// \file numeric.hpp 3 | /// Contains range-based versions of the numeric algorithms 4 | // 5 | // Copyright Eric Niebler 2014-present 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See 8 | // accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | 11 | #ifndef RANGES_V3_NUMERIC_HPP 12 | #define RANGES_V3_NUMERIC_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/numeric/iota.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_NUMERIC_IOTA_HPP 14 | #define RANGES_V3_NUMERIC_IOTA_HPP 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | namespace ranges 26 | { 27 | /// \addtogroup group-numerics 28 | /// @{ 29 | struct iota_fn 30 | { 31 | template(typename O, typename S, typename T)( 32 | requires output_iterator AND sentinel_for AND 33 | weakly_incrementable) 34 | O operator()(O first, S last, T val) const 35 | { 36 | for(; first != last; ++first, ++val) 37 | *first = detail::as_const(val); 38 | return first; 39 | } 40 | 41 | template(typename Rng, typename T)( 42 | requires output_range AND weakly_incrementable) 43 | borrowed_iterator_t operator()(Rng && rng, T val) const // 44 | { 45 | return (*this)(begin(rng), end(rng), detail::move(val)); 46 | } 47 | }; 48 | 49 | RANGES_INLINE_VARIABLE(iota_fn, iota) 50 | /// @} 51 | } // namespace ranges 52 | 53 | #include 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/range.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2019-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_RANGE_HPP 15 | #define RANGES_V3_RANGE_HPP 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/range_access.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // Copyright Casey Carter 2016 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_OLD_RANGE_ACCESS_HPP 15 | #define RANGES_V3_OLD_RANGE_ACCESS_HPP 16 | 17 | #include 18 | RANGES_DEPRECATED_HEADER( 19 | "This header is deprecated. Please #include instead.") 20 | 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/range_concepts.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_DEPRECATED_RANGE_CONCEPTS_HPP 14 | #define RANGES_V3_DEPRECATED_RANGE_CONCEPTS_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/range_traits.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_OLD_RANGE_TRAITS_HPP 14 | #define RANGES_V3_OLD_RANGE_TRAITS_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/size.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_SIZE_HPP 14 | #define RANGES_V3_SIZE_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/span.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Casey Carter 2016-2017 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_SPAN_HPP 14 | #define RANGES_V3_SPAN_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif // RANGES_V3_SPAN_HPP 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/to_container.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_TO_CONTAINER_HPP 14 | #define RANGES_V3_TO_CONTAINER_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2019-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_ITERATOR_HPP 15 | #define RANGES_V3_ITERATOR_HPP 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/addressof.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | #ifndef RANGES_V3_UTILITY_ADDRESSOF_HPP 13 | #define RANGES_V3_UTILITY_ADDRESSOF_HPP 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include 25 | 26 | namespace ranges 27 | { 28 | /// \cond 29 | namespace detail 30 | { 31 | #ifdef __cpp_lib_addressof_constexpr 32 | using std::addressof; 33 | #else 34 | namespace check_addressof 35 | { 36 | inline ignore_t operator&(ignore_t) 37 | { 38 | return {}; 39 | } 40 | template 41 | auto addressof(T & t) 42 | { 43 | return &t; 44 | } 45 | } // namespace check_addressof 46 | 47 | template 48 | constexpr bool has_bad_addressof() 49 | { 50 | return !std::is_scalar::value && 51 | !RANGES_IS_SAME(decltype(check_addressof::addressof(*(T *)nullptr)), 52 | ignore_t); 53 | } 54 | 55 | template(typename T)( 56 | requires(has_bad_addressof())) 57 | T * addressof(T & arg) noexcept 58 | { 59 | return std::addressof(arg); 60 | } 61 | 62 | template(typename T)( 63 | requires (!has_bad_addressof())) 64 | constexpr T * addressof(T & arg) noexcept 65 | { 66 | return &arg; 67 | } 68 | 69 | template 70 | T const * addressof(T const &&) = delete; 71 | #endif 72 | } // namespace detail 73 | /// \endcond 74 | } // namespace ranges 75 | 76 | #include 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/associated_types.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-2014, 2016 4 | // Copyright Casey Carter 2016 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_UTILITY_ASSOCIATED_TYPES_HPP 15 | #define RANGES_V3_UTILITY_ASSOCIATED_TYPES_HPP 16 | 17 | #include 18 | RANGES_DEPRECATED_HEADER( 19 | "This header is deprecated. Please #include instead.") 20 | 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/basic_iterator.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // Copyright Casey Carter 2016 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_UTILITY_BASIC_ITERATOR_HPP 14 | #define RANGES_V3_UTILITY_BASIC_ITERATOR_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include " 19 | "instead.") 20 | 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/common_iterator.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // Copyright Casey Carter 2016 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_UTILITY_COMMON_ITERATOR_HPP 14 | #define RANGES_V3_UTILITY_COMMON_ITERATOR_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include " 19 | "instead.") 20 | 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/concepts.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_UTILITY_CONCEPTS_HPP 14 | #define RANGES_V3_UTILITY_CONCEPTS_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/copy.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_UTILITY_COPY_HPP 15 | #define RANGES_V3_UTILITY_COPY_HPP 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace ranges 26 | { 27 | /// \addtogroup group-utility 28 | /// @{ 29 | namespace aux 30 | { 31 | struct copy_fn : copy_tag 32 | { 33 | template(typename T)( 34 | requires constructible_from, T>) 35 | constexpr auto operator()(T && t) const -> detail::decay_t 36 | { 37 | return static_cast(t); 38 | } 39 | 40 | /// \ingroup group-utility 41 | /// \sa `copy_fn` 42 | template 43 | friend constexpr auto operator|(T && t, copy_fn) 44 | -> CPP_broken_friend_ret(detail::decay_t)( 45 | requires constructible_from, T>) 46 | { 47 | return static_cast(t); 48 | } 49 | }; 50 | 51 | /// \ingroup group-utility 52 | /// \sa `copy_fn` 53 | RANGES_INLINE_VARIABLE(copy_fn, copy) 54 | } // namespace aux 55 | /// @} 56 | } // namespace ranges 57 | 58 | #include 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/counted_iterator.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | #ifndef RANGES_V3_UTILITY_COUNTED_ITERATOR_HPP 13 | #define RANGES_V3_UTILITY_COUNTED_ITERATOR_HPP 14 | 15 | #include 16 | RANGES_DEPRECATED_HEADER( 17 | "This header is deprecated. Please #include " 18 | "instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/dangling.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_UTILITY_DANGLING_HPP 14 | #define RANGES_V3_UTILITY_DANGLING_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/functional.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // Copyright Casey Carter 2016 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_UTILITY_FUNCTIONAL_HPP 14 | #define RANGES_V3_UTILITY_FUNCTIONAL_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header has been deprecated. Please find what you are looking for in the " 19 | "range/v3/functional/ directory.") 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | namespace ranges 38 | { 39 | using detail::with_braced_init_args; 40 | } // namespace ranges 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/get.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_UTILITY_GET_HPP 15 | #define RANGES_V3_UTILITY_GET_HPP 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | namespace ranges 26 | { 27 | /// \addtogroup group-utility Utility 28 | /// @{ 29 | /// 30 | 31 | /// \cond 32 | namespace _get_ 33 | { 34 | /// \endcond 35 | // clang-format off 36 | template 37 | constexpr auto CPP_auto_fun(get)(TupleLike &&t) 38 | ( 39 | return detail::adl_get(static_cast(t)) 40 | ) 41 | template 42 | constexpr auto CPP_auto_fun(get)(TupleLike &&t) 43 | ( 44 | return detail::adl_get(static_cast(t)) 45 | ) 46 | // clang-format on 47 | 48 | template 49 | T & get(meta::id_t & value) noexcept 50 | { 51 | return value; 52 | } 53 | template 54 | T const & get(meta::id_t const & value) noexcept 55 | { 56 | return value; 57 | } 58 | template 59 | T && get(meta::id_t && value) noexcept 60 | { 61 | return static_cast(value); 62 | } 63 | /// \cond 64 | } // namespace _get_ 65 | using namespace _get_; 66 | /// \endcond 67 | 68 | /// @} 69 | } // namespace ranges 70 | 71 | #include 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/in_place.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_UTILITY_IN_PLACE_HPP 15 | #define RANGES_V3_UTILITY_IN_PLACE_HPP 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | namespace ranges 24 | { 25 | /// \ingroup group-utility 26 | struct in_place_t 27 | {}; 28 | RANGES_INLINE_VARIABLE(in_place_t, in_place) 29 | } // namespace ranges 30 | 31 | #include 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/infinity.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_UTILITY_INFINITY_HPP 14 | #define RANGES_V3_UTILITY_INFINITY_HPP 15 | 16 | #include 17 | 18 | #include 19 | RANGES_DEPRECATED_HEADER( 20 | "This header is deprecated and will be removed from a future version of range-v3.") 21 | 22 | #include 23 | 24 | namespace ranges 25 | { 26 | /// \cond 27 | struct infinity 28 | { 29 | friend constexpr bool operator==(infinity, infinity) 30 | { 31 | return true; 32 | } 33 | friend constexpr bool operator!=(infinity, infinity) 34 | { 35 | return false; 36 | } 37 | template 38 | friend constexpr auto operator==(Integer, infinity) noexcept 39 | -> CPP_broken_friend_ret(bool)( 40 | requires integral) 41 | { 42 | return false; 43 | } 44 | template 45 | friend constexpr auto operator==(infinity, Integer) noexcept 46 | -> CPP_broken_friend_ret(bool)( 47 | requires integral) 48 | { 49 | return false; 50 | } 51 | template 52 | friend constexpr auto operator!=(Integer, infinity) noexcept 53 | -> CPP_broken_friend_ret(bool)( 54 | requires integral) 55 | { 56 | return true; 57 | } 58 | template 59 | friend constexpr auto operator!=(infinity, Integer) noexcept 60 | -> CPP_broken_friend_ret(bool)( 61 | requires integral) 62 | { 63 | return true; 64 | } 65 | }; 66 | /// \endcond 67 | } // namespace ranges 68 | 69 | #include 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/invoke.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // Copyright Casey Carter 2016 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_UTILITY_INVOKE_HPP 14 | #define RANGES_V3_UTILITY_INVOKE_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This file has been deprecated. Please #include " 19 | "instead.") 20 | 21 | #include 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/iterator.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_UTILITY_ITERATOR_HPP 14 | #define RANGES_V3_UTILITY_ITERATOR_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | R"(This header is deprecated. Please include one of the following depending on your need: 19 | , 20 | , 21 | , 22 | , 23 | )") 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/iterator_concepts.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_UTILITY_ITERATOR_CONCEPTS_HPP 14 | #define RANGES_V3_UTILITY_ITERATOR_CONCEPTS_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include " 19 | "instead.") 20 | 21 | #include 22 | 23 | #endif // RANGES_V3_UTILITY_ITERATOR_CONCEPTS_HPP 24 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/iterator_traits.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_UTILITY_ITERATOR_TRAITS_HPP 14 | #define RANGES_V3_UTILITY_ITERATOR_TRAITS_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif // RANGES_V3_UTILITY_ITERATOR_TRAITS_HPP 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/move.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_UTILITY_MOVE_HPP 15 | #define RANGES_V3_UTILITY_MOVE_HPP 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace ranges 28 | { 29 | namespace aux 30 | { 31 | /// \ingroup group-utility 32 | struct move_fn : move_tag 33 | { 34 | template 35 | constexpr meta::_t> && operator()(T && t) const // 36 | noexcept 37 | { 38 | return static_cast> &&>(t); 39 | } 40 | 41 | /// \ingroup group-utility 42 | /// \sa `move_fn` 43 | template 44 | friend constexpr decltype(auto) operator|(T && t, move_fn move) noexcept 45 | { 46 | return move(t); 47 | } 48 | }; 49 | 50 | /// \ingroup group-utility 51 | /// \sa `move_fn` 52 | RANGES_INLINE_VARIABLE(move_fn, move) 53 | 54 | /// \ingroup group-utility 55 | /// \sa `move_fn` 56 | template 57 | using move_t = 58 | meta::if_c::value, meta::_t> &&, 59 | detail::decay_t>; 60 | } // namespace aux 61 | } // namespace ranges 62 | 63 | #include 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/nullptr_v.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013,2014. 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_UTILITY_NULLPTR_V_HPP 14 | #define RANGES_V3_UTILITY_NULLPTR_V_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated and will be removed from a future version of range-v3.") 19 | 20 | #include 21 | 22 | namespace ranges 23 | { 24 | /// \ingroup group-utility 25 | template 26 | constexpr T * _nullptr_v() 27 | { 28 | return nullptr; 29 | } 30 | 31 | #if RANGES_CXX_VARIABLE_TEMPLATES 32 | /// \ingroup group-utility 33 | template 34 | constexpr T * nullptr_v = nullptr; 35 | #endif 36 | } // namespace ranges 37 | 38 | #include 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/polymorphic_cast.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Kevlin Henney and Dave Abrahams 1999. 2 | // Distributed under the Boost 3 | // Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #ifndef RANGES_V3_UTILITY_POLYMORPHIC_CAST_HPP 7 | #define RANGES_V3_UTILITY_POLYMORPHIC_CAST_HPP 8 | 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #include 15 | 16 | #include 17 | 18 | namespace ranges 19 | { 20 | template 21 | auto polymorphic_downcast(Source * x) noexcept 22 | -> meta::if_, 23 | decltype((static_cast(x), dynamic_cast(x)))> 24 | { 25 | auto result = static_cast(x); 26 | RANGES_ASSERT(dynamic_cast(x) == result); 27 | return result; 28 | } 29 | template 30 | auto polymorphic_downcast(Source && x) noexcept 31 | -> meta::if_, 32 | decltype((static_cast(std::declval()), 33 | dynamic_cast(std::declval())))> 34 | { 35 | auto && result = static_cast(static_cast(x)); 36 | #ifndef NDEBUG 37 | auto && dresult = dynamic_cast(static_cast(x)); 38 | RANGES_ASSERT(std::addressof(dresult) == std::addressof(result)); 39 | #endif 40 | return static_cast(result); 41 | } 42 | } // namespace ranges 43 | 44 | #include 45 | 46 | #endif // RANGES_V3_UTILITY_POLYMORPHIC_CAST_HPP 47 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/semiregular.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_UTILITY_SEMIREGULAR_HPP 15 | #define RANGES_V3_UTILITY_SEMIREGULAR_HPP 16 | 17 | #include 18 | RANGES_DEPRECATED_HEADER( 19 | "This header is deprecated. Please #include " 20 | "instead.") 21 | 22 | #include 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/static_const.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2013-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | 13 | #ifndef RANGES_V3_UTILITY_STATIC_CONST_HPP 14 | #define RANGES_V3_UTILITY_STATIC_CONST_HPP 15 | 16 | namespace ranges 17 | { 18 | /// \ingroup group-utility 19 | 20 | template 21 | struct static_const 22 | { 23 | static constexpr T value{}; 24 | }; 25 | 26 | /// \ingroup group-utility 27 | /// \sa `static_const` 28 | template 29 | constexpr T static_const::value; 30 | } // namespace ranges 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/swap.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | // The implementation of swap (see below) has been adapted from libc++ 14 | // (http://libcxx.llvm.org). 15 | 16 | #ifndef RANGES_V3_UTILITY_SWAP_HPP 17 | #define RANGES_V3_UTILITY_SWAP_HPP 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace ranges 28 | { 29 | template 30 | using is_swappable = concepts::is_swappable; 31 | 32 | template 33 | using is_nothrow_swappable = concepts::is_nothrow_swappable; 34 | 35 | template 36 | using is_swappable_with = concepts::is_swappable_with; 37 | 38 | template 39 | using is_nothrow_swappable_with = concepts::is_nothrow_swappable_with; 40 | 41 | using concepts::exchange; 42 | 43 | /// \ingroup group-utility 44 | /// \relates concepts::adl_swap_detail::swap_fn 45 | RANGES_DEFINE_CPO(uncvref_t, swap) 46 | 47 | namespace cpp20 48 | { 49 | using ranges::swap; 50 | } 51 | } // namespace ranges 52 | 53 | #include 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/tagged_tuple.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | 13 | #ifndef RANGES_V3_UTILITY_TAGGED_TUPLE_HPP 14 | #define RANGES_V3_UTILITY_TAGGED_TUPLE_HPP 15 | 16 | #include 17 | 18 | #include 19 | 20 | #include 21 | 22 | #include 23 | 24 | RANGES_DIAGNOSTIC_PUSH 25 | RANGES_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS 26 | 27 | namespace ranges 28 | { 29 | template 30 | using tagged_tuple RANGES_DEPRECATED("ranges::tagged_tuple is deprecated.") = 31 | tagged...>, detail::tag_spec...>; 32 | 33 | template 34 | RANGES_DEPRECATED("ranges::make_tagged_tuple is deprecated.") 35 | constexpr tagged_tuple)...> make_tagged_tuple(Ts &&... ts) 36 | { 37 | return tagged_tuple)...>{static_cast(ts)...}; 38 | } 39 | } // namespace ranges 40 | 41 | RANGES_DIAGNOSTIC_POP 42 | 43 | #include 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/utility/unreachable.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | #ifndef RANGES_V3_UTILITY_UNREACHABLE_HPP 13 | #define RANGES_V3_UTILITY_UNREACHABLE_HPP 14 | 15 | #include 16 | RANGES_DEPRECATED_HEADER( 17 | "This header is deprecated. Please #include " 18 | " instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/version.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2017-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_VERSION_HPP 15 | #define RANGES_V3_VERSION_HPP 16 | 17 | #define RANGE_V3_MAJOR 0 18 | #define RANGE_V3_MINOR 12 19 | #define RANGE_V3_PATCHLEVEL 0 20 | 21 | #define RANGE_V3_VERSION \ 22 | (RANGE_V3_MAJOR * 10000 + RANGE_V3_MINOR * 100 + RANGE_V3_PATCHLEVEL) 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/view/addressof.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Andrey Diduh 2019 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_VIEW_ADDRESSOF_HPP 15 | #define RANGES_V3_VIEW_ADDRESSOF_HPP 16 | 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace ranges 29 | { 30 | /// \addtogroup group-views 31 | /// @{ 32 | namespace views 33 | { 34 | struct addressof_fn 35 | { 36 | private: 37 | struct take_address 38 | { 39 | template 40 | constexpr V * operator()(V & value) const noexcept 41 | { 42 | return detail::addressof(value); 43 | } 44 | }; 45 | 46 | public: 47 | template(typename Rng)( 48 | requires viewable_range AND input_range AND 49 | std::is_lvalue_reference>::value) // 50 | constexpr auto CPP_auto_fun(operator())(Rng && rng)(const) // 51 | ( 52 | return transform(all(static_cast(rng)), take_address{}) // 53 | ) 54 | }; 55 | 56 | /// \relates addressof_fn 57 | /// \ingroup group-views 58 | RANGES_INLINE_VARIABLE(view_closure, addressof) 59 | } // namespace views 60 | /// @} 61 | } // namespace ranges 62 | 63 | #include 64 | 65 | #endif // RANGES_V3_VIEW_ADDRESSOF_HPP 66 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/view/bounded.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2014-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | #ifndef RANGES_V3_VIEW_BOUNDED_HPP 14 | #define RANGES_V3_VIEW_BOUNDED_HPP 15 | 16 | #include 17 | RANGES_DEPRECATED_HEADER( 18 | "This header is deprecated. Please #include instead.") 19 | 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/view/take_last.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Barry Revzin 2019-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_VIEW_TAKE_LAST_HPP 15 | #define RANGES_V3_VIEW_TAKE_LAST_HPP 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace ranges 29 | { 30 | /// \addtogroup group-views 31 | /// @{ 32 | 33 | namespace views 34 | { 35 | struct take_last_base_fn 36 | { 37 | template(typename Rng)( 38 | requires viewable_range AND sized_range) 39 | auto operator()(Rng && rng, range_difference_t n) const 40 | { 41 | auto sz = ranges::distance(rng); 42 | return drop_exactly(static_cast(rng), sz > n ? sz - n : 0); 43 | } 44 | }; 45 | 46 | struct take_last_fn : take_last_base_fn 47 | { 48 | using take_last_base_fn::operator(); 49 | 50 | template(typename Int)( 51 | requires detail::integer_like_) 52 | constexpr auto operator()(Int n) const 53 | { 54 | return make_view_closure(bind_back(take_last_base_fn{}, n)); 55 | } 56 | }; 57 | 58 | /// \relates take_last_fn 59 | RANGES_INLINE_VARIABLE(take_last_fn, take_last) 60 | } // namespace views 61 | /// @} 62 | } // namespace ranges 63 | 64 | #include 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/view/unbounded.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright Eric Niebler 2014-present 3 | // 4 | // Use, modification and distribution is subject to the 5 | // Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // Project home: https://github.com/ericniebler/range-v3 10 | // 11 | 12 | #ifndef RANGES_V3_VIEW_UNBOUNDED_HPP 13 | #define RANGES_V3_VIEW_UNBOUNDED_HPP 14 | 15 | #include 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | namespace ranges 24 | { 25 | /// \addtogroup group-views 26 | /// @{ 27 | template 28 | struct unbounded_view : view_interface, infinite> 29 | { 30 | private: 31 | I it_; 32 | 33 | public: 34 | unbounded_view() = default; 35 | constexpr explicit unbounded_view(I it) 36 | : it_(detail::move(it)) 37 | {} 38 | constexpr I begin() const 39 | { 40 | return it_; 41 | } 42 | constexpr unreachable_sentinel_t end() const 43 | { 44 | return {}; 45 | } 46 | }; 47 | 48 | template 49 | RANGES_INLINE_VAR constexpr bool enable_borrowed_range> = true; 50 | 51 | namespace views 52 | { 53 | struct unbounded_fn 54 | { 55 | template(typename I)( 56 | requires input_iterator) 57 | constexpr unbounded_view operator()(I it) const 58 | { 59 | return unbounded_view{detail::move(it)}; 60 | } 61 | }; 62 | 63 | /// \relates unbounded_fn 64 | /// \ingroup group-views 65 | RANGES_INLINE_VARIABLE(unbounded_fn, unbounded) 66 | } // namespace views 67 | /// @} 68 | } // namespace ranges 69 | 70 | #include 71 | #include 72 | RANGES_SATISFY_BOOST_RANGE(::ranges::unbounded_view) 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/view/unique.hpp: -------------------------------------------------------------------------------- 1 | /// \file 2 | // Range v3 library 3 | // 4 | // Copyright Eric Niebler 2013-present 5 | // 6 | // Use, modification and distribution is subject to the 7 | // Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // Project home: https://github.com/ericniebler/range-v3 12 | // 13 | 14 | #ifndef RANGES_V3_VIEW_UNIQUE_HPP 15 | #define RANGES_V3_VIEW_UNIQUE_HPP 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | namespace ranges 33 | { 34 | /// \addtogroup group-views 35 | /// @{ 36 | namespace views 37 | { 38 | struct unique_base_fn 39 | { 40 | template(typename Rng, typename C = equal_to)( 41 | requires viewable_range AND forward_range AND 42 | indirect_relation>) 43 | constexpr adjacent_filter_view, logical_negate> // 44 | operator()(Rng && rng, C pred = {}) const 45 | { 46 | return {all(static_cast(rng)), not_fn(pred)}; 47 | } 48 | }; 49 | 50 | struct unique_fn : unique_base_fn 51 | { 52 | using unique_base_fn::operator(); 53 | 54 | template(typename C)( 55 | requires (!range)) 56 | constexpr auto operator()(C && pred) const 57 | { 58 | return make_view_closure( 59 | bind_back(unique_base_fn{}, static_cast(pred))); 60 | } 61 | }; 62 | 63 | /// \relates unique_fn 64 | /// \ingroup group-views 65 | RANGES_INLINE_VARIABLE(view_closure, unique) 66 | } // namespace views 67 | /// @} 68 | } // namespace ranges 69 | 70 | #include 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/view_adaptor.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | #ifndef RANGES_V3_OLD_VIEW_ADAPTOR_HPP 13 | #define RANGES_V3_OLD_VIEW_ADAPTOR_HPP 14 | 15 | #include 16 | RANGES_DEPRECATED_HEADER( 17 | "This header is deprecated. Please #include instead.") 18 | 19 | #include 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/view_facade.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | #ifndef RANGES_V3_OLD_VIEW_FACADE_HPP 13 | #define RANGES_V3_OLD_VIEW_FACADE_HPP 14 | 15 | #include 16 | RANGES_DEPRECATED_HEADER( 17 | "This header is deprecated. Please #include instead.") 18 | 19 | #include 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /third-party/range-v3/range/v3/view_interface.hpp: -------------------------------------------------------------------------------- 1 | // Range v3 library 2 | // 3 | // Copyright Eric Niebler 2014-present 4 | // 5 | // Use, modification and distribution is subject to the 6 | // Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | // Project home: https://github.com/ericniebler/range-v3 11 | // 12 | #ifndef RANGES_V3_OLD_VIEW_INTERFACE_HPP 13 | #define RANGES_V3_OLD_VIEW_INTERFACE_HPP 14 | 15 | #include 16 | RANGES_DEPRECATED_HEADER( 17 | "This header is deprecated. Please #include instead.") 18 | 19 | #include 20 | 21 | #endif 22 | --------------------------------------------------------------------------------