casadi 3.6.5__cp27-none-win_amd64.whl → 3.6.7__cp27-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 +737 -306
- 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,87 @@
|
|
1
|
+
#pragma once
|
2
|
+
#include <vector>
|
3
|
+
#include <memory>
|
4
|
+
#ifndef casadi_real_capi
|
5
|
+
#define casadi_real_capi double
|
6
|
+
#endif
|
7
|
+
|
8
|
+
#ifndef casadi_int_capi
|
9
|
+
#define casadi_int_capi long long int
|
10
|
+
#endif
|
11
|
+
// c++ stuff here
|
12
|
+
// TODO: this can become part of the default fatrop API as well. It has no dependency on casadi.
|
13
|
+
// forward declaration of OCPApplication
|
14
|
+
namespace fatrop
|
15
|
+
{
|
16
|
+
class OCPAbstractApplication;
|
17
|
+
namespace spectool
|
18
|
+
{
|
19
|
+
|
20
|
+
struct C_api_userdata
|
21
|
+
{
|
22
|
+
// constructor
|
23
|
+
C_api_userdata(const std::shared_ptr<fatrop::OCPAbstractApplication> &app);
|
24
|
+
const std::shared_ptr<fatrop::OCPAbstractApplication> app_;
|
25
|
+
std::vector<std::vector<casadi_int_capi>> sparsity_in;
|
26
|
+
std::vector<std::vector<casadi_int_capi>> sparsity_out;
|
27
|
+
std::vector<double> arg_initial_vars;
|
28
|
+
std::vector<double> arg_stage_parameters;
|
29
|
+
std::vector<double> arg_global_parameters;
|
30
|
+
int n_vars;
|
31
|
+
int n_stage_params;
|
32
|
+
int n_global_params;
|
33
|
+
int ref_count = 0;
|
34
|
+
};
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
#ifdef __cplusplus
|
39
|
+
extern "C"
|
40
|
+
{
|
41
|
+
#endif
|
42
|
+
|
43
|
+
/* How to prefix internal symbols */
|
44
|
+
#ifdef CASADI_CODEGEN_PREFIX
|
45
|
+
#define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID)
|
46
|
+
#define _CASADI_NAMESPACE_CONCAT(NS, ID) NS##ID
|
47
|
+
#define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID)
|
48
|
+
#else
|
49
|
+
#undef CASADI_PREFIX
|
50
|
+
#define CASADI_PREFIX(ID) f_##ID
|
51
|
+
#endif
|
52
|
+
|
53
|
+
/* Symbol visibility in DLLs */
|
54
|
+
#ifndef CASADI_SYMBOL_EXPORT
|
55
|
+
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
56
|
+
#if defined(STATIC_LINKED)
|
57
|
+
#define CASADI_SYMBOL_EXPORT
|
58
|
+
#else
|
59
|
+
#define CASADI_SYMBOL_EXPORT __declspec(dllexport)
|
60
|
+
#endif
|
61
|
+
#elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
|
62
|
+
#define CASADI_SYMBOL_EXPORT __attribute__((visibility("default")))
|
63
|
+
#else
|
64
|
+
#define CASADI_SYMBOL_EXPORT
|
65
|
+
#endif
|
66
|
+
#endif
|
67
|
+
|
68
|
+
CASADI_SYMBOL_EXPORT int fatrop_func(const casadi_real_capi **arg, casadi_real_capi **res, casadi_int_capi *iw, casadi_real_capi *w, int mem, void *user_data);
|
69
|
+
CASADI_SYMBOL_EXPORT int fatrop_func_alloc_mem(void *user_data);
|
70
|
+
CASADI_SYMBOL_EXPORT int fatrop_func_init_mem(int mem, void *user_data);
|
71
|
+
CASADI_SYMBOL_EXPORT void fatrop_func_free_mem(int mem, void *user_data);
|
72
|
+
CASADI_SYMBOL_EXPORT int fatrop_func_checkout(void *user_data);
|
73
|
+
CASADI_SYMBOL_EXPORT void fatrop_func_release(int mem, void *user_data);
|
74
|
+
CASADI_SYMBOL_EXPORT void fatrop_func_incref(void *user_data);
|
75
|
+
CASADI_SYMBOL_EXPORT void fatrop_func_decref(void *user_data);
|
76
|
+
CASADI_SYMBOL_EXPORT casadi_int_capi fatrop_func_n_in(void *user_data);
|
77
|
+
CASADI_SYMBOL_EXPORT casadi_int_capi fatrop_func_n_out(void *user_data);
|
78
|
+
CASADI_SYMBOL_EXPORT casadi_real_capi fatrop_func_default_in(casadi_int_capi i, void *user_data);
|
79
|
+
CASADI_SYMBOL_EXPORT const char *fatrop_func_name_in(casadi_int_capi i, void *user_data);
|
80
|
+
CASADI_SYMBOL_EXPORT const char *fatrop_func_name_out(casadi_int_capi i, void *user_data);
|
81
|
+
CASADI_SYMBOL_EXPORT const casadi_int_capi *fatrop_func_sparsity_in(casadi_int_capi i, void *user_data);
|
82
|
+
CASADI_SYMBOL_EXPORT const casadi_int_capi *fatrop_func_sparsity_out(casadi_int_capi i, void *user_data);
|
83
|
+
CASADI_SYMBOL_EXPORT int fatrop_func_work(casadi_int_capi *sz_arg, casadi_int_capi *sz_res, casadi_int_capi *sz_iw, casadi_int_capi *sz_w, void *user_data);
|
84
|
+
|
85
|
+
#ifdef __cplusplus
|
86
|
+
} /* extern "C" */
|
87
|
+
#endif
|
@@ -0,0 +1,38 @@
|
|
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 DUINFEVALINCLUDED
|
20
|
+
#define DUINFEVALINCLUDED
|
21
|
+
#include "fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp"
|
22
|
+
#include "OCPKKT.hpp"
|
23
|
+
#include "fatrop/auxiliary/Common.hpp"
|
24
|
+
namespace fatrop
|
25
|
+
{
|
26
|
+
#define OCPMACRO(type, name, suffix) type name##suffix = ((type)OCP->name)
|
27
|
+
class DuInfEvaluator
|
28
|
+
{
|
29
|
+
public:
|
30
|
+
fatrop_int evaluate(
|
31
|
+
OCPKKTMemory *OCP,
|
32
|
+
double obj_scale,
|
33
|
+
const FatropVecBF &lam,
|
34
|
+
const FatropVecBF &grad,
|
35
|
+
FatropVecBF &du_inf);
|
36
|
+
};
|
37
|
+
}
|
38
|
+
#endif // DUINFEVALINCLUDED
|
@@ -0,0 +1,161 @@
|
|
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 OCPALGINCLUDED
|
20
|
+
#define OCPALGINCLUDED
|
21
|
+
#include "fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp"
|
22
|
+
#include "fatrop/templates/NLPAlg.hpp"
|
23
|
+
#include "OCPKKT.hpp"
|
24
|
+
#include "OCPLinearSolver.hpp"
|
25
|
+
#include "OCPScalingMethod.hpp"
|
26
|
+
#include "DuInfEvaluator.hpp"
|
27
|
+
#include "OCPInitializer.hpp"
|
28
|
+
#include "fatrop/solver/FatropPrinter.hpp"
|
29
|
+
// #include "fatrop/ocp/LineSearchDDP.hpp"
|
30
|
+
// #include "sparse/SparseOCP.hpp"
|
31
|
+
#include "OCP.hpp"
|
32
|
+
#include <memory>
|
33
|
+
#include "fatrop/auxiliary/Common.hpp"
|
34
|
+
#include "OCPLSScaler.hpp"
|
35
|
+
// #include <unistd.h>
|
36
|
+
namespace fatrop
|
37
|
+
{
|
38
|
+
class FatropOCP : public FatropNLP
|
39
|
+
{
|
40
|
+
public:
|
41
|
+
// FatropOCP();
|
42
|
+
FatropOCP(
|
43
|
+
const std::shared_ptr<OCP> &ocp,
|
44
|
+
const std::shared_ptr<OCPLinearSolver> &ls,
|
45
|
+
const std::shared_ptr<OCPScalingMethod> &scaler, const std::shared_ptr<FatropOptions> &options, const std::shared_ptr<FatropPrinter> &printer);
|
46
|
+
fatrop_int eval_lag_hess(
|
47
|
+
double obj_scale,
|
48
|
+
const FatropVecBF &primal_vars,
|
49
|
+
const FatropVecBF &slack_vars,
|
50
|
+
const FatropVecBF &lam) override;
|
51
|
+
fatrop_int eval_constr_jac(
|
52
|
+
const FatropVecBF &primal_vars,
|
53
|
+
const FatropVecBF &slack_vars) override;
|
54
|
+
fatrop_int solve_pd_sys(
|
55
|
+
const double inertia_correction_w,
|
56
|
+
const double inertia_correction_c,
|
57
|
+
const FatropVecBF &ux,
|
58
|
+
const FatropVecBF &lam,
|
59
|
+
const FatropVecBF &delta_s,
|
60
|
+
const FatropVecBF &sigma_total,
|
61
|
+
const FatropVecBF &gradb_total) override;
|
62
|
+
fatrop_int solve_soc_rhs(
|
63
|
+
const FatropVecBF &ux,
|
64
|
+
const FatropVecBF &lam,
|
65
|
+
const FatropVecBF &delta_s,
|
66
|
+
const FatropVecBF &constraint_violation) override;
|
67
|
+
fatrop_int compute_scalings(
|
68
|
+
double &obj_scale,
|
69
|
+
FatropVecBF &x_scales,
|
70
|
+
FatropVecBF &lam_scales,
|
71
|
+
const FatropVecBF &grad_curr_x, const FatropVecBF& grad_curr_s) override;
|
72
|
+
fatrop_int eval_constraint_viol(
|
73
|
+
const FatropVecBF &primal_vars,
|
74
|
+
const FatropVecBF &slack_vars,
|
75
|
+
FatropVecBF &constraint_violation) override;
|
76
|
+
fatrop_int eval_obj_grad(
|
77
|
+
double obj_scale,
|
78
|
+
const FatropVecBF &primal_vars,
|
79
|
+
const FatropVecBF &slack_vars,
|
80
|
+
FatropVecBF &gradient_x,FatropVecBF &gradient_s) override;
|
81
|
+
fatrop_int eval_obj(
|
82
|
+
double obj_scale,
|
83
|
+
const FatropVecBF &primal_vars,
|
84
|
+
const FatropVecBF &slack_vars,
|
85
|
+
double &res) override;
|
86
|
+
fatrop_int eval_dual_inf(
|
87
|
+
double obj_scale,
|
88
|
+
const FatropVecBF &lam,
|
89
|
+
const FatropVecBF &grad_x,
|
90
|
+
const FatropVecBF &grad_s,
|
91
|
+
FatropVecBF &du_inf_x, FatropVecBF& du_inf_s) override;
|
92
|
+
fatrop_int initialize_slacks(double mu0,
|
93
|
+
FatropVecBF &s_curr) override;
|
94
|
+
fatrop_int initialize_dual(
|
95
|
+
const FatropVecBF &grad_x,
|
96
|
+
const FatropVecBF &grad_s,
|
97
|
+
FatropVecBF &dlam,
|
98
|
+
const FatropVecBF &zL,
|
99
|
+
const FatropVecBF &zU) override;
|
100
|
+
|
101
|
+
fatrop_int get_bounds(
|
102
|
+
FatropVecBF &lower,
|
103
|
+
FatropVecBF &upper) const override
|
104
|
+
{
|
105
|
+
return ocp_->get_bounds(lower, upper);
|
106
|
+
};
|
107
|
+
fatrop_int get_initial_sol_guess(
|
108
|
+
FatropVecBF &initial) const override
|
109
|
+
{
|
110
|
+
return ocp_->get_initial_sol_guess(initial);
|
111
|
+
};
|
112
|
+
// int GetDefaultParams(
|
113
|
+
// FatropOptions ¶ms) const override
|
114
|
+
// {
|
115
|
+
// return ocp_->GetDefaultParams(params);
|
116
|
+
// };
|
117
|
+
NLPDims get_nlp_dims() const override;
|
118
|
+
void finalize() override;
|
119
|
+
void reset() override;
|
120
|
+
|
121
|
+
public:
|
122
|
+
std::shared_ptr<OCP> ocp_;
|
123
|
+
OCPDims dims_;
|
124
|
+
NLPDims nlpdims_;
|
125
|
+
std::shared_ptr<OCPLinearSolver> ls_;
|
126
|
+
std::shared_ptr<OCPScalingMethod> scaler_;
|
127
|
+
std::shared_ptr<FatropOptions> options_;
|
128
|
+
std::shared_ptr<FatropPrinter> printer_;
|
129
|
+
DuInfEvaluator duinfevaluator_;
|
130
|
+
OCPKKTMemory ocpkktmemory_;
|
131
|
+
OCPInitializer OCPInitializer_;
|
132
|
+
FatropMemoryVecBF s_memvec;
|
133
|
+
FatropMemoryVecBF ux_memvec;
|
134
|
+
FatropVecBF sigma;
|
135
|
+
FatropVecBF gradb;
|
136
|
+
FatropVecBF s_dummy;
|
137
|
+
FatropVecBF s_zero;
|
138
|
+
FatropVecBF ux_dummy;
|
139
|
+
FatropMemoryVecBF rhs_rq;
|
140
|
+
FatropMemoryVecBF rhs_b;
|
141
|
+
FatropMemoryVecBF rhs_g;
|
142
|
+
FatropMemoryVecBF rhs_g_ineq;
|
143
|
+
FatropMemoryVecBF rhs_gradb;
|
144
|
+
FatropMemoryVecBF rhs_rq2;
|
145
|
+
FatropMemoryVecBF rhs_b2;
|
146
|
+
FatropMemoryVecBF rhs_g2;
|
147
|
+
FatropMemoryVecBF rhs_g_ineq2;
|
148
|
+
FatropMemoryVecBF rhs_gradb2;
|
149
|
+
FatropMemoryVecBF gradb_total_cache;
|
150
|
+
FatropMemoryVecBF sigma_total_cache;
|
151
|
+
FatropMemoryVecBF ux_test;
|
152
|
+
FatropMemoryVecBF lam_test;
|
153
|
+
FatropMemoryVecBF delta_s_test;
|
154
|
+
double inertia_correction_w_cache;
|
155
|
+
double inertia_correction_c_cache;
|
156
|
+
bool it_ref;
|
157
|
+
bool ls_scaling;
|
158
|
+
OCPLSScaler lsscaler_;
|
159
|
+
};
|
160
|
+
} // namespace fatrop
|
161
|
+
#endif // OCPALGINCLUDED
|
@@ -0,0 +1,52 @@
|
|
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 FATROPOCPBUILDERINCLUDED
|
20
|
+
#define FATROPOCPBUILDERINCLUDED
|
21
|
+
#include "fatrop/ocp/OCP.hpp"
|
22
|
+
#include "fatrop/ocp/FatropOCP.hpp"
|
23
|
+
#include "fatrop/ocp/OCPAbstract.hpp"
|
24
|
+
#include "fatrop/ocp/OCPAdapter.hpp"
|
25
|
+
#include "fatrop/ocp/OCPLSRiccati.hpp"
|
26
|
+
#include "fatrop/ocp/OCPNoScaling.hpp"
|
27
|
+
namespace fatrop
|
28
|
+
{
|
29
|
+
class FatropOCPBuilder
|
30
|
+
{
|
31
|
+
public:
|
32
|
+
FatropOCPBuilder(const std::shared_ptr<OCP> &ocp, const std::shared_ptr<FatropOptions> &fatropparams, const std::shared_ptr<FatropPrinter> &printer) : ocp_(ocp), fatropoptions_(fatropparams), fatropprinter_(printer)
|
33
|
+
{
|
34
|
+
}
|
35
|
+
std::shared_ptr<FatropOCP> build()
|
36
|
+
{
|
37
|
+
return build(ocp_);
|
38
|
+
}
|
39
|
+
|
40
|
+
std::shared_ptr<FatropOCP> build(const std::shared_ptr<OCP> &ocp)
|
41
|
+
{
|
42
|
+
return std::make_shared<FatropOCP>(ocp, std::make_shared<OCPLSRiccati>(ocp->get_ocp_dims(), fatropoptions_, fatropprinter_), std::make_shared<OCPNoScaling>(fatropoptions_), fatropoptions_, fatropprinter_);
|
43
|
+
}
|
44
|
+
|
45
|
+
private:
|
46
|
+
const std::shared_ptr<OCP> ocp_;
|
47
|
+
const std::shared_ptr<FatropOptions> fatropoptions_;
|
48
|
+
const std::shared_ptr<FatropPrinter> fatropprinter_;
|
49
|
+
};
|
50
|
+
}
|
51
|
+
|
52
|
+
#endif // !OCPALGBUILDERINCLUDED
|
@@ -0,0 +1,299 @@
|
|
1
|
+
#pragma once
|
2
|
+
#include "FatropOCP.hpp"
|
3
|
+
#include "fatrop/solver/FatropOptions.hpp"
|
4
|
+
#include <memory>
|
5
|
+
namespace fatrop
|
6
|
+
{
|
7
|
+
class FatropOCPResto : public FatropNLP
|
8
|
+
{
|
9
|
+
public:
|
10
|
+
FatropOCPResto(const std::shared_ptr<FatropOCP> &orig, const std::shared_ptr<FatropOptions> &opts) : orig_(orig), orig_dims_(orig->get_nlp_dims()), lower_(orig_dims_.nineqs), upper_(orig_dims_.nineqs), x_start_(orig_dims_.nvars), s_start_(orig_dims_.nineqs), x_tmp_(orig_dims_.nvars), s_tmp_(orig_dims_.nineqs), upper_bounded_(orig_dims_.nineqs), lower_bounded_(orig_dims_.nineqs), slack_dummy_(orig_dims_.nineqs), sigma_dummy_(orig_dims_.nineqs), gradb_dummy_(orig_dims_.nineqs), zl_dummy_(orig_dims_.nineqs), zu_dummy_(orig_dims_.nineqs), sigma_cache_(orig_dims_.nineqs * 3), gradb_cache_(orig_dims_.nineqs * 3)
|
11
|
+
{
|
12
|
+
opts->register_option(DoubleOption::lower_bounded("resto_rho", "Resto L1 penalty parameter", &rho, 1000., 0.0));
|
13
|
+
opts->register_option(DoubleOption::lower_bounded("resto_xi", "Resto xi parameter", &xi, 1., 0.0));
|
14
|
+
auto lower_v = lower_[0];
|
15
|
+
auto upper_v = upper_[0];
|
16
|
+
orig_->get_bounds(lower_v, upper_v);
|
17
|
+
n_p = orig_dims_.nineqs;
|
18
|
+
n_n = orig_dims_.nineqs;
|
19
|
+
for (fatrop_int i = 0; i < orig_dims_.nineqs; ++i)
|
20
|
+
{
|
21
|
+
bool lower_bounded = !std::isinf(lower_v.at(i));
|
22
|
+
bool upper_bounded = !std::isinf(upper_v.at(i));
|
23
|
+
upper_bounded_[i] = upper_bounded;
|
24
|
+
lower_bounded_[i] = lower_bounded;
|
25
|
+
}
|
26
|
+
this_dims_.nvars = orig_dims_.nvars;
|
27
|
+
this_dims_.nineqs = orig_dims_.nineqs + n_n + n_p;
|
28
|
+
this_dims_.neqs = orig_dims_.neqs;
|
29
|
+
}
|
30
|
+
virtual void pre_solve(const FatropVecBF &x_init, const FatropVecBF &s_init) override
|
31
|
+
{
|
32
|
+
x_start_[0].copy(x_init);
|
33
|
+
s_start_[0].copy(s_init.block(0, orig_dims_.nineqs));
|
34
|
+
};
|
35
|
+
virtual fatrop_int eval_lag_hess(
|
36
|
+
double obj_scale,
|
37
|
+
const FatropVecBF &primal_vars,
|
38
|
+
const FatropVecBF &slack_vars,
|
39
|
+
const FatropVecBF &lam) override
|
40
|
+
{
|
41
|
+
FatropVecBF slack_dummy_v = slack_dummy_[0];
|
42
|
+
update_slack_vars(slack_vars, slack_dummy_v);
|
43
|
+
orig_->eval_lag_hess(0.0, primal_vars, slack_dummy_v, lam);
|
44
|
+
// compute delta's
|
45
|
+
axpby(xi, primal_vars, -xi, x_start_[0], x_tmp_[0]);
|
46
|
+
axpby(xi, slack_vars.block(0, orig_dims_.nineqs), -xi, s_start_[0], s_tmp_[0]);
|
47
|
+
// iterate over all RSQrq's
|
48
|
+
|
49
|
+
{
|
50
|
+
OCPKKTMemory* OCP =&this->orig_->ocpkktmemory_;
|
51
|
+
// horizon length
|
52
|
+
fatrop_int K = OCP->K;
|
53
|
+
// offsets
|
54
|
+
const fatrop_int *offs_ux = (const fatrop_int *)OCP->aux.ux_offs.data();
|
55
|
+
OCPMACRO(MAT *, RSQrqt, _p);
|
56
|
+
VEC* x_tmp_p = (VEC*) x_tmp_[0];
|
57
|
+
OCPMACRO(fatrop_int *, nu, _p);
|
58
|
+
OCPMACRO(fatrop_int *, nx, _p);
|
59
|
+
for (fatrop_int k = 0; k < K; k++)
|
60
|
+
{
|
61
|
+
fatrop_int nu_k = nu_p[k];
|
62
|
+
fatrop_int nx_k = nx_p[k];
|
63
|
+
fatrop_int offs_ux_k = offs_ux[k];
|
64
|
+
// add xi to RSQrq diagonal
|
65
|
+
DIARE(nx_k + nu_k, xi, RSQrqt_p + k, 0, 0);
|
66
|
+
// add gradient to rq
|
67
|
+
ROWAD(nu_k + nx_k, 1.0, x_tmp_p, offs_ux_k, RSQrqt_p+k, nu_k + nx_k, 0);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
return 0;
|
71
|
+
};
|
72
|
+
|
73
|
+
virtual fatrop_int eval_constr_jac(
|
74
|
+
const FatropVecBF &primal_vars,
|
75
|
+
const FatropVecBF &slack_vars) override
|
76
|
+
{
|
77
|
+
FatropVecBF slack_dummy_v = slack_dummy_[0];
|
78
|
+
update_slack_vars(slack_vars, slack_dummy_v);
|
79
|
+
orig_->eval_constr_jac(primal_vars, slack_dummy_v);
|
80
|
+
return 0;
|
81
|
+
};
|
82
|
+
void update_slack_vars(const FatropVecBF &slack_vars, FatropVecBF &slack_dummy)
|
83
|
+
{
|
84
|
+
fatrop_int offs_n = orig_dims_.nineqs;
|
85
|
+
fatrop_int offs_p = orig_dims_.nineqs + n_n;
|
86
|
+
for (fatrop_int i = 0; i < orig_dims_.nineqs; ++i)
|
87
|
+
{
|
88
|
+
slack_dummy.at(i) = slack_vars.at(i) - slack_vars.at(i + offs_n) + slack_vars.at(i + offs_p);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
virtual fatrop_int eval_constraint_viol(
|
92
|
+
const FatropVecBF &primal_vars,
|
93
|
+
const FatropVecBF &slack_vars,
|
94
|
+
FatropVecBF &constraint_violation) override
|
95
|
+
{
|
96
|
+
FatropVecBF slack_dummy_v = slack_dummy_[0];
|
97
|
+
update_slack_vars(slack_vars, slack_dummy_v);
|
98
|
+
orig_->eval_constraint_viol(primal_vars, slack_dummy_v, constraint_violation);
|
99
|
+
return 0;
|
100
|
+
};
|
101
|
+
virtual fatrop_int eval_obj_grad(
|
102
|
+
double obj_scale,
|
103
|
+
const FatropVecBF &primal_vars,
|
104
|
+
const FatropVecBF &slack_vars,
|
105
|
+
FatropVecBF &gradient_x,
|
106
|
+
FatropVecBF &gradient_s) override
|
107
|
+
{
|
108
|
+
// compute delta's
|
109
|
+
axpby(xi, primal_vars, -xi, x_start_[0], gradient_x);
|
110
|
+
axpby(xi, slack_vars.block(0, orig_dims_.nineqs), -xi, s_start_[0], gradient_s.block(0, orig_dims_.nineqs));
|
111
|
+
gradient_s.block(orig_dims_.nineqs, n_n + n_p) = rho;
|
112
|
+
return 0;
|
113
|
+
};
|
114
|
+
virtual fatrop_int eval_obj(
|
115
|
+
double obj_scale,
|
116
|
+
const FatropVecBF &primal_vars,
|
117
|
+
const FatropVecBF &slack_vars,
|
118
|
+
double &res) override
|
119
|
+
{
|
120
|
+
// compute delta's
|
121
|
+
axpby(1.0, primal_vars, -1.0, x_start_[0], x_tmp_[0]);
|
122
|
+
axpby(1.0, slack_vars.block(0, orig_dims_.nineqs), -1.0, s_start_[0], s_tmp_[0]);
|
123
|
+
res = 0.5*xi*(sumsqr(x_tmp_[0]) + sumsqr(s_tmp_[0]));
|
124
|
+
res += rho * sum(slack_vars.block(orig_dims_.nineqs, n_n + n_p));
|
125
|
+
return 0;
|
126
|
+
};
|
127
|
+
void get_initialization(const FatropVecBF &primal_vars_orig, FatropVecBF &intialization)
|
128
|
+
{
|
129
|
+
intialization.block(0, orig_dims_.nvars).copy(primal_vars_orig.block(0, orig_dims_.nvars));
|
130
|
+
}
|
131
|
+
virtual fatrop_int eval_dual_inf(
|
132
|
+
double obj_scale,
|
133
|
+
const FatropVecBF &lam,
|
134
|
+
const FatropVecBF &grad_x,
|
135
|
+
const FatropVecBF &grad_s,
|
136
|
+
FatropVecBF &du_inf_x, FatropVecBF &du_inf_s_wo_z) override
|
137
|
+
{
|
138
|
+
auto du_inf_s_wo_z_or = du_inf_s_wo_z.block(0, orig_dims_.nineqs);
|
139
|
+
orig_->eval_dual_inf(obj_scale, lam, grad_x, grad_s, du_inf_x, du_inf_s_wo_z_or);
|
140
|
+
auto lam_I = lam.block(orig_dims_.neqs - orig_dims_.nineqs, orig_dims_.nineqs);
|
141
|
+
axpby(1.0, lam_I, 1.0, grad_s.block(orig_dims_.nineqs, n_n), du_inf_s_wo_z.block(orig_dims_.nineqs, n_n));
|
142
|
+
axpby(-1.0, lam_I, 1.0, grad_s.block(orig_dims_.nineqs + n_n, n_p), du_inf_s_wo_z.block(orig_dims_.nineqs + n_n, n_p));
|
143
|
+
return 0;
|
144
|
+
}
|
145
|
+
void update_sigma_gradb(double inertia, const FatropVecBF &sigma_s, const FatropVecBF &sigma_n, const FatropVecBF &sigma_p, const FatropVecBF &gradb_s, const FatropVecBF &gradb_n, const FatropVecBF &gradb_p, const FatropVecBF &sigma_update, const FatropVecBF &gradb_update)
|
146
|
+
{
|
147
|
+
for (int i = 0; i < orig_dims_.nineqs; ++i)
|
148
|
+
{
|
149
|
+
double sigma_updt = 1.0 / (1.0 / (sigma_s.at(i) + inertia + xi) + 1.0 / (sigma_n.at(i) + inertia) + 1.0 / (sigma_p.at(i) + inertia));
|
150
|
+
sigma_update.at(i) = sigma_updt - inertia;
|
151
|
+
gradb_update.at(i) = ((gradb_s.at(i)) / (sigma_s.at(i) + inertia + xi) - (gradb_n.at(i)) / (sigma_n.at(i) + inertia) + (gradb_p.at(i)) / (sigma_p.at(i) + inertia)) * sigma_updt;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
void update_delta_snp(double inertia, const FatropVecBF &sigma_s, const FatropVecBF &sigma_n, const FatropVecBF &sigma_p, const FatropVecBF &gradb_s, const FatropVecBF &gradb_n, const FatropVecBF &gradb_p, const FatropVecBF &lam_I, const FatropVecBF &delta_s, const FatropVecBF &delta_n, const FatropVecBF &delta_p)
|
155
|
+
{
|
156
|
+
for (int i = 0; i < orig_dims_.nineqs; ++i)
|
157
|
+
{
|
158
|
+
double lam_I_i = lam_I.at(i);
|
159
|
+
delta_s.at(i) = (-gradb_s.at(i) + lam_I_i) / (sigma_s.at(i) + inertia+xi);
|
160
|
+
delta_n.at(i) = (-gradb_n.at(i) - lam_I_i) / (sigma_n.at(i) + inertia);
|
161
|
+
delta_p.at(i) = (-gradb_p.at(i) + lam_I_i) / (sigma_p.at(i) + inertia);
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
virtual fatrop_int solve_pd_sys(
|
166
|
+
const double inertia_correction_w,
|
167
|
+
const double inertia_correction_c,
|
168
|
+
const FatropVecBF &ux,
|
169
|
+
const FatropVecBF &lam,
|
170
|
+
const FatropVecBF &delta_s,
|
171
|
+
const FatropVecBF &sigma_total,
|
172
|
+
const FatropVecBF &gradb_total) override
|
173
|
+
{
|
174
|
+
// (todo) check if quadratic penalty on delta s is treated right
|
175
|
+
inertia_correction_w_cache = inertia_correction_w;
|
176
|
+
sigma_cache_[0].copy(sigma_total);
|
177
|
+
gradb_cache_[0].copy(gradb_total);
|
178
|
+
auto lam_I = lam.block(orig_dims_.neqs - orig_dims_.nineqs, orig_dims_.nineqs);
|
179
|
+
auto sigma_s = sigma_total.block(0, orig_dims_.nineqs);
|
180
|
+
auto sigma_n = sigma_total.block(orig_dims_.nineqs, n_n);
|
181
|
+
auto sigma_p = sigma_total.block(orig_dims_.nineqs + n_n, n_p);
|
182
|
+
auto gradb_s = gradb_total.block(0, orig_dims_.nineqs);
|
183
|
+
auto gradb_n = gradb_total.block(orig_dims_.nineqs, n_n);
|
184
|
+
auto gradb_p = gradb_total.block(orig_dims_.nineqs + n_n, n_p);
|
185
|
+
auto delta_s_or = delta_s.block(0, orig_dims_.nineqs);
|
186
|
+
auto delta_n = delta_s.block(orig_dims_.nineqs, n_n);
|
187
|
+
auto delta_p = delta_s.block(orig_dims_.nineqs + n_n, n_p);
|
188
|
+
update_sigma_gradb(inertia_correction_w, sigma_s, sigma_n, sigma_p, gradb_s, gradb_n, gradb_p, sigma_dummy_[0], gradb_dummy_[0]);
|
189
|
+
int ret = orig_->solve_pd_sys(inertia_correction_w, inertia_correction_c, ux, lam, delta_s.block(0, orig_dims_.nineqs), sigma_dummy_[0], gradb_dummy_[0]);
|
190
|
+
update_delta_snp(inertia_correction_w, sigma_s, sigma_n, sigma_p, gradb_s, gradb_n, gradb_p, lam_I, delta_s_or, delta_n, delta_p);
|
191
|
+
return ret;
|
192
|
+
};
|
193
|
+
virtual fatrop_int solve_soc_rhs(
|
194
|
+
const FatropVecBF &ux,
|
195
|
+
const FatropVecBF &lam,
|
196
|
+
const FatropVecBF &delta_s,
|
197
|
+
const FatropVecBF &cosntraint_violation) override
|
198
|
+
{
|
199
|
+
auto lam_I = lam.block(orig_dims_.neqs - orig_dims_.nineqs, orig_dims_.nineqs);
|
200
|
+
auto sigma_s = sigma_cache_[0].block(0, orig_dims_.nineqs);
|
201
|
+
auto sigma_n = sigma_cache_[0].block(orig_dims_.nineqs, n_n);
|
202
|
+
auto sigma_p = sigma_cache_[0].block(orig_dims_.nineqs + n_n, n_p);
|
203
|
+
auto gradb_s = gradb_cache_[0].block(0, orig_dims_.nineqs);
|
204
|
+
auto gradb_n = gradb_cache_[0].block(orig_dims_.nineqs, n_n);
|
205
|
+
auto gradb_p = gradb_cache_[0].block(orig_dims_.nineqs + n_n, n_p);
|
206
|
+
auto delta_s_or = delta_s.block(0, orig_dims_.nineqs);
|
207
|
+
auto delta_n = delta_s.block(orig_dims_.nineqs, n_n);
|
208
|
+
auto delta_p = delta_s.block(orig_dims_.nineqs + n_n, n_p);
|
209
|
+
int ret = orig_->solve_soc_rhs(ux, lam, delta_s.block(0, orig_dims_.nineqs), cosntraint_violation);
|
210
|
+
update_delta_snp(inertia_correction_w_cache + xi, sigma_s, sigma_n, sigma_p, gradb_s, gradb_n, gradb_p, lam_I, delta_s_or, delta_n, delta_p);
|
211
|
+
return ret;
|
212
|
+
}
|
213
|
+
virtual NLPDims get_nlp_dims() const override { return this_dims_; };
|
214
|
+
virtual fatrop_int compute_scalings(
|
215
|
+
double &obj_scale,
|
216
|
+
FatropVecBF &x_scales,
|
217
|
+
FatropVecBF &lam_scales,
|
218
|
+
const FatropVecBF &grad_curr_x, const FatropVecBF &grad_curr_s) override
|
219
|
+
{
|
220
|
+
return orig_->compute_scalings(obj_scale, x_scales, lam_scales, grad_curr_x, grad_curr_s);
|
221
|
+
};
|
222
|
+
virtual fatrop_int initialize_slacks(double mu0,
|
223
|
+
FatropVecBF &s_curr) override
|
224
|
+
{
|
225
|
+
auto s_curr_or = s_curr.block(0, orig_dims_.nineqs);
|
226
|
+
auto n_curr = s_curr.block(orig_dims_.nineqs, n_n);
|
227
|
+
auto p_curr = s_curr.block(orig_dims_.nineqs + n_n, n_p);
|
228
|
+
FatropVecBF ineq_viol = s_tmp_[0];
|
229
|
+
int ret = orig_->initialize_slacks(mu0, ineq_viol);
|
230
|
+
for (int i = 0; i < orig_dims_.nineqs; i++)
|
231
|
+
{
|
232
|
+
double viol = 0.0;
|
233
|
+
viol = (ineq_viol.at(i));
|
234
|
+
double n_init = (mu0 - rho * viol) / (2 * rho) + std::sqrt(std::pow((mu0 - rho * viol) / (2 * rho), 2) + mu0 * viol / (2 * rho));
|
235
|
+
// if viol >>>> 0 -> n_init = 0 if viol <<< 0 n_init = viol
|
236
|
+
n_curr.at(i) = n_init;
|
237
|
+
p_curr.at(i) = viol + n_init;
|
238
|
+
}
|
239
|
+
return 0;
|
240
|
+
}
|
241
|
+
virtual fatrop_int initialize_dual(
|
242
|
+
const FatropVecBF &grad_x,
|
243
|
+
const FatropVecBF &grad_s,
|
244
|
+
FatropVecBF &dlam,
|
245
|
+
const FatropVecBF &zL,
|
246
|
+
const FatropVecBF &zU) override
|
247
|
+
{
|
248
|
+
// todo check if this is correct
|
249
|
+
// return orig_->initialize_dual(grad_x, grad_s, dlam, zL.block(0, orig_dims_.nineqs), zU.block(0, orig_dims_.nineqs));
|
250
|
+
return 0;
|
251
|
+
};
|
252
|
+
virtual fatrop_int get_bounds(
|
253
|
+
FatropVecBF &lower,
|
254
|
+
FatropVecBF &upper) const override
|
255
|
+
{
|
256
|
+
orig_->get_bounds(lower, upper);
|
257
|
+
lower.block(orig_dims_.nineqs, n_n) = 0.0;
|
258
|
+
lower.block(orig_dims_.nineqs + n_n, n_p) = 0.0;
|
259
|
+
upper.block(orig_dims_.nineqs, n_n) = std::numeric_limits<double>::infinity();
|
260
|
+
upper.block(orig_dims_.nineqs + n_n, n_p) = std::numeric_limits<double>::infinity();
|
261
|
+
return 0;
|
262
|
+
};
|
263
|
+
virtual fatrop_int get_initial_sol_guess(
|
264
|
+
FatropVecBF &initial) const override
|
265
|
+
{
|
266
|
+
orig_->get_initial_sol_guess(initial);
|
267
|
+
return 0;
|
268
|
+
}
|
269
|
+
virtual void update_mu(double mu) override
|
270
|
+
{
|
271
|
+
xi = std::sqrt(mu);
|
272
|
+
orig_->update_mu(mu);
|
273
|
+
};
|
274
|
+
virtual void reset() override
|
275
|
+
{
|
276
|
+
orig_->reset();
|
277
|
+
};
|
278
|
+
std::shared_ptr<FatropOCP> orig_;
|
279
|
+
NLPDims orig_dims_;
|
280
|
+
NLPDims this_dims_;
|
281
|
+
FatropMemoryVecBF lower_, upper_;
|
282
|
+
FatropMemoryVecBF x_start_, s_start_;
|
283
|
+
FatropMemoryVecBF x_tmp_, s_tmp_;
|
284
|
+
std::vector<bool> upper_bounded_;
|
285
|
+
std::vector<bool> lower_bounded_;
|
286
|
+
fatrop_int n_p = 0;
|
287
|
+
fatrop_int n_n = 0;
|
288
|
+
FatropMemoryVecBF slack_dummy_;
|
289
|
+
FatropMemoryVecBF sigma_dummy_;
|
290
|
+
FatropMemoryVecBF gradb_dummy_;
|
291
|
+
FatropMemoryVecBF zl_dummy_;
|
292
|
+
FatropMemoryVecBF zu_dummy_;
|
293
|
+
double inertia_correction_w_cache = 0.0;
|
294
|
+
FatropMemoryVecBF sigma_cache_;
|
295
|
+
FatropMemoryVecBF gradb_cache_;
|
296
|
+
double rho = 1e4;
|
297
|
+
double xi = 1.0;
|
298
|
+
};
|
299
|
+
};
|