casadi 3.6.5__cp38-none-win_amd64.whl → 3.6.7__cp38-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,409 @@
|
|
1
|
+
#ifndef IPX_MODEL_H_
|
2
|
+
#define IPX_MODEL_H_
|
3
|
+
|
4
|
+
#include <vector>
|
5
|
+
#include "ipm/ipx/control.h"
|
6
|
+
#include "ipm/ipx/sparse_matrix.h"
|
7
|
+
|
8
|
+
namespace ipx {
|
9
|
+
|
10
|
+
// Model provides the interface between an LP model given by the user,
|
11
|
+
//
|
12
|
+
// minimize obj'x (1)
|
13
|
+
// subject to A*x {=,<,>} rhs, lbuser <= x <= ubuser,
|
14
|
+
//
|
15
|
+
// and the computational form used by the solver,
|
16
|
+
//
|
17
|
+
// minimize c'x
|
18
|
+
// subject to AI*x = b, (dual: y)
|
19
|
+
// x-xl = lb, xl >= 0, (dual: zl >= 0)
|
20
|
+
// x+xu = ub, xu >= 0. (dual: zu >= 0)
|
21
|
+
//
|
22
|
+
// The matrix AI has m >= 0 rows and n+m columns, where n > 0 is the number of
|
23
|
+
// "structural" variables. The last m columns of AI form the identity matrix.
|
24
|
+
// The last m components of c do not need to be zero (can happen when the model
|
25
|
+
// was dualized in preprocessing). Entries of -lb and ub can be infinity.
|
26
|
+
//
|
27
|
+
// The user model is translated into computational form in two steps:
|
28
|
+
// (a) scaling, which consists of
|
29
|
+
// - applying an automatic scaling algorithm to A (optional), and
|
30
|
+
// - "flipping" variables for which lbuser[j] is infinite but ubuser[j] is
|
31
|
+
// finite by multiplying the column of A by -1.
|
32
|
+
// (b) dualization if appropriate
|
33
|
+
//
|
34
|
+
// A Model object cannot be modified other than discarding the data and loading
|
35
|
+
// a new user model.
|
36
|
+
|
37
|
+
class Model {
|
38
|
+
public:
|
39
|
+
// Constructs an empty model.
|
40
|
+
Model() = default;
|
41
|
+
|
42
|
+
// Initializes a Model object from the form (1).
|
43
|
+
// @num_constr: number of rows of A
|
44
|
+
// @num_var: number of columns of A
|
45
|
+
// @Ap, @Ai, @Ax: matrix A in CSC format, 0-based indexing
|
46
|
+
// @rhs: array of size num_constr
|
47
|
+
// @constr_type: array of size num_constr with entries '=', '<' or '>'
|
48
|
+
// @obj: array of size num_var
|
49
|
+
// @lbuser: array of size num_var, entries can be -INFINITY
|
50
|
+
// @ubuser: array of size num_var, entries can be +INFINITY
|
51
|
+
// If the input is invalid an error code is returned and the Model object
|
52
|
+
// becomes empty.
|
53
|
+
// Returns:
|
54
|
+
// 0
|
55
|
+
// IPX_ERROR_argument_null
|
56
|
+
// IPX_ERROR_invalid_dimension
|
57
|
+
// IPX_ERROR_invalid_matrix
|
58
|
+
// IPX_ERROR_invalid_vector
|
59
|
+
Int Load(const Control& control, Int num_constr, Int num_var,
|
60
|
+
const Int* Ap, const Int* Ai, const double* Ax,
|
61
|
+
const double* rhs, const char* constr_type, const double* obj,
|
62
|
+
const double* lbuser, const double* ubuser);
|
63
|
+
// Performs Flippo's test for deciding dualization
|
64
|
+
bool filippoDualizationTest() const;
|
65
|
+
// Writes statistics of input data and preprocessing to @info.
|
66
|
+
void GetInfo(Info* info) const;
|
67
|
+
|
68
|
+
// Returns true if the model is empty.
|
69
|
+
bool empty() const { return cols() == 0; }
|
70
|
+
|
71
|
+
// Deallocates all memory; the object becomes empty.
|
72
|
+
void clear();
|
73
|
+
|
74
|
+
// Returns the number of rows of AI.
|
75
|
+
Int rows() const { return num_rows_; }
|
76
|
+
|
77
|
+
// Returns the number of structural columns of AI (i.e. without the
|
78
|
+
// rightmost identity matrix).
|
79
|
+
Int cols() const { return num_cols_; }
|
80
|
+
|
81
|
+
// Returns the number of columns classified as dense.
|
82
|
+
Int num_dense_cols() const { return num_dense_cols_; }
|
83
|
+
|
84
|
+
// Returns true if column j is classified as dense (0 <= j < n+m).
|
85
|
+
bool IsDenseColumn(Int j) const {
|
86
|
+
return AI_.entries(j) >= nz_dense_;
|
87
|
+
}
|
88
|
+
|
89
|
+
// Returns true if the user model was dualized in preprocessing.
|
90
|
+
bool dualized() const { return dualized_; }
|
91
|
+
|
92
|
+
// Returns a reference to the matrix AI in CSC and CSR format.
|
93
|
+
const SparseMatrix& AI() const { return AI_; }
|
94
|
+
const SparseMatrix& AIt() const { return AIt_; }
|
95
|
+
|
96
|
+
// Returns a reference to a model vector.
|
97
|
+
const Vector& b() const { return b_; }
|
98
|
+
const Vector& c() const { return c_; }
|
99
|
+
const Vector& lb() const { return lb_; }
|
100
|
+
const Vector& ub() const { return ub_; }
|
101
|
+
|
102
|
+
// Returns an entry of a model vector.
|
103
|
+
double b(Int i) const { return b_[i]; }
|
104
|
+
double c(Int j) const { return c_[j]; }
|
105
|
+
double lb(Int j) const { return lb_[j]; }
|
106
|
+
double ub(Int j) const { return ub_[j]; }
|
107
|
+
|
108
|
+
// Returns the infinity norm of [b; lb; ub], ignoring infinite entries.
|
109
|
+
double norm_bounds() const { return norm_bounds_; }
|
110
|
+
|
111
|
+
// Returns the infinity norm of c.
|
112
|
+
double norm_c() const { return norm_c_; }
|
113
|
+
|
114
|
+
// Transforms point from user model to solver model. Each of the pointer
|
115
|
+
// arguments can be NULL, in which case its components are assumed 0.0.
|
116
|
+
void PresolveStartingPoint(const double* x_user, const double* slack_user,
|
117
|
+
const double* y_user, const double* z_user,
|
118
|
+
Vector& x_solver, Vector& y_solver,
|
119
|
+
Vector& z_solver) const;
|
120
|
+
|
121
|
+
// Performs the inverse operations to PostsolveInteriorSolution().
|
122
|
+
// The user vectors must all be given and must satisfy the sign conditions
|
123
|
+
// given in the reference documentation. Otherwise an error code will be
|
124
|
+
// returned. At the moment PresolveIPMStartingPoint() is not implemented
|
125
|
+
// for the case that the model was dualized in preprocessing.
|
126
|
+
// Returns:
|
127
|
+
// 0
|
128
|
+
// IPX_ERROR_argument_null
|
129
|
+
// IPX_ERROR_invalid_vector if a sign condition is violated
|
130
|
+
// IPX_ERROR_not_implemented if the model was dualized in preprocessing.
|
131
|
+
Int PresolveIPMStartingPoint(const double* x_user,
|
132
|
+
const double* xl_user,
|
133
|
+
const double* xu_user,
|
134
|
+
const double* slack_user,
|
135
|
+
const double* y_user,
|
136
|
+
const double* zl_user,
|
137
|
+
const double* zu_user,
|
138
|
+
Vector& x_solver,
|
139
|
+
Vector& xl_solver,
|
140
|
+
Vector& xu_solver,
|
141
|
+
Vector& y_solver,
|
142
|
+
Vector& zl_solver,
|
143
|
+
Vector& zu_solver) const;
|
144
|
+
|
145
|
+
// Given an IPM iterate, recovers the solution to the user model (see the
|
146
|
+
// reference documentation). Each of the pointer arguments can be NULL, in
|
147
|
+
// which case the quantity is not returned. The sign conditions on the dual
|
148
|
+
// variables and those on the primal slack variables are staisfied if
|
149
|
+
// xl_solver, xu_solver, zl_solver and zu_solver are nonnegative.
|
150
|
+
void PostsolveInteriorSolution(const Vector& x_solver,
|
151
|
+
const Vector& xl_solver,
|
152
|
+
const Vector& xu_solver,
|
153
|
+
const Vector& y_solver,
|
154
|
+
const Vector& zl_solver,
|
155
|
+
const Vector& zu_solver,
|
156
|
+
double* x_user,
|
157
|
+
double* xl_user, double* xu_user,
|
158
|
+
double* slack_user,
|
159
|
+
double* y_user,
|
160
|
+
double* zl_user, double* zu_user) const;
|
161
|
+
|
162
|
+
// Evaluates the solution to the user model obtained from postsolving the
|
163
|
+
// IPM iterate. The following info members are set:
|
164
|
+
// abs_presidual, abs_dresidual, rel_presidual, rel_dresidual,
|
165
|
+
// pobjval, dobjval, rel_objgap, complementarity, normx, normy, normx.
|
166
|
+
void EvaluateInteriorSolution(const Vector& x_solver,
|
167
|
+
const Vector& xl_solver,
|
168
|
+
const Vector& xu_solver,
|
169
|
+
const Vector& y_solver,
|
170
|
+
const Vector& zl_solver,
|
171
|
+
const Vector& zu_solver,
|
172
|
+
Info* info) const;
|
173
|
+
|
174
|
+
// Given a basic solution to the solver model, recovers the basic solution
|
175
|
+
// to the user model. Each of the pointer arguments can be NULL.
|
176
|
+
void PostsolveBasicSolution(const Vector& x_solver,
|
177
|
+
const Vector& y_solver,
|
178
|
+
const Vector& z_solver,
|
179
|
+
const std::vector<Int>& basic_status_solver,
|
180
|
+
double* x_user, double* slack_user,
|
181
|
+
double* y_user, double* z_user) const;
|
182
|
+
|
183
|
+
// Evaluates the solution to the user model obtained from postsolving the
|
184
|
+
// basic solution from the solver. The following info members are set:
|
185
|
+
// primal_infeas, dual_infeas, objval
|
186
|
+
void EvaluateBasicSolution(const Vector& x_solver,
|
187
|
+
const Vector& y_solver,
|
188
|
+
const Vector& z_solver,
|
189
|
+
const std::vector<Int>& basic_status_solver,
|
190
|
+
Info* info) const;
|
191
|
+
|
192
|
+
// Given a basic status for each variable in the solver model, recovers the
|
193
|
+
// basic statuses for constraints and variables in the user model. Each
|
194
|
+
// of the pointer arguments can be NULL.
|
195
|
+
void PostsolveBasis(const std::vector<Int>& basic_status_solver,
|
196
|
+
Int* cbasis, Int* vbasis) const;
|
197
|
+
|
198
|
+
private:
|
199
|
+
// Checks that the input is valid, and if so copies into the members below
|
200
|
+
// (see "User model after scaling"). If the input is invalid, an error code
|
201
|
+
// is returned and the object remains unchanged.
|
202
|
+
// Returns:
|
203
|
+
// 0
|
204
|
+
// IPX_ERROR_argument_null
|
205
|
+
// IPX_ERROR_invalid_dimension
|
206
|
+
// IPX_ERROR_invalid_matrix
|
207
|
+
// IPX_ERROR_invalid_vector
|
208
|
+
Int CopyInput(Int num_constr, Int num_var, const Int* Ap, const Int* Ai,
|
209
|
+
const double* Ax, const double* rhs, const char* constr_type,
|
210
|
+
const double* obj, const double* lbuser,
|
211
|
+
const double* ubuser);
|
212
|
+
|
213
|
+
// Scales A_, scaled_obj_, scaled_rhs_, scaled_lbuser_ and scaled_ubuser_
|
214
|
+
// according to parameter control.scale(). The scaling factors are stored in
|
215
|
+
// colscale_ and rowscale_. If all factors are 1.0 (either because scaling
|
216
|
+
// was turned off or because the algorithm did nothing), rowscale_ and
|
217
|
+
// colscale_ have size 0.
|
218
|
+
// In any case, variables for which lbuser is infinite but ubbuser is finite
|
219
|
+
// are "flipped" and their indices are kept in flipped_vars_.
|
220
|
+
void ScaleModel(const Control& control);
|
221
|
+
|
222
|
+
// Builds computational form without dualization. In Julia notation:
|
223
|
+
// num_rows = nc
|
224
|
+
// num_cols = nv
|
225
|
+
// AI = [A eye(nc)]
|
226
|
+
// b = rhs
|
227
|
+
// c = [obj ; zeros(nc) ]
|
228
|
+
// lb = [lbuser ; constr_type_ .== '>' ? -Inf : 0]
|
229
|
+
// ub = [ubuser ; constr_type_ .== '<' ? +Inf : 0]
|
230
|
+
// dualized = false
|
231
|
+
// Here nc = num_constr and nv = num_var. The data must have been loaded
|
232
|
+
// into the class member below ("User model after scaling") before calling
|
233
|
+
// this method.
|
234
|
+
void LoadPrimal();
|
235
|
+
|
236
|
+
// Builds computational form with dualization. In Julia notation:
|
237
|
+
// num_rows = nv
|
238
|
+
// num_cols = nc + nb
|
239
|
+
// AI = [A' -eye(nv)[:,jboxed] eye(nv)]
|
240
|
+
// b = obj
|
241
|
+
// c = [-rhs ; ubuser[jb] ; -lbuser ]
|
242
|
+
// lb = [constr_type .== '>' ? 0 : -Inf; zeros(nb) ; zeros(nv) ]
|
243
|
+
// ub = [constr_type .== '<' ? 0 : +Inf; Inf*ones(nb); Inf*ones(nv)]
|
244
|
+
// dualized = true
|
245
|
+
// Here nc = num_constr, nv = num_var, nb is the number of boxed variables
|
246
|
+
// and jboxed are their indices. Every variable with a finite upper bound
|
247
|
+
// must have a finite lower bound (this is ensured after scaling). If a
|
248
|
+
// variable j of the input LP is a free variable, then the j-th slack
|
249
|
+
// variable of the model gets a zero upper bound (i.e. it is fixed at zero)
|
250
|
+
// and its objective coefficient is set to zero.
|
251
|
+
void LoadDual();
|
252
|
+
|
253
|
+
// Recursively equilibrates A_ in infinity norm using the algorithm from
|
254
|
+
// [1]. The scaling factors are truncated to powers of 2. Terminates when
|
255
|
+
// the entries of A_ are within the range [0.5,8).
|
256
|
+
// [1] P. A. Knight, D. Ruiz, B. Ucar, "A symmetry preserving algorithm for
|
257
|
+
// matrix scaling", SIAM J. Matrix Anal., 35(3), 2014.
|
258
|
+
void EquilibrateMatrix();
|
259
|
+
|
260
|
+
// Initializes num_dense_cols_ and nz_dense_. We classify the maximum #
|
261
|
+
// columns as "dense" which have more than 40 nonzeros and more than 10
|
262
|
+
// times the # nonzeros than any column that is not "dense". If this yields
|
263
|
+
// more than 1000 dense columns, then no columns are classified as dense.
|
264
|
+
void FindDenseColumns();
|
265
|
+
|
266
|
+
// Prints the coefficient ranges of input data via
|
267
|
+
// control.hLog(). Must be called after CopyInput() and before
|
268
|
+
// ScaleModel().
|
269
|
+
void PrintCoefficientRange(const Control& control) const;
|
270
|
+
|
271
|
+
// Prints preprocessing operations via control.hLog().
|
272
|
+
void PrintPreprocessingLog(const Control& control) const;
|
273
|
+
|
274
|
+
// Applies the operations from ScaleModel() to a primal-dual point.
|
275
|
+
void ScalePoint(Vector& x, Vector& slack, Vector& y, Vector& z) const;
|
276
|
+
void ScalePoint(Vector& x, Vector& xl, Vector& xu, Vector& slack,
|
277
|
+
Vector& y, Vector& zl, Vector& zu) const;
|
278
|
+
|
279
|
+
// ScaleBack*() do the reverse operation of ScaleModel().
|
280
|
+
void ScaleBackInteriorSolution(Vector& x, Vector& xl, Vector& xu,
|
281
|
+
Vector& slack, Vector& y, Vector& zl,
|
282
|
+
Vector& zu) const;
|
283
|
+
void ScaleBackResiduals(Vector& rb, Vector& rc, Vector& rl,
|
284
|
+
Vector& ru) const;
|
285
|
+
void ScaleBackBasicSolution(Vector& x, Vector& slack, Vector& y,
|
286
|
+
Vector& z) const;
|
287
|
+
void ScaleBackBasis(std::vector<Int>& cbasis,
|
288
|
+
std::vector<Int>& vbasis) const;
|
289
|
+
|
290
|
+
// Applies the operations of LoadPrimal() or LoadDual() to a primal-dual
|
291
|
+
// point.
|
292
|
+
void DualizeBasicSolution(const Vector& x_user, const Vector& slack_user,
|
293
|
+
const Vector& y_user, const Vector& z_user,
|
294
|
+
Vector& x_solver, Vector& y_solver,
|
295
|
+
Vector& z_solver) const;
|
296
|
+
|
297
|
+
// Applies the operations of LoadPrimal() or LoadDual() to a primal-dual
|
298
|
+
// point. Currently only implemented for dualized_ == false. Otherwise an
|
299
|
+
// assertion will fail.
|
300
|
+
void DualizeIPMStartingPoint(const Vector& x_user,
|
301
|
+
const Vector& xl_user,
|
302
|
+
const Vector& xu_user,
|
303
|
+
const Vector& slack_user,
|
304
|
+
const Vector& y_user,
|
305
|
+
const Vector& zl_user,
|
306
|
+
const Vector& zu_user,
|
307
|
+
Vector& x_solver,
|
308
|
+
Vector& xl_solver,
|
309
|
+
Vector& xu_solver,
|
310
|
+
Vector& y_solver,
|
311
|
+
Vector& zl_solver,
|
312
|
+
Vector& zu_solver) const;
|
313
|
+
|
314
|
+
// DualizeBack*() do the reverse operations of LoadPrimal() or LoadDual().
|
315
|
+
// Given the solution from the solver, they recover the solution to the
|
316
|
+
// scaled user model.
|
317
|
+
void DualizeBackInteriorSolution(const Vector& x_solver,
|
318
|
+
const Vector& xl_solver,
|
319
|
+
const Vector& xu_solver,
|
320
|
+
const Vector& y_solver,
|
321
|
+
const Vector& zl_solver,
|
322
|
+
const Vector& zu_solver,
|
323
|
+
Vector& x_user,
|
324
|
+
Vector& xl_user,
|
325
|
+
Vector& xu_user,
|
326
|
+
Vector& slack_user,
|
327
|
+
Vector& y_user,
|
328
|
+
Vector& zl_user,
|
329
|
+
Vector& zu_user) const;
|
330
|
+
void DualizeBackBasicSolution(const Vector& x_solver,
|
331
|
+
const Vector& y_solver,
|
332
|
+
const Vector& z_solver,
|
333
|
+
Vector& x_user,
|
334
|
+
Vector& slack_user,
|
335
|
+
Vector& y_user,
|
336
|
+
Vector& z_user) const;
|
337
|
+
void DualizeBackBasis(const std::vector<Int>& basic_status_solver,
|
338
|
+
std::vector<Int>& cbasis_user,
|
339
|
+
std::vector<Int>& vbasis_user) const;
|
340
|
+
|
341
|
+
void CorrectScaledBasicSolution(Vector& x, Vector& slack, Vector& y,
|
342
|
+
Vector& z,
|
343
|
+
const std::vector<Int> cbasis,
|
344
|
+
const std::vector<Int> vbasis) const;
|
345
|
+
|
346
|
+
// Performs lhs += alpha*A*rhs or lhs += alpha*A'rhs, where A is the user
|
347
|
+
// matrix after scaling. This matrix is not stored explicitly, but is used
|
348
|
+
// implicitly through AI.
|
349
|
+
// @trans: 't' or 'T' for multiplication with A'.
|
350
|
+
void MultiplyWithScaledMatrix(const Vector& rhs, double alpha, Vector& lhs,
|
351
|
+
char trans) const;
|
352
|
+
|
353
|
+
// Computational form model.
|
354
|
+
bool dualized_{false}; // model was dualized in preprocessing?
|
355
|
+
Int num_rows_{0}; // # rows of AI
|
356
|
+
Int num_cols_{0}; // # structural columns of AI
|
357
|
+
Int num_dense_cols_{0}; // # columns classified as dense
|
358
|
+
Int nz_dense_{0}; // minimum # nonzeros in a dense column
|
359
|
+
SparseMatrix AI_; // matrix AI columnwise
|
360
|
+
SparseMatrix AIt_; // matrix AI rowwise
|
361
|
+
Vector b_;
|
362
|
+
Vector c_;
|
363
|
+
Vector lb_;
|
364
|
+
Vector ub_;
|
365
|
+
double norm_bounds_{0.0}; // infinity norm of [b;lb;ub]
|
366
|
+
double norm_c_{0.0}; // infinity norm of c
|
367
|
+
|
368
|
+
// User model after scaling. The data members are first initialized by
|
369
|
+
// CopyInput() and the vectors and matrix are then modified by ScaleModel().
|
370
|
+
Int num_constr_{0}; // # constraints
|
371
|
+
Int num_eqconstr_{0}; // # equality constraints
|
372
|
+
Int num_var_{0}; // # variables
|
373
|
+
Int num_free_var_{0}; // # free variables
|
374
|
+
Int num_entries_{0}; // # entries in input matrix
|
375
|
+
std::vector<Int> boxed_vars_; // indices of boxed variables
|
376
|
+
std::vector<char> constr_type_;
|
377
|
+
double norm_obj_{0.0}; // Infnorm(obj) as given by user
|
378
|
+
double norm_rhs_{0.0}; // Infnorm(rhs,lb,ub) as given by user
|
379
|
+
Vector scaled_obj_;
|
380
|
+
Vector scaled_rhs_;
|
381
|
+
Vector scaled_lbuser_;
|
382
|
+
Vector scaled_ubuser_;
|
383
|
+
SparseMatrix A_; // is cleared after preprocessing
|
384
|
+
|
385
|
+
// Data from ScaleModel() that is required by ScaleBack*().
|
386
|
+
std::vector<Int> flipped_vars_;
|
387
|
+
Vector colscale_;
|
388
|
+
Vector rowscale_;
|
389
|
+
};
|
390
|
+
|
391
|
+
// Returns the maximum violation of lb <= x <= ub.
|
392
|
+
double PrimalInfeasibility(const Model& model, const Vector& x);
|
393
|
+
|
394
|
+
// Returns the maximum violation of the dual feasibility condition
|
395
|
+
// z[j] <= 0 if x[j] > lb[j],
|
396
|
+
// z[j] >= 0 if x[j] < ub[j].
|
397
|
+
// Note that dual feasibility implies complementarity, i.e.
|
398
|
+
// x[j] == lb[j] || x[j] == ub[j] || z[j] == 0.
|
399
|
+
double DualInfeasibility(const Model& model, const Vector& x, const Vector& z);
|
400
|
+
|
401
|
+
// Returns the maximum violation of Ax=b.
|
402
|
+
double PrimalResidual(const Model& model, const Vector& x);
|
403
|
+
|
404
|
+
// Returns the maximum violation of A'y+z=c.
|
405
|
+
double DualResidual(const Model& model, const Vector& y, const Vector& z);
|
406
|
+
|
407
|
+
} // namespace ipx
|
408
|
+
|
409
|
+
#endif // IPX_MODEL_H_
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#ifndef IPX_MULTISTREAM_H_
|
2
|
+
#define IPX_MULTISTREAM_H_
|
3
|
+
|
4
|
+
#include <ostream>
|
5
|
+
#include <vector>
|
6
|
+
|
7
|
+
namespace ipx {
|
8
|
+
|
9
|
+
// Multistream allows redirecting output to multiple std::ostreams. It is used
|
10
|
+
// from Control (see control.h) for printing log messages simultaneously to
|
11
|
+
// standard output and a logfile.
|
12
|
+
|
13
|
+
class Multistream : public std::ostream {
|
14
|
+
public:
|
15
|
+
Multistream() : std::ostream(nullptr) {
|
16
|
+
std::ostream::rdbuf(&mbuffer_);
|
17
|
+
}
|
18
|
+
|
19
|
+
// adds a new stream to the object
|
20
|
+
void add(std::ostream& os) {
|
21
|
+
os.flush();
|
22
|
+
mbuffer_.add(os.rdbuf());
|
23
|
+
}
|
24
|
+
|
25
|
+
// discards all streams
|
26
|
+
void clear() {
|
27
|
+
mbuffer_.clear();
|
28
|
+
}
|
29
|
+
|
30
|
+
private:
|
31
|
+
struct multibuffer : public std::streambuf {
|
32
|
+
void add(std::streambuf* b) {
|
33
|
+
buffers.push_back(b);
|
34
|
+
}
|
35
|
+
void clear() {
|
36
|
+
buffers.clear();
|
37
|
+
}
|
38
|
+
int overflow(int c) override {
|
39
|
+
for (std::streambuf* b : buffers)
|
40
|
+
b->sputc(static_cast<char>(c));
|
41
|
+
return c;
|
42
|
+
}
|
43
|
+
private:
|
44
|
+
std::vector<std::streambuf*> buffers;
|
45
|
+
};
|
46
|
+
|
47
|
+
multibuffer mbuffer_;
|
48
|
+
};
|
49
|
+
|
50
|
+
} // namespace ipx
|
51
|
+
|
52
|
+
#endif // IPX_MULTISTREAM_H_
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#ifndef IPX_NORMAL_MATRIX_H_
|
2
|
+
#define IPX_NORMAL_MATRIX_H_
|
3
|
+
|
4
|
+
#include "ipm/ipx/linear_operator.h"
|
5
|
+
#include "ipm/ipx/model.h"
|
6
|
+
|
7
|
+
namespace ipx {
|
8
|
+
|
9
|
+
// NormalMatrix provides matrix-vector operations with the matrix
|
10
|
+
//
|
11
|
+
// AI*W*AI',
|
12
|
+
//
|
13
|
+
// where AI is the m-by-(n+m) matrix defined by the model, and W is a diagonal
|
14
|
+
// (weight) matrix defined by the user.
|
15
|
+
|
16
|
+
class NormalMatrix : public LinearOperator {
|
17
|
+
public:
|
18
|
+
// Constructor stores a reference to the model. No data is copied. The model
|
19
|
+
// must be valid as long as the object is used.
|
20
|
+
explicit NormalMatrix(const Model& model);
|
21
|
+
|
22
|
+
// Prepares normal matrix for subsequent calls to Apply(). If W is not NULL,
|
23
|
+
// then W must hold n+m entries. No data is copied. The array must be valid
|
24
|
+
// in each subsequent call to Apply(). If W is NULL, then the first n
|
25
|
+
// entries are assumed 1.0 and the last m entries are assumed 0.0.
|
26
|
+
void Prepare(const double* W);
|
27
|
+
|
28
|
+
// Returns computation time for calls to Apply() since last reset_time().
|
29
|
+
double time() const;
|
30
|
+
void reset_time();
|
31
|
+
|
32
|
+
private:
|
33
|
+
void _Apply(const Vector& rhs, Vector& lhs, double* rhs_dot_lhs) override;
|
34
|
+
|
35
|
+
const Model& model_;
|
36
|
+
const double* W_{nullptr};
|
37
|
+
bool prepared_{false};
|
38
|
+
Vector work_; // size n+m workspace (2-pass matvec products only)
|
39
|
+
double time_{0.0};
|
40
|
+
};
|
41
|
+
|
42
|
+
} // namespace ipx
|
43
|
+
|
44
|
+
#endif // IPX_NORMAL_MATRIX_H_
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#ifndef IPX_POWER_METHOD_H_
|
2
|
+
#define IPX_POWER_METHOD_H_
|
3
|
+
|
4
|
+
#include <cmath>
|
5
|
+
#include "ipm/ipx/ipx_internal.h"
|
6
|
+
#include "ipm/ipx/utils.h"
|
7
|
+
|
8
|
+
namespace ipx {
|
9
|
+
|
10
|
+
// Power method for estimating the maximum eigenvalue of a linear operator f.
|
11
|
+
// @func: function object that is called by func(v,fv) to evaluate fv=f(v).
|
12
|
+
// @v: vector of dimension of the linear operator. On return holds an
|
13
|
+
// approximate eigenvector corresponding to the maximum eigenvalue of f.
|
14
|
+
// Returns an estimate for the maximum eigenvalue of f.
|
15
|
+
|
16
|
+
template <typename F>
|
17
|
+
double PowerMethod(F func, Vector& v) {
|
18
|
+
const Int maxiter = 100;
|
19
|
+
const double tol = 1e-3;
|
20
|
+
const Int dim = v.size();
|
21
|
+
Vector fv(dim);
|
22
|
+
|
23
|
+
// Construct starting vector and normalize.
|
24
|
+
for (Int i = 0; i < dim; i++)
|
25
|
+
v[i] = 1.0 + 1.0/(i+1);
|
26
|
+
v /= Twonorm(v);
|
27
|
+
|
28
|
+
// Run power method
|
29
|
+
double lambda = 0.0;
|
30
|
+
Int iter = 0;
|
31
|
+
while (iter++ < maxiter) {
|
32
|
+
func(v, fv);
|
33
|
+
double lambda_old = lambda;
|
34
|
+
lambda = Twonorm(fv);
|
35
|
+
v = fv/lambda;
|
36
|
+
if (std::abs(lambda-lambda_old) <= tol*lambda)
|
37
|
+
break;
|
38
|
+
}
|
39
|
+
return lambda;
|
40
|
+
}
|
41
|
+
|
42
|
+
} // namespace ipx
|
43
|
+
|
44
|
+
#endif // IPX_POWER_METHOD_H_
|