casadi 3.6.5__cp38-none-manylinux2014_x86_64.whl → 3.6.7__cp38-none-manylinux2014_x86_64.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.py +739 -308
- casadi/cbc +0 -0
- casadi/clp +0 -0
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/highs/highs-config.cmake +6 -13
- casadi/cmake/highs/highs-targets-release.cmake +13 -13
- casadi/cmake/highs/highs-targets.cmake +13 -10
- casadi/highs +0 -0
- casadi/include/casadi/casadi.i +3 -0
- casadi/include/casadi/casadi_c.h +2 -0
- casadi/include/casadi/config.h +8 -8
- casadi/include/casadi/core/casadi_common.hpp +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 +6 -5
- 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 +42 -0
- casadi/include/licenses/daqp-external/LICENSE +21 -0
- casadi/include/licenses/fatrop-external/LICENSE.txt +165 -0
- casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
- casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -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 +2 -2
- casadi/lib64/libtinyxml2.a +0 -0
- casadi/libCbcSolver.so +0 -0
- casadi/libCbcSolver.so.3 +0 -0
- casadi/libCbcSolver.so.3.10.11 +0 -0
- casadi/libClpSolver.so +0 -0
- casadi/libClpSolver.so.1 +0 -0
- casadi/libClpSolver.so.1.14.9 +0 -0
- casadi/libbonmin.so +0 -0
- casadi/libbonmin.so.4 +0 -0
- casadi/libbonmin.so.4.8.9 +0 -0
- casadi/libcasadi.so +0 -0
- casadi/libcasadi.so.3.7 +0 -0
- casadi/libcasadi_conic_cbc.so +0 -0
- casadi/libcasadi_conic_cbc.so.3.7 +0 -0
- casadi/libcasadi_conic_clp.so +0 -0
- casadi/libcasadi_conic_clp.so.3.7 +0 -0
- casadi/libcasadi_conic_cplex.so +0 -0
- casadi/libcasadi_conic_cplex.so.3.7 +0 -0
- casadi/libcasadi_conic_daqp.so +0 -0
- casadi/libcasadi_conic_daqp.so.3.7 +0 -0
- casadi/libcasadi_conic_fatrop.so +0 -0
- casadi/libcasadi_conic_fatrop.so.3.7 +0 -0
- casadi/libcasadi_conic_gurobi.so +0 -0
- casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
- casadi/libcasadi_conic_highs.so +0 -0
- casadi/libcasadi_conic_highs.so.3.7 +0 -0
- casadi/libcasadi_conic_hpipm.so +0 -0
- casadi/libcasadi_conic_hpipm.so.3.7 +0 -0
- casadi/libcasadi_conic_ipqp.so +0 -0
- casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
- casadi/libcasadi_conic_nlpsol.so +0 -0
- casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_conic_osqp.so +0 -0
- casadi/libcasadi_conic_osqp.so.3.7 +0 -0
- casadi/libcasadi_conic_proxqp.so +0 -0
- casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
- casadi/libcasadi_conic_qpoases.so +0 -0
- casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
- casadi/libcasadi_conic_qrqp.so +0 -0
- casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
- casadi/libcasadi_conic_superscs.so +0 -0
- casadi/libcasadi_conic_superscs.so.3.7 +0 -0
- casadi/libcasadi_integrator_collocation.so +0 -0
- casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
- casadi/libcasadi_integrator_cvodes.so +0 -0
- casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
- casadi/libcasadi_integrator_idas.so +0 -0
- casadi/libcasadi_integrator_idas.so.3.7 +0 -0
- casadi/libcasadi_integrator_rk.so +0 -0
- casadi/libcasadi_integrator_rk.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ampl.so +0 -0
- casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_bonmin.so +0 -0
- casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_fatrop.so +0 -0
- casadi/libcasadi_nlpsol_fatrop.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ipopt.so +0 -0
- casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_knitro.so +0 -0
- casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_madnlp.so +0 -0
- casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_scpgen.so +0 -0
- casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sleqp.so +0 -0
- casadi/libcasadi_nlpsol_sleqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_snopt.so +0 -0
- casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_worhp.so +0 -0
- casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_kinsol.so +0 -0
- casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_newton.so +0 -0
- casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_sundials_common.so +0 -0
- casadi/libcasadi_sundials_common.so.3.7 +0 -0
- casadi/libcoinmetis.la +1 -1
- casadi/libcoinmetis.so +0 -0
- casadi/libcoinmetis.so.2 +0 -0
- casadi/libcoinmetis.so.2.0.0 +0 -0
- casadi/libdaqp.so +0 -0
- casadi/libdaqpstat.a +0 -0
- casadi/libfatrop.so +0 -0
- casadi/libhighs.so +0 -0
- casadi/libhighs.so.1 +0 -0
- casadi/libhighs.so.1.7.2 +0 -0
- casadi/libindirect.a +0 -0
- casadi/liblinsys.a +0 -0
- casadi/libmatlab_ipc.so +0 -0
- casadi/libosqp.a +0 -0
- casadi/libosqp.so +0 -0
- casadi/libqdldl.a +0 -0
- casadi/libsleqp.so +0 -0
- casadi/libsleqp.so.1.0.1 +0 -0
- casadi/libspral.a +0 -0
- casadi/libsuperscs.a +0 -0
- casadi/pkgconfig/casadi.pc +1 -1
- casadi/pkgconfig/highs.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 +425 -255
- casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
- casadi/libFortranHighs.so +0 -0
- casadi/libhighs.so.1.6 +0 -0
- casadi/libhighs.so.1.6.0 +0 -0
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,152 @@
|
|
1
|
+
#pragma once
|
2
|
+
#include <string>
|
3
|
+
#include "fatrop/ocp/OCPAbstract.hpp"
|
4
|
+
#include "fatrop/ocp/UStageEvalAbstract.hpp"
|
5
|
+
#include <memory>
|
6
|
+
namespace fatrop
|
7
|
+
{
|
8
|
+
template<typename TUStageEval>
|
9
|
+
class UStageOCPImpl : public OCPAbstract
|
10
|
+
{
|
11
|
+
public:
|
12
|
+
UStageOCPImpl(std::vector<std::shared_ptr<TUStageEval>> && ustages, int n_global_parameters): ustages_(std::move(ustages)), n_global_parameters_(n_global_parameters)
|
13
|
+
{
|
14
|
+
horizon_length_ = ustages_.size();
|
15
|
+
}
|
16
|
+
fatrop_int get_nx(const fatrop_int k) const override { return ustages_[k]->get_nx(); };
|
17
|
+
fatrop_int get_nu(const fatrop_int k) const override { return ustages_[k]->get_nu(); };
|
18
|
+
fatrop_int get_ng(const fatrop_int k) const override { return ustages_[k]->get_ng(); };
|
19
|
+
fatrop_int get_n_stage_params(const fatrop_int k) const override { return ustages_[k]->get_n_stage_params(); };
|
20
|
+
fatrop_int get_n_global_params() const override { return n_global_parameters_; };
|
21
|
+
fatrop_int get_default_stage_params(double *stage_params, const fatrop_int k) const override { return 0; };
|
22
|
+
fatrop_int get_default_global_params(double *global_params) const override { return 0; };
|
23
|
+
fatrop_int get_ng_ineq(const fatrop_int k) const override { return ustages_[k]->get_ng_ineq(); };
|
24
|
+
fatrop_int get_horizon_length() const override { return horizon_length_; };
|
25
|
+
fatrop_int eval_BAbt(
|
26
|
+
const double *states_kp1,
|
27
|
+
const double *inputs_k,
|
28
|
+
const double *states_k,
|
29
|
+
const double *stage_params_k,
|
30
|
+
const double *global_params,
|
31
|
+
MAT *res,
|
32
|
+
const fatrop_int k) override
|
33
|
+
{
|
34
|
+
return ustages_[k]->eval_BAbt(states_kp1, inputs_k, states_k, stage_params_k, global_params, res);
|
35
|
+
};
|
36
|
+
fatrop_int eval_RSQrqt(
|
37
|
+
const double *objective_scale,
|
38
|
+
const double *inputs_k,
|
39
|
+
const double *states_k,
|
40
|
+
const double *lam_dyn_k,
|
41
|
+
const double *lam_eq_k,
|
42
|
+
const double *lam_eq_ineq_k,
|
43
|
+
const double *stage_params_k,
|
44
|
+
const double *global_params,
|
45
|
+
MAT *res,
|
46
|
+
const fatrop_int k) override
|
47
|
+
{
|
48
|
+
return ustages_[k]->eval_RSQrqt(objective_scale, inputs_k, states_k, lam_dyn_k, lam_eq_k, lam_eq_ineq_k, stage_params_k, global_params, res);
|
49
|
+
};
|
50
|
+
fatrop_int eval_Ggt(
|
51
|
+
const double *inputs_k,
|
52
|
+
const double *states_k,
|
53
|
+
const double *stage_params_k,
|
54
|
+
const double *global_params,
|
55
|
+
MAT *res,
|
56
|
+
const fatrop_int k) override
|
57
|
+
{
|
58
|
+
return ustages_[k]->eval_Ggt(inputs_k, states_k, stage_params_k, global_params, res);
|
59
|
+
};
|
60
|
+
fatrop_int eval_Ggt_ineq(
|
61
|
+
const double *inputs_k,
|
62
|
+
const double *states_k,
|
63
|
+
const double *stage_params_k,
|
64
|
+
const double *global_params,
|
65
|
+
MAT *res,
|
66
|
+
const fatrop_int k) override
|
67
|
+
{
|
68
|
+
return ustages_[k]->eval_Ggt_ineq(inputs_k, states_k, stage_params_k, global_params, res);
|
69
|
+
};
|
70
|
+
fatrop_int eval_b(
|
71
|
+
const double *states_kp1,
|
72
|
+
const double *inputs_k,
|
73
|
+
const double *states_k,
|
74
|
+
const double *stage_params_k,
|
75
|
+
const double *global_params,
|
76
|
+
double *res,
|
77
|
+
const fatrop_int k) override
|
78
|
+
{
|
79
|
+
return ustages_[k]->eval_b(states_kp1, inputs_k, states_k, stage_params_k, global_params, res);
|
80
|
+
};
|
81
|
+
fatrop_int eval_g(
|
82
|
+
const double *inputs_k,
|
83
|
+
const double *states_k,
|
84
|
+
const double *stage_params_k,
|
85
|
+
const double *global_params,
|
86
|
+
double *res,
|
87
|
+
const fatrop_int k) override
|
88
|
+
{
|
89
|
+
return ustages_[k]->eval_g(inputs_k, states_k, stage_params_k, global_params, res);
|
90
|
+
};
|
91
|
+
fatrop_int eval_gineq(
|
92
|
+
const double *inputs_k,
|
93
|
+
const double *states_k,
|
94
|
+
const double *stage_params_k,
|
95
|
+
const double *global_params,
|
96
|
+
double *res,
|
97
|
+
const fatrop_int k) override
|
98
|
+
{
|
99
|
+
return ustages_[k]->eval_gineq(inputs_k, states_k, stage_params_k, global_params, res);
|
100
|
+
};
|
101
|
+
fatrop_int eval_rq(
|
102
|
+
const double *objective_scale,
|
103
|
+
const double *inputs_k,
|
104
|
+
const double *states_k,
|
105
|
+
const double *stage_params_k,
|
106
|
+
const double *global_params,
|
107
|
+
double *res,
|
108
|
+
const fatrop_int k) override
|
109
|
+
{
|
110
|
+
return ustages_[k]->eval_rq(objective_scale, inputs_k, states_k, stage_params_k, global_params, res);
|
111
|
+
};
|
112
|
+
fatrop_int eval_L(
|
113
|
+
const double *objective_scale,
|
114
|
+
const double *inputs_k,
|
115
|
+
const double *states_k,
|
116
|
+
const double *stage_params_k,
|
117
|
+
const double *global_params,
|
118
|
+
double *res,
|
119
|
+
const fatrop_int k) override
|
120
|
+
{
|
121
|
+
return ustages_[k]->eval_L(objective_scale, inputs_k, states_k, stage_params_k, global_params, res);
|
122
|
+
};
|
123
|
+
fatrop_int get_bounds(double *lower, double *upper, const fatrop_int k) const override
|
124
|
+
{
|
125
|
+
return ustages_[k]->get_bounds(lower, upper);
|
126
|
+
};
|
127
|
+
fatrop_int get_initial_xk(double *xk, const fatrop_int k) const override
|
128
|
+
{
|
129
|
+
// initialization is done higher up
|
130
|
+
for (int i = 0; i < get_nx(k); i++)
|
131
|
+
{
|
132
|
+
xk[i] = 0;
|
133
|
+
}
|
134
|
+
return 0;
|
135
|
+
};
|
136
|
+
fatrop_int get_initial_uk(double *uk, const fatrop_int k) const override
|
137
|
+
{
|
138
|
+
// initialization is done higher up
|
139
|
+
for (int i = 0; i < get_nu(k); i++)
|
140
|
+
{
|
141
|
+
uk[i] = 0;
|
142
|
+
}
|
143
|
+
return 0;
|
144
|
+
};
|
145
|
+
|
146
|
+
private:
|
147
|
+
std::vector<std::shared_ptr<TUStageEval>> ustages_;
|
148
|
+
int horizon_length_;
|
149
|
+
int n_global_parameters_;
|
150
|
+
};
|
151
|
+
// implementation of OCPAbstract, given an OCP
|
152
|
+
} // namespace fatrop
|
@@ -0,0 +1,159 @@
|
|
1
|
+
|
2
|
+
class BFGSUpdater
|
3
|
+
{
|
4
|
+
public:
|
5
|
+
BFGSUpdater(const int m) : m(m), Bk_prev(m, m), tmp1(m, 2), tmp2(m, 2), vk(m), yk_tilde(m) {}
|
6
|
+
int update(MAT *Bip1, VEC *si, VEC *yi)
|
7
|
+
{
|
8
|
+
MAT *Bk_prev_p = Bk_prev;
|
9
|
+
VEC *vk_p = vk;
|
10
|
+
VEC *yk_tilde_p = yk_tilde;
|
11
|
+
|
12
|
+
// powell update formula
|
13
|
+
// compute update
|
14
|
+
double sts = DOT(m, si, 0, si, 0);
|
15
|
+
double sty = DOT(m, si, 0, yi, 0);
|
16
|
+
double yty = DOT(m, yi, 0, yi, 0);
|
17
|
+
if (sts == 0.0 || first_time)
|
18
|
+
{
|
19
|
+
skips = 0;
|
20
|
+
reset();
|
21
|
+
GECP(m, m, Bk_prev_p, 0, 0, Bip1, 0, 0);
|
22
|
+
return 0;
|
23
|
+
}
|
24
|
+
GEMV_N(m, m, 1.0, Bk_prev_p, 0, 0, si, 0, 0.0, vk_p, 0, vk_p, 0);
|
25
|
+
double stv = DOT(m, si, 0, vk_p, 0);
|
26
|
+
double beta = -1.0 / stv;
|
27
|
+
#define SKIPPING
|
28
|
+
#define ALT_RANK1
|
29
|
+
#ifdef SKIPPING
|
30
|
+
double alpha_tilde = 1.0 / sty;
|
31
|
+
AXPBY(m, 1.0, yi, 0, 0.0, vk_p, 0, yk_tilde_p, 0);
|
32
|
+
if (sty <= 1e-8 * std::sqrt(yty) * std::sqrt(sts))
|
33
|
+
{
|
34
|
+
int ret = 0;
|
35
|
+
if (skips >= 1)
|
36
|
+
{
|
37
|
+
reset(1.0);
|
38
|
+
ret = 1;
|
39
|
+
// std::cout << "resetting Bk" << std::endl;
|
40
|
+
}
|
41
|
+
GECP(m, m, Bk_prev_p, 0, 0, Bip1, 0, 0);
|
42
|
+
skips++;
|
43
|
+
return ret;
|
44
|
+
}
|
45
|
+
#else
|
46
|
+
double theta = sty > 0.2 * stv ? 1.0 : (0.8 * stv) / (stv - sty);
|
47
|
+
AXPBY(m, theta, yi, 0, 1.0 - theta, vk_p, 0, yk_tilde_p, 0);
|
48
|
+
double sty_tilde = DOT(m, si, 0, yk_tilde_p, 0);
|
49
|
+
double alpha_tilde = 1.0 / sty_tilde;
|
50
|
+
#endif
|
51
|
+
#ifdef ALT_RANK1
|
52
|
+
|
53
|
+
COLIN(m, yk_tilde_p, 0, tmp1, 0, 0);
|
54
|
+
VECSC(m, alpha_tilde, yk_tilde_p, 0);
|
55
|
+
COLIN(m, yk_tilde_p, 0, tmp2, 0, 0);
|
56
|
+
|
57
|
+
COLIN(m, vk_p, 0, tmp1, 0, 1);
|
58
|
+
VECSC(m, beta, vk_p, 0);
|
59
|
+
COLIN(m, vk_p, 0, tmp2, 0, 1);
|
60
|
+
|
61
|
+
SYRK_LN(m, 2, 1.0, tmp1, 0, 0, tmp2, 0, 0, 1.0, Bk_prev_p, 0, 0, Bip1, 0, 0);
|
62
|
+
TRTR_L(m, Bip1, 0, 0, Bip1, 0, 0);
|
63
|
+
#else
|
64
|
+
GER(m, m, alpha_tilde, yk_tilde_p, 0, yk_tilde_p, 0, Bk_prev_p, 0, 0, Bip1, 0, 0);
|
65
|
+
GER(m, m, beta, vk_p, 0, vk_p, 0, Bip1, 0, 0, Bip1, 0, 0);
|
66
|
+
#endif
|
67
|
+
// save the previous Bk
|
68
|
+
GECP(m, m, Bip1, 0, 0, Bk_prev_p, 0, 0);
|
69
|
+
skips = 0;
|
70
|
+
return 0;
|
71
|
+
}
|
72
|
+
void reset(double alpha = 1.0, bool reset_skips = true)
|
73
|
+
{
|
74
|
+
// std:: cout << "resetting Bk" << std::endl;
|
75
|
+
MAT *Bk_prev_p = Bk_prev;
|
76
|
+
// identity matrix for B0
|
77
|
+
GESE(m, m, 0.0, Bk_prev_p, 0, 0);
|
78
|
+
DIARE(m, alpha, Bk_prev_p, 0, 0);
|
79
|
+
}
|
80
|
+
const int m;
|
81
|
+
MATBF Bk_prev;
|
82
|
+
MATBF tmp1;
|
83
|
+
MATBF tmp2;
|
84
|
+
VECBF vk;
|
85
|
+
VECBF yk_tilde;
|
86
|
+
int skips = 0;
|
87
|
+
bool first_time = true;
|
88
|
+
};
|
89
|
+
class OCPBFGSUpdater : public BFGSUpdater
|
90
|
+
{
|
91
|
+
public:
|
92
|
+
OCPBFGSUpdater(int nu, int nx, int nxp1, int ng, int ng_ineq, bool first, bool last) : BFGSUpdater(nu + nx), nu(nu), nx(nx), nxp1(nxp1), ng(ng), ng_ineq(ng_ineq), first(first), last(last), BAt_prev(nu + nx, nxp1), Gt_prev(nu + nx, ng), Gt_ineq_prev(nu + nx, ng_ineq), ux_prev(nu + nx), grad_obj_prev(nu + nx), s(nu + nx), y(nu + nx) {reset();}
|
93
|
+
int update(MAT *Bkp1, VEC *ux, int a_ux, VEC *grad_obj, int a_grad_obj, MAT *BAbt, VEC *lam_dyn, int a_lam_dyn, MAT *Ggt, VEC *lam_eq, int a_lam_eq, MAT *Ggt_ineq, VEC *lam_ineq, int a_lam_ineq)
|
94
|
+
{
|
95
|
+
VEC *ux_prev_p = ux_prev;
|
96
|
+
VEC *grad_obj_prev_p = grad_obj_prev;
|
97
|
+
VEC *s_p = s;
|
98
|
+
VEC *y_p = y;
|
99
|
+
MAT *BAt_prev_p = BAt_prev;
|
100
|
+
MAT *Gt_prev_p = Gt_prev;
|
101
|
+
MAT *Gt_ineq_prev_p = Gt_ineq_prev;
|
102
|
+
|
103
|
+
// compute s
|
104
|
+
AXPBY(nu + nx, 1.0, ux, a_ux, -1.0, ux_prev_p, 0, s_p, 0);
|
105
|
+
|
106
|
+
// compute y
|
107
|
+
AXPBY(nu + nx, 1.0, grad_obj, a_grad_obj, 0.0, y_p, 0, y_p, 0);
|
108
|
+
if (!last)
|
109
|
+
{
|
110
|
+
// contribution from dynamics
|
111
|
+
GEMV_N(nu + nx, nxp1, 1.0, BAbt, 0, 0, lam_dyn, a_lam_dyn, 1.0, y_p, 0, y_p, 0);
|
112
|
+
}
|
113
|
+
// contribution from equality constraints
|
114
|
+
GEMV_N(nu + nx, ng, 1.0, Ggt, 0, 0, lam_eq, a_lam_eq, 1.0, y_p, 0, y_p, 0);
|
115
|
+
// contribution from inequality constraints
|
116
|
+
GEMV_N(nu + nx, ng_ineq, 1.0, Ggt_ineq, 0, 0, lam_ineq, a_lam_ineq, 1.0, y_p, 0, y_p, 0);
|
117
|
+
// save in last row
|
118
|
+
ROWIN(nu + nx, 1.0, y_p, 0, Bkp1, nu + nx, 0);
|
119
|
+
if (!first_time)
|
120
|
+
{
|
121
|
+
AXPBY(nu + nx, -1.0, grad_obj_prev_p, 0, 1.0, y_p, 0, y_p, 0);
|
122
|
+
if (!last)
|
123
|
+
{
|
124
|
+
// contribution from dynamics
|
125
|
+
GEMV_N(nu + nx, nxp1, -1.0, BAt_prev_p, 0, 0, lam_dyn, a_lam_dyn, 1.0, y_p, 0, y_p, 0);
|
126
|
+
}
|
127
|
+
// contribution from equality constraints
|
128
|
+
GEMV_N(nu + nx, ng, -1.0, Gt_prev_p, 0, 0, lam_eq, a_lam_eq, 1.0, y_p, 0, y_p, 0);
|
129
|
+
// contribution from inequality constraints
|
130
|
+
GEMV_N(nu + nx, ng_ineq, -1.0, Gt_ineq_prev_p, 0, 0, lam_ineq, a_lam_ineq, 1.0, y_p, 0, y_p, 0);
|
131
|
+
}
|
132
|
+
// call BFGS update
|
133
|
+
int ret = BFGSUpdater::update(Bkp1, s_p, y_p);
|
134
|
+
// save ux and grad_obj
|
135
|
+
VECCP(nu + nx, ux, a_ux, ux_prev_p, 0);
|
136
|
+
VECCP(nu + nx, grad_obj, a_grad_obj, grad_obj_prev_p, 0);
|
137
|
+
// save BAt, Gt, Gt_ineq
|
138
|
+
GECP(nu + nx, nxp1, BAbt, 0, 0, BAt_prev_p, 0, 0);
|
139
|
+
GECP(nu + nx, ng, Ggt, 0, 0, Gt_prev_p, 0, 0);
|
140
|
+
GECP(nu + nx, ng_ineq, Ggt_ineq, 0, 0, Gt_ineq_prev_p, 0, 0);
|
141
|
+
first_time = false;
|
142
|
+
// blasfeo_print_dmat(nu+nx+1, nu+nx, Bkp1, 0, 0);
|
143
|
+
return ret;
|
144
|
+
}
|
145
|
+
void reset()
|
146
|
+
{
|
147
|
+
first_time = true;
|
148
|
+
BFGSUpdater::reset();
|
149
|
+
}
|
150
|
+
const int nu, nx, nxp1, ng, ng_ineq;
|
151
|
+
const bool first, last;
|
152
|
+
MATBF BAt_prev;
|
153
|
+
MATBF Gt_prev;
|
154
|
+
MATBF Gt_ineq_prev;
|
155
|
+
VECBF ux_prev;
|
156
|
+
VECBF grad_obj_prev;
|
157
|
+
VECBF s;
|
158
|
+
VECBF y;
|
159
|
+
};
|
@@ -0,0 +1,76 @@
|
|
1
|
+
/*
|
2
|
+
* Fatrop - A fast trajectory optimization solver
|
3
|
+
* Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
|
4
|
+
*
|
5
|
+
* This file is part of Fatrop.
|
6
|
+
*
|
7
|
+
* Fatrop is free software: you can redistribute it and/or modify
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
10
|
+
* (at your option) any later version.
|
11
|
+
*
|
12
|
+
* Fatrop is distributed in the hope that it will be useful,
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
* GNU Lesser General Public License for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
|
19
|
+
#ifndef ALBBUILDERINCLUDED
|
20
|
+
#define ALBBUILDERINCLUDED
|
21
|
+
// #include "NLPAlg.hpp"
|
22
|
+
#include "FatropAlg.hpp"
|
23
|
+
#include "fatrop/auxiliary/Common.hpp"
|
24
|
+
namespace fatrop
|
25
|
+
{
|
26
|
+
class AlgBuilder
|
27
|
+
{
|
28
|
+
public:
|
29
|
+
void build_fatrop_algorithm_objects(const std::shared_ptr<FatropNLP> &nlp,const std::shared_ptr<FatropNLP> &nlp_resto,
|
30
|
+
const std::shared_ptr<FatropOptions> &fatropparams,
|
31
|
+
std::shared_ptr<FatropData> &fatropdata, std::shared_ptr<FatropData> &fatropdata_resto,
|
32
|
+
std::shared_ptr<Journaller> &journaller)
|
33
|
+
{
|
34
|
+
if (fatropprinter_ == nullptr)
|
35
|
+
{
|
36
|
+
fatropprinter_ = std::make_shared<FatropPrinter>();
|
37
|
+
}
|
38
|
+
fatropdata = std::make_shared<FatropData>(nlp->get_nlp_dims(), fatropparams, fatropprinter_);
|
39
|
+
fatropdata_resto = std::make_shared<FatropData>(nlp_resto->get_nlp_dims(), fatropparams, fatropprinter_);
|
40
|
+
journaller = std::make_shared<Journaller>(fatropparams->maxiter + 1, fatropprinter_);
|
41
|
+
fatropdata_ = fatropdata; // keep this around for building the algorithm
|
42
|
+
fatropdata_resto_ = fatropdata_resto;
|
43
|
+
journaller_ = journaller;
|
44
|
+
nlp_ = nlp;
|
45
|
+
nlp_resto_ = nlp_resto;
|
46
|
+
fatropoptions_ = fatropparams;
|
47
|
+
}
|
48
|
+
void set_printer(const std::shared_ptr<FatropPrinter> &printer)
|
49
|
+
{
|
50
|
+
fatropprinter_ = printer;
|
51
|
+
}
|
52
|
+
std::shared_ptr<FatropAlg> build_algorithm()
|
53
|
+
{
|
54
|
+
// TODO unsafe if maxiter is changed during application
|
55
|
+
std::shared_ptr<Filter> filter = std::make_shared<Filter>(fatropoptions_->maxiter + 1);
|
56
|
+
std::shared_ptr<LineSearch> linesearch = std::make_shared<BackTrackingLineSearch>(fatropoptions_, nlp_, fatropdata_, filter, journaller_, fatropprinter_);
|
57
|
+
std::shared_ptr<Filter> filter_resto = std::make_shared<Filter>(fatropoptions_->maxiter + 1);
|
58
|
+
std::shared_ptr<LineSearch> linesearch_resto = std::make_shared<BackTrackingLineSearch>(fatropoptions_, nlp_resto_, fatropdata_resto_, filter_resto, journaller_, fatropprinter_);
|
59
|
+
std::shared_ptr<FatropAlg> orig_alg = std::make_shared<FatropAlg>(nlp_, fatropdata_, fatropoptions_, filter, linesearch, journaller_, fatropprinter_, nullptr, nullptr, false);
|
60
|
+
std::shared_ptr<FatropAlg> resto_alg = std::make_shared<FatropAlg>(nlp_resto_, fatropdata_resto_, fatropoptions_, filter_resto, linesearch_resto, journaller_, fatropprinter_, orig_alg, nullptr, true);
|
61
|
+
orig_alg-> set_resto_alg(resto_alg);
|
62
|
+
return orig_alg;
|
63
|
+
}
|
64
|
+
|
65
|
+
private:
|
66
|
+
std::shared_ptr<FatropNLP> nlp_;
|
67
|
+
std::shared_ptr<FatropNLP> nlp_resto_;
|
68
|
+
std::shared_ptr<FatropOptions> fatropoptions_;
|
69
|
+
std::shared_ptr<FatropData> fatropdata_;
|
70
|
+
std::shared_ptr<FatropData> fatropdata_resto_;
|
71
|
+
std::shared_ptr<Journaller> journaller_;
|
72
|
+
std::shared_ptr<FatropPrinter> fatropprinter_;
|
73
|
+
};
|
74
|
+
};
|
75
|
+
|
76
|
+
#endif // ALBBUILDERINCLUDED
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/*
|
2
|
+
* Fatrop - A fast trajectory optimization solver
|
3
|
+
* Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
|
4
|
+
*
|
5
|
+
* This file is part of Fatrop.
|
6
|
+
*
|
7
|
+
* Fatrop is free software: you can redistribute it and/or modify
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
10
|
+
* (at your option) any later version.
|
11
|
+
*
|
12
|
+
* Fatrop is distributed in the hope that it will be useful,
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
* GNU Lesser General Public License for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
|
19
|
+
#ifndef ALGSTRATEGYINCLUDED
|
20
|
+
#define ALGSTRATEGYINCLUDED
|
21
|
+
#include "FatropOptions.hpp"
|
22
|
+
#include <memory>
|
23
|
+
namespace fatrop
|
24
|
+
{
|
25
|
+
class AlgStrategy
|
26
|
+
{
|
27
|
+
public:
|
28
|
+
AlgStrategy(const std::shared_ptr<FatropOptions> &fatrop_params) : fatrop_params_(fatrop_params){};
|
29
|
+
std::shared_ptr<FatropOptions> fatrop_params_;
|
30
|
+
void initialize() {};
|
31
|
+
};
|
32
|
+
};
|
33
|
+
#endif // !ALGSTRATEGYINCLUDED
|
@@ -0,0 +1,121 @@
|
|
1
|
+
/*
|
2
|
+
* Fatrop - A fast trajectory optimization solver
|
3
|
+
* Copyright (C) 2022 - 2024 Lander Vanroye, KU Leuven. All rights reserved.
|
4
|
+
*
|
5
|
+
* This file is part of Fatrop.
|
6
|
+
*
|
7
|
+
* Fatrop is free software: you can redistribute it and/or modify
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
10
|
+
* (at your option) any later version.
|
11
|
+
*
|
12
|
+
* Fatrop is distributed in the hope that it will be useful,
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
* GNU Lesser General Public License for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* along with Fatrop. If not, see <http://www.gnu.org/licenses/>. */
|
19
|
+
#ifndef FATROPALGINCLUDED
|
20
|
+
#define FATROPALGINCLUDED
|
21
|
+
#include "fatrop/templates/NLPAlg.hpp"
|
22
|
+
#include "FatropData.hpp"
|
23
|
+
#include "Filter.hpp"
|
24
|
+
#include "LineSearch.hpp"
|
25
|
+
#include <cmath>
|
26
|
+
#include "IterationData.hpp"
|
27
|
+
#include <memory>
|
28
|
+
#include "FatropStats.hpp"
|
29
|
+
#include <limits>
|
30
|
+
#include <fatrop/solver/FatropPrinter.hpp>
|
31
|
+
#include "fatrop/auxiliary/Common.hpp"
|
32
|
+
// #include "AlgorithmQuantities.hpp"
|
33
|
+
// #ifdef ENABLE_MULTITHREADING
|
34
|
+
// #include "fatrop/auxiliary/Worker.hpp"
|
35
|
+
// #endif
|
36
|
+
|
37
|
+
namespace fatrop
|
38
|
+
{
|
39
|
+
// TODO: get rid of FatropApplication
|
40
|
+
class FatropAlg
|
41
|
+
{
|
42
|
+
public:
|
43
|
+
FatropAlg(
|
44
|
+
const std::shared_ptr<FatropNLP> &fatropnlp,
|
45
|
+
const std::shared_ptr<FatropData> &fatropdata,
|
46
|
+
const std::shared_ptr<FatropOptions> &fatropparams,
|
47
|
+
const std::shared_ptr<Filter> &filter,
|
48
|
+
const std::shared_ptr<LineSearch> &linesearch,
|
49
|
+
const std::shared_ptr<Journaller> &journaller,
|
50
|
+
const std::shared_ptr<FatropPrinter> &printer,
|
51
|
+
const std::shared_ptr<FatropAlg>&orig_, const std::shared_ptr<FatropAlg>&resto_alg_, bool resto_problem);
|
52
|
+
void initialize() ;
|
53
|
+
void reset() ;
|
54
|
+
void set_bounds(const std::vector<double> &lower, const std::vector<double> &upper) ;
|
55
|
+
void set_initial(const std::vector<double> &initial) ;
|
56
|
+
void get_solution(std::vector<double> &sol) ;
|
57
|
+
fatrop_int optimize() ;
|
58
|
+
fatrop_int eval_lag_hess();
|
59
|
+
fatrop_int eval_constr_jac();
|
60
|
+
fatrop_int eval_constr_viol_curr();
|
61
|
+
fatrop_int eval_constr_viol_trial();
|
62
|
+
fatrop_int eval_obj_grad_curr();
|
63
|
+
double eval_objective_curr();
|
64
|
+
double eval_objective_trial();
|
65
|
+
fatrop_int eval_dual_infeasiblity();
|
66
|
+
fatrop_int perform_initializiation_dual();
|
67
|
+
fatrop_int solve_pd_sys(double inertia_correction_w, double inertia_correction_c, double mu);
|
68
|
+
fatrop_int start_resto_alg(double mu, int iter);
|
69
|
+
fatrop_int return_from_resto_alg(double mu);
|
70
|
+
bool resto_stop_crit();
|
71
|
+
std::shared_ptr<FatropNLP> fatropnlp_;
|
72
|
+
std::shared_ptr<FatropData> fatropdata_;
|
73
|
+
std::shared_ptr<FatropOptions> fatropoptions_;
|
74
|
+
std::shared_ptr<Filter> filter_;
|
75
|
+
std::shared_ptr<LineSearch> linesearch_;
|
76
|
+
std::shared_ptr<Journaller> journaller_;
|
77
|
+
std::shared_ptr<FatropPrinter> printer_;
|
78
|
+
FatropStats get_stats()
|
79
|
+
{
|
80
|
+
return stats;
|
81
|
+
};
|
82
|
+
|
83
|
+
public:
|
84
|
+
double tol;
|
85
|
+
double acceptable_tol;
|
86
|
+
fatrop_int acceptable_iter;
|
87
|
+
fatrop_int maxiter;
|
88
|
+
void set_resto_alg(const std::shared_ptr<FatropAlg> &resto_alg)
|
89
|
+
{
|
90
|
+
resto_alg_ = resto_alg;
|
91
|
+
};
|
92
|
+
|
93
|
+
private:
|
94
|
+
double lammax;
|
95
|
+
double mu0;
|
96
|
+
double kappa_eta;
|
97
|
+
double kappa_mu;
|
98
|
+
double theta_mu;
|
99
|
+
double delta_w0;
|
100
|
+
double delta_wmin;
|
101
|
+
double kappa_wmin;
|
102
|
+
double kappa_wplus;
|
103
|
+
double kappa_wplusem;
|
104
|
+
double delta_c_stripe;
|
105
|
+
double kappa_c;
|
106
|
+
double kappa_d;
|
107
|
+
double theta_min;
|
108
|
+
fatrop_int max_watchdog_steps;
|
109
|
+
bool warm_start_init_point;
|
110
|
+
bool recalc_y;
|
111
|
+
double recalc_y_feas_tol;
|
112
|
+
// bool first_try_watchdog;
|
113
|
+
FatropStats stats;
|
114
|
+
std::weak_ptr<FatropAlg> orig_;
|
115
|
+
std::shared_ptr<FatropAlg> resto_alg_;
|
116
|
+
bool resto_problem_ = false;
|
117
|
+
fatrop_int start_iter_ = 0;
|
118
|
+
fatrop_int iter_count_ = 0;
|
119
|
+
};
|
120
|
+
} // namespace fatrop
|
121
|
+
#endif // FATROPALGINCLUDED
|