casadi 3.6.5__cp39-none-macosx_11_0_arm64.whl → 3.6.7__cp39-none-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- casadi/_casadi.so +0 -0
- casadi/casadi-cli +0 -0
- casadi/casadi.py +739 -308
- casadi/cbc +0 -0
- casadi/clp +0 -0
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/casadi-targets.cmake +10 -6
- casadi/cmake/highs/highs-config.cmake +6 -13
- casadi/cmake/highs/highs-targets-release.cmake +13 -13
- casadi/cmake/highs/highs-targets.cmake +25 -22
- casadi/cmake/osqp/osqp-targets.cmake +10 -6
- casadi/cmake/proxsuite/proxsuiteConfigVersion.cmake +0 -5
- casadi/cmake/proxsuite/proxsuiteTargets.cmake +12 -12
- casadi/cmake/qdldl/qdldl-targets.cmake +10 -6
- casadi/cmake/sleqp/sleqp-config-version.cmake +0 -5
- casadi/cmake/sleqp/sleqp-targets.cmake +10 -6
- casadi/cmake/trlib/trlib-config-release.cmake +1 -1
- casadi/cmake/trlib/trlib-config-version.cmake +0 -5
- casadi/cmake/trlib/trlib-config.cmake +12 -12
- casadi/highs +0 -0
- casadi/include/casadi/casadi.i +3 -0
- casadi/include/casadi/casadi_c.h +2 -0
- casadi/include/casadi/config.h +9 -9
- casadi/include/casadi/core/casadi_common.hpp +1 -0
- casadi/include/casadi/core/casadi_export.h +1 -0
- casadi/include/casadi/core/casadi_misc.hpp +52 -0
- casadi/include/casadi/core/casadi_types.hpp +3 -2
- casadi/include/casadi/core/code_generator.hpp +30 -1
- casadi/include/casadi/core/global_options.hpp +2 -0
- casadi/include/casadi/core/mx.hpp +18 -3
- casadi/include/casadi/core/optistack.hpp +23 -0
- casadi/include/casadi/core/runtime/casadi_nlp.hpp +19 -4
- casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
- casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
- casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
- casadi/include/casadi/core/runtime/casadi_runtime.hpp +4 -1
- casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
- casadi/include/casadi/core/serializing_stream.hpp +2 -2
- casadi/include/casadi/core/sparsity.hpp +7 -0
- casadi/include/casadi/doc.i +1513 -1016
- casadi/include/casadi/doc_merged.i +965 -719
- casadi/include/casadi/mem.h +1 -0
- casadi/include/daqp/api.h +46 -0
- casadi/include/daqp/auxiliary.h +29 -0
- casadi/include/daqp/bnb.h +32 -0
- casadi/include/daqp/codegen.h +18 -0
- casadi/include/daqp/constants.h +92 -0
- casadi/include/daqp/daqp.h +22 -0
- casadi/include/daqp/daqp_prox.h +18 -0
- casadi/include/daqp/factorization.h +18 -0
- casadi/include/daqp/types.h +161 -0
- casadi/include/daqp/utils.h +44 -0
- casadi/include/fatrop/auxiliary/Common.hpp +34 -0
- casadi/include/fatrop/auxiliary/DynamicLib.hpp +34 -0
- casadi/include/fatrop/auxiliary/FatropOptions.hpp +68 -0
- casadi/include/fatrop/auxiliary/FatropVector.hpp +143 -0
- casadi/include/fatrop/auxiliary/LinearAlgebra.hpp +88 -0
- casadi/include/fatrop/auxiliary/VectorUtils.hpp +54 -0
- casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +493 -0
- casadi/include/fatrop/fatrop.hpp +39 -0
- casadi/include/fatrop/function_evaluation/CasadiCodegen.hpp +104 -0
- casadi/include/fatrop/function_evaluation/FunctionEvaluation.hpp +60 -0
- casadi/include/fatrop/json/json.h +946 -0
- casadi/include/fatrop/ocp/CasadiCApiUserdataWrap.hpp +87 -0
- casadi/include/fatrop/ocp/DuInfEvaluator.hpp +38 -0
- casadi/include/fatrop/ocp/FatropOCP.hpp +161 -0
- casadi/include/fatrop/ocp/FatropOCPBuilder.hpp +52 -0
- casadi/include/fatrop/ocp/FatropOCPResto.hpp +299 -0
- casadi/include/fatrop/ocp/OCP.hpp +82 -0
- casadi/include/fatrop/ocp/OCPAbstract.hpp +254 -0
- casadi/include/fatrop/ocp/OCPAdapter.hpp +197 -0
- casadi/include/fatrop/ocp/OCPCInterface.h +289 -0
- casadi/include/fatrop/ocp/OCPDims.hpp +60 -0
- casadi/include/fatrop/ocp/OCPInitializer.hpp +41 -0
- casadi/include/fatrop/ocp/OCPKKT.hpp +69 -0
- casadi/include/fatrop/ocp/OCPLSRiccati.hpp +198 -0
- casadi/include/fatrop/ocp/OCPLSScaler.hpp +66 -0
- casadi/include/fatrop/ocp/OCPLinearSolver.hpp +75 -0
- casadi/include/fatrop/ocp/OCPNoScaling.hpp +42 -0
- casadi/include/fatrop/ocp/OCPScalingMethod.hpp +42 -0
- casadi/include/fatrop/ocp/StageOCP.hpp +592 -0
- casadi/include/fatrop/ocp/StageOCPApplication.hpp +242 -0
- casadi/include/fatrop/ocp/StageOCPExpressions.hpp +182 -0
- casadi/include/fatrop/ocp/UStageEvalAbstract.hpp +168 -0
- casadi/include/fatrop/ocp/UStageOCPImpl.hpp +152 -0
- casadi/include/fatrop/quasi_newton/bfgs.hpp +159 -0
- casadi/include/fatrop/solver/AlgBuilder.hpp +76 -0
- casadi/include/fatrop/solver/AlgStrategy.hpp +33 -0
- casadi/include/fatrop/solver/FatropAlg.hpp +121 -0
- casadi/include/fatrop/solver/FatropData.hpp +188 -0
- casadi/include/fatrop/solver/FatropOptions.hpp +95 -0
- casadi/include/fatrop/solver/FatropPrinter.hpp +65 -0
- casadi/include/fatrop/solver/FatropStats.hpp +63 -0
- casadi/include/fatrop/solver/Filter.hpp +54 -0
- casadi/include/fatrop/solver/IterationData.hpp +56 -0
- casadi/include/fatrop/solver/LineSearch.hpp +86 -0
- casadi/include/fatrop/solver/NLPL1.hpp +263 -0
- casadi/include/fatrop/templates/NLPAlg.hpp +104 -0
- casadi/include/highs/HConfig.h +8 -7
- casadi/include/highs/Highs.h +93 -23
- casadi/include/highs/filereaderlp/def.hpp +19 -0
- casadi/include/highs/interfaces/highs_c_api.h +200 -24
- casadi/include/highs/io/Filereader.h +1 -1
- casadi/include/highs/io/FilereaderEms.h +1 -1
- casadi/include/highs/io/FilereaderLp.h +1 -1
- casadi/include/highs/io/FilereaderMps.h +1 -1
- casadi/include/highs/io/HMPSIO.h +1 -1
- casadi/include/highs/io/HMpsFF.h +5 -3
- casadi/include/highs/io/HighsIO.h +18 -8
- casadi/include/highs/io/LoadOptions.h +1 -1
- casadi/include/highs/ipm/IpxSolution.h +35 -0
- casadi/include/highs/ipm/IpxWrapper.h +1 -1
- casadi/include/highs/ipm/basiclu/basiclu.h +161 -0
- casadi/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
- casadi/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
- casadi/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
- casadi/include/highs/ipm/basiclu/basiclu_object.h +30 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
- casadi/include/highs/ipm/basiclu/basiclu_update.h +125 -0
- casadi/include/highs/ipm/basiclu/lu_def.h +39 -0
- casadi/include/highs/ipm/basiclu/lu_file.h +21 -0
- casadi/include/highs/ipm/basiclu/lu_internal.h +220 -0
- casadi/include/highs/ipm/basiclu/lu_list.h +168 -0
- casadi/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
- casadi/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
- casadi/include/highs/ipm/ipx/basis.h +351 -0
- casadi/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
- casadi/include/highs/ipm/ipx/control.h +163 -0
- casadi/include/highs/ipm/ipx/crossover.h +157 -0
- casadi/include/highs/ipm/ipx/diagonal_precond.h +45 -0
- casadi/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
- casadi/include/highs/ipm/ipx/guess_basis.h +21 -0
- casadi/include/highs/ipm/ipx/indexed_vector.h +113 -0
- casadi/include/highs/ipm/ipx/info.h +27 -0
- casadi/include/highs/ipm/ipx/ipm.h +94 -0
- casadi/include/highs/ipm/ipx/ipx_c.h +47 -0
- casadi/include/highs/ipm/ipx/ipx_config.h +9 -0
- casadi/include/highs/ipm/ipx/ipx_info.h +111 -0
- casadi/include/highs/ipm/ipx/ipx_internal.h +88 -0
- casadi/include/highs/ipm/ipx/ipx_parameters.h +75 -0
- casadi/include/highs/ipm/ipx/ipx_status.h +57 -0
- casadi/include/highs/ipm/ipx/iterate.h +328 -0
- casadi/include/highs/ipm/ipx/kkt_solver.h +70 -0
- casadi/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
- casadi/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
- casadi/include/highs/ipm/ipx/linear_operator.h +26 -0
- casadi/include/highs/ipm/ipx/lp_solver.h +201 -0
- casadi/include/highs/ipm/ipx/lu_factorization.h +79 -0
- casadi/include/highs/ipm/ipx/lu_update.h +129 -0
- casadi/include/highs/ipm/ipx/maxvolume.h +54 -0
- casadi/include/highs/ipm/ipx/model.h +409 -0
- casadi/include/highs/ipm/ipx/multistream.h +52 -0
- casadi/include/highs/ipm/ipx/normal_matrix.h +44 -0
- casadi/include/highs/ipm/ipx/power_method.h +44 -0
- casadi/include/highs/ipm/ipx/sparse_matrix.h +195 -0
- casadi/include/highs/ipm/ipx/sparse_utils.h +58 -0
- casadi/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
- casadi/include/highs/ipm/ipx/starting_basis.h +39 -0
- casadi/include/highs/ipm/ipx/symbolic_invert.h +29 -0
- casadi/include/highs/ipm/ipx/timer.h +24 -0
- casadi/include/highs/ipm/ipx/utils.h +39 -0
- casadi/include/highs/lp_data/HConst.h +20 -10
- casadi/include/highs/lp_data/HStruct.h +23 -1
- casadi/include/highs/lp_data/HighsAnalysis.h +1 -1
- casadi/include/highs/lp_data/HighsCallback.h +10 -3
- casadi/include/highs/lp_data/HighsCallbackStruct.h +31 -5
- casadi/include/highs/lp_data/HighsDebug.h +1 -1
- casadi/include/highs/lp_data/HighsInfo.h +20 -2
- casadi/include/highs/lp_data/HighsInfoDebug.h +1 -1
- casadi/include/highs/lp_data/HighsLp.h +17 -1
- casadi/include/highs/lp_data/HighsLpSolverObject.h +1 -1
- casadi/include/highs/lp_data/HighsLpUtils.h +19 -19
- casadi/include/highs/lp_data/HighsModelUtils.h +1 -1
- casadi/include/highs/lp_data/HighsOptions.h +237 -10
- casadi/include/highs/lp_data/HighsRanging.h +1 -1
- casadi/include/highs/lp_data/HighsRuntimeOptions.h +2 -2
- casadi/include/highs/lp_data/HighsSolution.h +2 -2
- casadi/include/highs/lp_data/HighsSolutionDebug.h +1 -1
- casadi/include/highs/lp_data/HighsSolve.h +3 -1
- casadi/include/highs/lp_data/HighsStatus.h +1 -1
- casadi/include/highs/mip/HighsCliqueTable.h +4 -4
- casadi/include/highs/mip/HighsConflictPool.h +1 -1
- casadi/include/highs/mip/HighsCutGeneration.h +1 -1
- casadi/include/highs/mip/HighsCutPool.h +2 -2
- casadi/include/highs/mip/HighsDebugSol.h +22 -29
- casadi/include/highs/mip/HighsDomain.h +10 -2
- casadi/include/highs/mip/HighsDomainChange.h +1 -1
- casadi/include/highs/mip/HighsDynamicRowMatrix.h +5 -3
- casadi/include/highs/mip/HighsGFkSolve.h +3 -3
- casadi/include/highs/mip/HighsImplications.h +3 -3
- casadi/include/highs/mip/HighsLpAggregator.h +1 -1
- casadi/include/highs/mip/HighsLpRelaxation.h +6 -1
- casadi/include/highs/mip/HighsMipSolver.h +4 -2
- casadi/include/highs/mip/HighsMipSolverData.h +47 -4
- casadi/include/highs/mip/HighsModkSeparator.h +2 -2
- casadi/include/highs/mip/HighsNodeQueue.h +5 -3
- casadi/include/highs/mip/HighsObjectiveFunction.h +1 -1
- casadi/include/highs/mip/HighsPathSeparator.h +2 -2
- casadi/include/highs/mip/HighsPrimalHeuristics.h +1 -1
- casadi/include/highs/mip/HighsPseudocost.h +35 -23
- casadi/include/highs/mip/HighsRedcostFixing.h +1 -1
- casadi/include/highs/mip/HighsSearch.h +2 -1
- casadi/include/highs/mip/HighsSeparation.h +1 -1
- casadi/include/highs/mip/HighsSeparator.h +1 -1
- casadi/include/highs/mip/HighsTableauSeparator.h +1 -1
- casadi/include/highs/mip/HighsTransformedLp.h +1 -1
- casadi/include/highs/model/HighsHessian.h +5 -0
- casadi/include/highs/model/HighsHessianUtils.h +2 -0
- casadi/include/highs/model/HighsModel.h +10 -1
- casadi/include/highs/parallel/HighsMutex.h +2 -1
- casadi/include/highs/parallel/HighsParallel.h +7 -2
- casadi/include/highs/parallel/HighsTask.h +1 -2
- casadi/include/highs/pdlp/CupdlpWrapper.h +93 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +41 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +423 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +183 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_scaling_cuda.h +28 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +98 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +33 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +1726 -0
- casadi/include/highs/pdqsort/pdqsort.h +532 -0
- casadi/include/highs/presolve/HPresolve.h +27 -14
- casadi/include/highs/presolve/HPresolveAnalysis.h +1 -1
- casadi/include/highs/presolve/HighsPostsolveStack.h +92 -68
- casadi/include/highs/presolve/HighsSymmetry.h +6 -5
- casadi/include/highs/presolve/ICrash.h +8 -2
- casadi/include/highs/presolve/ICrashUtil.h +1 -1
- casadi/include/highs/presolve/ICrashX.h +1 -1
- casadi/include/highs/presolve/PresolveComponent.h +1 -1
- casadi/include/highs/qpsolver/a_asm.hpp +23 -12
- casadi/include/highs/qpsolver/a_quass.hpp +8 -1
- casadi/include/highs/qpsolver/basis.hpp +150 -0
- casadi/include/highs/qpsolver/crashsolution.hpp +12 -0
- casadi/include/highs/qpsolver/dantzigpricing.hpp +72 -0
- casadi/include/highs/qpsolver/devexpricing.hpp +99 -0
- casadi/include/highs/qpsolver/eventhandler.hpp +23 -0
- casadi/include/highs/qpsolver/factor.hpp +400 -0
- casadi/include/highs/qpsolver/feasibility_bounded.hpp +105 -0
- casadi/include/highs/qpsolver/feasibility_highs.hpp +270 -0
- casadi/include/highs/qpsolver/gradient.hpp +39 -0
- casadi/include/highs/qpsolver/instance.hpp +63 -0
- casadi/include/highs/qpsolver/matrix.hpp +335 -0
- casadi/include/highs/qpsolver/pricing.hpp +15 -0
- casadi/include/highs/qpsolver/qpconst.hpp +27 -0
- casadi/include/highs/qpsolver/{vector.hpp → qpvector.hpp} +25 -25
- casadi/include/highs/qpsolver/quass.hpp +1 -1
- casadi/include/highs/qpsolver/ratiotest.hpp +19 -0
- casadi/include/highs/qpsolver/runtime.hpp +38 -0
- casadi/include/highs/qpsolver/settings.hpp +57 -0
- casadi/include/highs/qpsolver/snippets.hpp +29 -0
- casadi/include/highs/qpsolver/statistics.hpp +23 -0
- casadi/include/highs/qpsolver/steepestedgepricing.hpp +167 -0
- casadi/include/highs/simplex/HApp.h +1 -1
- casadi/include/highs/simplex/HEkk.h +52 -18
- casadi/include/highs/simplex/HEkkDual.h +1 -1
- casadi/include/highs/simplex/HEkkDualRHS.h +6 -7
- casadi/include/highs/simplex/HEkkDualRow.h +2 -2
- casadi/include/highs/simplex/HEkkPrimal.h +6 -1
- casadi/include/highs/simplex/HSimplex.h +1 -3
- casadi/include/highs/simplex/HSimplexDebug.h +1 -1
- casadi/include/highs/simplex/HSimplexNla.h +1 -1
- casadi/include/highs/simplex/HSimplexReport.h +1 -1
- casadi/include/highs/simplex/HighsSimplexAnalysis.h +228 -100
- casadi/include/highs/simplex/SimplexConst.h +1 -1
- casadi/include/highs/simplex/SimplexStruct.h +2 -2
- casadi/include/highs/simplex/SimplexTimer.h +1 -1
- casadi/include/highs/test/DevKkt.h +1 -1
- casadi/include/highs/test/KktCh2.h +1 -1
- casadi/include/highs/util/FactorTimer.h +1 -1
- casadi/include/highs/util/HFactor.h +35 -6
- casadi/include/highs/util/HFactorConst.h +1 -1
- casadi/include/highs/util/HFactorDebug.h +1 -1
- casadi/include/highs/util/HSet.h +1 -1
- casadi/include/highs/util/HVector.h +1 -1
- casadi/include/highs/util/HVectorBase.h +1 -1
- casadi/include/highs/util/HighsCDouble.h +3 -3
- casadi/include/highs/util/HighsComponent.h +1 -1
- casadi/include/highs/util/HighsDataStack.h +4 -4
- casadi/include/highs/util/HighsDisjointSets.h +1 -1
- casadi/include/highs/util/HighsHash.h +28 -21
- casadi/include/highs/util/HighsHashTree.h +63 -63
- casadi/include/highs/util/HighsInt.h +1 -1
- casadi/include/highs/util/HighsIntegers.h +8 -9
- casadi/include/highs/util/HighsLinearSumBounds.h +1 -1
- casadi/include/highs/util/HighsMatrixPic.h +1 -1
- casadi/include/highs/util/HighsMatrixSlice.h +9 -6
- casadi/include/highs/util/HighsMatrixUtils.h +1 -1
- casadi/include/highs/util/HighsMemoryAllocation.h +55 -0
- casadi/include/highs/util/HighsRandom.h +27 -15
- casadi/include/highs/util/HighsRbTree.h +2 -2
- casadi/include/highs/util/HighsSort.h +7 -7
- casadi/include/highs/util/HighsSparseMatrix.h +5 -2
- casadi/include/highs/util/HighsSparseVectorSum.h +2 -2
- casadi/include/highs/util/HighsSplay.h +1 -1
- casadi/include/highs/util/HighsTimer.h +18 -9
- casadi/include/highs/util/HighsUtils.h +15 -8
- casadi/include/highs/util/stringutil.h +9 -4
- casadi/include/highs/zstr/strict_fstream.hpp +237 -0
- casadi/include/highs/zstr/zstr.hpp +472 -0
- casadi/include/highs_export.h +43 -0
- casadi/include/licenses/daqp-external/LICENSE +21 -0
- casadi/include/licenses/{alpaqa-external/LICENSE → fatrop-external/LICENSE.txt} +2 -2
- casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
- casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -0
- casadi/include/licenses/fatrop-external/misc/license_header.txt +17 -0
- casadi/include/licenses/highs-external/{LICENSE → LICENSE.txt} +1 -1
- casadi/include/osqp/constants.h +2 -3
- casadi/include/osqp/version.h +9 -0
- casadi/include/sleqp/defs.h +4 -4
- casadi/include/sleqp/export.h +1 -0
- casadi/lib/cmake/tinyxml2/tinyxml2-config-version.cmake +0 -5
- casadi/lib/cmake/tinyxml2/tinyxml2-static-targets.cmake +10 -6
- casadi/lib/libtinyxml2.a +0 -0
- casadi/lib/pkgconfig/tinyxml2.pc +1 -1
- casadi/libCbc.3.10.11.dylib +0 -0
- casadi/libCbc.3.dylib +0 -0
- casadi/libCbc.dylib +0 -0
- casadi/libCbc.la +2 -2
- casadi/libCbcSolver.3.10.11.dylib +0 -0
- casadi/libCbcSolver.3.dylib +0 -0
- casadi/libCbcSolver.dylib +0 -0
- casadi/libCbcSolver.la +2 -2
- casadi/libCgl.1.10.8.dylib +0 -0
- casadi/libCgl.1.dylib +0 -0
- casadi/libCgl.dylib +0 -0
- casadi/libCgl.la +2 -2
- casadi/libClp.1.14.9.dylib +0 -0
- casadi/libClp.1.dylib +0 -0
- casadi/libClp.dylib +0 -0
- casadi/libClp.la +2 -2
- casadi/libClpSolver.1.14.9.dylib +0 -0
- casadi/libClpSolver.1.dylib +0 -0
- casadi/libClpSolver.dylib +0 -0
- casadi/libClpSolver.la +2 -2
- casadi/libCoinUtils.3.11.10.dylib +0 -0
- casadi/libCoinUtils.3.dylib +0 -0
- casadi/libCoinUtils.dylib +0 -0
- casadi/libCoinUtils.la +1 -1
- casadi/libOsi.1.13.9.dylib +0 -0
- casadi/libOsi.1.dylib +0 -0
- casadi/libOsi.dylib +0 -0
- casadi/libOsi.la +2 -2
- casadi/libOsiCbc.3.10.11.dylib +0 -0
- casadi/libOsiCbc.3.dylib +0 -0
- casadi/libOsiCbc.dylib +0 -0
- casadi/libOsiCbc.la +2 -2
- casadi/libOsiClp.1.14.9.dylib +0 -0
- casadi/libOsiClp.1.dylib +0 -0
- casadi/libOsiClp.dylib +0 -0
- casadi/libOsiClp.la +2 -2
- casadi/libOsiCommonTests.1.13.9.dylib +0 -0
- casadi/libOsiCommonTests.1.dylib +0 -0
- casadi/libOsiCommonTests.dylib +0 -0
- casadi/libOsiCommonTests.la +2 -2
- casadi/libblasfeo.dylib +0 -0
- casadi/libbonmin.4.8.9.dylib +0 -0
- casadi/libbonmin.4.dylib +0 -0
- casadi/libbonmin.dylib +0 -0
- casadi/libbonmin.la +2 -2
- casadi/libc++.1.0.dylib +0 -0
- casadi/libcasadi.3.7.dylib +0 -0
- casadi/libcasadi.dylib +0 -0
- casadi/libcasadi_conic_cbc.3.7.dylib +0 -0
- casadi/libcasadi_conic_cbc.dylib +0 -0
- casadi/libcasadi_conic_clp.3.7.dylib +0 -0
- casadi/libcasadi_conic_clp.dylib +0 -0
- casadi/libcasadi_conic_cplex.3.7.dylib +0 -0
- casadi/libcasadi_conic_cplex.dylib +0 -0
- casadi/libcasadi_conic_daqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_daqp.dylib +0 -0
- casadi/libcasadi_conic_fatrop.3.7.dylib +0 -0
- casadi/libcasadi_conic_fatrop.dylib +0 -0
- casadi/libcasadi_conic_gurobi.3.7.dylib +0 -0
- casadi/libcasadi_conic_gurobi.dylib +0 -0
- casadi/libcasadi_conic_highs.3.7.dylib +0 -0
- casadi/libcasadi_conic_highs.dylib +0 -0
- casadi/libcasadi_conic_ipqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_ipqp.dylib +0 -0
- casadi/libcasadi_conic_nlpsol.3.7.dylib +0 -0
- casadi/libcasadi_conic_nlpsol.dylib +0 -0
- casadi/libcasadi_conic_osqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_osqp.dylib +0 -0
- casadi/libcasadi_conic_proxqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_proxqp.dylib +0 -0
- casadi/libcasadi_conic_qpoases.3.7.dylib +0 -0
- casadi/libcasadi_conic_qpoases.dylib +0 -0
- casadi/libcasadi_conic_qrqp.3.7.dylib +0 -0
- casadi/libcasadi_conic_qrqp.dylib +0 -0
- casadi/libcasadi_conic_superscs.3.7.dylib +0 -0
- casadi/libcasadi_conic_superscs.dylib +0 -0
- casadi/libcasadi_importer_shell.3.7.dylib +0 -0
- casadi/libcasadi_importer_shell.dylib +0 -0
- casadi/libcasadi_integrator_collocation.3.7.dylib +0 -0
- casadi/libcasadi_integrator_collocation.dylib +0 -0
- casadi/libcasadi_integrator_cvodes.3.7.dylib +0 -0
- casadi/libcasadi_integrator_cvodes.dylib +0 -0
- casadi/libcasadi_integrator_idas.3.7.dylib +0 -0
- casadi/libcasadi_integrator_idas.dylib +0 -0
- casadi/libcasadi_integrator_rk.3.7.dylib +0 -0
- casadi/libcasadi_integrator_rk.dylib +0 -0
- casadi/libcasadi_interpolant_bspline.3.7.dylib +0 -0
- casadi/libcasadi_interpolant_bspline.dylib +0 -0
- casadi/libcasadi_interpolant_linear.3.7.dylib +0 -0
- casadi/libcasadi_interpolant_linear.dylib +0 -0
- casadi/libcasadi_linsol_csparse.3.7.dylib +0 -0
- casadi/libcasadi_linsol_csparse.dylib +0 -0
- casadi/libcasadi_linsol_csparsecholesky.3.7.dylib +0 -0
- casadi/libcasadi_linsol_csparsecholesky.dylib +0 -0
- casadi/libcasadi_linsol_lapacklu.3.7.dylib +0 -0
- casadi/libcasadi_linsol_lapacklu.dylib +0 -0
- casadi/libcasadi_linsol_lapackqr.3.7.dylib +0 -0
- casadi/libcasadi_linsol_lapackqr.dylib +0 -0
- casadi/libcasadi_linsol_ldl.3.7.dylib +0 -0
- casadi/libcasadi_linsol_ldl.dylib +0 -0
- casadi/libcasadi_linsol_lsqr.3.7.dylib +0 -0
- casadi/libcasadi_linsol_lsqr.dylib +0 -0
- casadi/libcasadi_linsol_ma27.3.7.dylib +0 -0
- casadi/libcasadi_linsol_ma27.dylib +0 -0
- casadi/libcasadi_linsol_mumps.3.7.dylib +0 -0
- casadi/libcasadi_linsol_mumps.dylib +0 -0
- casadi/libcasadi_linsol_qr.3.7.dylib +0 -0
- casadi/libcasadi_linsol_qr.dylib +0 -0
- casadi/libcasadi_linsol_symbolicqr.3.7.dylib +0 -0
- casadi/libcasadi_linsol_symbolicqr.dylib +0 -0
- casadi/libcasadi_linsol_tridiag.3.7.dylib +0 -0
- casadi/libcasadi_linsol_tridiag.dylib +0 -0
- casadi/libcasadi_nlpsol_ampl.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_ampl.dylib +0 -0
- casadi/libcasadi_nlpsol_blocksqp.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_blocksqp.dylib +0 -0
- casadi/libcasadi_nlpsol_bonmin.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_bonmin.dylib +0 -0
- casadi/libcasadi_nlpsol_fatrop.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_fatrop.dylib +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.dylib +0 -0
- casadi/libcasadi_nlpsol_ipopt.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_ipopt.dylib +0 -0
- casadi/libcasadi_nlpsol_knitro.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_knitro.dylib +0 -0
- casadi/libcasadi_nlpsol_madnlp.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_madnlp.dylib +0 -0
- casadi/libcasadi_nlpsol_qrsqp.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_qrsqp.dylib +0 -0
- casadi/libcasadi_nlpsol_scpgen.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_scpgen.dylib +0 -0
- casadi/libcasadi_nlpsol_sleqp.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_sleqp.dylib +0 -0
- casadi/libcasadi_nlpsol_snopt.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_snopt.dylib +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.dylib +0 -0
- casadi/libcasadi_rootfinder_fast_newton.3.7.dylib +0 -0
- casadi/libcasadi_rootfinder_fast_newton.dylib +0 -0
- casadi/libcasadi_rootfinder_kinsol.3.7.dylib +0 -0
- casadi/libcasadi_rootfinder_kinsol.dylib +0 -0
- casadi/libcasadi_rootfinder_newton.3.7.dylib +0 -0
- casadi/libcasadi_rootfinder_newton.dylib +0 -0
- casadi/libcasadi_rootfinder_nlpsol.3.7.dylib +0 -0
- casadi/libcasadi_rootfinder_nlpsol.dylib +0 -0
- casadi/libcasadi_sundials_common.3.7.dylib +0 -0
- casadi/libcasadi_sundials_common.dylib +0 -0
- casadi/libcasadi_xmlfile_tinyxml.3.7.dylib +0 -0
- casadi/libcasadi_xmlfile_tinyxml.dylib +0 -0
- casadi/libcoinmetis.2.dylib +0 -0
- casadi/libcoinmetis.dylib +0 -0
- casadi/libcoinmetis.la +1 -1
- casadi/libcoinmumps.3.dylib +0 -0
- casadi/libcoinmumps.dylib +0 -0
- casadi/libcoinmumps.la +2 -2
- casadi/libcplex_adaptor.dylib +0 -0
- casadi/{libamd.3.0.3.dylib → libdaqp.dylib} +0 -0
- casadi/libdaqpstat.a +0 -0
- casadi/libfatrop.dylib +0 -0
- casadi/libgcc_s.1.1.dylib +0 -0
- casadi/libgfortran.5.dylib +0 -0
- casadi/libgurobi_adaptor.dylib +0 -0
- casadi/libhighs.1.7.dylib +0 -0
- casadi/libhighs.1.dylib +0 -0
- casadi/libhighs.dylib +0 -0
- casadi/libindirect.a +0 -0
- casadi/libipopt.3.dylib +0 -0
- casadi/libipopt.dylib +0 -0
- casadi/libipopt.la +2 -2
- casadi/liblinsys.a +0 -0
- casadi/{libsuitesparseconfig.7.0.1.dylib → libmatlab_ipc.dylib} +0 -0
- casadi/libosqp.a +0 -0
- casadi/libosqp.dylib +0 -0
- casadi/libqdldl.a +0 -0
- casadi/libqdldl.dylib +0 -0
- casadi/libquadmath.0.dylib +0 -0
- casadi/libsipopt.3.dylib +0 -0
- casadi/libsipopt.dylib +0 -0
- casadi/libsipopt.la +2 -2
- casadi/libsleqp.1.0.1.dylib +0 -0
- casadi/libsleqp.dylib +0 -0
- casadi/libsuperscs.a +0 -0
- casadi/libtrlib.0.4.dylib +0 -0
- casadi/libtrlib.dylib +0 -0
- casadi/libz.1.2.13.dylib +0 -0
- casadi/pkgconfig/bonmin.pc +1 -1
- casadi/pkgconfig/casadi.pc +5 -5
- casadi/pkgconfig/cbc.pc +1 -1
- casadi/pkgconfig/cgl.pc +1 -1
- casadi/pkgconfig/clp.pc +1 -1
- casadi/pkgconfig/coinmetis.pc +1 -1
- casadi/pkgconfig/coinmumps.pc +2 -2
- casadi/pkgconfig/coinutils.pc +2 -2
- casadi/pkgconfig/highs.pc +4 -4
- casadi/pkgconfig/ipopt.pc +2 -2
- casadi/pkgconfig/osi-cbc.pc +1 -1
- casadi/pkgconfig/osi-clp.pc +1 -1
- casadi/pkgconfig/osi-unittests.pc +1 -1
- casadi/pkgconfig/osi.pc +1 -1
- casadi/pkgconfig/sleqp.pc +1 -1
- casadi/tools/__init__.py +4 -0
- casadi/tools/bounds.py +3 -3
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/METADATA +2 -2
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/RECORD +532 -477
- casadi/cmake/alpaqa/alpaqaConfig.cmake +0 -24
- casadi/cmake/alpaqa/alpaqaConfigVersion.cmake +0 -70
- casadi/cmake/alpaqa/alpaqaTargets-release.cmake +0 -19
- casadi/cmake/alpaqa/alpaqaTargets.cmake +0 -116
- casadi/include/alpaqa/accelerators/anderson.hpp +0 -133
- casadi/include/alpaqa/accelerators/internal/anderson-helpers.hpp +0 -92
- casadi/include/alpaqa/accelerators/internal/limited-memory-qr.hpp +0 -295
- casadi/include/alpaqa/accelerators/lbfgs.hpp +0 -244
- casadi/include/alpaqa/accelerators/steihaugcg.hpp +0 -143
- casadi/include/alpaqa/alpaqa.hpp +0 -3
- casadi/include/alpaqa/casadi/CasADiControlProblem.hpp +0 -185
- casadi/include/alpaqa/casadi/CasADiFunctionWrapper.hpp +0 -104
- casadi/include/alpaqa/casadi/CasADiProblem.hpp +0 -102
- casadi/include/alpaqa/casadi-loader-export.hpp +0 -15
- casadi/include/alpaqa/casadi-ocp-loader-export.hpp +0 -15
- casadi/include/alpaqa/config/config.hpp +0 -165
- casadi/include/alpaqa/dl/dl-problem.h +0 -476
- casadi/include/alpaqa/dl/dl-problem.hpp +0 -301
- casadi/include/alpaqa/export.h +0 -42
- casadi/include/alpaqa/export.hpp +0 -30
- casadi/include/alpaqa/implementation/accelerators/lbfgs.tpp +0 -240
- casadi/include/alpaqa/implementation/casadi/CasADiControlProblem.tpp +0 -594
- casadi/include/alpaqa/implementation/casadi/CasADiLoader-util.hpp +0 -50
- casadi/include/alpaqa/implementation/casadi/CasADiProblem.tpp +0 -425
- casadi/include/alpaqa/implementation/inner/directions/panoc/structured-lbfgs.tpp +0 -164
- casadi/include/alpaqa/implementation/inner/panoc-helpers.tpp +0 -389
- casadi/include/alpaqa/implementation/inner/panoc-ocp.tpp +0 -798
- casadi/include/alpaqa/implementation/inner/panoc.tpp +0 -448
- casadi/include/alpaqa/implementation/inner/pantr.tpp +0 -474
- casadi/include/alpaqa/implementation/inner/zerofpr.tpp +0 -482
- casadi/include/alpaqa/implementation/outer/alm.tpp +0 -228
- casadi/include/alpaqa/implementation/outer/internal/alm-helpers.tpp +0 -80
- casadi/include/alpaqa/implementation/params/params.tpp +0 -158
- casadi/include/alpaqa/implementation/problem/ocproblem.tpp +0 -56
- casadi/include/alpaqa/implementation/problem/type-erased-problem.tpp +0 -211
- casadi/include/alpaqa/implementation/util/io/csv.tpp +0 -120
- casadi/include/alpaqa/implementation/util/print.tpp +0 -151
- casadi/include/alpaqa/inner/directions/panoc/anderson.hpp +0 -98
- casadi/include/alpaqa/inner/directions/panoc/lbfgs.hpp +0 -94
- casadi/include/alpaqa/inner/directions/panoc/structured-lbfgs.hpp +0 -146
- casadi/include/alpaqa/inner/directions/panoc/structured-newton.hpp +0 -264
- casadi/include/alpaqa/inner/directions/panoc-direction-update.hpp +0 -96
- casadi/include/alpaqa/inner/directions/panoc-ocp/lqr.hpp +0 -181
- casadi/include/alpaqa/inner/directions/panoc-ocp/ocp-vars.hpp +0 -492
- casadi/include/alpaqa/inner/directions/pantr/newton-tr.hpp +0 -192
- casadi/include/alpaqa/inner/directions/pantr/pantr-direction.hpp +0 -99
- casadi/include/alpaqa/inner/inner-solve-options.hpp +0 -30
- casadi/include/alpaqa/inner/internal/lipschitz.hpp +0 -27
- casadi/include/alpaqa/inner/internal/panoc-helpers.hpp +0 -10
- casadi/include/alpaqa/inner/internal/panoc-stop-crit.hpp +0 -124
- casadi/include/alpaqa/inner/internal/solverstatus.hpp +0 -42
- casadi/include/alpaqa/inner/panoc-ocp.hpp +0 -302
- casadi/include/alpaqa/inner/panoc.hpp +0 -274
- casadi/include/alpaqa/inner/pantr.hpp +0 -284
- casadi/include/alpaqa/inner/zerofpr.hpp +0 -274
- casadi/include/alpaqa/ipopt/ipopt-adapter.hpp +0 -81
- casadi/include/alpaqa/ipopt/ipopt-enums.hpp +0 -35
- casadi/include/alpaqa/lbfgsb/lbfgsb-adapter.hpp +0 -111
- casadi/include/alpaqa/newton-tr-pantr-alm.hpp +0 -27
- casadi/include/alpaqa/outer/alm.hpp +0 -190
- casadi/include/alpaqa/outer/internal/alm-helpers.hpp +0 -10
- casadi/include/alpaqa/panoc-alm.hpp +0 -27
- casadi/include/alpaqa/panoc-anderson-alm.hpp +0 -27
- casadi/include/alpaqa/params/params.hpp +0 -60
- casadi/include/alpaqa/problem/box-constr-problem.hpp +0 -220
- casadi/include/alpaqa/problem/box.hpp +0 -82
- casadi/include/alpaqa/problem/functional-problem.hpp +0 -73
- casadi/include/alpaqa/problem/kkt-error.hpp +0 -43
- casadi/include/alpaqa/problem/ocproblem-counters.hpp +0 -116
- casadi/include/alpaqa/problem/ocproblem.hpp +0 -662
- casadi/include/alpaqa/problem/problem-counters.hpp +0 -116
- casadi/include/alpaqa/problem/problem-with-counters.hpp +0 -141
- casadi/include/alpaqa/problem/type-erased-problem.hpp +0 -874
- casadi/include/alpaqa/problem/unconstr-problem.hpp +0 -37
- casadi/include/alpaqa/structured-panoc-alm.hpp +0 -27
- casadi/include/alpaqa/structured-zerofpr-alm.hpp +0 -27
- casadi/include/alpaqa/util/alloc-check.hpp +0 -23
- casadi/include/alpaqa/util/atomic-stop-signal.hpp +0 -24
- casadi/include/alpaqa/util/check-dim.hpp +0 -64
- casadi/include/alpaqa/util/copyable_unique_ptr.hpp +0 -32
- casadi/include/alpaqa/util/demangled-typename.hpp +0 -9
- casadi/include/alpaqa/util/enumerate.hpp +0 -70
- casadi/include/alpaqa/util/float.hpp +0 -25
- casadi/include/alpaqa/util/index-set.hpp +0 -97
- casadi/include/alpaqa/util/io/csv.hpp +0 -43
- casadi/include/alpaqa/util/iter-adapter.hpp +0 -68
- casadi/include/alpaqa/util/max-history.hpp +0 -47
- casadi/include/alpaqa/util/noop-delete.hpp +0 -15
- casadi/include/alpaqa/util/not-implemented.hpp +0 -12
- casadi/include/alpaqa/util/print.hpp +0 -78
- casadi/include/alpaqa/util/quadmath/quadmath-print.hpp +0 -20
- casadi/include/alpaqa/util/quadmath/quadmath.hpp +0 -137
- casadi/include/alpaqa/util/required-method.hpp +0 -29
- casadi/include/alpaqa/util/ringbuffer.hpp +0 -212
- casadi/include/alpaqa/util/set-intersection.hpp +0 -129
- casadi/include/alpaqa/util/sparse-ops.hpp +0 -164
- casadi/include/alpaqa/util/timed.hpp +0 -22
- casadi/include/alpaqa/util/type-erasure.hpp +0 -568
- casadi/include/alpaqa/util/type-traits.hpp +0 -58
- casadi/include/alpaqa/zerofpr-alm.hpp +0 -27
- casadi/include/alpaqa/zerofpr-anderson-alm.hpp +0 -27
- casadi/include/alpaqa-version.h +0 -8
- casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
- casadi/include/licenses/alpaqa-external/src/thirdparty/lbfgsb/Lbfgsb.3.0/License.txt +0 -71
- casadi/libFortranHighs.dylib +0 -0
- casadi/libalpaqa.1.0.0.dylib +0 -0
- casadi/libalpaqa.dylib +0 -0
- casadi/libcamd.3.0.3.dylib +0 -0
- casadi/libcasadi_nlpsol_alpaqa.3.7.dylib +0 -0
- casadi/libcasadi_nlpsol_alpaqa.dylib +0 -0
- casadi/libccolamd.3.0.3.dylib +0 -0
- casadi/libcholmod.4.0.3.dylib +0 -0
- casadi/libcholmod_cuda.4.0.3.dylib +0 -0
- casadi/libcolamd.3.0.3.dylib +0 -0
- casadi/libhighs.1.6.0.dylib +0 -0
- casadi/libhighs.1.6.dylib +0 -0
- casadi/libumfpack.6.1.0.dylib +0 -0
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -1,568 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/export.hpp>
|
4
|
-
#include <alpaqa/util/demangled-typename.hpp>
|
5
|
-
#include <alpaqa/util/noop-delete.hpp>
|
6
|
-
#include <alpaqa/util/type-traits.hpp>
|
7
|
-
|
8
|
-
#include <algorithm>
|
9
|
-
#include <cassert>
|
10
|
-
#include <cstddef>
|
11
|
-
#include <functional>
|
12
|
-
#include <memory>
|
13
|
-
#include <new>
|
14
|
-
#include <stdexcept>
|
15
|
-
#include <type_traits>
|
16
|
-
#include <typeinfo>
|
17
|
-
#include <utility>
|
18
|
-
|
19
|
-
namespace alpaqa::util {
|
20
|
-
|
21
|
-
class ALPAQA_EXPORT bad_type_erased_type : public std::logic_error {
|
22
|
-
public:
|
23
|
-
bad_type_erased_type(const std::type_info &actual_type,
|
24
|
-
const std::type_info &requested_type,
|
25
|
-
const std::string &message = "")
|
26
|
-
: std::logic_error{message}, actual_type{actual_type},
|
27
|
-
requested_type{requested_type} {}
|
28
|
-
|
29
|
-
[[nodiscard]] const char *what() const noexcept override {
|
30
|
-
message = "";
|
31
|
-
if (const char *w = std::logic_error::what(); w && *w) {
|
32
|
-
message += w;
|
33
|
-
message += ": ";
|
34
|
-
}
|
35
|
-
message = "Type requested: " + demangled_typename(requested_type) +
|
36
|
-
", type contained: " + demangled_typename(actual_type);
|
37
|
-
return message.c_str();
|
38
|
-
}
|
39
|
-
|
40
|
-
private:
|
41
|
-
const std::type_info &actual_type;
|
42
|
-
const std::type_info &requested_type;
|
43
|
-
mutable std::string message;
|
44
|
-
};
|
45
|
-
|
46
|
-
/// Struct that stores the size of a polymorphic object, as well as pointers to
|
47
|
-
/// functions to copy, move or destroy the object.
|
48
|
-
/// Inherit from this struct to add useful functions.
|
49
|
-
struct BasicVTable {
|
50
|
-
|
51
|
-
template <class>
|
52
|
-
struct required_function; // undefined
|
53
|
-
template <class R, class... Args>
|
54
|
-
struct required_function<R(Args...)> {
|
55
|
-
using type = R (*)(void *self, Args...);
|
56
|
-
};
|
57
|
-
template <class>
|
58
|
-
struct required_const_function; // undefined
|
59
|
-
template <class R, class... Args>
|
60
|
-
struct required_const_function<R(Args...)> {
|
61
|
-
using type = R (*)(const void *self, Args...);
|
62
|
-
};
|
63
|
-
template <class, class VTable = BasicVTable>
|
64
|
-
struct optional_function; // undefined
|
65
|
-
template <class R, class... Args, class VTable>
|
66
|
-
struct optional_function<R(Args...), VTable> {
|
67
|
-
using type = R (*)(void *self, Args..., const VTable &);
|
68
|
-
};
|
69
|
-
template <class, class VTable = BasicVTable>
|
70
|
-
struct optional_const_function; // undefined
|
71
|
-
template <class R, class... Args, class VTable>
|
72
|
-
struct optional_const_function<R(Args...), VTable> {
|
73
|
-
using type = R (*)(const void *self, Args..., const VTable &);
|
74
|
-
};
|
75
|
-
/// A required function includes a void pointer to self, in addition to the
|
76
|
-
/// arguments of @p F.
|
77
|
-
template <class F>
|
78
|
-
using required_function_t = typename required_function<F>::type;
|
79
|
-
/// @copydoc required_function_t
|
80
|
-
/// For const-qualified member functions.
|
81
|
-
template <class F>
|
82
|
-
using required_const_function_t = typename required_const_function<F>::type;
|
83
|
-
/// An optional function includes a void pointer to self, the arguments of
|
84
|
-
/// @p F, and an additional reference to the VTable, so that it can be
|
85
|
-
/// implemented in terms of other functions.
|
86
|
-
template <class F, class VTable = BasicVTable>
|
87
|
-
using optional_function_t = typename optional_function<F, VTable>::type;
|
88
|
-
/// @copydoc optional_function_t
|
89
|
-
/// For const-qualified member functions.
|
90
|
-
template <class F, class VTable = BasicVTable>
|
91
|
-
using optional_const_function_t =
|
92
|
-
typename optional_const_function<F, VTable>::type;
|
93
|
-
|
94
|
-
/// Copy-construct a new instance into storage.
|
95
|
-
required_const_function_t<void(void *storage)> copy = nullptr;
|
96
|
-
/// Move-construct a new instance into storage.
|
97
|
-
required_function_t<void(void *storage)> move = nullptr;
|
98
|
-
/// Destruct the given instance.
|
99
|
-
required_function_t<void()> destroy = nullptr;
|
100
|
-
/// The original type of the stored object.
|
101
|
-
const std::type_info *type = &typeid(void);
|
102
|
-
|
103
|
-
BasicVTable() = default;
|
104
|
-
|
105
|
-
template <class T>
|
106
|
-
BasicVTable(std::in_place_t, T &) noexcept {
|
107
|
-
copy = [](const void *self, void *storage) {
|
108
|
-
new (storage) T(*std::launder(reinterpret_cast<const T *>(self)));
|
109
|
-
};
|
110
|
-
// TODO: require that move constructor is noexcept?
|
111
|
-
move = [](void *self, void *storage) noexcept {
|
112
|
-
new (storage)
|
113
|
-
T(std::move(*std::launder(reinterpret_cast<T *>(self))));
|
114
|
-
};
|
115
|
-
destroy = [](void *self) {
|
116
|
-
std::launder(reinterpret_cast<T *>(self))->~T();
|
117
|
-
};
|
118
|
-
type = &typeid(T);
|
119
|
-
}
|
120
|
-
};
|
121
|
-
|
122
|
-
namespace detail {
|
123
|
-
template <class Class, class... ExtraArgs>
|
124
|
-
struct Launderer {
|
125
|
-
private:
|
126
|
-
template <auto M, class V, class C, class R, class... Args>
|
127
|
-
[[gnu::always_inline]] static constexpr auto
|
128
|
-
do_invoke(V *self, Args... args, ExtraArgs...) -> R {
|
129
|
-
return std::invoke(M, *std::launder(reinterpret_cast<C *>(self)),
|
130
|
-
std::forward<Args>(args)...);
|
131
|
-
}
|
132
|
-
template <auto M, class T, class R, class... Args>
|
133
|
-
requires std::is_base_of_v<T, Class>
|
134
|
-
[[gnu::always_inline]] static constexpr auto invoker_ovl(R (T::*)(Args...)
|
135
|
-
const) {
|
136
|
-
return do_invoke<M, const void, const Class, R, Args...>;
|
137
|
-
}
|
138
|
-
template <auto M, class T, class R, class... Args>
|
139
|
-
requires std::is_base_of_v<T, Class>
|
140
|
-
[[gnu::always_inline]] static constexpr auto
|
141
|
-
invoker_ovl(R (T::*)(Args...)) {
|
142
|
-
return do_invoke<M, void, Class, R, Args...>;
|
143
|
-
}
|
144
|
-
|
145
|
-
public:
|
146
|
-
/// Returns a function that accepts a void pointer, casts it to the class
|
147
|
-
/// type of the member function @p Method, launders it, and then invokes
|
148
|
-
/// @p Method with it, passing on the arguments to @p Method. The function
|
149
|
-
/// can also accept additional arguments at the end, of type @p ExtraArgs.
|
150
|
-
template <auto Method>
|
151
|
-
[[gnu::always_inline]] static constexpr auto invoker() {
|
152
|
-
return invoker_ovl<Method>(Method);
|
153
|
-
}
|
154
|
-
};
|
155
|
-
} // namespace detail
|
156
|
-
|
157
|
-
/// @copydoc detail::Launderer::invoker
|
158
|
-
template <class Class, auto Method, class... ExtraArgs>
|
159
|
-
[[gnu::always_inline]] constexpr auto type_erased_wrapped() {
|
160
|
-
return detail::Launderer<Class, ExtraArgs...>::template invoker<Method>();
|
161
|
-
}
|
162
|
-
|
163
|
-
template <class VTable, class Allocator>
|
164
|
-
inline constexpr size_t default_te_buffer_size() {
|
165
|
-
struct S {
|
166
|
-
[[no_unique_address]] Allocator allocator;
|
167
|
-
void *self = nullptr;
|
168
|
-
VTable vtable;
|
169
|
-
};
|
170
|
-
const size_t max_size = 128;
|
171
|
-
return max_size - std::min(max_size, sizeof(S));
|
172
|
-
}
|
173
|
-
|
174
|
-
template <class... Types>
|
175
|
-
inline constexpr size_t required_te_buffer_size_for() {
|
176
|
-
constexpr size_t sizes[] = {sizeof(Types)...};
|
177
|
-
return *std::max_element(std::begin(sizes), std::end(sizes));
|
178
|
-
}
|
179
|
-
|
180
|
-
/// Similar to `std::in_place_t`.
|
181
|
-
template <class T>
|
182
|
-
struct te_in_place_t {};
|
183
|
-
/// Convenience instance of @ref te_in_place_t.
|
184
|
-
template <class T>
|
185
|
-
inline constexpr te_in_place_t<T> te_in_place;
|
186
|
-
|
187
|
-
/// Class for polymorphism through type erasure. Saves the entire vtable, and
|
188
|
-
/// uses small buffer optimization.
|
189
|
-
///
|
190
|
-
/// @todo Decouple allocation/small buffer optimization.
|
191
|
-
template <class VTable = BasicVTable,
|
192
|
-
class Allocator = std::allocator<std::byte>,
|
193
|
-
size_t SmallBufferSize = default_te_buffer_size<VTable, Allocator>()>
|
194
|
-
class TypeErased {
|
195
|
-
public:
|
196
|
-
static constexpr size_t small_buffer_size = SmallBufferSize;
|
197
|
-
using allocator_type = Allocator;
|
198
|
-
|
199
|
-
private:
|
200
|
-
using allocator_traits = std::allocator_traits<allocator_type>;
|
201
|
-
using buffer_type = std::array<std::byte, small_buffer_size>;
|
202
|
-
[[no_unique_address]] alignas(std::max_align_t) buffer_type small_buffer;
|
203
|
-
[[no_unique_address]] allocator_type allocator;
|
204
|
-
|
205
|
-
private:
|
206
|
-
/// True if @p T is not a child class of @ref TypeErased.
|
207
|
-
template <class T>
|
208
|
-
static constexpr auto no_child_of_ours =
|
209
|
-
!std::is_base_of_v<TypeErased, std::remove_cvref_t<T>>;
|
210
|
-
|
211
|
-
protected:
|
212
|
-
static constexpr size_t invalid_size =
|
213
|
-
static_cast<size_t>(0xDEADBEEFDEADBEEF);
|
214
|
-
/// Pointer to the stored object.
|
215
|
-
void *self = nullptr;
|
216
|
-
/// Size required to store the object.
|
217
|
-
size_t size = invalid_size;
|
218
|
-
VTable vtable;
|
219
|
-
|
220
|
-
public:
|
221
|
-
/// Default constructor.
|
222
|
-
TypeErased() noexcept(noexcept(allocator_type())) = default;
|
223
|
-
/// Default constructor (allocator aware).
|
224
|
-
template <class Alloc>
|
225
|
-
TypeErased(std::allocator_arg_t, const Alloc &alloc) : allocator{alloc} {}
|
226
|
-
/// Copy constructor.
|
227
|
-
TypeErased(const TypeErased &other)
|
228
|
-
: allocator{allocator_traits::select_on_container_copy_construction(
|
229
|
-
other.allocator)} {
|
230
|
-
do_copy_assign<false>(other);
|
231
|
-
}
|
232
|
-
/// Copy constructor (allocator aware).
|
233
|
-
TypeErased(const TypeErased &other, allocator_type alloc)
|
234
|
-
: allocator{std::move(alloc)} {
|
235
|
-
do_copy_assign<false>(other);
|
236
|
-
}
|
237
|
-
/// Copy assignment.
|
238
|
-
TypeErased &operator=(const TypeErased &other) {
|
239
|
-
// Check for self-assignment
|
240
|
-
if (&other == this)
|
241
|
-
return *this;
|
242
|
-
// Delete our own storage before assigning a new value
|
243
|
-
cleanup();
|
244
|
-
do_copy_assign<true>(other);
|
245
|
-
return *this;
|
246
|
-
}
|
247
|
-
|
248
|
-
/// Move constructor.
|
249
|
-
TypeErased(TypeErased &&other) noexcept
|
250
|
-
: allocator{std::move(other.allocator)} {
|
251
|
-
size = other.size;
|
252
|
-
vtable = std::move(other.vtable);
|
253
|
-
// If dynamically allocated, simply steal storage
|
254
|
-
if (size > small_buffer_size) {
|
255
|
-
// We stole the allocator, so we can steal the storage as well
|
256
|
-
self = std::exchange(other.self, nullptr);
|
257
|
-
}
|
258
|
-
// Otherwise, use the small buffer and do an explicit move
|
259
|
-
else if (other.self) {
|
260
|
-
self = small_buffer.data();
|
261
|
-
vtable.move(other.self, self);
|
262
|
-
vtable.destroy(other.self); // nothing to deallocate
|
263
|
-
other.self = nullptr;
|
264
|
-
}
|
265
|
-
}
|
266
|
-
/// Move constructor (allocator aware).
|
267
|
-
TypeErased(TypeErased &&other, const allocator_type &alloc) noexcept
|
268
|
-
: allocator{alloc} {
|
269
|
-
// Only continue if other actually contains a value
|
270
|
-
if (other.self == nullptr)
|
271
|
-
return;
|
272
|
-
size = other.size;
|
273
|
-
vtable = std::move(other.vtable);
|
274
|
-
// If dynamically allocated, simply steal other's storage
|
275
|
-
if (size > small_buffer_size) {
|
276
|
-
// Can we steal the storage because of equal allocators?
|
277
|
-
if (allocator == other.allocator) {
|
278
|
-
self = std::exchange(other.self, nullptr);
|
279
|
-
}
|
280
|
-
// If the allocators are not the same, we cannot steal the
|
281
|
-
// storage, so do an explicit move
|
282
|
-
else {
|
283
|
-
self = allocator.allocate(size);
|
284
|
-
vtable.move(other.self, self);
|
285
|
-
// Cannot call other.cleanup() here because we stole the vtable
|
286
|
-
vtable.destroy(other.self);
|
287
|
-
other.deallocate();
|
288
|
-
}
|
289
|
-
}
|
290
|
-
// Otherwise, use the small buffer and do an explicit move
|
291
|
-
else if (other.self) {
|
292
|
-
self = small_buffer.data();
|
293
|
-
vtable.move(other.self, self);
|
294
|
-
// Cannot call other.cleanup() here because we stole the vtable
|
295
|
-
vtable.destroy(other.self); // nothing to deallocate
|
296
|
-
other.self = nullptr;
|
297
|
-
}
|
298
|
-
}
|
299
|
-
/// Move assignment.
|
300
|
-
TypeErased &operator=(TypeErased &&other) noexcept {
|
301
|
-
// Check for self-assignment
|
302
|
-
if (&other == this)
|
303
|
-
return *this;
|
304
|
-
// Delete our own storage before assigning a new value
|
305
|
-
cleanup();
|
306
|
-
// Check if we are allowed to steal the allocator
|
307
|
-
static constexpr bool prop_alloc =
|
308
|
-
allocator_traits::propagate_on_container_move_assignment::value;
|
309
|
-
if constexpr (prop_alloc)
|
310
|
-
allocator = std::move(other.allocator);
|
311
|
-
// Only assign if other contains a value
|
312
|
-
if (other.self == nullptr)
|
313
|
-
return *this;
|
314
|
-
|
315
|
-
size = other.size;
|
316
|
-
vtable = std::move(other.vtable);
|
317
|
-
// If dynamically allocated, simply steal other's storage
|
318
|
-
if (size > small_buffer_size) {
|
319
|
-
// Can we steal the storage because of equal allocators?
|
320
|
-
if (prop_alloc || allocator == other.allocator) {
|
321
|
-
self = std::exchange(other.self, nullptr);
|
322
|
-
}
|
323
|
-
// If the allocators are not the same, we cannot steal the
|
324
|
-
// storage, so do an explicit move
|
325
|
-
else {
|
326
|
-
self = allocator.allocate(size);
|
327
|
-
vtable.move(other.self, self);
|
328
|
-
vtable.destroy(other.self);
|
329
|
-
// Careful, we might have moved other.allocator!
|
330
|
-
auto &deallocator = prop_alloc ? allocator : other.allocator;
|
331
|
-
using pointer_t = typename allocator_traits::pointer;
|
332
|
-
auto &&other_pointer = static_cast<pointer_t>(other.self);
|
333
|
-
deallocator.deallocate(other_pointer, size);
|
334
|
-
other.self = nullptr;
|
335
|
-
}
|
336
|
-
}
|
337
|
-
// Otherwise, use the small buffer and do an explicit move
|
338
|
-
else if (other.self) {
|
339
|
-
self = small_buffer.data();
|
340
|
-
vtable.move(other.self, self);
|
341
|
-
vtable.destroy(other.self); // nothing to deallocate
|
342
|
-
other.self = nullptr;
|
343
|
-
}
|
344
|
-
return *this;
|
345
|
-
}
|
346
|
-
|
347
|
-
/// Destructor.
|
348
|
-
~TypeErased() { cleanup(); }
|
349
|
-
|
350
|
-
/// Main constructor that type-erases the given argument.
|
351
|
-
template <class T, class Alloc>
|
352
|
-
explicit TypeErased(std::allocator_arg_t, const Alloc &alloc, T &&d)
|
353
|
-
: allocator{alloc} {
|
354
|
-
construct_inplace<std::remove_cvref_t<T>>(std::forward<T>(d));
|
355
|
-
}
|
356
|
-
/// Main constructor that type-erases the object constructed from the given
|
357
|
-
/// argument.
|
358
|
-
template <class T, class Alloc, class... Args>
|
359
|
-
explicit TypeErased(std::allocator_arg_t, const Alloc &alloc,
|
360
|
-
te_in_place_t<T>, Args &&...args)
|
361
|
-
: allocator{alloc} {
|
362
|
-
construct_inplace<std::remove_cvref_t<T>>(std::forward<Args>(args)...);
|
363
|
-
}
|
364
|
-
/// @copydoc TypeErased(std::allocator_arg_t, const Alloc &, T &&)
|
365
|
-
/// Requirement prevents this constructor from taking precedence over the
|
366
|
-
/// copy and move constructors.
|
367
|
-
template <class T>
|
368
|
-
requires no_child_of_ours<T>
|
369
|
-
explicit TypeErased(T &&d) {
|
370
|
-
construct_inplace<std::remove_cvref_t<T>>(std::forward<T>(d));
|
371
|
-
}
|
372
|
-
/// Main constructor that type-erases the object constructed from the given
|
373
|
-
/// argument.
|
374
|
-
template <class T, class... Args>
|
375
|
-
explicit TypeErased(te_in_place_t<T>, Args &&...args) {
|
376
|
-
construct_inplace<std::remove_cvref_t<T>>(std::forward<Args>(args)...);
|
377
|
-
}
|
378
|
-
|
379
|
-
/// Construct a type-erased wrapper of type Ret for an object of type T,
|
380
|
-
/// initialized in-place with the given arguments.
|
381
|
-
template <class Ret, class T, class Alloc, class... Args>
|
382
|
-
requires std::is_base_of_v<TypeErased, Ret>
|
383
|
-
static Ret make(std::allocator_arg_t tag, const Alloc &alloc,
|
384
|
-
Args &&...args) {
|
385
|
-
Ret r{tag, alloc};
|
386
|
-
r.template construct_inplace<T>(std::forward<Args>(args)...);
|
387
|
-
return r;
|
388
|
-
}
|
389
|
-
/// Construct a type-erased wrapper of type Ret for an object of type T,
|
390
|
-
/// initialized in-place with the given arguments.
|
391
|
-
template <class Ret, class T, class... Args>
|
392
|
-
requires no_leading_allocator<Args...>
|
393
|
-
static Ret make(Args &&...args) {
|
394
|
-
return make<Ret, T>(std::allocator_arg, allocator_type{},
|
395
|
-
std::forward<Args>(args)...);
|
396
|
-
}
|
397
|
-
|
398
|
-
/// Check if this wrapper wraps an object. False for default-constructed
|
399
|
-
/// objects.
|
400
|
-
explicit operator bool() const noexcept { return self != nullptr; }
|
401
|
-
|
402
|
-
/// Get a copy of the allocator.
|
403
|
-
allocator_type get_allocator() const noexcept { return allocator; }
|
404
|
-
|
405
|
-
/// Query the contained type.
|
406
|
-
[[nodiscard]] const std::type_info &type() const noexcept {
|
407
|
-
return *vtable.type;
|
408
|
-
}
|
409
|
-
|
410
|
-
/// Convert the type-erased object to the given type. The type is checked
|
411
|
-
/// in debug builds only, use with caution.
|
412
|
-
template <class T>
|
413
|
-
T &as() & {
|
414
|
-
if (typeid(T) != type())
|
415
|
-
throw bad_type_erased_type(type(), typeid(T));
|
416
|
-
return *reinterpret_cast<T *>(self);
|
417
|
-
}
|
418
|
-
/// @copydoc as()
|
419
|
-
template <class T>
|
420
|
-
const T &as() const & {
|
421
|
-
if (typeid(T) != type())
|
422
|
-
throw bad_type_erased_type(type(), typeid(T));
|
423
|
-
return *reinterpret_cast<const T *>(self);
|
424
|
-
}
|
425
|
-
/// @copydoc as()
|
426
|
-
template <class T>
|
427
|
-
const T &&as() && {
|
428
|
-
if (typeid(T) != type())
|
429
|
-
throw bad_type_erased_type(type(), typeid(T));
|
430
|
-
return std::move(*reinterpret_cast<T *>(self));
|
431
|
-
}
|
432
|
-
|
433
|
-
private:
|
434
|
-
/// Deallocates the storage when destroyed.
|
435
|
-
struct Deallocator {
|
436
|
-
TypeErased *instance;
|
437
|
-
Deallocator(TypeErased *instance) noexcept : instance{instance} {}
|
438
|
-
Deallocator(const Deallocator &) = delete;
|
439
|
-
Deallocator &operator=(const Deallocator &) = delete;
|
440
|
-
Deallocator(Deallocator &&o) noexcept
|
441
|
-
: instance{std::exchange(o.instance, nullptr)} {}
|
442
|
-
Deallocator &operator=(Deallocator &&) noexcept = delete;
|
443
|
-
void release() noexcept { instance = nullptr; }
|
444
|
-
~Deallocator() { instance ? instance->deallocate() : void(); }
|
445
|
-
};
|
446
|
-
|
447
|
-
/// Ensure that storage is available, either by using the small buffer if
|
448
|
-
/// it is large enough, or by calling the allocator.
|
449
|
-
/// Returns a RAII wrapper that deallocates the storage unless released.
|
450
|
-
Deallocator allocate(size_t size) {
|
451
|
-
assert(!self);
|
452
|
-
assert(size != invalid_size);
|
453
|
-
self = size <= small_buffer_size ? small_buffer.data()
|
454
|
-
: allocator.allocate(size);
|
455
|
-
this->size = size;
|
456
|
-
return {this};
|
457
|
-
}
|
458
|
-
|
459
|
-
/// Deallocate the memory without invoking the destructor.
|
460
|
-
void deallocate() {
|
461
|
-
assert(size != invalid_size);
|
462
|
-
using pointer_t = typename allocator_traits::pointer;
|
463
|
-
if (size > small_buffer_size)
|
464
|
-
allocator.deallocate(reinterpret_cast<pointer_t>(self), size);
|
465
|
-
self = nullptr;
|
466
|
-
}
|
467
|
-
|
468
|
-
/// Destroy the type-erased object (if not empty), and deallocate the memory
|
469
|
-
/// if necessary.
|
470
|
-
void cleanup() {
|
471
|
-
if (self) {
|
472
|
-
vtable.destroy(self);
|
473
|
-
deallocate();
|
474
|
-
}
|
475
|
-
}
|
476
|
-
|
477
|
-
template <bool CopyAllocator>
|
478
|
-
void do_copy_assign(const TypeErased &other) {
|
479
|
-
constexpr bool prop_alloc =
|
480
|
-
allocator_traits::propagate_on_container_copy_assignment::value;
|
481
|
-
if constexpr (CopyAllocator && prop_alloc)
|
482
|
-
allocator = other.allocator;
|
483
|
-
if (!other)
|
484
|
-
return;
|
485
|
-
vtable = other.vtable;
|
486
|
-
auto storage_guard = allocate(other.size);
|
487
|
-
// If copy constructor throws, storage should be deallocated and self
|
488
|
-
// set to null, otherwise the TypeErased destructor will attempt to call
|
489
|
-
// the contained object's destructor, which is undefined behavior if
|
490
|
-
// construction failed.
|
491
|
-
vtable.copy(other.self, self);
|
492
|
-
storage_guard.release();
|
493
|
-
}
|
494
|
-
|
495
|
-
protected:
|
496
|
-
/// Ensure storage and construct the type-erased object of type T in-place.
|
497
|
-
template <class T, class... Args>
|
498
|
-
void construct_inplace(Args &&...args) {
|
499
|
-
static_assert(std::is_same_v<T, std::remove_cvref_t<T>>);
|
500
|
-
// Allocate memory
|
501
|
-
auto storage_guard = allocate(sizeof(T));
|
502
|
-
// Construct the stored object
|
503
|
-
using destroyer = std::unique_ptr<T, noop_delete<T>>;
|
504
|
-
destroyer object_guard{new (self) T{std::forward<Args>(args)...}};
|
505
|
-
vtable = VTable{std::in_place, static_cast<T &>(*object_guard.get())};
|
506
|
-
object_guard.release();
|
507
|
-
storage_guard.release();
|
508
|
-
}
|
509
|
-
|
510
|
-
/// Call the vtable function @p f with the given arguments @p args,
|
511
|
-
/// implicitly passing the @ref self pointer and @ref vtable reference if
|
512
|
-
/// necessary.
|
513
|
-
template <class Ret, class... FArgs, class... Args>
|
514
|
-
[[gnu::always_inline]] decltype(auto) call(Ret (*f)(const void *, FArgs...),
|
515
|
-
Args &&...args) const {
|
516
|
-
assert(f);
|
517
|
-
assert(self);
|
518
|
-
using LastArg = util::last_type_t<FArgs...>;
|
519
|
-
if constexpr (std::is_same_v<LastArg, const VTable &>)
|
520
|
-
return f(self, std::forward<Args>(args)..., vtable);
|
521
|
-
else
|
522
|
-
return f(self, std::forward<Args>(args)...);
|
523
|
-
}
|
524
|
-
/// @copydoc call
|
525
|
-
template <class Ret, class... FArgs, class... Args>
|
526
|
-
[[gnu::always_inline]] decltype(auto) call(Ret (*f)(void *, FArgs...),
|
527
|
-
Args &&...args) {
|
528
|
-
assert(f);
|
529
|
-
assert(self);
|
530
|
-
using LastArg = util::last_type_t<FArgs...>;
|
531
|
-
if constexpr (std::is_same_v<LastArg, const VTable &>)
|
532
|
-
return f(self, std::forward<Args>(args)..., vtable);
|
533
|
-
else
|
534
|
-
return f(self, std::forward<Args>(args)...);
|
535
|
-
}
|
536
|
-
/// @copydoc call
|
537
|
-
template <class Ret>
|
538
|
-
[[gnu::always_inline]] decltype(auto) call(Ret (*f)(const void *)) const {
|
539
|
-
assert(f);
|
540
|
-
assert(self);
|
541
|
-
return f(self);
|
542
|
-
}
|
543
|
-
/// @copydoc call
|
544
|
-
template <class Ret>
|
545
|
-
[[gnu::always_inline]] decltype(auto) call(Ret (*f)(void *)) {
|
546
|
-
assert(f);
|
547
|
-
assert(self);
|
548
|
-
return f(self);
|
549
|
-
}
|
550
|
-
/// @copydoc call
|
551
|
-
template <class Ret>
|
552
|
-
[[gnu::always_inline]] decltype(auto) call(Ret (*f)(const void *,
|
553
|
-
const VTable &)) const {
|
554
|
-
assert(f);
|
555
|
-
assert(self);
|
556
|
-
return f(self, vtable);
|
557
|
-
}
|
558
|
-
/// @copydoc call
|
559
|
-
template <class Ret>
|
560
|
-
[[gnu::always_inline]] decltype(auto) call(Ret (*f)(void *,
|
561
|
-
const VTable &)) {
|
562
|
-
assert(f);
|
563
|
-
assert(self);
|
564
|
-
return f(self, vtable);
|
565
|
-
}
|
566
|
-
};
|
567
|
-
|
568
|
-
} // namespace alpaqa::util
|
@@ -1,58 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <concepts>
|
4
|
-
#include <memory>
|
5
|
-
#include <type_traits>
|
6
|
-
|
7
|
-
namespace alpaqa::util {
|
8
|
-
|
9
|
-
template <class M>
|
10
|
-
struct class_from_member_ptr_impl {};
|
11
|
-
|
12
|
-
template <class C, class Ret, class... Args>
|
13
|
-
struct class_from_member_ptr_impl<Ret (C::*)(Args...)> {
|
14
|
-
using type = C;
|
15
|
-
};
|
16
|
-
|
17
|
-
template <class C, class Ret, class... Args>
|
18
|
-
struct class_from_member_ptr_impl<Ret (C::*)(Args...) const> {
|
19
|
-
using type = std::add_const_t<C>;
|
20
|
-
};
|
21
|
-
|
22
|
-
template <class M>
|
23
|
-
using class_from_member_ptr_impl_t =
|
24
|
-
typename class_from_member_ptr_impl<M>::type;
|
25
|
-
|
26
|
-
template <auto M>
|
27
|
-
using class_from_member_ptr_t = class_from_member_ptr_impl_t<decltype(M)>;
|
28
|
-
|
29
|
-
template <class First, class... Pack>
|
30
|
-
struct last_type {
|
31
|
-
using type = typename last_type<Pack...>::type;
|
32
|
-
};
|
33
|
-
template <class Only>
|
34
|
-
struct last_type<Only> {
|
35
|
-
using type = Only;
|
36
|
-
};
|
37
|
-
template <class... Pack>
|
38
|
-
using last_type_t = typename last_type<Pack...>::type;
|
39
|
-
|
40
|
-
template <class... Pack>
|
41
|
-
struct first_type_or_void;
|
42
|
-
template <class First, class... Pack>
|
43
|
-
struct first_type_or_void<First, Pack...> {
|
44
|
-
using type = First;
|
45
|
-
};
|
46
|
-
template <>
|
47
|
-
struct first_type_or_void<> {
|
48
|
-
using type = void;
|
49
|
-
};
|
50
|
-
template <class... Pack>
|
51
|
-
using first_type_or_void_t = typename first_type_or_void<Pack...>::type;
|
52
|
-
|
53
|
-
template <class... Pack>
|
54
|
-
concept no_leading_allocator = !
|
55
|
-
std::is_same_v<std::remove_cvref_t<first_type_or_void_t<Pack...>>,
|
56
|
-
std::allocator_arg_t>;
|
57
|
-
|
58
|
-
} // namespace alpaqa::util
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/inner/directions/panoc/lbfgs.hpp>
|
4
|
-
#include <alpaqa/inner/zerofpr.hpp>
|
5
|
-
#include <alpaqa/outer/alm.hpp>
|
6
|
-
|
7
|
-
namespace alpaqa {
|
8
|
-
|
9
|
-
// clang-format off
|
10
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, LBFGSDirection<DefaultConfig>);
|
11
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, LBFGSDirection<EigenConfigf>);
|
12
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, LBFGSDirection<EigenConfigd>);
|
13
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, LBFGSDirection<EigenConfigl>);
|
14
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
15
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, LBFGSDirection<EigenConfigq>);
|
16
|
-
#endif
|
17
|
-
|
18
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<LBFGSDirection<DefaultConfig>>);
|
19
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<LBFGSDirection<EigenConfigf>>);
|
20
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<LBFGSDirection<EigenConfigd>>);
|
21
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<LBFGSDirection<EigenConfigl>>);
|
22
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
23
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<LBFGSDirection<EigenConfigq>>);
|
24
|
-
#endif
|
25
|
-
// clang-format on
|
26
|
-
|
27
|
-
} // namespace alpaqa
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <alpaqa/inner/directions/panoc/anderson.hpp>
|
4
|
-
#include <alpaqa/inner/zerofpr.hpp>
|
5
|
-
#include <alpaqa/outer/alm.hpp>
|
6
|
-
|
7
|
-
namespace alpaqa {
|
8
|
-
|
9
|
-
// clang-format off
|
10
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, AndersonDirection<DefaultConfig>);
|
11
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, AndersonDirection<EigenConfigf>);
|
12
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, AndersonDirection<EigenConfigd>);
|
13
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, AndersonDirection<EigenConfigl>);
|
14
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
15
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ZeroFPRSolver, AndersonDirection<EigenConfigq>);
|
16
|
-
#endif
|
17
|
-
|
18
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<AndersonDirection<DefaultConfig>>);
|
19
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<AndersonDirection<EigenConfigf>>);
|
20
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<AndersonDirection<EigenConfigd>>);
|
21
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<AndersonDirection<EigenConfigl>>);
|
22
|
-
#ifdef ALPAQA_WITH_QUAD_PRECISION
|
23
|
-
ALPAQA_EXPORT_EXTERN_TEMPLATE(class, ALMSolver, ZeroFPRSolver<AndersonDirection<EigenConfigq>>);
|
24
|
-
#endif
|
25
|
-
// clang-format on
|
26
|
-
|
27
|
-
} // namespace alpaqa
|
casadi/include/alpaqa-version.h
DELETED
Binary file
|