casadi 3.6.5__cp311-none-win_amd64.whl → 3.6.7__cp311-none-win_amd64.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.pyd +0 -0
- casadi/bin/libtinyxml2.dll +0 -0
- casadi/blasfeo.lib +0 -0
- casadi/casadi-cli.exe +0 -0
- casadi/casadi.lib +0 -0
- casadi/casadi.py +739 -308
- casadi/cbc.exe +0 -0
- casadi/clp.exe +0 -0
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/highs/highs-config.cmake +7 -14
- casadi/cmake/highs/highs-targets-release.cmake +13 -13
- casadi/cmake/highs/highs-targets.cmake +11 -9
- casadi/daqp.lib +0 -0
- casadi/fatrop.lib +0 -0
- casadi/highs.exe +0 -0
- casadi/highs.lib +0 -0
- casadi/hpipm.lib +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/dlfcn.h +94 -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/ipopt.lib +0 -0
- casadi/lapack.lib +0 -0
- casadi/lib/libtinyxml2.dll.a +0 -0
- casadi/libCbc-3.dll +0 -0
- casadi/libCbc.dll.a +0 -0
- casadi/libCbcSolver-3.dll +0 -0
- casadi/libCbcSolver.dll.a +0 -0
- casadi/libCgl-1.dll +0 -0
- casadi/libCgl.dll.a +0 -0
- casadi/libClp-1.dll +0 -0
- casadi/libClp.dll.a +0 -0
- casadi/libClpSolver-1.dll +0 -0
- casadi/libClpSolver.dll.a +0 -0
- casadi/libCoinUtils-3.dll +0 -0
- casadi/libCoinUtils.dll.a +0 -0
- casadi/libOsi-1.dll +0 -0
- casadi/libOsi.dll.a +0 -0
- casadi/libOsiCbc-3.dll +0 -0
- casadi/libOsiCbc.dll.a +0 -0
- casadi/libOsiClp-1.dll +0 -0
- casadi/libOsiClp.dll.a +0 -0
- casadi/libOsiCommonTests-1.dll +0 -0
- casadi/libOsiCommonTests.dll.a +0 -0
- casadi/libalpaqa.dll +0 -0
- casadi/libalpaqa.dll.a +0 -0
- casadi/libblasfeo.dll +0 -0
- casadi/libblasfeo.dll.a +0 -0
- casadi/libbonmin-4.dll +0 -0
- casadi/libbonmin.dll.a +0 -0
- casadi/libcasadi-tp-openblas.dll +0 -0
- casadi/libcasadi-tp-openblas.dll.a +0 -0
- casadi/libcasadi.dll +0 -0
- casadi/libcasadi.dll.a +0 -0
- casadi/libcasadi_conic_cbc.dll +0 -0
- casadi/libcasadi_conic_cbc.dll.a +0 -0
- casadi/libcasadi_conic_clp.dll +0 -0
- casadi/libcasadi_conic_clp.dll.a +0 -0
- casadi/libcasadi_conic_cplex.dll +0 -0
- casadi/libcasadi_conic_cplex.dll.a +0 -0
- casadi/libcasadi_conic_daqp.dll +0 -0
- casadi/libcasadi_conic_daqp.dll.a +0 -0
- casadi/libcasadi_conic_fatrop.dll +0 -0
- casadi/libcasadi_conic_fatrop.dll.a +0 -0
- casadi/libcasadi_conic_gurobi.dll +0 -0
- casadi/libcasadi_conic_gurobi.dll.a +0 -0
- casadi/libcasadi_conic_highs.dll +0 -0
- casadi/libcasadi_conic_highs.dll.a +0 -0
- casadi/libcasadi_conic_hpipm.dll +0 -0
- casadi/libcasadi_conic_hpipm.dll.a +0 -0
- casadi/libcasadi_conic_ipqp.dll +0 -0
- casadi/libcasadi_conic_ipqp.dll.a +0 -0
- casadi/libcasadi_conic_nlpsol.dll +0 -0
- casadi/libcasadi_conic_nlpsol.dll.a +0 -0
- casadi/libcasadi_conic_osqp.dll +0 -0
- casadi/libcasadi_conic_osqp.dll.a +0 -0
- casadi/libcasadi_conic_proxqp.dll +0 -0
- casadi/libcasadi_conic_proxqp.dll.a +0 -0
- casadi/libcasadi_conic_qpoases.dll +0 -0
- casadi/libcasadi_conic_qpoases.dll.a +0 -0
- casadi/libcasadi_conic_qrqp.dll +0 -0
- casadi/libcasadi_conic_qrqp.dll.a +0 -0
- casadi/libcasadi_conic_superscs.dll +0 -0
- casadi/libcasadi_conic_superscs.dll.a +0 -0
- casadi/libcasadi_importer_shell.dll +0 -0
- casadi/libcasadi_importer_shell.dll.a +0 -0
- casadi/libcasadi_integrator_collocation.dll +0 -0
- casadi/libcasadi_integrator_collocation.dll.a +0 -0
- casadi/libcasadi_integrator_cvodes.dll +0 -0
- casadi/libcasadi_integrator_cvodes.dll.a +0 -0
- casadi/libcasadi_integrator_idas.dll +0 -0
- casadi/libcasadi_integrator_idas.dll.a +0 -0
- casadi/libcasadi_integrator_rk.dll +0 -0
- casadi/libcasadi_integrator_rk.dll.a +0 -0
- casadi/libcasadi_interpolant_bspline.dll +0 -0
- casadi/libcasadi_interpolant_bspline.dll.a +0 -0
- casadi/libcasadi_interpolant_linear.dll +0 -0
- casadi/libcasadi_interpolant_linear.dll.a +0 -0
- casadi/libcasadi_linsol_csparse.dll +0 -0
- casadi/libcasadi_linsol_csparse.dll.a +0 -0
- casadi/libcasadi_linsol_csparsecholesky.dll +0 -0
- casadi/libcasadi_linsol_csparsecholesky.dll.a +0 -0
- casadi/libcasadi_linsol_lapacklu.dll +0 -0
- casadi/libcasadi_linsol_lapacklu.dll.a +0 -0
- casadi/libcasadi_linsol_lapackqr.dll +0 -0
- casadi/libcasadi_linsol_lapackqr.dll.a +0 -0
- casadi/libcasadi_linsol_ldl.dll +0 -0
- casadi/libcasadi_linsol_ldl.dll.a +0 -0
- casadi/libcasadi_linsol_lsqr.dll +0 -0
- casadi/libcasadi_linsol_lsqr.dll.a +0 -0
- casadi/libcasadi_linsol_ma27.dll +0 -0
- casadi/libcasadi_linsol_ma27.dll.a +0 -0
- casadi/libcasadi_linsol_mumps.dll +0 -0
- casadi/libcasadi_linsol_mumps.dll.a +0 -0
- casadi/libcasadi_linsol_qr.dll +0 -0
- casadi/libcasadi_linsol_qr.dll.a +0 -0
- casadi/libcasadi_linsol_symbolicqr.dll +0 -0
- casadi/libcasadi_linsol_symbolicqr.dll.a +0 -0
- casadi/libcasadi_linsol_tridiag.dll +0 -0
- casadi/libcasadi_linsol_tridiag.dll.a +0 -0
- casadi/libcasadi_nlpsol_alpaqa.dll +0 -0
- casadi/libcasadi_nlpsol_alpaqa.dll.a +0 -0
- casadi/libcasadi_nlpsol_ampl.dll +0 -0
- casadi/libcasadi_nlpsol_ampl.dll.a +0 -0
- casadi/libcasadi_nlpsol_blocksqp.dll +0 -0
- casadi/libcasadi_nlpsol_blocksqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_bonmin.dll +0 -0
- casadi/libcasadi_nlpsol_bonmin.dll.a +0 -0
- casadi/libcasadi_nlpsol_fatrop.dll +0 -0
- casadi/libcasadi_nlpsol_fatrop.dll.a +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.dll +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.dll.a +0 -0
- casadi/libcasadi_nlpsol_ipopt.dll +0 -0
- casadi/libcasadi_nlpsol_ipopt.dll.a +0 -0
- casadi/libcasadi_nlpsol_knitro.dll +0 -0
- casadi/libcasadi_nlpsol_knitro.dll.a +0 -0
- casadi/libcasadi_nlpsol_madnlp.dll +0 -0
- casadi/libcasadi_nlpsol_madnlp.dll.a +0 -0
- casadi/libcasadi_nlpsol_qrsqp.dll +0 -0
- casadi/libcasadi_nlpsol_qrsqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_scpgen.dll +0 -0
- casadi/libcasadi_nlpsol_scpgen.dll.a +0 -0
- casadi/libcasadi_nlpsol_sleqp.dll +0 -0
- casadi/libcasadi_nlpsol_sleqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_snopt.dll +0 -0
- casadi/libcasadi_nlpsol_snopt.dll.a +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.dll +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.dll.a +0 -0
- casadi/libcasadi_nlpsol_worhp.dll +0 -0
- casadi/libcasadi_nlpsol_worhp.dll.a +0 -0
- casadi/libcasadi_rootfinder_fast_newton.dll +0 -0
- casadi/libcasadi_rootfinder_fast_newton.dll.a +0 -0
- casadi/libcasadi_rootfinder_kinsol.dll +0 -0
- casadi/libcasadi_rootfinder_kinsol.dll.a +0 -0
- casadi/libcasadi_rootfinder_newton.dll +0 -0
- casadi/libcasadi_rootfinder_newton.dll.a +0 -0
- casadi/libcasadi_rootfinder_nlpsol.dll +0 -0
- casadi/libcasadi_rootfinder_nlpsol.dll.a +0 -0
- casadi/libcasadi_sundials_common.dll +0 -0
- casadi/libcasadi_sundials_common.dll.a +0 -0
- casadi/libcasadi_xmlfile_tinyxml.dll +0 -0
- casadi/libcasadi_xmlfile_tinyxml.dll.a +0 -0
- casadi/libcoinmetis-2.dll +0 -0
- casadi/libcoinmetis.dll.a +0 -0
- casadi/libcoinmetis.la +1 -1
- casadi/libcoinmumps-3.dll +0 -0
- casadi/libcoinmumps.dll.a +0 -0
- casadi/libcplex_adaptor.dll +0 -0
- casadi/libdaqp.dll +0 -0
- casadi/libdaqp.dll.a +0 -0
- casadi/libdaqpstat.a +0 -0
- casadi/{libFortranHighs.dll → libdl.dll} +0 -0
- casadi/libdl.dll.a +0 -0
- casadi/libfatrop.dll +0 -0
- casadi/libfatrop.dll.a +0 -0
- casadi/libgurobi_adaptor.dll +0 -0
- casadi/libhighs.dll +0 -0
- casadi/libhighs.dll.a +0 -0
- casadi/libhpipm.dll +0 -0
- casadi/libhpipm.dll.a +0 -0
- casadi/libipopt-3.dll +0 -0
- casadi/libipopt.dll.a +0 -0
- casadi/libmatlab_ipc.dll +0 -0
- casadi/libmatlab_ipc.dll.a +0 -0
- casadi/libosqp.a +0 -0
- casadi/libosqp.dll +0 -0
- casadi/libosqp.dll.a +0 -0
- casadi/libqdldl.dll +0 -0
- casadi/libqdldl.dll.a +0 -0
- casadi/libsipopt-3.dll +0 -0
- casadi/libsipopt.dll.a +0 -0
- casadi/libsleqp.dll +0 -0
- casadi/libsleqp.dll.a +0 -0
- casadi/libtinyxml2.dll +0 -0
- casadi/libtrlib.dll +0 -0
- casadi/libtrlib.dll.a +0 -0
- casadi/matlab_ipc.lib +0 -0
- casadi/osqp.lib +0 -0
- casadi/pkgconfig/casadi.pc +1 -1
- casadi/pkgconfig/highs.pc +1 -1
- casadi/sleqp.lib +0 -0
- casadi/spral_ssids.exe +0 -0
- 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 +503 -325
- casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
- casadi/libFortranHighs.dll.a +0 -0
- {casadi-3.6.5.dist-info → casadi-3.6.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,82 @@
|
|
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 OCPINCLUDED
|
20
|
+
#define OCPINCLUDED
|
21
|
+
#include "fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp"
|
22
|
+
#include "OCPDims.hpp"
|
23
|
+
#include "fatrop/ocp/OCPKKT.hpp"
|
24
|
+
#include "fatrop/solver/FatropData.hpp"
|
25
|
+
#include <memory>
|
26
|
+
#include "fatrop/auxiliary/Common.hpp"
|
27
|
+
namespace fatrop
|
28
|
+
{
|
29
|
+
/** \brief interface class for OCP operations*/
|
30
|
+
class OCP
|
31
|
+
{
|
32
|
+
public:
|
33
|
+
virtual fatrop_int eval_lag_hess(
|
34
|
+
OCPKKTMemory *OCP,
|
35
|
+
double obj_scale,
|
36
|
+
const FatropVecBF &primal_vars,
|
37
|
+
const FatropVecBF &lam) = 0;
|
38
|
+
virtual fatrop_int eval_constr_jac(
|
39
|
+
OCPKKTMemory *OCP,
|
40
|
+
const FatropVecBF &primal_vars,
|
41
|
+
const FatropVecBF &slack_vars) = 0;
|
42
|
+
virtual fatrop_int eval_contr_viol(
|
43
|
+
OCPKKTMemory *OCP,
|
44
|
+
const FatropVecBF &primal_vars,
|
45
|
+
const FatropVecBF &slack_vars,
|
46
|
+
FatropVecBF &constraint_violation) = 0;
|
47
|
+
virtual fatrop_int eval_ineqs(
|
48
|
+
OCPKKTMemory *OCP,
|
49
|
+
const FatropVecBF &primal_vars,
|
50
|
+
FatropVecBF &constraint_violation) = 0;
|
51
|
+
virtual fatrop_int eval_obj_grad(
|
52
|
+
OCPKKTMemory *OCP,
|
53
|
+
double obj_scale,
|
54
|
+
const FatropVecBF &primal_vars,
|
55
|
+
FatropVecBF &gradient_x
|
56
|
+
) = 0;
|
57
|
+
virtual fatrop_int eval_obj(
|
58
|
+
OCPKKTMemory *OCP,
|
59
|
+
double obj_scale,
|
60
|
+
const FatropVecBF &primal_vars,
|
61
|
+
double &res) = 0;
|
62
|
+
virtual fatrop_int integrate_dynamics(
|
63
|
+
OCPKKTMemory *OCP,
|
64
|
+
const fatrop_int k,
|
65
|
+
const FatropVecBF &uk,
|
66
|
+
const FatropVecBF &xk,
|
67
|
+
FatropVecBF &xkp1) = 0;
|
68
|
+
virtual OCPDims get_ocp_dims() const = 0;
|
69
|
+
virtual fatrop_int get_bounds(
|
70
|
+
FatropVecBF &lower,
|
71
|
+
FatropVecBF &upper) const = 0;
|
72
|
+
virtual fatrop_int get_initial_sol_guess(
|
73
|
+
FatropVecBF &initial) const = 0;
|
74
|
+
virtual void reset() = 0;
|
75
|
+
// virtual fatrop_int GetDefaultParams(
|
76
|
+
// FatropOptions ¶ms) const = 0;
|
77
|
+
virtual void set_parameters(const std::vector<double> &stage_params_in, const std::vector<double> &global_params_in) = 0;
|
78
|
+
virtual void set_initial_sol_guess(const std::shared_ptr<FatropData> &fatropdata, std::vector<double> &initial_u, std::vector<double> &initial_x) = 0;
|
79
|
+
virtual void get_solution(const std::shared_ptr<FatropData> &fatropdata, std::vector<double> &u, std::vector<double> &x) = 0;
|
80
|
+
};
|
81
|
+
} // namespace fatrop
|
82
|
+
#endif // OCPINCLUDED
|
@@ -0,0 +1,254 @@
|
|
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 OCPTEMPLATEINCLUDED
|
20
|
+
#define OCPTEMPLATEINCLUDED
|
21
|
+
#include "fatrop/ocp/OCPKKT.hpp"
|
22
|
+
#include "fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp"
|
23
|
+
#include "fatrop/auxiliary/FatropVector.hpp"
|
24
|
+
#include "OCPDims.hpp"
|
25
|
+
#include "fatrop/auxiliary/Common.hpp"
|
26
|
+
namespace fatrop
|
27
|
+
{
|
28
|
+
/// @brief Abstract class for OCP template
|
29
|
+
/// @details This class is used to define the interface for the OCP template.
|
30
|
+
/// an implemtation contains all information that is needed by the fatrop algorithm to solve the OCP.
|
31
|
+
/// the information includes the problem dimensions, the default parameters, default initial solution guess and evaluation code for stagewise function quantities.
|
32
|
+
class OCPAbstract
|
33
|
+
{
|
34
|
+
public:
|
35
|
+
/// @brief number of states for time step k
|
36
|
+
/// @param k: time step
|
37
|
+
virtual fatrop_int get_nx(const fatrop_int k) const = 0;
|
38
|
+
/// @brief number of inputs for time step k
|
39
|
+
/// @param k: time step
|
40
|
+
virtual fatrop_int get_nu(const fatrop_int k) const = 0;
|
41
|
+
/// @brief number of equality constraints for time step k
|
42
|
+
/// @param k: time step
|
43
|
+
virtual fatrop_int get_ng(const fatrop_int k) const = 0;
|
44
|
+
/// @brief number of stage parameters for time step k
|
45
|
+
/// @param k: time step
|
46
|
+
virtual fatrop_int get_n_stage_params(const fatrop_int k) const = 0;
|
47
|
+
/// @brief number of global parameters
|
48
|
+
virtual fatrop_int get_n_global_params() const = 0;
|
49
|
+
/// @brief default stage parameters for time step k
|
50
|
+
/// @param stage_params: pointer to array of size n_stage_params_k
|
51
|
+
/// @param k: time step
|
52
|
+
virtual fatrop_int get_default_stage_params(double *stage_params, const fatrop_int k) const = 0;
|
53
|
+
/// @brief default global parameters
|
54
|
+
/// @param global_params: pointer to array of size n_global_params
|
55
|
+
virtual fatrop_int get_default_global_params(double *global_params) const = 0;
|
56
|
+
/// @brief number of inequality constraints for time step k
|
57
|
+
/// @param k: time step
|
58
|
+
virtual fatrop_int get_ng_ineq(const fatrop_int k) const = 0;
|
59
|
+
/// @brief horizon length
|
60
|
+
virtual fatrop_int get_horizon_length() const = 0;
|
61
|
+
/// @brief discretized dynamics
|
62
|
+
/// it evaluates the vertical concatenation of A_k^T, B_k^T, and b_k^T from the linearized dynamics x_{k+1} = A_k x_k + B_k u_k + b_k.
|
63
|
+
/// The matrix is in column major format.
|
64
|
+
/// @param states_kp1: pointer to nx_{k+1}-array states of time step k+1
|
65
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
66
|
+
/// @param states_k: pointer to array states of time step k
|
67
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
68
|
+
/// @param global_params: pointer to array global parameters
|
69
|
+
/// @param res: pointer to (nu+nx+1 x nu+nx)-matrix
|
70
|
+
/// @param k: time step
|
71
|
+
virtual fatrop_int eval_BAbt(
|
72
|
+
const double *states_kp1,
|
73
|
+
const double *inputs_k,
|
74
|
+
const double *states_k,
|
75
|
+
const double *stage_params_k,
|
76
|
+
const double *global_params,
|
77
|
+
MAT *res,
|
78
|
+
const fatrop_int k) = 0;
|
79
|
+
/// @brief stagewise Lagrangian Hessian
|
80
|
+
/// It evaluates is the vertical concatenation of (1) the Hessian of the Lagrangian to the concatenation of (u_k, x_k) (2) the first order derivative of the Lagrangian Hessian to the concatenation of (u_k, x_k).
|
81
|
+
/// The matrix is in column major format.
|
82
|
+
/// @param objective_scale: scale factor for objective function (usually 1.0)
|
83
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
84
|
+
/// @param states_k: pointer to array states of time step k
|
85
|
+
/// @param lam_dyn_k: pointer to array dual variables for dynamics of time step k
|
86
|
+
/// @param lam_eq_k: pointer to array dual variables for equality constraints of time step k
|
87
|
+
/// @param lam_eq_ineq_k: pointer to array dual variables for inequality constraints of time step k
|
88
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
89
|
+
/// @param global_params: pointer to array global parameters
|
90
|
+
/// @param res: pointer to (nu+nx+1 x nu+nx)-matrix.
|
91
|
+
/// @param k
|
92
|
+
/// @return
|
93
|
+
virtual fatrop_int eval_RSQrqt(
|
94
|
+
const double *objective_scale,
|
95
|
+
const double *inputs_k,
|
96
|
+
const double *states_k,
|
97
|
+
const double *lam_dyn_k,
|
98
|
+
const double *lam_eq_k,
|
99
|
+
const double *lam_eq_ineq_k,
|
100
|
+
const double *stage_params_k,
|
101
|
+
const double *global_params,
|
102
|
+
MAT *res,
|
103
|
+
const fatrop_int k) = 0;
|
104
|
+
/// @brief stagewise equality constraints Jacobian.
|
105
|
+
/// It evaluates the vertical concatenation of (1) the Jacobian of the equality constraints to the concatenation of (u_k, x_k) (2) the equality constraints evaluated at u_k, x_k.
|
106
|
+
/// The matrix is in column major format.
|
107
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
108
|
+
/// @param states_k: pointer to array states of time step k
|
109
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
110
|
+
/// @param global_params: pointer to array global parameters
|
111
|
+
/// @param res: pointer to (nu+nx+1 x ng)-matrix.
|
112
|
+
/// @param k: time step
|
113
|
+
/// @return
|
114
|
+
virtual fatrop_int eval_Ggt(
|
115
|
+
const double *inputs_k,
|
116
|
+
const double *states_k,
|
117
|
+
const double *stage_params_k,
|
118
|
+
const double *global_params,
|
119
|
+
MAT *res,
|
120
|
+
const fatrop_int k) = 0;
|
121
|
+
/// @brief stagewise inequality constraints Jacobian.
|
122
|
+
/// It evaluates the vertical concatenation of (1) the Jacobian of the inequality constraints to the concatenation of (u_k, x_k) (2) the inequality constraints evaluated at u_k, x_k.
|
123
|
+
/// The matrix is in column major format.
|
124
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
125
|
+
/// @param states_k: pointer to array states of time step k
|
126
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
127
|
+
/// @param global_params_ko: pointer to array global parameters
|
128
|
+
/// @param res: pointer to (nu+nx+1 x ng_ineq)-matrix, column major format
|
129
|
+
/// @param k : time step
|
130
|
+
/// @return
|
131
|
+
virtual fatrop_int eval_Ggt_ineq(
|
132
|
+
const double *inputs_k,
|
133
|
+
const double *states_k,
|
134
|
+
const double *stage_params_k,
|
135
|
+
const double *global_params,
|
136
|
+
MAT *res,
|
137
|
+
const fatrop_int k) = 0;
|
138
|
+
/// @brief the dynamics constraint violation (b_k = -x_{k+1} + f_k(u_k, x_k, p_k, p))
|
139
|
+
/// @param states_kp1: pointer to array states of time step k+1
|
140
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
141
|
+
/// @param states_k: pointer to array states of time step k
|
142
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
143
|
+
/// @param global_params: pointer to array global parameters
|
144
|
+
/// @param res: pointer to array nx_{k+1}-vector
|
145
|
+
/// @param k: time step
|
146
|
+
/// @return
|
147
|
+
virtual fatrop_int eval_b(
|
148
|
+
const double *states_kp1,
|
149
|
+
const double *inputs_k,
|
150
|
+
const double *states_k,
|
151
|
+
const double *stage_params_k,
|
152
|
+
const double *global_params,
|
153
|
+
double *res,
|
154
|
+
const fatrop_int k) = 0;
|
155
|
+
/// @brief the equality constraint violation (g_k = g_k(u_k, x_k, p_k, p))
|
156
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
157
|
+
/// @param states_k: pointer to array states of time step k
|
158
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
159
|
+
/// @param global_params: pointer to array global parameters
|
160
|
+
/// @param res: pointer to array ng-vector
|
161
|
+
/// @param k: time step
|
162
|
+
virtual fatrop_int eval_g(
|
163
|
+
const double *inputs_k,
|
164
|
+
const double *states_k,
|
165
|
+
const double *stage_params_k,
|
166
|
+
const double *global_params,
|
167
|
+
double *res,
|
168
|
+
const fatrop_int k) = 0;
|
169
|
+
/// @brief the inequality constraint violation (g_ineq_k = g_ineq_k(u_k, x_k, p_k, p))
|
170
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
171
|
+
/// @param states_k: pointer to array states of time step k
|
172
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
173
|
+
/// @param global_params: pointer to array global parameters
|
174
|
+
/// @param res: pointer to array ng_ineq-vector
|
175
|
+
/// @param k: time step
|
176
|
+
virtual fatrop_int eval_gineq(
|
177
|
+
const double *inputs_k,
|
178
|
+
const double *states_k,
|
179
|
+
const double *stage_params_k,
|
180
|
+
const double *global_params,
|
181
|
+
double *res,
|
182
|
+
const fatrop_int k) = 0;
|
183
|
+
/// @brief gradient of the objective function (not the Lagrangian!) to the concatenation of (u_k, x_k)
|
184
|
+
/// @param objective_scale: pointer to objective scale
|
185
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
186
|
+
/// @param states_k: pointer to array states of time step k
|
187
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
188
|
+
/// @param global_params: pointer to array global parameters
|
189
|
+
/// @param res: pointer to (nu+nx)-array
|
190
|
+
/// @param k: time step
|
191
|
+
virtual fatrop_int eval_rq(
|
192
|
+
const double *objective_scale,
|
193
|
+
const double *inputs_k,
|
194
|
+
const double *states_k,
|
195
|
+
const double *stage_params_k,
|
196
|
+
const double *global_params,
|
197
|
+
double *res,
|
198
|
+
const fatrop_int k) = 0;
|
199
|
+
/// @brief objective function value
|
200
|
+
/// @param objective_scale: pointer to array objective scale
|
201
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
202
|
+
/// @param states_k: pointer to array states of time step k
|
203
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
204
|
+
/// @param global_params: pointer to array global parameters
|
205
|
+
/// @param res: pointer to double
|
206
|
+
/// @param k: time step
|
207
|
+
virtual fatrop_int eval_L(
|
208
|
+
const double *objective_scale,
|
209
|
+
const double *inputs_k,
|
210
|
+
const double *states_k,
|
211
|
+
const double *stage_params_k,
|
212
|
+
const double *global_params,
|
213
|
+
double *res,
|
214
|
+
const fatrop_int k) = 0;
|
215
|
+
/// @brief the bounds of the inequalites at stage k
|
216
|
+
/// @param lower: pointer to ng_ineq-vector
|
217
|
+
/// @param upper: pointer to ng_ineq-vector
|
218
|
+
/// @param k: time step
|
219
|
+
virtual fatrop_int get_bounds(double *lower, double *upper, const fatrop_int k) const = 0;
|
220
|
+
/// @brief default initial guess for the states of stage k
|
221
|
+
/// @param xk: pointer to states of time step k
|
222
|
+
/// @param k: time step
|
223
|
+
virtual fatrop_int get_initial_xk(double *xk, const fatrop_int k) const = 0;
|
224
|
+
/// @brief default initial guess for the inputs of stage k
|
225
|
+
/// @param uk: pointer to inputs of time step k
|
226
|
+
/// @param k: time step
|
227
|
+
virtual fatrop_int get_initial_uk(double *uk, const fatrop_int k) const = 0;
|
228
|
+
|
229
|
+
virtual fatrop_int full_eval_lag_hess(double objective_scale,
|
230
|
+
const double* primal_data,
|
231
|
+
const double* lam_data,
|
232
|
+
const double* stageparams_p,
|
233
|
+
const double* globalparams_p, MAT * RSQrqt_p) {
|
234
|
+
return 0;
|
235
|
+
}
|
236
|
+
virtual fatrop_int full_eval_constr_jac(const double* primal_data, const double* stageparams_p, const double* globalparams_p,
|
237
|
+
MAT* BAbt_p, MAT* Ggt_p, MAT* Ggt_ineq_p) {
|
238
|
+
return 0;
|
239
|
+
}
|
240
|
+
virtual fatrop_int full_eval_contr_viol(const double* primal_data, const double* stageparams_p, const double* globalparams_p,
|
241
|
+
double* cv_p) {
|
242
|
+
return 0;
|
243
|
+
}
|
244
|
+
virtual fatrop_int full_eval_obj_grad(double objective_scale, const double* primal_data, const double* stageparams_p, const double* globalparams_p,
|
245
|
+
double* grad_p) {
|
246
|
+
return 0;
|
247
|
+
}
|
248
|
+
virtual fatrop_int full_eval_obj(double objective_scale, const double* primal_data, const double* stageparams_p, const double* globalparams_p,
|
249
|
+
double* res) {
|
250
|
+
return 0;
|
251
|
+
}
|
252
|
+
};
|
253
|
+
}; // namespace fatrop
|
254
|
+
#endif // OCPTEMPLATEINCLUDED
|
@@ -0,0 +1,197 @@
|
|
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 OCPEVALUATORINCLUDED
|
20
|
+
#define OCPEVALUATORINCLUDED
|
21
|
+
#include "OCPKKT.hpp"
|
22
|
+
#include "OCPAbstract.hpp"
|
23
|
+
#include "fatrop/solver/FatropData.hpp"
|
24
|
+
#include "OCP.hpp"
|
25
|
+
#include <memory>
|
26
|
+
#include "fatrop/auxiliary/Common.hpp"
|
27
|
+
#define OCPMACRO(type, name, suffix) type name##suffix = ((type)OCP->name)
|
28
|
+
#define AUXMACRO(type, name, suffix) type name##suffix = ((type)OCP->aux.name)
|
29
|
+
#define SOLVERMACRO(type, name, suffix) type name##suffix = ((type)name)
|
30
|
+
#ifdef ENABLE_MULTITHREADING
|
31
|
+
#include <omp.h>
|
32
|
+
#endif
|
33
|
+
|
34
|
+
// Example: you can make a for loop parallel with the following code. But to be further investigated to do this in an efficient way...
|
35
|
+
// #ifdef ENABLE_MULTITHREADING
|
36
|
+
// #pragma omp parallel for
|
37
|
+
// <your for loop>
|
38
|
+
// #endif
|
39
|
+
|
40
|
+
namespace fatrop
|
41
|
+
{
|
42
|
+
class OCPAdapter : public OCP // public OCP -> also include KKTmemory, OCPDims, ...
|
43
|
+
{
|
44
|
+
public:
|
45
|
+
OCPAdapter(const std::shared_ptr<OCPAbstract> &ocptempl_, const std::shared_ptr<FatropOptions> &options) : K(ocptempl_->get_horizon_length()),
|
46
|
+
nuexpr(TransformRange<fatrop_int>(0, K, [&ocptempl_](fatrop_int k)
|
47
|
+
{ return ocptempl_->get_nu(k); })),
|
48
|
+
nxexpr(TransformRange<fatrop_int>(0, K, [&ocptempl_](fatrop_int k)
|
49
|
+
{ return ocptempl_->get_nx(k); })),
|
50
|
+
ngexpr(TransformRange<fatrop_int>(0, K, [&ocptempl_](fatrop_int k)
|
51
|
+
{ return ocptempl_->get_ng(k); })),
|
52
|
+
ngineqexpr(TransformRange<fatrop_int>(0, K, [&ocptempl_](fatrop_int k)
|
53
|
+
{ return ocptempl_->get_ng_ineq(k); })),
|
54
|
+
nstageparamsexpr(TransformRange<fatrop_int>(0, K, [&ocptempl_](fatrop_int k)
|
55
|
+
{ return ocptempl_->get_n_stage_params(k); })),
|
56
|
+
offs_stageparams(offsets(nstageparamsexpr)), stageparams(sum(nstageparamsexpr), 0.0), globalparams(ocptempl_->get_n_global_params(), 0.0), options(options), ocptempl(ocptempl_)
|
57
|
+
{
|
58
|
+
#ifdef ENABLE_MULTITHREADING
|
59
|
+
// check if environment variable OMP_NUM_THREADS is set
|
60
|
+
if (getenv("OMP_NUM_THREADS") == NULL)
|
61
|
+
{
|
62
|
+
throw std::runtime_error("Environment variable OMP_NUM_THREADS is not set. Please set it to the number of threads you want to use or compile fatrop with multithreading disabled.");
|
63
|
+
}
|
64
|
+
#endif
|
65
|
+
|
66
|
+
// initialize the default parameters
|
67
|
+
ocptempl_->get_default_global_params(globalparams.data());
|
68
|
+
fatrop_int offs = 0;
|
69
|
+
for (fatrop_int k = 0; k < K; k++)
|
70
|
+
{
|
71
|
+
ocptempl_->get_default_stage_params(stageparams.data() + offs, k);
|
72
|
+
offs += ocptempl_->get_n_stage_params(k);
|
73
|
+
}
|
74
|
+
// initialize gradbuf
|
75
|
+
// for (fatrop_int k = 0; k < K; k++)
|
76
|
+
// gradbuf.emplace_back(ocptempl_->get_nuk(k) + ocptempl_->get_nxk(k));
|
77
|
+
x_dummy = std::vector<double>(maxel(nxexpr), 0.0);
|
78
|
+
}
|
79
|
+
void reset() override
|
80
|
+
{
|
81
|
+
}
|
82
|
+
void print_kkt_matrix(OCPKKTMemory *OCP);
|
83
|
+
fatrop_int eval_lag_hess(
|
84
|
+
OCPKKTMemory *OCP,
|
85
|
+
double obj_scale,
|
86
|
+
const FatropVecBF &primal_vars,
|
87
|
+
const FatropVecBF &lam) override;
|
88
|
+
fatrop_int eval_constr_jac(
|
89
|
+
OCPKKTMemory *OCP,
|
90
|
+
const FatropVecBF &primal_vars,
|
91
|
+
const FatropVecBF &slack_vars) override;
|
92
|
+
fatrop_int eval_contr_viol(
|
93
|
+
OCPKKTMemory *OCP,
|
94
|
+
const FatropVecBF &primal_vars,
|
95
|
+
const FatropVecBF &slack_vars,
|
96
|
+
FatropVecBF &constraint_violation) override;
|
97
|
+
fatrop_int eval_ineqs(
|
98
|
+
OCPKKTMemory *OCP,
|
99
|
+
const FatropVecBF &primal_vars,
|
100
|
+
FatropVecBF &constraint_violation) override;
|
101
|
+
fatrop_int eval_obj_grad(
|
102
|
+
OCPKKTMemory *OCP,
|
103
|
+
double obj_scale,
|
104
|
+
const FatropVecBF &primal_vars,
|
105
|
+
FatropVecBF &gradient_x) override;
|
106
|
+
fatrop_int eval_obj(
|
107
|
+
OCPKKTMemory *OCP,
|
108
|
+
double obj_scale,
|
109
|
+
const FatropVecBF &primal_vars,
|
110
|
+
double &res) override;
|
111
|
+
fatrop_int integrate_dynamics(
|
112
|
+
OCPKKTMemory *OCP,
|
113
|
+
const fatrop_int k,
|
114
|
+
const FatropVecBF &uk,
|
115
|
+
const FatropVecBF &xk,
|
116
|
+
FatropVecBF &xkp1) override;
|
117
|
+
OCPDims get_ocp_dims() const override
|
118
|
+
{
|
119
|
+
return OCPDims(ocptempl->get_horizon_length(), nuexpr, nxexpr, ngexpr, ngineqexpr, nstageparamsexpr, ocptempl->get_n_global_params());
|
120
|
+
}
|
121
|
+
|
122
|
+
public:
|
123
|
+
void set_parameters(const std::vector<double> &stage_params_in, const std::vector<double> &global_params_in) override;
|
124
|
+
void set_initial_sol_guess(const std::shared_ptr<FatropData> &fatropdata, std::vector<double> &initial_u, std::vector<double> &initial_x) override;
|
125
|
+
void get_solution(const std::shared_ptr<FatropData> &fatropdata, std::vector<double> &u, std::vector<double> &x) override;
|
126
|
+
double *get_global_parameters()
|
127
|
+
{
|
128
|
+
if (globalparams.size() == 0)
|
129
|
+
return nullptr;
|
130
|
+
return globalparams.data();
|
131
|
+
}
|
132
|
+
double *get_stage_parameters()
|
133
|
+
{
|
134
|
+
if (stageparams.size() == 0)
|
135
|
+
return nullptr;
|
136
|
+
return stageparams.data();
|
137
|
+
}
|
138
|
+
std::vector<double> &get_global_parameters_vec()
|
139
|
+
{
|
140
|
+
return globalparams;
|
141
|
+
}
|
142
|
+
std::vector<double> &get_stage_parameters_vec()
|
143
|
+
{
|
144
|
+
return stageparams;
|
145
|
+
}
|
146
|
+
fatrop_int get_bounds(
|
147
|
+
FatropVecBF &lower,
|
148
|
+
FatropVecBF &upper) const override
|
149
|
+
{
|
150
|
+
fatrop_int offs = 0;
|
151
|
+
double *lower_p = ((VEC *)lower)->pa;
|
152
|
+
double *upper_p = ((VEC *)upper)->pa;
|
153
|
+
for (fatrop_int k = 0; k < K; k++)
|
154
|
+
{
|
155
|
+
ocptempl->get_bounds(lower_p + offs, upper_p + offs, k);
|
156
|
+
offs += ocptempl->get_ng_ineq(k);
|
157
|
+
}
|
158
|
+
return 0;
|
159
|
+
};
|
160
|
+
fatrop_int get_initial_sol_guess(
|
161
|
+
FatropVecBF &initial) const override
|
162
|
+
{
|
163
|
+
fatrop_int offs = 0;
|
164
|
+
for (fatrop_int k = 0; k < K; k++)
|
165
|
+
{
|
166
|
+
ocptempl->get_initial_uk(((VEC *)initial)->pa + offs, k);
|
167
|
+
offs += ocptempl->get_nu(k);
|
168
|
+
ocptempl->get_initial_xk(((VEC *)initial)->pa + offs, k);
|
169
|
+
offs += ocptempl->get_nx(k);
|
170
|
+
}
|
171
|
+
return 0;
|
172
|
+
}
|
173
|
+
// virtual fatrop_int GetDefaultParams(
|
174
|
+
// FatropOptions ¶ms)
|
175
|
+
// {
|
176
|
+
// };
|
177
|
+
|
178
|
+
public:
|
179
|
+
fatrop_int K;
|
180
|
+
FatropVector<fatrop_int> nuexpr;
|
181
|
+
FatropVector<fatrop_int> nxexpr;
|
182
|
+
FatropVector<fatrop_int> ngexpr;
|
183
|
+
FatropVector<fatrop_int> ngineqexpr;
|
184
|
+
FatropVector<fatrop_int> nstageparamsexpr;
|
185
|
+
FatropVector<fatrop_int> offs_stageparams;
|
186
|
+
std::vector<double> stageparams;
|
187
|
+
std::vector<double> globalparams;
|
188
|
+
std::vector<double> x_dummy;
|
189
|
+
// std::vector<VECBF> gradbuf;
|
190
|
+
std::shared_ptr<FatropOptions> options;
|
191
|
+
|
192
|
+
private:
|
193
|
+
std::shared_ptr<OCPAbstract> ocptempl;
|
194
|
+
};
|
195
|
+
} // namespace fatrop
|
196
|
+
|
197
|
+
#endif // OCPEVALUATORINCLUDED
|