casadi 3.6.2__cp311-none-manylinux2014_i686.whl → 3.6.4__cp311-none-manylinux2014_i686.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- casadi/_casadi.so +0 -0
- casadi/casadi.py +217 -60
- casadi/cbc +0 -0
- casadi/clp +0 -0
- casadi/cmake/alpaqa/alpaqaConfig.cmake +24 -0
- casadi/cmake/alpaqa/alpaqaConfigVersion.cmake +70 -0
- casadi/cmake/alpaqa/alpaqaTargets-release.cmake +29 -0
- casadi/cmake/alpaqa/alpaqaTargets.cmake +131 -0
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/casadi-config.cmake +4 -0
- casadi/cmake/highs/highs-config.cmake +18 -4
- casadi/cmake/highs/highs-targets-release.cmake +3 -3
- casadi/cmake/highs/highs-targets.cmake +1 -1
- casadi/cmake/sleqp/sleqp-config-version.cmake +70 -0
- casadi/cmake/sleqp/sleqp-config.cmake +1 -0
- casadi/cmake/sleqp/sleqp-targets-release.cmake +20 -0
- casadi/cmake/sleqp/sleqp-targets.cmake +102 -0
- casadi/cmake/trlib/trlib-config-release.cmake +19 -0
- casadi/cmake/trlib/trlib-config-version.cmake +88 -0
- casadi/cmake/trlib/trlib-config.cmake +107 -0
- casadi/highs +0 -0
- casadi/include/casadi/casadi.i +20 -3
- casadi/include/casadi/config.h +8 -8
- casadi/include/casadi/core/calculus.hpp +1 -1
- casadi/include/casadi/core/code_generator.hpp +10 -0
- casadi/include/casadi/core/fmu.hpp +224 -0
- casadi/include/casadi/core/generic_matrix.hpp +4 -2
- casadi/include/casadi/core/nlpsol.hpp +0 -2
- casadi/include/casadi/core/runtime/casadi_finite_diff.hpp +204 -11
- casadi/include/casadi/core/serializing_stream.hpp +12 -0
- casadi/include/casadi/core/sparsity_interface.hpp +55 -1
- casadi/include/casadi/doc.i +916 -462
- casadi/include/casadi/doc_merged.i +492 -176
- casadi/include/casadi/mem.h +13 -2
- casadi/include/casadi/valgrind-casadi.supp +82 -0
- casadi/include/casadi/valgrind-python.supp +39 -0
- casadi/include/highs/HConfig.h +4 -7
- casadi/include/highs/Highs.h +240 -51
- casadi/include/highs/filereaderlp/builder.hpp +12 -13
- casadi/include/highs/filereaderlp/model.hpp +32 -35
- casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
- casadi/include/highs/interfaces/highs_c_api.h +964 -577
- casadi/include/highs/io/Filereader.h +2 -4
- casadi/include/highs/io/FilereaderEms.h +2 -4
- casadi/include/highs/io/FilereaderLp.h +2 -4
- casadi/include/highs/io/FilereaderMps.h +2 -4
- casadi/include/highs/io/HMPSIO.h +2 -4
- casadi/include/highs/io/HMpsFF.h +2 -4
- casadi/include/highs/io/HighsIO.h +19 -13
- casadi/include/highs/io/LoadOptions.h +7 -6
- casadi/include/highs/ipm/IpxWrapper.h +4 -5
- casadi/include/highs/lp_data/HConst.h +60 -15
- casadi/include/highs/lp_data/HStruct.h +32 -8
- casadi/include/highs/lp_data/HighsAnalysis.h +2 -4
- casadi/include/highs/lp_data/HighsCallback.h +33 -0
- casadi/include/highs/lp_data/HighsCallbackStruct.h +36 -0
- casadi/include/highs/lp_data/HighsDebug.h +2 -4
- casadi/include/highs/lp_data/HighsInfo.h +22 -23
- casadi/include/highs/lp_data/HighsInfoDebug.h +2 -4
- casadi/include/highs/lp_data/HighsLp.h +14 -6
- casadi/include/highs/lp_data/HighsLpSolverObject.h +6 -5
- casadi/include/highs/lp_data/HighsLpUtils.h +23 -12
- casadi/include/highs/lp_data/HighsModelUtils.h +22 -8
- casadi/include/highs/lp_data/HighsOptions.h +175 -106
- casadi/include/highs/lp_data/HighsRanging.h +2 -4
- casadi/include/highs/lp_data/HighsRuntimeOptions.h +21 -6
- casadi/include/highs/lp_data/HighsSolution.h +4 -4
- casadi/include/highs/lp_data/HighsSolutionDebug.h +2 -4
- casadi/include/highs/lp_data/HighsSolve.h +2 -4
- casadi/include/highs/lp_data/HighsStatus.h +2 -4
- casadi/include/highs/mip/HighsCliqueTable.h +18 -20
- casadi/include/highs/mip/HighsConflictPool.h +2 -4
- casadi/include/highs/mip/HighsCutGeneration.h +2 -4
- casadi/include/highs/mip/HighsCutPool.h +2 -4
- casadi/include/highs/mip/HighsDebugSol.h +2 -4
- casadi/include/highs/mip/HighsDomain.h +5 -5
- casadi/include/highs/mip/HighsDomainChange.h +2 -4
- casadi/include/highs/mip/HighsDynamicRowMatrix.h +2 -4
- casadi/include/highs/mip/HighsGFkSolve.h +2 -4
- casadi/include/highs/mip/HighsImplications.h +2 -4
- casadi/include/highs/mip/HighsLpAggregator.h +2 -4
- casadi/include/highs/mip/HighsLpRelaxation.h +2 -4
- casadi/include/highs/mip/HighsMipSolver.h +18 -6
- casadi/include/highs/mip/HighsMipSolverData.h +8 -4
- casadi/include/highs/mip/HighsModkSeparator.h +2 -4
- casadi/include/highs/mip/HighsNodeQueue.h +3 -9
- casadi/include/highs/mip/HighsObjectiveFunction.h +2 -4
- casadi/include/highs/mip/HighsPathSeparator.h +2 -4
- casadi/include/highs/mip/HighsPrimalHeuristics.h +2 -4
- casadi/include/highs/mip/HighsPseudocost.h +2 -4
- casadi/include/highs/mip/HighsRedcostFixing.h +2 -4
- casadi/include/highs/mip/HighsSearch.h +2 -4
- casadi/include/highs/mip/HighsSeparation.h +2 -4
- casadi/include/highs/mip/HighsSeparator.h +2 -4
- casadi/include/highs/mip/HighsTableauSeparator.h +2 -4
- casadi/include/highs/mip/HighsTransformedLp.h +2 -4
- casadi/include/highs/model/HighsHessian.h +3 -1
- casadi/include/highs/model/HighsModel.h +2 -0
- casadi/include/highs/parallel/HighsSpinMutex.h +2 -1
- casadi/include/highs/parallel/HighsSplitDeque.h +1 -1
- casadi/include/highs/parallel/HighsTaskExecutor.h +10 -2
- casadi/include/highs/presolve/HPresolve.h +9 -6
- casadi/include/highs/presolve/HPresolveAnalysis.h +5 -4
- casadi/include/highs/presolve/HighsPostsolveStack.h +50 -13
- casadi/include/highs/presolve/HighsSymmetry.h +2 -4
- casadi/include/highs/presolve/ICrash.h +4 -3
- casadi/include/highs/presolve/ICrashUtil.h +2 -2
- casadi/include/highs/presolve/ICrashX.h +4 -6
- casadi/include/highs/presolve/PresolveComponent.h +4 -42
- casadi/include/highs/qpsolver/a_asm.hpp +56 -0
- casadi/include/highs/qpsolver/a_quass.hpp +12 -0
- casadi/include/highs/qpsolver/quass.hpp +1 -4
- casadi/include/highs/simplex/HApp.h +14 -16
- casadi/include/highs/simplex/HEkk.h +12 -11
- casadi/include/highs/simplex/HEkkDual.h +2 -4
- casadi/include/highs/simplex/HEkkDualRHS.h +5 -6
- casadi/include/highs/simplex/HEkkDualRow.h +2 -4
- casadi/include/highs/simplex/HEkkPrimal.h +2 -4
- casadi/include/highs/simplex/HSimplex.h +2 -4
- casadi/include/highs/simplex/HSimplexDebug.h +2 -4
- casadi/include/highs/simplex/HSimplexNla.h +2 -4
- casadi/include/highs/simplex/HSimplexReport.h +3 -5
- casadi/include/highs/simplex/HighsSimplexAnalysis.h +2 -4
- casadi/include/highs/simplex/SimplexConst.h +7 -5
- casadi/include/highs/simplex/SimplexStruct.h +11 -5
- casadi/include/highs/simplex/SimplexTimer.h +2 -4
- casadi/include/highs/test/DevKkt.h +2 -4
- casadi/include/highs/test/KktCh2.h +2 -4
- casadi/include/highs/util/FactorTimer.h +2 -4
- casadi/include/highs/util/HFactor.h +2 -4
- casadi/include/highs/util/HFactorConst.h +2 -4
- casadi/include/highs/util/HFactorDebug.h +2 -4
- casadi/include/highs/util/HSet.h +3 -5
- casadi/include/highs/util/HVector.h +2 -4
- casadi/include/highs/util/HVectorBase.h +2 -4
- casadi/include/highs/util/HighsCDouble.h +2 -4
- casadi/include/highs/util/HighsComponent.h +2 -4
- casadi/include/highs/util/HighsDataStack.h +3 -5
- casadi/include/highs/util/HighsDisjointSets.h +8 -10
- casadi/include/highs/util/HighsHash.h +22 -7
- casadi/include/highs/util/HighsHashTree.h +25 -7
- casadi/include/highs/util/HighsInt.h +2 -4
- casadi/include/highs/util/HighsIntegers.h +2 -4
- casadi/include/highs/util/HighsLinearSumBounds.h +2 -4
- casadi/include/highs/util/HighsMatrixPic.h +2 -4
- casadi/include/highs/util/HighsMatrixSlice.h +2 -4
- casadi/include/highs/util/HighsMatrixUtils.h +2 -4
- casadi/include/highs/util/HighsRandom.h +2 -4
- casadi/include/highs/util/HighsRbTree.h +2 -4
- casadi/include/highs/util/HighsSort.h +2 -4
- casadi/include/highs/util/HighsSparseMatrix.h +11 -7
- casadi/include/highs/util/HighsSparseVectorSum.h +2 -4
- casadi/include/highs/util/HighsSplay.h +2 -4
- casadi/include/highs/util/HighsTimer.h +3 -4
- casadi/include/highs/util/HighsUtils.h +14 -4
- casadi/include/highs/util/stringutil.h +2 -4
- casadi/include/licenses/alpaqa-external/LICENSE +165 -0
- casadi/include/licenses/highs-external/LICENSE +1 -1
- casadi/include/licenses/sleqp-external/LICENSE +165 -0
- casadi/include/licenses/trlib-external/LICENSE +21 -0
- casadi/include/trlib/trlib_eigen_inverse.h +118 -0
- casadi/include/trlib/trlib_krylov.h +493 -0
- casadi/include/trlib/trlib_leftmost.h +181 -0
- casadi/include/trlib/trlib_private.h +109 -0
- casadi/include/trlib/trlib_quadratic_zero.h +57 -0
- casadi/include/trlib/trlib_tri_factor.h +409 -0
- casadi/include/trlib/trlib_types.h +36 -0
- casadi/lib/libtinyxml2.a +0 -0
- casadi/libCbc.la +3 -3
- casadi/libCbc.so +0 -0
- casadi/libCbc.so.3 +0 -0
- casadi/libCbc.so.3.10.11 +0 -0
- casadi/libCbcSolver.la +3 -3
- casadi/libCbcSolver.so +0 -0
- casadi/libCbcSolver.so.3 +0 -0
- casadi/libCbcSolver.so.3.10.11 +0 -0
- casadi/libCgl.la +2 -2
- casadi/libCgl.so +0 -0
- casadi/libCgl.so.1 +0 -0
- casadi/libCgl.so.1.10.8 +0 -0
- casadi/libClp.la +2 -2
- casadi/libClp.so +0 -0
- casadi/libClp.so.1 +0 -0
- casadi/{libClp.so.1.14.7 → libClp.so.1.14.9} +0 -0
- casadi/libClpSolver.la +2 -2
- casadi/libClpSolver.so +0 -0
- casadi/libClpSolver.so.1 +0 -0
- casadi/{libClpSolver.so.1.14.7 → libClpSolver.so.1.14.9} +0 -0
- casadi/libCoinUtils.la +2 -2
- casadi/libCoinUtils.so +0 -0
- casadi/libCoinUtils.so.3 +0 -0
- casadi/libCoinUtils.so.3.11.10 +0 -0
- casadi/libFortranHighs.so +0 -0
- casadi/libOsi.la +2 -2
- casadi/libOsiCbc.la +3 -3
- casadi/libOsiCbc.so +0 -0
- casadi/libOsiCbc.so.3 +0 -0
- casadi/{libOsiCbc.so.3.10.6 → libOsiCbc.so.3.10.11} +0 -0
- casadi/libOsiClp.la +2 -2
- casadi/libOsiClp.so +0 -0
- casadi/libOsiClp.so.1 +0 -0
- casadi/libOsiClp.so.1.14.9 +0 -0
- casadi/libOsiCommonTests.la +2 -2
- casadi/libOsiCommonTests.so +0 -0
- casadi/libOsiCommonTests.so.1 +0 -0
- casadi/{libOsiCommonTests.so.1.13.7 → libOsiCommonTests.so.1.13.9} +0 -0
- casadi/libalpaqa-dl-loader.so +0 -0
- casadi/libalpaqa-dl-loader.so.1.0.0 +0 -0
- casadi/libalpaqa.so +0 -0
- casadi/libalpaqa.so.1.0.0 +0 -0
- casadi/libbonmin.la +3 -3
- casadi/libbonmin.so +0 -0
- casadi/libbonmin.so.4 +0 -0
- casadi/libbonmin.so.4.8.9 +0 -0
- casadi/libcasadi.so +0 -0
- casadi/libcasadi.so.3.7 +0 -0
- casadi/libcasadi_conic_cbc.so +0 -0
- casadi/libcasadi_conic_cbc.so.3.7 +0 -0
- casadi/libcasadi_conic_clp.so +0 -0
- casadi/libcasadi_conic_clp.so.3.7 +0 -0
- casadi/libcasadi_conic_gurobi.so +0 -0
- casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
- casadi/libcasadi_conic_highs.so +0 -0
- casadi/libcasadi_conic_highs.so.3.7 +0 -0
- casadi/libcasadi_conic_ipqp.so +0 -0
- casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
- casadi/libcasadi_conic_nlpsol.so +0 -0
- casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_conic_osqp.so +0 -0
- casadi/libcasadi_conic_osqp.so.3.7 +0 -0
- casadi/libcasadi_conic_proxqp.so +0 -0
- casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
- casadi/libcasadi_conic_qpoases.so +0 -0
- casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
- casadi/libcasadi_conic_qrqp.so +0 -0
- casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
- casadi/libcasadi_conic_superscs.so +0 -0
- casadi/libcasadi_conic_superscs.so.3.7 +0 -0
- casadi/libcasadi_integrator_collocation.so +0 -0
- casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
- casadi/libcasadi_integrator_cvodes.so +0 -0
- casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
- casadi/libcasadi_integrator_idas.so +0 -0
- casadi/libcasadi_integrator_idas.so.3.7 +0 -0
- casadi/libcasadi_interpolant_bspline.so +0 -0
- casadi/libcasadi_interpolant_bspline.so.3.7 +0 -0
- casadi/libcasadi_interpolant_linear.so +0 -0
- casadi/libcasadi_interpolant_linear.so.3.7 +0 -0
- casadi/libcasadi_linsol_lapacklu.so +0 -0
- casadi/libcasadi_linsol_lapacklu.so.3.7 +0 -0
- casadi/libcasadi_linsol_lapackqr.so +0 -0
- casadi/libcasadi_linsol_lapackqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_ldl.so +0 -0
- casadi/libcasadi_linsol_ldl.so.3.7 +0 -0
- casadi/libcasadi_linsol_mumps.so +0 -0
- casadi/libcasadi_linsol_mumps.so.3.7 +0 -0
- casadi/libcasadi_linsol_qr.so +0 -0
- casadi/libcasadi_linsol_qr.so.3.7 +0 -0
- casadi/libcasadi_linsol_symbolicqr.so +0 -0
- casadi/libcasadi_linsol_symbolicqr.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ampl.so +0 -0
- casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_bonmin.so +0 -0
- casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ipopt.so +0 -0
- casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_knitro.so +0 -0
- casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_scpgen.so +0 -0
- casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sleqp.so +0 -0
- casadi/libcasadi_nlpsol_sleqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_snopt.so +0 -0
- casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_worhp.so +0 -0
- casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_newton.so +0 -0
- casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
- casadi/libcasadi_sundials_common.so +0 -0
- casadi/libcasadi_sundials_common.so.3.7 +0 -0
- casadi/libhighs.so +0 -0
- casadi/libhighs.so.1.6 +0 -0
- casadi/libhighs.so.1.6.0 +0 -0
- casadi/libindirect.a +0 -0
- casadi/liblinsys.a +0 -0
- casadi/libosqp.a +0 -0
- casadi/libqdldl.a +0 -0
- casadi/libsleqp.so +0 -0
- casadi/libsleqp.so.1.0.1 +0 -0
- casadi/libspral.a +0 -0
- casadi/libsuperscs.a +0 -0
- casadi/libtrlib.so +0 -0
- casadi/libtrlib.so.0.4 +0 -0
- casadi/pkgconfig/blas.pc +11 -0
- casadi/pkgconfig/bonmin.pc +1 -1
- casadi/pkgconfig/casadi.pc +1 -1
- casadi/pkgconfig/cbc.pc +2 -2
- casadi/pkgconfig/cgl.pc +2 -2
- casadi/pkgconfig/clp.pc +1 -1
- casadi/pkgconfig/coinutils.pc +1 -1
- casadi/pkgconfig/highs.pc +3 -3
- casadi/pkgconfig/lapack.pc +11 -0
- casadi/pkgconfig/openblas.pc +1 -1
- casadi/pkgconfig/osi-cbc.pc +1 -1
- casadi/pkgconfig/osi-clp.pc +1 -1
- casadi/pkgconfig/osi-unittests.pc +1 -1
- casadi/pkgconfig/osi.pc +1 -1
- casadi/pkgconfig/sleqp.pc +10 -0
- {casadi-3.6.2.dist-info → casadi-3.6.4.dist-info}/METADATA +1 -1
- {casadi-3.6.2.dist-info → casadi-3.6.4.dist-info}/RECORD +324 -283
- casadi/libCbc.so.3.10.6 +0 -0
- casadi/libCbcSolver.so.3.10.6 +0 -0
- casadi/libCgl.so.1.10.4 +0 -0
- casadi/libCoinUtils.so.3.11.6 +0 -0
- casadi/libOsiClp.so.1.14.7 +0 -0
- casadi/libbonmin.so.4.8.8 +0 -0
- casadi/libhighs.so.1.4 +0 -0
- casadi/libhighs.so.1.4.0 +0 -0
- /casadi/{libOsi.so.1.13.7 → libOsi.so.1.13.9} +0 -0
- {casadi-3.6.2.dist-info → casadi-3.6.4.dist-info}/WHEEL +0 -0
casadi/include/highs/Highs.h
CHANGED
@@ -2,13 +2,11 @@
|
|
2
2
|
/* */
|
3
3
|
/* This file is part of the HiGHS linear optimization suite */
|
4
4
|
/* */
|
5
|
-
/* Written and engineered 2008-
|
5
|
+
/* Written and engineered 2008-2023 by Julian Hall, Ivet Galabova, */
|
6
|
+
/* Leona Gottwald and Michael Feldmeier */
|
6
7
|
/* */
|
7
8
|
/* Available as open-source under the MIT License */
|
8
9
|
/* */
|
9
|
-
/* Authors: Julian Hall, Ivet Galabova, Leona Gottwald and Michael */
|
10
|
-
/* Feldmeier */
|
11
|
-
/* */
|
12
10
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
13
11
|
/**@file Highs.h
|
14
12
|
* @brief The HiGHS class
|
@@ -18,6 +16,7 @@
|
|
18
16
|
|
19
17
|
#include <sstream>
|
20
18
|
|
19
|
+
#include "lp_data/HighsCallback.h"
|
21
20
|
#include "lp_data/HighsLpUtils.h"
|
22
21
|
#include "lp_data/HighsRanging.h"
|
23
22
|
#include "lp_data/HighsSolutionDebug.h"
|
@@ -25,6 +24,21 @@
|
|
25
24
|
#include "presolve/ICrash.h"
|
26
25
|
#include "presolve/PresolveComponent.h"
|
27
26
|
|
27
|
+
/**
|
28
|
+
* @brief Return the version
|
29
|
+
*/
|
30
|
+
const char* highsVersion();
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @brief Return detailed version information, githash and compilation
|
34
|
+
* date
|
35
|
+
*/
|
36
|
+
HighsInt highsVersionMajor();
|
37
|
+
HighsInt highsVersionMinor();
|
38
|
+
HighsInt highsVersionPatch();
|
39
|
+
const char* highsGithash();
|
40
|
+
const char* highsCompilationDate();
|
41
|
+
|
28
42
|
/**
|
29
43
|
* @brief Class to set parameters and run HiGHS
|
30
44
|
*/
|
@@ -32,13 +46,43 @@ class Highs {
|
|
32
46
|
public:
|
33
47
|
Highs();
|
34
48
|
virtual ~Highs() {
|
35
|
-
FILE*
|
36
|
-
if (
|
37
|
-
assert(
|
38
|
-
fclose(
|
49
|
+
FILE* log_stream = options_.log_options.log_stream;
|
50
|
+
if (log_stream != nullptr) {
|
51
|
+
assert(log_stream != stdout);
|
52
|
+
fclose(log_stream);
|
39
53
|
}
|
40
54
|
}
|
41
55
|
|
56
|
+
/**
|
57
|
+
* @brief Return the version as a string
|
58
|
+
*/
|
59
|
+
std::string version() const { return highsVersion(); }
|
60
|
+
|
61
|
+
/**
|
62
|
+
* @brief Return major version
|
63
|
+
*/
|
64
|
+
HighsInt versionMajor() const { return highsVersionMajor(); }
|
65
|
+
|
66
|
+
/**
|
67
|
+
* @brief Return minor version
|
68
|
+
*/
|
69
|
+
HighsInt versionMinor() const { return highsVersionMinor(); }
|
70
|
+
|
71
|
+
/**
|
72
|
+
* @brief Return patch version
|
73
|
+
*/
|
74
|
+
HighsInt versionPatch() const { return highsVersionPatch(); }
|
75
|
+
|
76
|
+
/**
|
77
|
+
* @brief Return githash
|
78
|
+
*/
|
79
|
+
std::string githash() const { return highsGithash(); }
|
80
|
+
|
81
|
+
/**
|
82
|
+
* @brief Return compilation date
|
83
|
+
*/
|
84
|
+
std::string compilationDate() const { return highsCompilationDate(); }
|
85
|
+
|
42
86
|
/**
|
43
87
|
* @brief Reset the options and then call clearModel()
|
44
88
|
*/
|
@@ -111,6 +155,15 @@ class Highs {
|
|
111
155
|
HighsStatus passHessian(const HighsInt dim, const HighsInt num_nz,
|
112
156
|
const HighsInt format, const HighsInt* start,
|
113
157
|
const HighsInt* index, const double* value);
|
158
|
+
/**
|
159
|
+
* @brief Pass a column name to the incumbent model
|
160
|
+
*/
|
161
|
+
HighsStatus passColName(const HighsInt col, const std::string& name);
|
162
|
+
|
163
|
+
/**
|
164
|
+
* @brief Pass a row name to the incumbent model
|
165
|
+
*/
|
166
|
+
HighsStatus passRowName(const HighsInt row, const std::string& name);
|
114
167
|
|
115
168
|
/**
|
116
169
|
* @brief Read in a model
|
@@ -133,7 +186,12 @@ class Highs {
|
|
133
186
|
HighsStatus run();
|
134
187
|
|
135
188
|
/**
|
136
|
-
* @brief Postsolve the incumbent model
|
189
|
+
* @brief Postsolve the incumbent model using a solution
|
190
|
+
*/
|
191
|
+
HighsStatus postsolve(const HighsSolution& solution);
|
192
|
+
|
193
|
+
/**
|
194
|
+
* @brief Postsolve the incumbent model using a solution and basis
|
137
195
|
*/
|
138
196
|
HighsStatus postsolve(const HighsSolution& solution, const HighsBasis& basis);
|
139
197
|
|
@@ -150,10 +208,12 @@ class Highs {
|
|
150
208
|
const HighsInt style = kSolutionStyleRaw);
|
151
209
|
|
152
210
|
/**
|
153
|
-
* @brief
|
154
|
-
* after calling
|
211
|
+
* @brief Assess the validity, integrality and feasibility of the
|
212
|
+
* current primal solution. Of value after calling
|
213
|
+
* Highs::readSolution
|
155
214
|
*/
|
156
|
-
HighsStatus
|
215
|
+
HighsStatus assessPrimalSolution(bool& valid, bool& integral,
|
216
|
+
bool& feasible) const;
|
157
217
|
|
158
218
|
/**
|
159
219
|
* Methods for HiGHS option input/output
|
@@ -199,21 +259,34 @@ class Highs {
|
|
199
259
|
/**
|
200
260
|
* @brief Gets an option value as bool/HighsInt/double/string and, for
|
201
261
|
* bool/int/double, only if it's of the correct type.
|
262
|
+
*
|
263
|
+
* NB Deprecate in v2.0, in order to replace with more general
|
264
|
+
* get*OptionValues
|
202
265
|
*/
|
203
|
-
HighsStatus getOptionValue(const std::string& option, bool& value) const
|
266
|
+
HighsStatus getOptionValue(const std::string& option, bool& value) const {
|
267
|
+
return this->getBoolOptionValues(option, &value);
|
268
|
+
}
|
204
269
|
|
205
|
-
HighsStatus getOptionValue(const std::string& option, HighsInt& value) const
|
270
|
+
HighsStatus getOptionValue(const std::string& option, HighsInt& value) const {
|
271
|
+
return this->getIntOptionValues(option, &value);
|
272
|
+
}
|
206
273
|
|
207
|
-
HighsStatus getOptionValue(const std::string& option, double& value) const
|
274
|
+
HighsStatus getOptionValue(const std::string& option, double& value) const {
|
275
|
+
return this->getDoubleOptionValues(option, &value);
|
276
|
+
}
|
208
277
|
|
209
278
|
HighsStatus getOptionValue(const std::string& option,
|
210
|
-
std::string& value) const
|
279
|
+
std::string& value) const {
|
280
|
+
return this->getStringOptionValues(option, &value);
|
281
|
+
}
|
211
282
|
|
212
283
|
/**
|
213
284
|
* @brief Get the type expected by an option
|
214
285
|
*/
|
215
286
|
HighsStatus getOptionType(const std::string& option,
|
216
|
-
HighsOptionType& type) const
|
287
|
+
HighsOptionType& type) const {
|
288
|
+
return this->getOptionType(option, &type);
|
289
|
+
}
|
217
290
|
|
218
291
|
/**
|
219
292
|
* @brief Reset the options to the default values
|
@@ -228,6 +301,56 @@ class Highs {
|
|
228
301
|
HighsStatus writeOptions(const std::string& filename, //!< The filename
|
229
302
|
const bool report_only_deviations = false) const;
|
230
303
|
|
304
|
+
/**
|
305
|
+
* @brief Returns the number of user-settable options
|
306
|
+
*/
|
307
|
+
HighsInt getNumOptions() const {
|
308
|
+
return this->options_.num_user_settable_options_;
|
309
|
+
}
|
310
|
+
|
311
|
+
/**
|
312
|
+
* @brief Get the number of user-settable options
|
313
|
+
*/
|
314
|
+
HighsStatus getOptionName(const HighsInt index, std::string* name) const;
|
315
|
+
|
316
|
+
/**
|
317
|
+
* @brief Get the type of an option
|
318
|
+
*/
|
319
|
+
HighsStatus getOptionType(const std::string& option,
|
320
|
+
HighsOptionType* type) const;
|
321
|
+
|
322
|
+
/**
|
323
|
+
* @brief Get the current and default values of a bool option
|
324
|
+
*/
|
325
|
+
HighsStatus getBoolOptionValues(const std::string& option,
|
326
|
+
bool* current_value = nullptr,
|
327
|
+
bool* default_value = nullptr) const;
|
328
|
+
|
329
|
+
/**
|
330
|
+
* @brief Get the current, min, max and default values of an int option
|
331
|
+
*/
|
332
|
+
HighsStatus getIntOptionValues(const std::string& option,
|
333
|
+
HighsInt* current_value = nullptr,
|
334
|
+
HighsInt* min_value = nullptr,
|
335
|
+
HighsInt* max_value = nullptr,
|
336
|
+
HighsInt* default_value = nullptr) const;
|
337
|
+
|
338
|
+
/**
|
339
|
+
* @brief Get the current, min, max and default values of a double option
|
340
|
+
*/
|
341
|
+
HighsStatus getDoubleOptionValues(const std::string& option,
|
342
|
+
double* current_value = nullptr,
|
343
|
+
double* min_value = nullptr,
|
344
|
+
double* max_value = nullptr,
|
345
|
+
double* default_value = nullptr) const;
|
346
|
+
|
347
|
+
/**
|
348
|
+
* @brief Get the current and default values of a string option
|
349
|
+
*/
|
350
|
+
HighsStatus getStringOptionValues(const std::string& option,
|
351
|
+
std::string* current_value = nullptr,
|
352
|
+
std::string* default_value = nullptr) const;
|
353
|
+
|
231
354
|
/**
|
232
355
|
* @brief Get a const reference to the internal info values
|
233
356
|
* type.
|
@@ -247,12 +370,14 @@ class Highs {
|
|
247
370
|
|
248
371
|
HighsStatus getInfoValue(const std::string& info, double& value) const;
|
249
372
|
|
373
|
+
HighsStatus getInfoType(const std::string& info, HighsInfoType& type) const;
|
374
|
+
|
250
375
|
/**
|
251
376
|
* @brief Write info values to a file, with the extension ".html"
|
252
377
|
* producing HTML, otherwise using the standard format used to read
|
253
378
|
* options from a file.
|
254
379
|
*/
|
255
|
-
HighsStatus writeInfo(const std::string& filename) const;
|
380
|
+
HighsStatus writeInfo(const std::string& filename = "") const;
|
256
381
|
|
257
382
|
/**
|
258
383
|
* @brief Get the value of infinity used by HiGHS
|
@@ -299,6 +424,21 @@ class Highs {
|
|
299
424
|
*/
|
300
425
|
const HighsSolution& getSolution() const { return solution_; }
|
301
426
|
|
427
|
+
/**
|
428
|
+
* @brief Zero all clocks in the internal HighsTimer instance
|
429
|
+
*/
|
430
|
+
void zeroAllClocks() { timer_.zeroAllClocks(); };
|
431
|
+
|
432
|
+
/**
|
433
|
+
* @brief Return a const reference to the internal HighsSolution instance
|
434
|
+
*/
|
435
|
+
const std::vector<HighsObjectiveSolution>& getSavedMipSolutions() const {
|
436
|
+
return saved_objective_and_solution_;
|
437
|
+
}
|
438
|
+
|
439
|
+
/**
|
440
|
+
* @brief Return a const reference to the internal ICrash info instance
|
441
|
+
*/
|
302
442
|
const ICrashInfo& getICrashInfo() const { return icrash_info_; };
|
303
443
|
|
304
444
|
/**
|
@@ -338,10 +478,8 @@ class Highs {
|
|
338
478
|
double* primal_ray_value = nullptr);
|
339
479
|
|
340
480
|
/**
|
341
|
-
* @brief Get the ranging information for the current LP
|
342
|
-
* returning it, as well as holding it internally
|
481
|
+
* @brief Get the ranging information for the current LP
|
343
482
|
*/
|
344
|
-
HighsStatus getRanging();
|
345
483
|
HighsStatus getRanging(HighsRanging& ranging);
|
346
484
|
|
347
485
|
/**
|
@@ -360,15 +498,6 @@ class Highs {
|
|
360
498
|
*/
|
361
499
|
bool hasInvert() const;
|
362
500
|
|
363
|
-
/**
|
364
|
-
* @brief Gets the internal basic variable index array in the order
|
365
|
-
* corresponding to calls to getBasisInverseRow, getBasisInverseCol,
|
366
|
-
* getBasisSolve, getBasisTransposeSolve, getReducedRow and getReducedColumn.
|
367
|
-
* Entries are indices of columns if in [0,num_col), and entries in [num_col,
|
368
|
-
* num_col+num_row) are (num_col+row_index).
|
369
|
-
*/
|
370
|
-
const HighsInt* getBasicVariablesArray() const;
|
371
|
-
|
372
501
|
/**
|
373
502
|
* @brief Gets the basic variables in the order corresponding to
|
374
503
|
* calls to getBasisInverseRow, getBasisInverseCol, getBasisSolve,
|
@@ -378,15 +507,6 @@ class Highs {
|
|
378
507
|
*/
|
379
508
|
HighsStatus getBasicVariables(HighsInt* basic_variables);
|
380
509
|
|
381
|
-
/**
|
382
|
-
* @brief Form a row of \f$B^{-1}\f$ for basis matrix \f$B\f$,
|
383
|
-
* returning the result in the given HVector buffer which is
|
384
|
-
* expected to be setup with dimension num_row. The buffers
|
385
|
-
* previous contents will be overwritten.
|
386
|
-
*/
|
387
|
-
HighsStatus getBasisInverseRowSparse(const HighsInt row,
|
388
|
-
HVector& row_ep_buffer);
|
389
|
-
|
390
510
|
/**
|
391
511
|
* @brief Form a row of \f$B^{-1}\f$ for basis matrix \f$B\f$,
|
392
512
|
* returning the indices of the nonzeros unless row_num_nz is
|
@@ -529,6 +649,22 @@ class Highs {
|
|
529
649
|
double* value //!< Array of size num_nz with row values for the columns
|
530
650
|
);
|
531
651
|
|
652
|
+
/**
|
653
|
+
* @brief Get a column name from the incumbent model
|
654
|
+
*/
|
655
|
+
HighsStatus getColName(const HighsInt col, std::string& name) const;
|
656
|
+
|
657
|
+
/**
|
658
|
+
* @brief Get column index corresponding to name
|
659
|
+
*/
|
660
|
+
HighsStatus getColByName(const std::string& name, HighsInt& col);
|
661
|
+
|
662
|
+
/**
|
663
|
+
* @brief Get a column integrality from the incumbent model
|
664
|
+
*/
|
665
|
+
HighsStatus getColIntegrality(const HighsInt col,
|
666
|
+
HighsVarType& integrality) const;
|
667
|
+
|
532
668
|
/**
|
533
669
|
* @brief Get multiple rows from the model given by an interval [from_row,
|
534
670
|
* to_row]
|
@@ -583,6 +719,16 @@ class Highs {
|
|
583
719
|
double* value //!< Array of size num_nz with column values for the rows
|
584
720
|
);
|
585
721
|
|
722
|
+
/**
|
723
|
+
* @brief Get a row name from the incumbent model
|
724
|
+
*/
|
725
|
+
HighsStatus getRowName(const HighsInt row, std::string& name) const;
|
726
|
+
|
727
|
+
/**
|
728
|
+
* @brief Get row index corresponding to name
|
729
|
+
*/
|
730
|
+
HighsStatus getRowByName(const std::string& name, HighsInt& row);
|
731
|
+
|
586
732
|
/**
|
587
733
|
* @brief Get a matrix coefficient
|
588
734
|
*/
|
@@ -591,12 +737,12 @@ class Highs {
|
|
591
737
|
/**
|
592
738
|
* @brief Write out the incumbent model to a file
|
593
739
|
*/
|
594
|
-
HighsStatus writeModel(const std::string& filename);
|
740
|
+
HighsStatus writeModel(const std::string& filename = "");
|
595
741
|
|
596
742
|
/**
|
597
743
|
* @brief Write out the internal HighsBasis instance to a file
|
598
744
|
*/
|
599
|
-
HighsStatus writeBasis(const std::string& filename);
|
745
|
+
HighsStatus writeBasis(const std::string& filename = "");
|
600
746
|
|
601
747
|
/**
|
602
748
|
* Methods for incumbent model modification
|
@@ -871,11 +1017,22 @@ class Highs {
|
|
871
1017
|
HighsStatus setSolution(const HighsSolution& solution);
|
872
1018
|
|
873
1019
|
/**
|
874
|
-
* @brief Set the callback method
|
1020
|
+
* @brief Set the callback method to use for HiGHS
|
875
1021
|
*/
|
876
|
-
HighsStatus
|
877
|
-
|
878
|
-
|
1022
|
+
HighsStatus setCallback(void (*user_callback)(const int, const char*,
|
1023
|
+
const HighsCallbackDataOut*,
|
1024
|
+
HighsCallbackDataIn*, void*),
|
1025
|
+
void* user_callback_data = nullptr);
|
1026
|
+
|
1027
|
+
/**
|
1028
|
+
* @brief Start callback of given type
|
1029
|
+
*/
|
1030
|
+
HighsStatus startCallback(const int callback_type);
|
1031
|
+
|
1032
|
+
/**
|
1033
|
+
* @brief Stop callback of given type
|
1034
|
+
*/
|
1035
|
+
HighsStatus stopCallback(const int callback_type);
|
879
1036
|
|
880
1037
|
/**
|
881
1038
|
* @brief Use the HighsBasis passed to set the internal HighsBasis
|
@@ -904,6 +1061,8 @@ class Highs {
|
|
904
1061
|
/**
|
905
1062
|
* @brief Interpret common qualifiers to string values
|
906
1063
|
*/
|
1064
|
+
std::string presolveStatusToString(
|
1065
|
+
const HighsPresolveStatus presolve_status) const;
|
907
1066
|
std::string modelStatusToString(const HighsModelStatus model_status) const;
|
908
1067
|
std::string solutionStatusToString(const HighsInt solution_status) const;
|
909
1068
|
std::string basisStatusToString(const HighsBasisStatus basis_status) const;
|
@@ -984,11 +1143,30 @@ class Highs {
|
|
984
1143
|
: nullptr;
|
985
1144
|
}
|
986
1145
|
|
987
|
-
|
988
|
-
|
989
|
-
|
1146
|
+
/**
|
1147
|
+
* @brief Gets the internal basic variable index array in the order
|
1148
|
+
* corresponding to calls to getBasisInverseRow, getBasisInverseCol,
|
1149
|
+
* getBasisSolve, getBasisTransposeSolve, getReducedRow and getReducedColumn.
|
1150
|
+
* Entries are indices of columns if in [0,num_col), and entries in [num_col,
|
1151
|
+
* num_col+num_row) are (num_col+row_index).
|
1152
|
+
*/
|
1153
|
+
const HighsInt* getBasicVariablesArray() const;
|
1154
|
+
|
1155
|
+
/**
|
1156
|
+
* @brief Form a row of \f$B^{-1}\f$ for basis matrix \f$B\f$,
|
1157
|
+
* returning the result in the given HVector buffer which is
|
1158
|
+
* expected to be setup with dimension num_row. The buffers
|
1159
|
+
* previous contents will be overwritten.
|
1160
|
+
*/
|
1161
|
+
HighsStatus getBasisInverseRowSparse(const HighsInt row,
|
1162
|
+
HVector& row_ep_buffer);
|
1163
|
+
|
990
1164
|
// Start of deprecated methods
|
991
1165
|
|
1166
|
+
HighsStatus setLogCallback(void (*user_log_callback)(HighsLogType,
|
1167
|
+
const char*, void*),
|
1168
|
+
void* user_log_callback_data = nullptr);
|
1169
|
+
|
992
1170
|
HighsInt getNumCols() const {
|
993
1171
|
deprecationMessage("getNumCols", "getNumCol");
|
994
1172
|
return getNumCol();
|
@@ -1093,10 +1271,13 @@ class Highs {
|
|
1093
1271
|
HighsModel presolved_model_;
|
1094
1272
|
HighsTimer timer_;
|
1095
1273
|
|
1274
|
+
HighsCallback callback_;
|
1096
1275
|
HighsOptions options_;
|
1097
1276
|
HighsInfo info_;
|
1098
1277
|
HighsRanging ranging_;
|
1099
1278
|
|
1279
|
+
std::vector<HighsObjectiveSolution> saved_objective_and_solution_;
|
1280
|
+
|
1100
1281
|
HighsPresolveStatus model_presolve_status_ =
|
1101
1282
|
HighsPresolveStatus::kNotPresolved;
|
1102
1283
|
HighsModelStatus model_status_ = HighsModelStatus::kNotset;
|
@@ -1120,7 +1301,7 @@ class Highs {
|
|
1120
1301
|
this->model_.hessian_.exactResize();
|
1121
1302
|
}
|
1122
1303
|
|
1123
|
-
HighsStatus
|
1304
|
+
HighsStatus assignContinuousAtDiscreteSolution();
|
1124
1305
|
|
1125
1306
|
HighsStatus callSolveLp(HighsLp& lp, const string message);
|
1126
1307
|
HighsStatus callSolveQp();
|
@@ -1129,11 +1310,12 @@ class Highs {
|
|
1129
1310
|
const HighsBasis& basis);
|
1130
1311
|
|
1131
1312
|
PresolveComponent presolve_;
|
1132
|
-
HighsPresolveStatus runPresolve(const bool
|
1313
|
+
HighsPresolveStatus runPresolve(const bool force_lp_presolve,
|
1314
|
+
const bool force_presolve = false);
|
1133
1315
|
HighsPostsolveStatus runPostsolve();
|
1134
1316
|
|
1135
1317
|
HighsStatus openWriteFile(const string filename, const string method_name,
|
1136
|
-
FILE*& file,
|
1318
|
+
FILE*& file, HighsFileType& file_type) const;
|
1137
1319
|
|
1138
1320
|
void reportModel();
|
1139
1321
|
void newHighsBasis();
|
@@ -1182,6 +1364,8 @@ class Highs {
|
|
1182
1364
|
// Invalidates ekk_instance_
|
1183
1365
|
void invalidateEkk();
|
1184
1366
|
|
1367
|
+
HighsStatus returnFromWriteSolution(FILE* file,
|
1368
|
+
const HighsStatus return_status);
|
1185
1369
|
HighsStatus returnFromRun(const HighsStatus return_status);
|
1186
1370
|
HighsStatus returnFromHighs(const HighsStatus return_status);
|
1187
1371
|
void reportSolvedLpQpStats();
|
@@ -1259,12 +1443,17 @@ class Highs {
|
|
1259
1443
|
|
1260
1444
|
HighsStatus getPrimalRayInterface(bool& has_primal_ray,
|
1261
1445
|
double* primal_ray_value);
|
1446
|
+
HighsStatus getRangingInterface();
|
1262
1447
|
bool aFormatOk(const HighsInt num_nz, const HighsInt format);
|
1263
1448
|
bool qFormatOk(const HighsInt num_nz, const HighsInt format);
|
1264
1449
|
void clearZeroHessian();
|
1265
1450
|
HighsStatus checkOptimality(const std::string& solver_type,
|
1266
1451
|
HighsStatus return_status);
|
1267
1452
|
HighsStatus invertRequirementError(std::string method_name);
|
1453
|
+
HighsStatus lpInvertRequirementError(std::string method_name);
|
1454
|
+
|
1455
|
+
HighsStatus handleInfCost();
|
1456
|
+
void restoreInfCost(HighsStatus& return_status);
|
1268
1457
|
};
|
1269
1458
|
|
1270
1459
|
#endif
|
@@ -1,26 +1,25 @@
|
|
1
1
|
#ifndef __READERLP_BUILDER_HPP__
|
2
2
|
#define __READERLP_BUILDER_HPP__
|
3
3
|
|
4
|
-
#include <unordered_map>
|
5
4
|
#include <memory>
|
6
5
|
#include <string>
|
6
|
+
#include <unordered_map>
|
7
7
|
|
8
8
|
#include "model.hpp"
|
9
9
|
|
10
|
-
struct Builder {
|
11
|
-
|
10
|
+
struct Builder {
|
11
|
+
std::unordered_map<std::string, std::shared_ptr<Variable>> variables;
|
12
12
|
|
13
|
-
|
13
|
+
Model model;
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
15
|
+
std::shared_ptr<Variable> getvarbyname(const std::string& name) {
|
16
|
+
auto it = variables.find(name);
|
17
|
+
if (it != variables.end()) return it->second;
|
18
|
+
auto newvar = std::shared_ptr<Variable>(new Variable(name));
|
19
|
+
variables.insert(std::make_pair(name, newvar));
|
20
|
+
model.variables.push_back(newvar);
|
21
|
+
return newvar;
|
22
|
+
}
|
24
23
|
};
|
25
24
|
|
26
25
|
#endif
|
@@ -7,65 +7,62 @@
|
|
7
7
|
#include <vector>
|
8
8
|
|
9
9
|
enum class VariableType {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
CONTINUOUS,
|
11
|
+
BINARY,
|
12
|
+
GENERAL,
|
13
|
+
SEMICONTINUOUS,
|
14
|
+
SEMIINTEGER
|
15
15
|
};
|
16
16
|
|
17
|
-
enum class ObjectiveSense {
|
18
|
-
MIN,
|
19
|
-
MAX
|
20
|
-
};
|
17
|
+
enum class ObjectiveSense { MIN, MAX };
|
21
18
|
|
22
19
|
struct Variable {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
VariableType type = VariableType::CONTINUOUS;
|
21
|
+
double lowerbound = 0.0;
|
22
|
+
double upperbound = std::numeric_limits<double>::infinity();
|
23
|
+
std::string name;
|
27
24
|
|
28
|
-
|
25
|
+
Variable(std::string n = "") : name(n){};
|
29
26
|
};
|
30
27
|
|
31
28
|
struct LinTerm {
|
32
|
-
|
33
|
-
|
29
|
+
std::shared_ptr<Variable> var;
|
30
|
+
double coef = 1.0;
|
34
31
|
};
|
35
32
|
|
36
33
|
struct QuadTerm {
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
std::shared_ptr<Variable> var1;
|
35
|
+
std::shared_ptr<Variable> var2;
|
36
|
+
double coef = 1.0;
|
40
37
|
};
|
41
38
|
|
42
39
|
struct Expression {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
40
|
+
std::vector<std::shared_ptr<LinTerm>> linterms;
|
41
|
+
std::vector<std::shared_ptr<QuadTerm>> quadterms;
|
42
|
+
double offset = 0.0;
|
43
|
+
std::string name = "";
|
47
44
|
};
|
48
45
|
|
49
46
|
struct Constraint {
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
double lowerbound = -std::numeric_limits<double>::infinity();
|
48
|
+
double upperbound = std::numeric_limits<double>::infinity();
|
49
|
+
std::shared_ptr<Expression> expr;
|
53
50
|
|
54
|
-
|
51
|
+
Constraint() : expr(std::shared_ptr<Expression>(new Expression)){};
|
55
52
|
};
|
56
53
|
|
57
54
|
struct SOS {
|
58
|
-
|
59
|
-
|
60
|
-
|
55
|
+
std::string name = "";
|
56
|
+
short type = 0; // 1 or 2
|
57
|
+
std::vector<std::pair<std::shared_ptr<Variable>, double>> entries;
|
61
58
|
};
|
62
59
|
|
63
60
|
struct Model {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
61
|
+
std::shared_ptr<Expression> objective;
|
62
|
+
ObjectiveSense sense;
|
63
|
+
std::vector<std::shared_ptr<Constraint>> constraints;
|
64
|
+
std::vector<std::shared_ptr<Variable>> variables;
|
65
|
+
std::vector<std::shared_ptr<SOS>> soss;
|
69
66
|
};
|
70
67
|
|
71
68
|
#endif
|
Binary file
|