casadi 3.6.5__cp37-none-win_amd64.whl → 3.6.7__cp37-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,242 @@
|
|
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 BASICOCPAPPLICATIONINCLUDED
|
20
|
+
#define BASICOCPAPPLICATIONINCLUDED
|
21
|
+
#include "fatrop/solver/FatropStats.hpp"
|
22
|
+
#include "fatrop/solver/FatropAlg.hpp"
|
23
|
+
#include "fatrop/ocp/StageOCPExpressions.hpp"
|
24
|
+
#include <map>
|
25
|
+
#include <fstream>
|
26
|
+
#include <sstream>
|
27
|
+
#include <string>
|
28
|
+
|
29
|
+
namespace fatrop
|
30
|
+
{
|
31
|
+
// forward declarations to hide the implementation details
|
32
|
+
class Journaller;
|
33
|
+
class FatropAlg;
|
34
|
+
class StageOCP;
|
35
|
+
class NLPDims;
|
36
|
+
class FatropVecBF;
|
37
|
+
class FatropNLP;
|
38
|
+
class FatropOptions;
|
39
|
+
class FatropData;
|
40
|
+
class OCPAdapter;
|
41
|
+
class FatropPrinter;
|
42
|
+
class OCPAbstract;
|
43
|
+
class OCPDims;
|
44
|
+
class OCP;
|
45
|
+
class FatropSolution
|
46
|
+
{
|
47
|
+
public:
|
48
|
+
// void GetPrimalSolution(vector<double> &result);
|
49
|
+
// defautl copy constructor
|
50
|
+
FatropSolution(const FatropSolution &other) = default;
|
51
|
+
const std::vector<double> &primal_solution() { return sol_primal_; };
|
52
|
+
|
53
|
+
protected:
|
54
|
+
FatropSolution();
|
55
|
+
void set_dims(const NLPDims &dims);
|
56
|
+
void set_primal_solution(const FatropVecBF &sol);
|
57
|
+
void set_solution(const FatropVecBF &sol_primal, const FatropVecBF &sol_dual, const FatropVecBF &sol_zL, const FatropVecBF &sol_zU);
|
58
|
+
|
59
|
+
protected:
|
60
|
+
std::vector<double> sol_primal_;
|
61
|
+
std::vector<double> sol_dual_;
|
62
|
+
std::vector<double> sol_zL_;
|
63
|
+
std::vector<double> sol_zU_;
|
64
|
+
friend class NLPApplication;
|
65
|
+
};
|
66
|
+
// TODO move this class to a separate file
|
67
|
+
class NLPApplication
|
68
|
+
{
|
69
|
+
public:
|
70
|
+
NLPApplication();
|
71
|
+
|
72
|
+
protected:
|
73
|
+
void build(const std::shared_ptr<FatropNLP> &nlp, const std::shared_ptr<FatropNLP> &nlp_resto);
|
74
|
+
|
75
|
+
public:
|
76
|
+
fatrop_int optimize() const;
|
77
|
+
// TODO: make this protected and use last_solution instead and choose other name
|
78
|
+
const FatropVecBF &last_solution_primal() const;
|
79
|
+
const FatropVecBF &last_solution_dual() const;
|
80
|
+
const FatropVecBF &last_solution_zL() const;
|
81
|
+
const FatropVecBF &last_solution_zU() const;
|
82
|
+
FatropVecBF &initial_guess_primal() const;
|
83
|
+
FatropVecBF &initial_guess_dual() const;
|
84
|
+
FatropVecBF &initial_guess_zL() const;
|
85
|
+
FatropVecBF &initial_guess_zU() const;
|
86
|
+
FatropStats get_stats() const;
|
87
|
+
NLPDims get_nlp_dims();
|
88
|
+
template <typename T>
|
89
|
+
void set_option(const std::string &option_name, T value);
|
90
|
+
|
91
|
+
public:
|
92
|
+
void set_initial(const FatropSolution &initial_guess) const;
|
93
|
+
void set_initial(const std::vector<double> &initial_guess_primal_) const;
|
94
|
+
const FatropOptions &get_options() const;
|
95
|
+
|
96
|
+
protected:
|
97
|
+
std::shared_ptr<FatropOptions> fatropoptions_;
|
98
|
+
std::shared_ptr<FatropData> fatropdata_;
|
99
|
+
std::shared_ptr<FatropNLP> nlp_;
|
100
|
+
bool dirty = true;
|
101
|
+
std::shared_ptr<FatropPrinter> printer_;
|
102
|
+
friend class OcpSolverDriver;
|
103
|
+
|
104
|
+
private:
|
105
|
+
const std::shared_ptr<OCPAbstract> ocp_;
|
106
|
+
std::shared_ptr<Journaller> journaller_;
|
107
|
+
std::shared_ptr<FatropAlg> fatropalg_;
|
108
|
+
};
|
109
|
+
|
110
|
+
class OCPApplication : public NLPApplication
|
111
|
+
{
|
112
|
+
public:
|
113
|
+
OCPApplication(const std::shared_ptr<OCP> &ocp);
|
114
|
+
OCPApplication();
|
115
|
+
void build();
|
116
|
+
public:
|
117
|
+
using NLPApplication::set_initial;
|
118
|
+
void set_initial(std::vector<double> &initial_u, std::vector<double> &initial_x);
|
119
|
+
OCPDims get_ocp_dims();
|
120
|
+
std::shared_ptr<OCP> ocp_;
|
121
|
+
};
|
122
|
+
|
123
|
+
// TODO move this class to a separate file
|
124
|
+
class OCPAbstractApplication : public OCPApplication
|
125
|
+
{
|
126
|
+
public:
|
127
|
+
OCPAbstractApplication(const std::shared_ptr<OCPAbstract> &ocp);
|
128
|
+
void set_params(const std::vector<double> &global_params, const std::vector<double> &stage_params);
|
129
|
+
|
130
|
+
protected:
|
131
|
+
std::shared_ptr<OCPAdapter> adapter;
|
132
|
+
|
133
|
+
protected:
|
134
|
+
std::vector<double> &global_parameters();
|
135
|
+
std::vector<double> &stage_parameters();
|
136
|
+
};
|
137
|
+
|
138
|
+
struct StageOCPSolution : public FatropSolution
|
139
|
+
{
|
140
|
+
public:
|
141
|
+
StageOCPSolution(const std::shared_ptr<OCP> &app);
|
142
|
+
void get_u(std::vector<double> &result) const;
|
143
|
+
void get_x(std::vector<double> &result) const;
|
144
|
+
int get_nx() const
|
145
|
+
{
|
146
|
+
return nx;
|
147
|
+
};
|
148
|
+
int get_nu() const
|
149
|
+
{
|
150
|
+
return nu;
|
151
|
+
};
|
152
|
+
int get_K() const
|
153
|
+
{
|
154
|
+
return K;
|
155
|
+
};
|
156
|
+
|
157
|
+
protected:
|
158
|
+
StageOCPSolution();
|
159
|
+
void set_dims(const OCPDims &dims);
|
160
|
+
void set_parameters(const std::vector<double> &global_params, const std::vector<double> &stage_params);
|
161
|
+
fatrop_int nx;
|
162
|
+
fatrop_int nu;
|
163
|
+
fatrop_int n_stage_params;
|
164
|
+
fatrop_int n_global_params;
|
165
|
+
fatrop_int K;
|
166
|
+
|
167
|
+
public:
|
168
|
+
// todo make this deprecated, only use Eval
|
169
|
+
void sample(const StageControlGridSampler &sampler, std::vector<double> &result) const;
|
170
|
+
std::vector<double> evaluate(const StageExpressionEvaluatorBase &evaluator) const;
|
171
|
+
void evaluate(const StageExpressionEvaluatorBase &evaluator, std::vector<double> &result) const;
|
172
|
+
|
173
|
+
protected:
|
174
|
+
std::vector<double> global_params;
|
175
|
+
std::vector<double> stage_params;
|
176
|
+
friend class StageOCPApplication;
|
177
|
+
};
|
178
|
+
|
179
|
+
// struct StageOCPApplicationAbstract : public OCPApplication
|
180
|
+
// {
|
181
|
+
// StageOCPApplicationAbstract(const shared_ptr<StageOCP> &ocp);
|
182
|
+
// };
|
183
|
+
class StageOCPApplication : public OCPAbstractApplication
|
184
|
+
{
|
185
|
+
public:
|
186
|
+
StageOCPApplication(const std::shared_ptr<StageOCP> &ocp);
|
187
|
+
|
188
|
+
void set_initial_u(const std::vector<double> &initial_guess_u) const;
|
189
|
+
void set_initial_x(const std::vector<double> &initial_guess_x) const;
|
190
|
+
|
191
|
+
public:
|
192
|
+
class AppParameterSetter : public ParameterSetter
|
193
|
+
{
|
194
|
+
public:
|
195
|
+
AppParameterSetter(const std::shared_ptr<OCPAdapter> &adapter, const std::shared_ptr<ParameterSetter> &ps);
|
196
|
+
|
197
|
+
public:
|
198
|
+
void set_value(const double value[]);
|
199
|
+
void set_value(const std::initializer_list<double> il_);
|
200
|
+
void set_value(const std::vector<double> il_)
|
201
|
+
{
|
202
|
+
set_value(il_.data());
|
203
|
+
};
|
204
|
+
|
205
|
+
private:
|
206
|
+
const std::shared_ptr<OCPAdapter> adapter_;
|
207
|
+
};
|
208
|
+
|
209
|
+
public:
|
210
|
+
StageExpressionEvaluatorFactory get_expression(const std::string &sampler_name);
|
211
|
+
StageExpressionEvaluatorFactory get_expression_evaluator(const std::shared_ptr<StageExpression> &expr);
|
212
|
+
AppParameterSetter get_parameter_setter(const std::string &setter_name);
|
213
|
+
void set_value(const std::string &setter_name, const std::vector<double>& value);
|
214
|
+
void build();
|
215
|
+
fatrop_int optimize();
|
216
|
+
const StageOCPSolution &last_solution() const;
|
217
|
+
// const FatropSolution &last_solution() const { return last_solution(); };
|
218
|
+
const std::vector<std::string> parameter_names() const;
|
219
|
+
const std::vector<std::string> stage_expression_names() const;
|
220
|
+
|
221
|
+
public:
|
222
|
+
const fatrop_int nx_;
|
223
|
+
const fatrop_int nu_;
|
224
|
+
const fatrop_int n_stage_params_;
|
225
|
+
const fatrop_int K_;
|
226
|
+
|
227
|
+
private:
|
228
|
+
StageOCPSolution last_solution_;
|
229
|
+
|
230
|
+
protected:
|
231
|
+
std::map<std::string, std::shared_ptr<StageExpression>> stage_expressions;
|
232
|
+
std::map<std::string, std::shared_ptr<ParameterSetter>> param_setters;
|
233
|
+
friend class StageOCPApplicationFactory;
|
234
|
+
};
|
235
|
+
|
236
|
+
class StageOCPApplicationFactory
|
237
|
+
{
|
238
|
+
public:
|
239
|
+
static StageOCPApplication from_rockit_interface(const std::string &functions, const std::string &json_spec_file);
|
240
|
+
};
|
241
|
+
}
|
242
|
+
#endif // BASICOCPAPPLICATIONINCLUDED
|
@@ -0,0 +1,182 @@
|
|
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 BASICOCPSAMPLERSINCLUDED
|
20
|
+
#define BASICOCPSAMPLERSINCLUDED
|
21
|
+
#include <memory>
|
22
|
+
#include <vector>
|
23
|
+
#include <fatrop/auxiliary/Common.hpp>
|
24
|
+
// todo change the name of this file to evaluators
|
25
|
+
namespace fatrop
|
26
|
+
{
|
27
|
+
class EvalBase;
|
28
|
+
class StageExpression
|
29
|
+
{
|
30
|
+
public:
|
31
|
+
virtual void evaluate(const double *u, const double *x, const double *global_params, const double *stage_params, double *res) const = 0;
|
32
|
+
virtual fatrop_int n_rows() const = 0;
|
33
|
+
virtual fatrop_int n_cols() const= 0;
|
34
|
+
fatrop_int size() const;
|
35
|
+
};
|
36
|
+
class IndexEpression : public StageExpression
|
37
|
+
{
|
38
|
+
public:
|
39
|
+
IndexEpression(const bool control, const std::vector<fatrop_int> offsets_in, const std::vector<fatrop_int> offsets_out);
|
40
|
+
void evaluate(const double *u, const double *x, const double *global_params, const double *stage_params, double *res) const override;
|
41
|
+
fatrop_int n_rows() const override;
|
42
|
+
fatrop_int n_cols() const override;
|
43
|
+
|
44
|
+
private:
|
45
|
+
const fatrop_int _no_var;
|
46
|
+
const std::vector<fatrop_int> _offsets_in;
|
47
|
+
const std::vector<fatrop_int> _offsets_out;
|
48
|
+
const bool _control;
|
49
|
+
};
|
50
|
+
class EvalBaseSE : public StageExpression
|
51
|
+
{
|
52
|
+
public:
|
53
|
+
EvalBaseSE(const std::shared_ptr<EvalBase> &evalbase);
|
54
|
+
void evaluate(const double *u, const double *x, const double *global_params, const double *stage_params, double *res) const override;
|
55
|
+
fatrop_int n_rows() const override;
|
56
|
+
fatrop_int n_cols() const override;
|
57
|
+
|
58
|
+
private:
|
59
|
+
std::shared_ptr<EvalBase> evalbase_;
|
60
|
+
const fatrop_int n_rows_;
|
61
|
+
const fatrop_int n_cols_;
|
62
|
+
};
|
63
|
+
class StageExpressionEvaluatorBase
|
64
|
+
{
|
65
|
+
public:
|
66
|
+
virtual fatrop_int size() const = 0;
|
67
|
+
virtual fatrop_int n_rows() const= 0;
|
68
|
+
virtual fatrop_int n_cols() const = 0;
|
69
|
+
virtual fatrop_int evaluate(const std::vector<double> &solution, const std::vector<double> &global_params, const std::vector<double> &stage_params, std::vector<double> &result) const = 0;
|
70
|
+
std::vector<double> evaluate(const std::vector<double> &solution, const std::vector<double> &global_params, const std::vector<double> &stage_params) const
|
71
|
+
{
|
72
|
+
std::vector<double> res(size());
|
73
|
+
evaluate(solution, global_params, stage_params, res);
|
74
|
+
return res;
|
75
|
+
};
|
76
|
+
virtual ~StageExpressionEvaluatorBase() = default;
|
77
|
+
|
78
|
+
protected:
|
79
|
+
// virtual fatrop_int Evaluate()
|
80
|
+
};
|
81
|
+
class StageControlGridSampler : public StageExpressionEvaluatorBase
|
82
|
+
{
|
83
|
+
public:
|
84
|
+
StageControlGridSampler(fatrop_int nu, fatrop_int nx, fatrop_int no_stage_params, fatrop_int K, const std::shared_ptr<StageExpression> &eval);
|
85
|
+
fatrop_int evaluate(const std::vector<double> &solution, const std::vector<double> &global_params, const std::vector<double> &stage_params, std::vector<double> &result) const;
|
86
|
+
fatrop_int size() const;
|
87
|
+
fatrop_int n_rows() const;
|
88
|
+
fatrop_int n_cols() const;
|
89
|
+
fatrop_int K() const;
|
90
|
+
const fatrop_int nu;
|
91
|
+
const fatrop_int nx;
|
92
|
+
const fatrop_int no_stage_params;
|
93
|
+
const fatrop_int K_;
|
94
|
+
|
95
|
+
private:
|
96
|
+
std::shared_ptr<StageExpression> eval_;
|
97
|
+
};
|
98
|
+
|
99
|
+
class OCPTimeStepSampler : public StageExpressionEvaluatorBase
|
100
|
+
{
|
101
|
+
public:
|
102
|
+
OCPTimeStepSampler(fatrop_int nu, fatrop_int nx, fatrop_int no_stage_params, fatrop_int K, fatrop_int k, const std::shared_ptr<StageExpression> &eval) : nu(nu), nx(nx), no_stage_params(no_stage_params), K_(K), k_(k), eval_(eval)
|
103
|
+
{
|
104
|
+
}
|
105
|
+
fatrop_int evaluate(const std::vector<double> &solution, const std::vector<double> &global_params, const std::vector<double> &stage_params, std::vector<double> &result) const
|
106
|
+
{
|
107
|
+
eval_->evaluate(solution.data() + (k_ < K_ - 1 ? k_ * (nu + nx) : (K_ - 2) * (nu + nx)), solution.data() + (k_ < K_ - 1 ? k_ * (nu + nx) + nu : (K_ - 1) * (nu + nx)), global_params.data(), stage_params.data() + k_ * no_stage_params, result.data());
|
108
|
+
return 0;
|
109
|
+
}
|
110
|
+
fatrop_int size() const
|
111
|
+
{
|
112
|
+
return eval_->size();
|
113
|
+
}
|
114
|
+
fatrop_int n_rows() const
|
115
|
+
{
|
116
|
+
return eval_->n_rows();
|
117
|
+
}
|
118
|
+
fatrop_int n_cols() const
|
119
|
+
{
|
120
|
+
return eval_->n_cols();
|
121
|
+
}
|
122
|
+
const fatrop_int nu;
|
123
|
+
const fatrop_int nx;
|
124
|
+
const fatrop_int no_stage_params;
|
125
|
+
const fatrop_int K_;
|
126
|
+
const fatrop_int k_;
|
127
|
+
|
128
|
+
private:
|
129
|
+
std::shared_ptr<StageExpression> eval_;
|
130
|
+
};
|
131
|
+
class StageExpressionEvaluatorFactory
|
132
|
+
{
|
133
|
+
public:
|
134
|
+
StageExpressionEvaluatorFactory(const std::shared_ptr<StageExpression> &eval, fatrop_int nu, fatrop_int nx, fatrop_int no_stage_params, fatrop_int K) : nu(nu), nx(nx), no_stage_params(no_stage_params), K(K), eval_(eval){};
|
135
|
+
// at_t0()
|
136
|
+
OCPTimeStepSampler at_t0() const
|
137
|
+
{
|
138
|
+
return OCPTimeStepSampler(nu, nx, no_stage_params, K, 0, eval_);
|
139
|
+
}
|
140
|
+
// at_tf()
|
141
|
+
OCPTimeStepSampler at_tf() const
|
142
|
+
{
|
143
|
+
return OCPTimeStepSampler(nu, nx, no_stage_params, K, K - 1, eval_);
|
144
|
+
}
|
145
|
+
// at_tk(fatrop_int k)
|
146
|
+
OCPTimeStepSampler at_tk(const fatrop_int k) const
|
147
|
+
{
|
148
|
+
return OCPTimeStepSampler(nu, nx, no_stage_params, K, k, eval_);
|
149
|
+
}
|
150
|
+
// evaluate at control grid
|
151
|
+
StageControlGridSampler at_control() const
|
152
|
+
{
|
153
|
+
return StageControlGridSampler(nu, nx, no_stage_params, K, eval_);
|
154
|
+
}
|
155
|
+
const fatrop_int nu;
|
156
|
+
const fatrop_int nx;
|
157
|
+
const fatrop_int no_stage_params;
|
158
|
+
const fatrop_int K;
|
159
|
+
std::shared_ptr<StageExpression> eval_;
|
160
|
+
};
|
161
|
+
|
162
|
+
class ParameterSetter
|
163
|
+
{
|
164
|
+
public:
|
165
|
+
ParameterSetter(const std::vector<fatrop_int> &offsets_in, const std::vector<fatrop_int> &offsets_out, const fatrop_int no_stage_params, const fatrop_int no_var, const fatrop_int K, const bool global);
|
166
|
+
void set_value(std::vector<double> &global_params, std::vector<double> &stage_params, const double value[]);
|
167
|
+
void set_value(std::vector<double> &global_params, std::vector<double> &stage_params, const std::initializer_list<double> il_);
|
168
|
+
|
169
|
+
private:
|
170
|
+
const std::vector<fatrop_int> _offsets_in;
|
171
|
+
const std::vector<fatrop_int> _offsets_out;
|
172
|
+
const fatrop_int no_stage_params;
|
173
|
+
|
174
|
+
protected:
|
175
|
+
const fatrop_int _no_var;
|
176
|
+
const fatrop_int K;
|
177
|
+
const bool _global;
|
178
|
+
};
|
179
|
+
|
180
|
+
} // namespace fatrop
|
181
|
+
|
182
|
+
#endif // BASICOCPSAMPLERSINCLUDED
|
@@ -0,0 +1,168 @@
|
|
1
|
+
#pragma once
|
2
|
+
extern "C"
|
3
|
+
{
|
4
|
+
#include <blasfeo.h>
|
5
|
+
}
|
6
|
+
#define MAT blasfeo_dmat
|
7
|
+
namespace fatrop
|
8
|
+
{
|
9
|
+
class UStageEvalAbstract
|
10
|
+
{
|
11
|
+
public:
|
12
|
+
/// @brief number of states for time step k
|
13
|
+
/// @param k: time step
|
14
|
+
virtual int get_nx() const = 0;
|
15
|
+
/// @brief number of inputs for time step k
|
16
|
+
/// @param k: time step
|
17
|
+
virtual int get_nu() const = 0;
|
18
|
+
/// @brief number of equality constraints for time step k
|
19
|
+
/// @param k: time step
|
20
|
+
virtual int get_ng() const = 0;
|
21
|
+
/// @brief number of stage parameters for time step k
|
22
|
+
/// @param k: time step
|
23
|
+
virtual int get_n_stage_params() const = 0;
|
24
|
+
/// @brief default global parameters
|
25
|
+
/// @param global_params: pointer to array of size n_global_params
|
26
|
+
virtual int get_ng_ineq() const = 0;
|
27
|
+
/// @brief discretized dynamics
|
28
|
+
/// 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.
|
29
|
+
/// The matrix is in column major format.
|
30
|
+
/// @param states_kp1: pointer to nx_{k+1}-array states of time step k+1
|
31
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
32
|
+
/// @param states_k: pointer to array states of time step k
|
33
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
34
|
+
/// @param global_params: pointer to array global parameters
|
35
|
+
/// @param res: pointer to (nu+nx+1 x nu+nx)-matrix
|
36
|
+
virtual int eval_BAbt(
|
37
|
+
const double *states_kp1,
|
38
|
+
const double *inputs_k,
|
39
|
+
const double *states_k,
|
40
|
+
const double *stage_params_k,
|
41
|
+
const double *global_params,
|
42
|
+
MAT *res) = 0;
|
43
|
+
/// The matrix is in column major format.
|
44
|
+
/// @param objective_scale: scale factor for objective function (usually 1.0)
|
45
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
46
|
+
/// @param states_k: pointer to array states of time step k
|
47
|
+
/// @param lam_dyn_k: pointer to array dual variables for dynamics of time step k
|
48
|
+
/// @param lam_eq_k: pointer to array dual variables for equality constraints of time step k
|
49
|
+
/// @param lam_eq_ineq_k: pointer to array dual variables for inequality constraints of time step k
|
50
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
51
|
+
/// @param global_params: pointer to array global parameters
|
52
|
+
/// @param res: pointer to (nu+nx+1 x nu+nx)-matrix.
|
53
|
+
/// @param k
|
54
|
+
/// @return
|
55
|
+
virtual int eval_RSQrqt(
|
56
|
+
const double *objective_scale,
|
57
|
+
const double *inputs_k,
|
58
|
+
const double *states_k,
|
59
|
+
const double *lam_dyn_k,
|
60
|
+
const double *lam_eq_k,
|
61
|
+
const double *lam_eq_ineq_k,
|
62
|
+
const double *stage_params_k,
|
63
|
+
const double *global_params,
|
64
|
+
MAT *res) = 0;
|
65
|
+
/// @brief stagewise equality constraints Jacobian.
|
66
|
+
/// 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.
|
67
|
+
/// The matrix is in column major format.
|
68
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
69
|
+
/// @param states_k: pointer to array states of time step k
|
70
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
71
|
+
/// @param global_params: pointer to array global parameters
|
72
|
+
/// @param res: pointer to (nu+nx+1 x ng)-matrix.
|
73
|
+
/// @return
|
74
|
+
virtual int eval_Ggt(
|
75
|
+
const double *inputs_k,
|
76
|
+
const double *states_k,
|
77
|
+
const double *stage_params_k,
|
78
|
+
const double *global_params,
|
79
|
+
MAT *res) = 0;
|
80
|
+
/// @brief stagewise inequality constraints Jacobian.
|
81
|
+
/// 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.
|
82
|
+
/// The matrix is in column major format.
|
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 stage_params_k: pointer to array stage parameters of time step k
|
86
|
+
/// @param global_params_ko: pointer to array global parameters
|
87
|
+
/// @param res: pointer to (nu+nx+1 x ng_ineq)-matrix, column major format
|
88
|
+
virtual int eval_Ggt_ineq(
|
89
|
+
const double *inputs_k,
|
90
|
+
const double *states_k,
|
91
|
+
const double *stage_params_k,
|
92
|
+
const double *global_params,
|
93
|
+
MAT *res) = 0;
|
94
|
+
/// @brief the dynamics constraint violation (b_k = -x_{k+1} + f_k(u_k, x_k, p_k, p))
|
95
|
+
/// @param states_kp1: pointer to array states of time step k+1
|
96
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
97
|
+
/// @param states_k: pointer to array states of time step k
|
98
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
99
|
+
/// @param global_params: pointer to array global parameters
|
100
|
+
/// @param res: pointer to array nx_{k+1}-vector
|
101
|
+
/// @return
|
102
|
+
virtual int eval_b(
|
103
|
+
const double *states_kp1,
|
104
|
+
const double *inputs_k,
|
105
|
+
const double *states_k,
|
106
|
+
const double *stage_params_k,
|
107
|
+
const double *global_params,
|
108
|
+
double *res) = 0;
|
109
|
+
/// @brief the equality constraint violation (g_k = g_k(u_k, x_k, p_k, p))
|
110
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
111
|
+
/// @param states_k: pointer to array states of time step k
|
112
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
113
|
+
/// @param global_params: pointer to array global parameters
|
114
|
+
/// @param res: pointer to array ng-vector
|
115
|
+
virtual int eval_g(
|
116
|
+
const double *inputs_k,
|
117
|
+
const double *states_k,
|
118
|
+
const double *stage_params_k,
|
119
|
+
const double *global_params,
|
120
|
+
double *res) = 0;
|
121
|
+
/// @brief the inequality constraint violation (g_ineq_k = g_ineq_k(u_k, x_k, p_k, p))
|
122
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
123
|
+
/// @param states_k: pointer to array states of time step k
|
124
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
125
|
+
/// @param global_params: pointer to array global parameters
|
126
|
+
/// @param res: pointer to array ng_ineq-vector
|
127
|
+
virtual int eval_gineq(
|
128
|
+
const double *inputs_k,
|
129
|
+
const double *states_k,
|
130
|
+
const double *stage_params_k,
|
131
|
+
const double *global_params,
|
132
|
+
double *res) = 0;
|
133
|
+
/// @brief gradient of the objective function (not the Lagrangian!) to the concatenation of (u_k, x_k)
|
134
|
+
/// @param objective_scale: pointer to objective scale
|
135
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
136
|
+
/// @param states_k: pointer to array states of time step k
|
137
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
138
|
+
/// @param global_params: pointer to array global parameters
|
139
|
+
/// @param res: pointer to (nu+nx)-array
|
140
|
+
virtual int eval_rq(
|
141
|
+
const double *objective_scale,
|
142
|
+
const double *inputs_k,
|
143
|
+
const double *states_k,
|
144
|
+
const double *stage_params_k,
|
145
|
+
const double *global_params,
|
146
|
+
double *res) = 0;
|
147
|
+
/// @brief objective function value
|
148
|
+
/// @param objective_scale: pointer to array objective scale
|
149
|
+
/// @param inputs_k: pointer to array inputs of time step k
|
150
|
+
/// @param states_k: pointer to array states of time step k
|
151
|
+
/// @param stage_params_k: pointer to array stage parameters of time step k
|
152
|
+
/// @param global_params: pointer to array global parameters
|
153
|
+
/// @param res: pointer to double
|
154
|
+
virtual int eval_L(
|
155
|
+
const double *objective_scale,
|
156
|
+
const double *inputs_k,
|
157
|
+
const double *states_k,
|
158
|
+
const double *stage_params_k,
|
159
|
+
const double *global_params,
|
160
|
+
double *res) = 0;
|
161
|
+
/// @brief the bounds of the inequalites at stage k
|
162
|
+
/// @param lower: pointer to ng_ineq-vector
|
163
|
+
/// @param upper: pointer to ng_ineq-vector
|
164
|
+
virtual int get_bounds(double *lower, double *upper) const = 0;
|
165
|
+
/// @brief default initial guess for the states of stage k
|
166
|
+
/// @param xk: pointer to states of time step k
|
167
|
+
};
|
168
|
+
}
|