├── .clang-format ├── .gitignore ├── .gitlab-ci.yml ├── .gitlab └── merge_request_templates │ └── Code_Review.md ├── CHANGELOG ├── CMakeLists.txt ├── COPYING ├── COPYING.LESSER ├── Format.md ├── Makefile ├── README.md ├── binaries └── CMakeLists.txt ├── check ├── VeriPB │ ├── example.opb │ ├── example.pbp │ ├── verify_files_with_veripb.sh │ └── verify_single_file_with_veripb.sh ├── check.sh ├── check_cluster.sh ├── configuration_cluster.sh ├── configuration_logfiles.sh ├── configuration_set.sh ├── configuration_solufile.sh ├── evalcheck_cluster.sh ├── instances │ ├── IP │ │ ├── air01.opb │ │ ├── air02.opb │ │ ├── air03.opb │ │ ├── air06.opb │ │ ├── bm23.opb │ │ ├── cracpb1.opb │ │ ├── enigma.opb │ │ ├── lseu.opb │ │ └── pipex.opb │ ├── LP │ │ ├── adlittle.mps │ │ ├── afiro.mps │ │ ├── agg.mps │ │ ├── beaconfd.mps │ │ ├── bgetam.mps │ │ ├── blend.mps │ │ ├── bore3d.mps │ │ ├── box1.mps │ │ ├── brandy.mps │ │ ├── capri.mps │ │ ├── etamacro.mps │ │ ├── ex72a.mps │ │ ├── finnis.mps │ │ ├── forest6.mps │ │ ├── galenet.mps │ │ ├── gams10am.mps │ │ ├── gas11.mps │ │ ├── grow7.mps │ │ ├── israel.mps │ │ ├── kb2.mps │ │ ├── klein1.mps │ │ ├── lotfi.mps │ │ ├── recipe.mps │ │ ├── refinery.mps │ │ ├── sc105.mps │ │ ├── sc205.mps │ │ ├── sc50a.mps │ │ ├── sc50b.mps │ │ ├── scagr25.mps │ │ ├── scagr7.mps │ │ ├── scfxm1.mps │ │ ├── scorpion.mps │ │ ├── scrs8.mps │ │ ├── scsd1.mps │ │ ├── seba.mps │ │ ├── share1b.mps │ │ ├── share2b.mps │ │ ├── shell.mps │ │ ├── vtp-base.mps │ │ └── woodinfe.mps │ └── MIP │ │ ├── MANN_a9.clq.lp │ │ ├── bell5.mps │ │ ├── blend2.mps │ │ ├── dcmulti.mps │ │ ├── egout.mps │ │ ├── enigma.mps │ │ ├── flugpl.mps │ │ ├── gt2.mps │ │ ├── lseu.mps │ │ ├── misc03.mps │ │ ├── p0548.mps │ │ └── rgn.mps ├── ipet │ ├── PapiloSolver.py │ ├── papilo_evaluation.xml │ ├── papilo_evaluation_groupsettings.xml │ └── papilo_evaluation_solver_specific.xml ├── parser │ ├── LogFileParser.py │ ├── TableParser.py │ ├── lock.py │ ├── papilo_parser.py │ └── requirements.txt ├── run.sh ├── testset │ ├── short.solu │ └── short.test ├── waitcluster.sh └── wakeup-slurm ├── cmake ├── Dependencies.cmake ├── Modules │ ├── FindGLOP.cmake │ ├── FindGMP.cmake │ ├── FindGUROBI.cmake │ ├── FindQuadmath.cmake │ └── FindTBB.cmake └── StdAtomic.cmake ├── make ├── local │ ├── make.htccmp │ ├── make.htclogin │ └── make.targets ├── make.detecthost └── make.project ├── papilo-config.cmake.in ├── parameters.txt ├── scripts ├── change_version.sh ├── increment_apiversion.sh ├── makedist.sh ├── scip_solve ├── solve_instances └── updatedates.sh ├── settings ├── 16_threads.set ├── 2_threads.set ├── 32_threads.set ├── 4_threads.set ├── 8_threads.set ├── default.set ├── lp_presolvers_with_basis.set ├── lp_presolvers_without_basis.set ├── lp_presolvers_without_basis_glop.set ├── no_strong_dual_reductions.set ├── roundingsat.set ├── scip_no_strong_dual_reductions.set ├── scip_settings.set ├── sequential.set ├── sequential_not_immediately.set ├── trivial.set ├── verification.set └── verification_add.set ├── solutions.test ├── src ├── convMPS.cpp ├── duplicates.cpp ├── papilo.cpp ├── papilo │ ├── CMakeConfig.hpp.in │ ├── Config.hpp │ ├── core │ │ ├── Components.hpp │ │ ├── ConstraintMatrix.cpp │ │ ├── ConstraintMatrix.hpp │ │ ├── MatrixBuffer.hpp │ │ ├── Objective.hpp │ │ ├── Presolve.cpp │ │ ├── Presolve.hpp │ │ ├── PresolveMethod.hpp │ │ ├── PresolveOptions.hpp │ │ ├── ProbingView.cpp │ │ ├── ProbingView.hpp │ │ ├── Problem.hpp │ │ ├── ProblemBuilder.hpp │ │ ├── ProblemFlag.hpp │ │ ├── ProblemUpdate.cpp │ │ ├── ProblemUpdate.hpp │ │ ├── Reductions.hpp │ │ ├── RowFlags.hpp │ │ ├── SingleRow.hpp │ │ ├── Solution.hpp │ │ ├── SparseStorage.cpp │ │ ├── SparseStorage.hpp │ │ ├── Statistics.hpp │ │ ├── SymmetryStorage.hpp │ │ ├── VariableDomains.cpp │ │ ├── VariableDomains.hpp │ │ └── postsolve │ │ │ ├── BoundStorage.hpp │ │ │ ├── Postsolve.cpp │ │ │ ├── Postsolve.hpp │ │ │ ├── PostsolveStatus.hpp │ │ │ ├── PostsolveStorage.cpp │ │ │ ├── PostsolveStorage.hpp │ │ │ ├── PostsolveType.hpp │ │ │ ├── ReductionType.hpp │ │ │ └── SavedRow.hpp │ ├── external │ │ ├── catch │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── catch_amalgamated.cpp │ │ │ └── catch_amalgamated.hpp │ │ ├── fmt │ │ │ ├── CONTRIBUTING.md │ │ │ ├── ChangeLog.rst │ │ │ ├── LICENSE.rst │ │ │ ├── README.rst │ │ │ ├── chrono.h │ │ │ ├── color.h │ │ │ ├── compile.h │ │ │ ├── core.h │ │ │ ├── format-inl.h │ │ │ ├── format.cc │ │ │ ├── format.h │ │ │ ├── locale.h │ │ │ ├── os.cc │ │ │ ├── os.h │ │ │ ├── ostream.h │ │ │ ├── posix.h │ │ │ ├── printf.h │ │ │ └── ranges.h │ │ ├── lusol │ │ │ ├── .gitignore │ │ │ ├── CHANGES.md │ │ │ ├── LICENSE.md │ │ │ ├── NOTES.md │ │ │ ├── README.md │ │ │ ├── clusol.h │ │ │ ├── gen │ │ │ │ ├── README.md │ │ │ │ ├── interface.py │ │ │ │ ├── interface_files.org │ │ │ │ ├── lu1fac.org │ │ │ │ ├── lu6mul.org │ │ │ │ ├── lu6sol.org │ │ │ │ ├── lu8adc.org │ │ │ │ ├── lu8adr.org │ │ │ │ ├── lu8dlc.org │ │ │ │ ├── lu8dlr.org │ │ │ │ ├── lu8mod.org │ │ │ │ ├── lu8rpc.org │ │ │ │ └── lu8rpr.org │ │ │ ├── makefile │ │ │ └── src │ │ │ │ ├── README.md │ │ │ │ ├── clusol.c │ │ │ │ ├── lusol.f90 │ │ │ │ ├── lusol.txt │ │ │ │ ├── lusol6b.f │ │ │ │ ├── lusol7b.f │ │ │ │ ├── lusol8b.f │ │ │ │ ├── lusol_precision.f90 │ │ │ │ ├── lusol_util.f │ │ │ │ ├── symbols.map │ │ │ │ └── symbols.osx │ │ ├── pdqsort │ │ │ ├── license.txt │ │ │ ├── pdqsort.h │ │ │ └── readme.md │ │ └── ska │ │ │ ├── LICENSE.txt │ │ │ ├── bytell_hash_map.hpp │ │ │ ├── flat_hash_map.hpp │ │ │ └── unordered_map.hpp │ ├── interfaces │ │ ├── GlopInterface.hpp │ │ ├── GurobiInterface.hpp │ │ ├── HighsInterface.hpp │ │ ├── RoundingsatInterface.hpp │ │ ├── ScipInterface.hpp │ │ ├── SolverInterface.hpp │ │ └── SoplexInterface.hpp │ ├── io │ │ ├── BoundType.hpp │ │ ├── Message.hpp │ │ ├── MpsParser.hpp │ │ ├── MpsWriter.hpp │ │ ├── OpbParser.hpp │ │ ├── OpbWriter.hpp │ │ ├── ParseKey.hpp │ │ ├── Parser.hpp │ │ ├── SolParser.hpp │ │ └── SolWriter.hpp │ ├── misc │ │ ├── Alloc.hpp │ │ ├── Array.hpp │ │ ├── DependentRows.hpp │ │ ├── Flags.hpp │ │ ├── Hash.hpp │ │ ├── MultiPrecision.hpp │ │ ├── Num.hpp │ │ ├── NumericalStatistics.hpp │ │ ├── OptionsParser.hpp │ │ ├── ParameterSet.hpp │ │ ├── PrimalDualSolValidation.hpp │ │ ├── Signature.hpp │ │ ├── StableSum.hpp │ │ ├── String.hpp │ │ ├── Timer.hpp │ │ ├── Validation.hpp │ │ ├── Vec.hpp │ │ ├── VectorUtils.hpp │ │ ├── VersionLogger.hpp │ │ ├── Wrappers.hpp │ │ ├── compress_vector.hpp │ │ ├── extended_euclidean.hpp │ │ ├── fmt.hpp │ │ └── tbb.hpp │ ├── presolvers │ │ ├── CoefficientStrengthening.cpp │ │ ├── CoefficientStrengthening.hpp │ │ ├── ConstraintPropagation.cpp │ │ ├── ConstraintPropagation.hpp │ │ ├── DominatedCols.cpp │ │ ├── DominatedCols.hpp │ │ ├── DualFix.cpp │ │ ├── DualFix.hpp │ │ ├── DualInfer.cpp │ │ ├── DualInfer.hpp │ │ ├── FixContinuous.cpp │ │ ├── FixContinuous.hpp │ │ ├── FreeVarSubstitution.cpp │ │ ├── FreeVarSubstitution.hpp │ │ ├── ImplIntDetection.cpp │ │ ├── ImplIntDetection.hpp │ │ ├── ParallelColDetection.cpp │ │ ├── ParallelColDetection.hpp │ │ ├── ParallelRowDetection.cpp │ │ ├── ParallelRowDetection.hpp │ │ ├── Probing.cpp │ │ ├── Probing.hpp │ │ ├── SimpleProbing.cpp │ │ ├── SimpleProbing.hpp │ │ ├── SimpleSubstitution.cpp │ │ ├── SimpleSubstitution.hpp │ │ ├── SimplifyInequalities.cpp │ │ ├── SimplifyInequalities.hpp │ │ ├── SingletonCols.cpp │ │ ├── SingletonCols.hpp │ │ ├── SingletonStuffing.cpp │ │ ├── SingletonStuffing.hpp │ │ ├── Sparsify.cpp │ │ └── Sparsify.hpp │ └── verification │ │ ├── ArgumentType.hpp │ │ ├── CertificateInterface.hpp │ │ ├── EmptyCertificate.hpp │ │ └── VeriPb.hpp ├── papilolib.cpp └── papilolib.h ├── suppressions.valgrind └── test ├── CMakeLists.txt ├── PapiloLib.cpp ├── TestMain.cpp ├── check_CmakeConfig_includes.sh ├── instances ├── dual_fix_neg_inf.mps ├── dual_fix_pos_inf.mps ├── presolved_ns2080781.mps ├── simple_subsitution_gdc_detection.mps └── test.mps ├── papilo ├── core │ ├── MatrixBufferTest.cpp │ ├── PostsolveTest.cpp │ ├── PresolveTest.cpp │ ├── ProblemUpdateTest.cpp │ └── SparseStorageTest.cpp ├── io │ └── MpsParserTest.cpp ├── misc │ └── VectorUtilsTest.cpp └── presolve │ ├── CoefficientStrengtheningTest.cpp │ ├── ConstraintPropagationTest.cpp │ ├── DominatedColsTest.cpp │ ├── DualFixTest.cpp │ ├── FixContinuousTest.cpp │ ├── FreeVarSubstitutionTest.cpp │ ├── ImplIntDetectionTest.cpp │ ├── ParallelColDetectionTest.cpp │ ├── ParallelRowDetectionTest.cpp │ ├── ProbingTest.cpp │ ├── SimpleProbingTest.cpp │ ├── SimpleSubstitutionTest.cpp │ ├── SimplifyInequalitiesTest.cpp │ ├── SingletonColsTest.cpp │ ├── SingletonStuffingTest.cpp │ └── SparsifyTest.cpp └── resources ├── dual_fix_neg_inf.postsolve ├── dual_fix_pos_inf.postsolve ├── kb2.bas ├── kb2.postsolve ├── kb2_dual.solution ├── kb2_primal.solution └── kb2_reduced.solution /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | AllowShortFunctionsOnASingleLine: Inline 3 | AlwaysBreakAfterDefinitionReturnType: All 4 | AlwaysBreakAfterReturnType: All 5 | AlwaysBreakTemplateDeclarations: 'true' 6 | BreakBeforeBraces: Allman 7 | IndentCaseLabels: 'false' 8 | IndentWidth: '3' 9 | PointerAlignment: Left 10 | SortIncludes: 'true' 11 | SpaceBeforeParens: Never 12 | SpacesInParentheses: 'true' 13 | TabWidth: '3' 14 | UseTab: Never 15 | 16 | ... 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | #IDES 35 | .vscode 36 | .idea/ 37 | 38 | # test and testcluster 39 | check/results/ 40 | check/IP 41 | check/LP 42 | check/MINLP 43 | check/instancedata 44 | check/IP/miplib2017-benchmark/* 45 | 46 | #Generated Files 47 | build/ 48 | debug/ 49 | build*/ 50 | cmake-build-debug/ 51 | cmake-build-debug-coverage/ 52 | external/tbb/cmake/ 53 | solutions.test 54 | 55 | #downloads 56 | cmake/*tgz 57 | cmake/*tar.gz 58 | 59 | -------------------------------------------------------------------------------- /.gitlab/merge_request_templates/Code_Review.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | [Add a description of the introduced changes here.] 4 | 5 | ### Code review 6 | 7 | * [ ] The code change is correct. 8 | * [ ] The naming and place of new methods is clear and consistent **or** no new methods have been added. 9 | * [ ] The code is sufficiently documented. 10 | * [ ] The CHANGELOG is up to date (including API changes if present in this MR). 11 | * [ ] The new code is sufficiently covered by tests (perhaps, new coverage settings or new unit tests have been added). 12 | 13 | ### Additional Testing (depending on the changes) 14 | 15 | * [ ] Supported integrated solver (besides SCIP and SoPlex) pass `jenkins rerun build_with_{gurobi,glop,highs}`). 16 | * [ ] PaPILO without TBB is build `jenkins rerun build_no_TBB` 17 | 18 | ### Does this merge request introduce an API change? :warning: 19 | 20 | * [ ] No, **or** as far as possible, the code ensures backwards compatibility to `SCIP` and `SoPlex`. 21 | * [ ] No, **or** the `PAPILO_MINOR_VERSION` or `PAPILO_MAJOR_VERSION` is updated. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 | #* * 3 | #* This file is part of the program and library * 4 | #* SCIP --- Solving Constraint Integer Programs * 5 | #* * 6 | #* Copyright (C) 2002-2025 Zuse Institute Berlin (ZIB) * 7 | #* * 8 | #* SCIP is distributed under the terms of the ZIB Academic License. * 9 | #* * 10 | #* You should have received a copy of the ZIB Academic License * 11 | #* along with SCIP; see the file COPYING. If not email to scip@zib.de. * 12 | #* * 13 | #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 14 | 15 | # description -> see check/README_PERFORMANCE.md 16 | 17 | #----------------------------------------------------------------------------- 18 | # paths variables 19 | #----------------------------------------------------------------------------- 20 | 21 | PAPILODIR=$(shell pwd -P) 22 | 23 | .DEFAULT_GOAL := help 24 | 25 | #----------------------------------------------------------------------------- 26 | # include make.project file 27 | #----------------------------------------------------------------------------- 28 | 29 | # load default settings and detect host architecture 30 | include $(PAPILODIR)/make/make.project 31 | 32 | # include local targets 33 | -include make/local/make.targets 34 | 35 | #----------------------------------------------------------------------------- 36 | # Rules 37 | #----------------------------------------------------------------------------- 38 | 39 | .PHONY: help 40 | help: 41 | @echo " Main targets:" 42 | @echo " - test: start Papilo testrun locally." 43 | @echo " - testcluster: start Papilo testrun on the cluster." 44 | 45 | .PHONY: test 46 | test: 47 | cd check; \ 48 | $(SHELL) ./check.sh $(TEST) $(EXECUTABLE) $(SETTINGS) $(BINID) $(OUTPUTDIR) $(TIME) $(NODES) $(MEM) $(FEASTOL) $(DISPFREQ) \ 49 | $(CONTINUE) $(LOCK) $(VERSION) $(LPS) $(DEBUGTOOL) $(CLIENTTMPDIR) $(REOPT) $(PAPILO_OPT_COMMAND) $(SETCUTOFF) $(MAXJOBS) $(VISUALIZE) $(PERMUTE) \ 50 | $(SEEDS) $(GLBSEEDSHIFT) $(STARTPERM) $(SOLVE_EXECUTABLE) $(SKIP_PRESOLVE); 51 | 52 | # --- EOF --------------------------------------------------------------------- 53 | # DO NOT DELETE 54 | -------------------------------------------------------------------------------- /check/VeriPB/example.opb: -------------------------------------------------------------------------------- 1 | min: +1 x1 +1 x2; 2 | +1 x1 +1 x2 -1 x3 -1 x4 = 1 ; 3 | -1 x1 +1 x5 >= 0 ; -------------------------------------------------------------------------------- /check/VeriPB/example.pbp: -------------------------------------------------------------------------------- 1 | pseudo-Boolean proof version 2.0 2 | f 3 3 | 4 | 5 | * Example to certify substituting an implied free variables x_1 and dual-fixing variable x_2: 6 | 7 | * In VeriPB every constraint gets an ID and equalities are split into two separated constraints (1/2): 8 | * - Objective: min 1 x1 1 x2 0 9 | * - ConstraintId 001: 1 x1 1 x2 1 ~x3 1 ~x4 >= 3 10 | * - ConstraintId 002: 1 ~x1 1 ~x2 1 x3 1 x4 >= 1 11 | * - ConstraintId 003: 1 ~x1 1 x5 >= 1 12 | * we use these IDs to reference them. 13 | 14 | 15 | * x_1 is an implied variable by constraint (1/2) (3). 16 | * Hence (1) and (2) can be used to substitute it 17 | 18 | * First remove x1 from constraints (1) and (2) to obtain (4) and (5) 19 | pol 1 ~x1 + ; 20 | core id -1 21 | * generates ConstraintId 004: 1 x2 1 ~x3 1 ~x4 >= 2 22 | pol 2 x1 + ; 23 | core id -1 24 | * generates ConstraintId 005: 1 ~x2 1 x3 1 x4 >= 0 25 | 26 | * remove x1 from the constraint (3) and replaces the constraint (3) with the newly created (6) 27 | pol 3 1 + 28 | core id -1 29 | * generates ConstraintId 006: 1 x2 1 ~x3 1 ~x4 1 x5 >= 3 30 | delc 3 ; ; begin 31 | pol 6 2 + 32 | end 33 | * update objective 34 | obju new +1 x3 +1 x4 1; 35 | *delete constraints (1) and (2) 36 | delc 1 ; x1 -> 1 ; 37 | delc 2 ; x1 -> 0 ; 38 | *delete auxiliary constraints (4) and (5) using the updated constraint (3) or (6) 39 | delc 5 ; ; begin 40 | end 41 | delc 4 ; ; begin 42 | pol 6 -1 + 43 | end 44 | 45 | * Dual Fix 46 | * x2 has no uplocks and can be fixed to 1 -> generates Constraint (12) 47 | red +1 x2 >= 1 ; x2 -> 1 48 | * generates ConstraintId 012: 1 x2 >= 1 49 | core id -1 50 | * update all constraints with x2 = 1 51 | pol 6 ~x2 + 52 | * generates ConstraintId 013: 1 ~x3 1 ~x4 1 x5 >= 2 53 | core id -1 54 | delc 6 ; ; begin 55 | pol 13 12 + 56 | end 57 | 58 | output NONE 59 | conclusion NONE 60 | end pseudo-Boolean proof 61 | -------------------------------------------------------------------------------- /check/VeriPB/verify_files_with_veripb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | for f in /data/optimi/optimi/kombadon/IP/MIPLIB01/dec/miplib2017/*.pbp; 3 | do 4 | export FILENAME="${f}" 5 | echo "${FILENAME}" 6 | out=${FILENAME%.pbp}.out 7 | sbatch --constraint="Gold5122" --partition="opt_int" -A "optimi_integer" --output=${out} --cpu-freq=highm1 --export=FILENAME=$FILENAME verify_single_file_with_veripb.sh 8 | done 9 | -------------------------------------------------------------------------------- /check/VeriPB/verify_single_file_with_veripb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | echo "${FILENAME}" 3 | instance=${FILENAME%.pbp}.opb 4 | # sbatch -c "veripb --trace --useColor ${instance} ${f} > ${out}" 5 | echo ">>> Executing: veripb --trace --useColor ${instance} ${FILENAME}" 6 | source "/scratch/opt/ahoen/VeriPB/z1venv/bin/activate" 7 | eval "veripb --trace --useColor ${instance} ${FILENAME}" 8 | -------------------------------------------------------------------------------- /check/configuration_solufile.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 | #* * 4 | #* This file is part of the program and library * 5 | #* SCIP --- Solving Constraint Integer Programs * 6 | #* * 7 | #* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) * 8 | #* * 9 | #* SCIP is distributed under the terms of the ZIB Academic License. * 10 | #* * 11 | #* You should have received a copy of the ZIB Academic License * 12 | #* along with SCIP; see the file COPYING. If not email to scip@zib.de. * 13 | #* * 14 | #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 15 | 16 | # configures SOLUFILE environment variable for test runs and evaluation runs 17 | 18 | # input environment - these environment variables should be set before invoking this script 19 | TSTNAME="${1}" # name of the test set 20 | 21 | # new environment variables defined by this script: 22 | # SOLUFILE - .solu file for this test set, for parsing optimal solution values 23 | 24 | # look for solufiles under the name of the test, the name of the test with everything after the first "_" or "-" stripped, and all; 25 | # prefer more specific solufile names over general ones and the instance database solufiles over those in testset/ 26 | SOLUFILE="" 27 | for f in "${TSTNAME}" ${TSTNAME%%_*} ${TSTNAME%%-*} all 28 | do 29 | for d in instancedata/testsets testset 30 | do 31 | if test -f "${d}/${f}.solu" 32 | then 33 | SOLUFILE="${d}/${f}.solu" 34 | break 35 | fi 36 | done 37 | if ! test "${SOLUFILE}" = "" 38 | then 39 | break 40 | fi 41 | done 42 | -------------------------------------------------------------------------------- /check/instances/IP/pipex.opb: -------------------------------------------------------------------------------- 1 | * #variable= 48 #constraint= 25 2 | * #binary= 48 #integer= 0 3 | * NOTE: using following variable name mapping 4 | * x1..1 : QUAN0101 5 | * x2..2 : QUAN0102 6 | * x3..3 : QUAN0103 7 | * x4..4 : QUAN0104 8 | * x5..5 : QUAN0105 9 | * x6..6 : QUAN0106 10 | * x7..7 : QUAN0107 11 | * x8..8 : QUAN0108 12 | * x9..9 : QUAN0109 13 | * x10..10 : QUAN0110 14 | * x11..11 : QUAN0111 15 | * x12..12 : QUAN0112 16 | * x13..13 : QUAN0113 17 | * x14..14 : QUAN0114 18 | * x15..15 : QUAN0115 19 | * x16..16 : QUAN0116 20 | * x17..17 : QUAN0201 21 | * x18..18 : QUAN0202 22 | * x19..19 : QUAN0203 23 | * x20..20 : QUAN0204 24 | * x21..21 : QUAN0205 25 | * x22..22 : QUAN0206 26 | * x23..23 : QUAN0207 27 | * x24..24 : QUAN0208 28 | * x25..25 : QUAN0209 29 | * x26..26 : QUAN0210 30 | * x27..27 : QUAN0211 31 | * x28..28 : QUAN0212 32 | * x29..29 : QUAN0213 33 | * x30..30 : QUAN0214 34 | * x31..31 : QUAN0215 35 | * x32..32 : QUAN0216 36 | * x33..33 : QUAN0301 37 | * x34..34 : QUAN0302 38 | * x35..35 : QUAN0303 39 | * x36..36 : QUAN0304 40 | * x37..37 : QUAN0305 41 | * x38..38 : QUAN0306 42 | * x39..39 : QUAN0307 43 | * x40..40 : QUAN0308 44 | * x41..41 : QUAN0309 45 | * x42..42 : QUAN0310 46 | * x43..43 : QUAN0311 47 | * x44..44 : QUAN0312 48 | * x45..45 : QUAN0313 49 | * x46..46 : QUAN0314 50 | * x47..47 : QUAN0315 51 | * x48..48 : QUAN0316 52 | * Obj. scale : 1000 53 | * Obj. offset : 0 54 | * NOTE: new objective = (old objective - offset) * scale 55 | min: +18700 x1 +22040 x2 +29280 x3 +28280 x4 +23580 x5 +23460 x6 +36000 x7 +39520 x8 +69240 x9 +84459 x10 +79134 x11 +71416 x12 +59976 x13 +57123 x14 +60515 x15 +60840 x16 +25300 x17 +32380 x18 +35380 x19 +33540 x20 +35270 x21 +33120 x22 +25920 x23 +25840 x24 +76200 x25 +97290 x26 +84821 x27 +75484 x28 +69258 x29 +63954 x30 +52780 x31 +51210 x32 +22000 x33 +30160 x34 +32940 x35 +36120 x36 +26200 x37 +26220 x38 +46080 x39 +48640 x40 +83880 x41 +107865 x42 +93896 x43 +88931 x44 +71298 x45 +68112 x46 +75640 x47 +74790 x48 ; 56 | -110 x1 -116 x2 -122 x3 -129 x4 -131 x5 -138 x6 -144 x7 -152 x8 -120 x9 -141 x10 -121 x11 -113 x12 -102 x13 -99 x14 -91 x15 -90 x16 >= -450 ; 57 | -110 x17 -116 x18 -122 x19 -129 x20 -131 x21 -138 x22 -144 x23 -152 x24 -120 x25 -141 x26 -121 x27 -113 x28 -102 x29 -99 x30 -91 x31 -90 x32 >= -700 ; 58 | -110 x33 -116 x34 -122 x35 -129 x36 -131 x37 -138 x38 -144 x39 -152 x40 -120 x41 -141 x42 -121 x43 -113 x44 -102 x45 -99 x46 -91 x47 -90 x48 >= -800 ; 59 | +10 x1 +14 x2 +18 x3 +23 x4 +31 x5 +30 x6 +40 x7 +50 x8 -40 x9 -59 x10 -41 x11 -27 x12 -24 x13 -19 x14 -11 x15 -8 x16 >= -45 ; 60 | +10 x17 +14 x18 +18 x19 +23 x20 +31 x21 +30 x22 +40 x23 +50 x24 -40 x25 -59 x26 -41 x27 -27 x28 -24 x29 -19 x30 -11 x31 -8 x32 >= -70 ; 61 | +10 x33 +14 x34 +18 x35 +23 x36 +31 x37 +30 x38 +40 x39 +50 x40 -40 x41 -59 x42 -41 x43 -27 x44 -24 x45 -19 x46 -11 x47 -8 x48 >= -80 ; 62 | -10 x1 -14 x2 -18 x3 -23 x4 -31 x5 -30 x6 -40 x7 -50 x8 +40 x9 +59 x10 +41 x11 +27 x12 +24 x13 +19 x14 +11 x15 +8 x16 >= -45 ; 63 | -10 x17 -14 x18 -18 x19 -23 x20 -31 x21 -30 x22 -40 x23 -50 x24 +40 x25 +59 x26 +41 x27 +27 x28 +24 x29 +19 x30 +11 x31 +8 x32 >= -70 ; 64 | -10 x33 -14 x34 -18 x35 -23 x36 -31 x37 -30 x38 -40 x39 -50 x40 +40 x41 +59 x42 +41 x43 +27 x44 +24 x45 +19 x46 +11 x47 +8 x48 >= -80 ; 65 | +1 x1 +1 x17 +1 x33 = 1 ; 66 | +1 x2 +1 x18 +1 x34 = 1 ; 67 | +1 x3 +1 x19 +1 x35 = 1 ; 68 | +1 x4 +1 x20 +1 x36 = 1 ; 69 | +1 x5 +1 x21 +1 x37 = 1 ; 70 | +1 x6 +1 x22 +1 x38 = 1 ; 71 | +1 x7 +1 x23 +1 x39 = 1 ; 72 | +1 x8 +1 x24 +1 x40 = 1 ; 73 | +1 x9 +1 x25 +1 x41 = 1 ; 74 | +1 x10 +1 x26 +1 x42 = 1 ; 75 | +1 x11 +1 x27 +1 x43 = 1 ; 76 | +1 x12 +1 x28 +1 x44 = 1 ; 77 | +1 x13 +1 x29 +1 x45 = 1 ; 78 | +1 x14 +1 x30 +1 x46 = 1 ; 79 | +1 x15 +1 x31 +1 x47 = 1 ; 80 | +1 x16 +1 x32 +1 x48 = 1 ; 81 | -------------------------------------------------------------------------------- /check/instances/LP/afiro.mps: -------------------------------------------------------------------------------- 1 | NAME AFIRO 2 | ROWS 3 | E R09 4 | E R10 5 | L X05 6 | L X21 7 | E R12 8 | E R13 9 | L X17 10 | L X18 11 | L X19 12 | L X20 13 | E R19 14 | E R20 15 | L X27 16 | L X44 17 | E R22 18 | E R23 19 | L X40 20 | L X41 21 | L X42 22 | L X43 23 | L X45 24 | L X46 25 | L X47 26 | L X48 27 | L X49 28 | L X50 29 | L X51 30 | N COST 31 | COLUMNS 32 | X01 X48 .301 R09 -1. 33 | X01 R10 -1.06 X05 1. 34 | X02 X21 -1. R09 1. 35 | X02 COST -.4 36 | X03 X46 -1. R09 1. 37 | X04 X50 1. R10 1. 38 | X06 X49 .301 R12 -1. 39 | X06 R13 -1.06 X17 1. 40 | X07 X49 .313 R12 -1. 41 | X07 R13 -1.06 X18 1. 42 | X08 X49 .313 R12 -1. 43 | X08 R13 -.96 X19 1. 44 | X09 X49 .326 R12 -1. 45 | X09 R13 -.86 X20 1. 46 | X10 X45 2.364 X17 -1. 47 | X11 X45 2.386 X18 -1. 48 | X12 X45 2.408 X19 -1. 49 | X13 X45 2.429 X20 -1. 50 | X14 X21 1.4 R12 1. 51 | X14 COST -.32 52 | X15 X47 -1. R12 1. 53 | X16 X51 1. R13 1. 54 | X22 X46 .109 R19 -1. 55 | X22 R20 -.43 X27 1. 56 | X23 X44 -1. R19 1. 57 | X23 COST -.6 58 | X24 X48 -1. R19 1. 59 | X25 X45 -1. R19 1. 60 | X26 X50 1. R20 1. 61 | X28 X47 .109 R22 -.43 62 | X28 R23 1. X40 1. 63 | X29 X47 .108 R22 -.43 64 | X29 R23 1. X41 1. 65 | X30 X47 .108 R22 -.39 66 | X30 R23 1. X42 1. 67 | X31 X47 .107 R22 -.37 68 | X31 R23 1. X43 1. 69 | X32 X45 2.191 X40 -1. 70 | X33 X45 2.219 X41 -1. 71 | X34 X45 2.249 X42 -1. 72 | X35 X45 2.279 X43 -1. 73 | X36 X44 1.4 R23 -1. 74 | X36 COST -.48 75 | X37 X49 -1. R23 1. 76 | X38 X51 1. R22 1. 77 | X39 R23 1. COST 10. 78 | RHS 79 | B X50 310. X51 300. 80 | B X05 80. X17 80. 81 | B X27 500. R23 44. 82 | B X40 500. 83 | ENDATA 84 | -------------------------------------------------------------------------------- /check/instances/LP/galenet.mps: -------------------------------------------------------------------------------- 1 | NAME GALENET 2 | ROWS 3 | L S1 4 | L S2 5 | L S3 6 | E NODE4 7 | E NODE5 8 | G D6 9 | G D7 10 | G D8 11 | N COST 12 | COLUMNS 13 | T14 S1 1. NODE4 1. 14 | T24 S2 1. NODE4 1. 15 | T25 S2 1. NODE5 1. 16 | T35 S3 1. NODE5 1. 17 | T46 D6 1. NODE4 -1. 18 | T47 D7 1. NODE4 -1. 19 | T57 D7 1. NODE5 -1. 20 | T58 D8 1. NODE5 -1. 21 | RHS 22 | RHS S1 20. S2 20. 23 | RHS S3 20. D6 10. 24 | RHS D7 20. D8 30. 25 | BOUNDS 26 | UP BND T14 30. 27 | UP BND T24 20. 28 | UP BND T25 10. 29 | UP BND T35 10. 30 | UP BND T46 10. 31 | UP BND T47 2. 32 | UP BND T57 20. 33 | UP BND T58 30. 34 | ENDATA 35 | -------------------------------------------------------------------------------- /check/parser/requirements.txt: -------------------------------------------------------------------------------- 1 | dataclasses 2 | numpy 3 | -------------------------------------------------------------------------------- /check/testset/short.solu: -------------------------------------------------------------------------------- 1 | =opt= bell5 8966406.49 2 | =opt= blend2 7.598985 3 | =opt= dcmulti 188182 4 | =opt= egout 568.1007 5 | =opt= enigma 0 6 | =opt= flugpl 1201500 7 | =opt= gt2 21166 8 | =opt= lseu 1120 9 | =opt= MANN_a9.clq 16 10 | =opt= mcf64-4-1 10 11 | -------------------------------------------------------------------------------- /check/testset/short.test: -------------------------------------------------------------------------------- 1 | instances/MIP/bell5.mps 2 | instances/MIP/blend2.mps 3 | instances/MIP/dcmulti.mps 4 | instances/MIP/egout.mps 5 | instances/MIP/enigma.mps 6 | instances/MIP/flugpl.mps 7 | instances/MIP/gt2.mps 8 | instances/MIP/lseu.mps 9 | instances/MIP/misc03.mps 10 | instances/MIP/p0548.mps 11 | instances/MIP/rgn.mps -------------------------------------------------------------------------------- /check/waitcluster.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 3 | #* * 4 | #* This file is part of the program and library * 5 | #* SCIP --- Solving Constraint Integer Programs * 6 | #* * 7 | #* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) * 8 | #* * 9 | #* SCIP is distributed under the terms of the ZIB Academic License. * 10 | #* * 11 | #* You should have received a copy of the ZIB Academic License * 12 | #* along with SCIP; see the file COPYING. If not email to scip@zib.de. * 13 | #* * 14 | #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 15 | 16 | # In order to not overload the cluster, no jobs are submitted if the queue is too full 17 | # instead, this script waits until the queue load falls under a threshold and returns 18 | # for the calling script to continue submitting jobs. 19 | 20 | # The cluster queue QUEUE has an upper bound of LIMIT jobs; if this limit is 21 | # reached the submitted jobs are dumped; to avoid that we check the total 22 | # load of the cluster and wait until it is safe (total load not more than 23 | # LIMIT jobs or we have submitted less than LIMITQUEUE jobs) to submit the next job. 24 | 25 | # Usage example: ./waitcluster.sh 1600 ${QUEUE} 200 26 | 27 | LIMIT="${1}" 28 | QUEUE="${2}" 29 | LIMITQUEUE="${3}" 30 | 31 | while true 32 | do 33 | ALLQUEUED=$(qstat | grep -c "") 34 | QUEUED=$(qstat -u "${USER}" | grep -c " ${QUEUE} ") 35 | RUNNING=$(qstat -u "${USER}" | grep -c " R ") 36 | 37 | # display current user load and total load 38 | echo "jobs in progress: ${RUNNING} / ${QUEUED} (${ALLQUEUED})" 39 | 40 | if test "${ALLQUEUED}" -le 1990 41 | then 42 | 43 | if test "${QUEUED}" -le "${LIMITQUEUE}" 44 | then 45 | break 46 | fi 47 | 48 | if test "${ALLQUEUED}" -le "${LIMIT}" 49 | then 50 | break 51 | fi 52 | fi 53 | 54 | sleep 30 55 | done 56 | -------------------------------------------------------------------------------- /cmake/Modules/FindGLOP.cmake: -------------------------------------------------------------------------------- 1 | find_path(GLOP_INCLUDE_DIRS 2 | NAMES ortools/glop/lp_solver.h 3 | HINTS ${GLOP_DIR} $ENV{GLOP_DIR} 4 | PATH_SUFFIXES include) 5 | 6 | set(GLOP_INCLUDE_DIRS 7 | ${GLOP_INCLUDE_DIRS} 8 | ${GLOP_INCLUDE_DIRS}/ortools/gen 9 | ${GLOP_INCLUDE_DIRS}/dependencies/install/include 10 | ${GLOP_INCLUDE_DIRS}/include 11 | ) 12 | 13 | # todo: enable recursive search 14 | find_library(GLOP_LIBRARY 15 | NAMES ortools 16 | HINTS ${GLOP_DIR} $ENV{GLOP_DIR} 17 | PATH_SUFFIXES lib) 18 | 19 | find_library(GLOG_LIBRARY 20 | NAMES glog 21 | HINTS ${GLOP_DIR}/dependencies/install/lib $ENV{GLOP_DIR}/dependencies/install/lib 22 | HINTS ${GLOP_DIR} $ENV{GLOP_DIR} 23 | PATH_SUFFIXES lib) 24 | 25 | if(GLOG_LIBRARY) 26 | set(GLOP_LIBRARIES ${GLOP_LIBRARY} ${GLOG_LIBRARY}) 27 | else() 28 | set(GLOP_LIBRARIES ${GLOP_LIBRARY}) 29 | endif() 30 | 31 | include(FindPackageHandleStandardArgs) 32 | find_package_handle_standard_args(GLOP DEFAULT_MSG GLOP_INCLUDE_DIRS GLOP_LIBRARIES) 33 | -------------------------------------------------------------------------------- /cmake/Modules/FindGMP.cmake: -------------------------------------------------------------------------------- 1 | # ${GMP_INCLUDE_DIRS} contains the paths to gmp.h (and gmpxx.h) if GMP is found. 2 | # ${GMP_LIBRARIES} contains libgmp and libgmpxx if GMP is found. 3 | 4 | # Check whether environment variable GMP_DIR was set. 5 | if(NOT GMP_DIR) 6 | set(ENV_GMP_DIR $ENV{GMP_DIR}) 7 | if(ENV_GMP_DIR) 8 | set(GMP_DIR $ENV{GMP_DIR} CACHE PATH "Path to gmp directory") 9 | endif() 10 | endif() 11 | 12 | find_path(GMP_INCLUDE_DIRS 13 | NAMES gmp.h gmpxx.h 14 | HINTS ${GMP_DIR} 15 | PATH_SUFFIXES include) 16 | 17 | if(STATIC_GMP) 18 | find_library(GMP_LIBRARY 19 | NAMES libgmp.a gmp 20 | HINTS ${GMP_DIR} 21 | PATH_SUFFIXES lib) 22 | 23 | find_library(GMPXX_LIBRARY 24 | NAMES libgmpxx.a gmpxx 25 | HINTS ${GMP_DIR} 26 | PATH_SUFFIXES lib) 27 | else() 28 | find_library(GMP_LIBRARY 29 | NAMES libgmp.so gmp 30 | HINTS ${GMP_DIR} 31 | PATH_SUFFIXES lib) 32 | 33 | find_library(GMPXX_LIBRARY 34 | NAMES libgmpxx.so gmpxx 35 | HINTS ${GMP_DIR} 36 | PATH_SUFFIXES lib) 37 | endif() 38 | 39 | SET(GMP_LIBRARIES ${GMP_LIBRARY} ${GMPXX_LIBRARY}) 40 | 41 | # look for mpir library and include files when gmp could not be found 42 | if(NOT GMP_LIBRARIES) 43 | find_path(GMP_INCLUDE_DIRS 44 | NAMES mpir.h 45 | HINTS ${GMP_DIR} 46 | PATH_SUFFIXES include) 47 | 48 | find_library(GMP_LIBRARY 49 | NAMES mpir 50 | HINTS ${GMP_DIR} 51 | PATH_SUFFIXES lib) 52 | 53 | SET(GMP_LIBRARIES ${GMP_LIBRARY}) 54 | endif() 55 | 56 | file(GLOB GMP_HEADERS "${GMP_INCLUDE_DIRS}/gmp.h" "${GMP_INCLUDE_DIRS}/gmp-*.h") 57 | foreach (gmp_header_filename ${GMP_HEADERS}) 58 | file(READ "${gmp_header_filename}" _gmp_version_header) 59 | string(REGEX MATCH 60 | "define[ \t]+__GNU_MP_VERSION[ \t]+([0-9]+)" _gmp_major_version_match 61 | "${_gmp_version_header}") 62 | if (_gmp_major_version_match) 63 | set(GMP_MAJOR_VERSION "${CMAKE_MATCH_1}") 64 | string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_MINOR[ \t]+([0-9]+)" 65 | _gmp_minor_version_match "${_gmp_version_header}") 66 | set(GMP_MINOR_VERSION "${CMAKE_MATCH_1}") 67 | string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_PATCHLEVEL[ \t]+([0-9]+)" 68 | _gmp_patchlevel_version_match "${_gmp_version_header}") 69 | set(GMP_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") 70 | set(GMP_VERSION 71 | ${GMP_MAJOR_VERSION}.${GMP_MINOR_VERSION}.${GMP_PATCHLEVEL_VERSION}) 72 | endif () 73 | endforeach () 74 | 75 | include(FindPackageHandleStandardArgs) 76 | find_package_handle_standard_args(GMP DEFAULT_MSG GMP_INCLUDE_DIRS GMP_LIBRARIES) 77 | -------------------------------------------------------------------------------- /cmake/Modules/FindGUROBI.cmake: -------------------------------------------------------------------------------- 1 | find_path(GUROBI_INCLUDE_DIRS 2 | NAMES gurobi_c++.h 3 | HINTS ${GUROBI_DIR} $ENV{GUROBI_DIR} 4 | PATH_SUFFIXES linux64/include include) 5 | 6 | # todo: enable recursive search 7 | find_library(GUROBI_LIBRARY 8 | NAMES gurobi gurobi70 gurobi75 gurobi80 gurobi81 gurobi90 gurobi91 gurobi95 9 | HINTS ${GUROBI_DIR} $ENV{GUROBI_DIR} 10 | PATH_SUFFIXES linux64/lib lib) 11 | 12 | find_library(GUROBI_CPP_LIBRARY 13 | NAMES gurobi_c++ 14 | HINTS ${GUROBI_DIR} $ENV{GUROBI_DIR} 15 | PATH_SUFFIXES linux64/lib lib) 16 | 17 | set(GUROBI_LIBRARIES ${GUROBI_CPP_LIBRARY} ${GUROBI_LIBRARY}) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(GUROBI DEFAULT_MSG GUROBI_INCLUDE_DIRS GUROBI_LIBRARIES) 21 | -------------------------------------------------------------------------------- /cmake/StdAtomic.cmake: -------------------------------------------------------------------------------- 1 | # copied from https://github.com/ccache/ccache/blob/master/cmake/StdAtomic.cmake 2 | 3 | # Check if std::atomic needs -latomic 4 | 5 | include(CheckCXXSourceCompiles) 6 | 7 | set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX11_STANDARD_COMPILE_OPTION}) 8 | set( 9 | check_std_atomic_source_code 10 | [=[ 11 | #include 12 | int main() 13 | { 14 | std::atomic x; 15 | (void)x.load(); 16 | return 0; 17 | } 18 | ]=]) 19 | 20 | check_cxx_source_compiles("${check_std_atomic_source_code}" std_atomic_without_libatomic) 21 | 22 | if(NOT std_atomic_without_libatomic) 23 | set(CMAKE_REQUIRED_LIBRARIES atomic) 24 | check_cxx_source_compiles("${check_std_atomic_source_code}" std_atomic_with_libatomic) 25 | set(CMAKE_REQUIRED_LIBRARIES) 26 | if(NOT std_atomic_with_libatomic) 27 | message(FATAL_ERROR "Toolchain doesn't support std::atomic with nor without -latomic") 28 | else() 29 | target_link_libraries(papilo INTERFACE atomic) 30 | endif() 31 | endif() 32 | 33 | set(CMAKE_REQUIRED_FLAGS) -------------------------------------------------------------------------------- /make/local/make.htccmp: -------------------------------------------------------------------------------- 1 | # Call with "make testcluster" 2 | # 3 | # Runs distributed tests on the z1 cluster via SLURM. 4 | # 5 | # In case of time measuring you should use the flag EXCLUSIVE=true to enforce 6 | # that only one process is running on any node you use. 7 | # 8 | # To cancel all your jobs of a testset MyTestSet you can call 9 | # "make cancelcluster TEST=MyTestSet". 10 | # 11 | # To get the result files call "./evalcheck_cluster.sh 12 | # results/check.$TSTNAME.$BINNMAE.$SETNAME.eval in directory check/ 13 | # This leads to result files 14 | # - results/check.$TSTNAME.$BINNMAE.$SETNAME.out 15 | # - results/check.$TSTNAME.$BINNMAE.$SETNAME.res 16 | # - results/check.$TSTNAME.$BINNMAE.$SETNAME.err 17 | # 18 | 19 | QUEUETYPE = srun 20 | QUEUE = small 21 | PPN = -1 22 | CLIENTTMPDIR = /tmp 23 | NOWAITCLUSTER = 1 24 | EXCLUSIVE = false 25 | 26 | .PHONY: cancelcluster 27 | cancelcluster: 28 | scancel --user=$(USER) 29 | -------------------------------------------------------------------------------- /make/local/make.htclogin: -------------------------------------------------------------------------------- 1 | # Call with "make testcluster" 2 | # 3 | # Runs distributed tests on the z1 cluster via SLURM. 4 | # 5 | # In case of time measuring you should use the flag EXCLUSIVE=true to enforce 6 | # that only one process is running on any node you use. 7 | # 8 | # To cancel all your jobs of a testset MyTestSet you can call 9 | # "make cancelcluster TEST=MyTestSet". 10 | # 11 | # To get the result files call "./evalcheck_cluster.sh 12 | # results/check.$TSTNAME.$BINNMAE.$SETNAME.eval in directory check/ 13 | # This leads to result files 14 | # - results/check.$TSTNAME.$BINNMAE.$SETNAME.out 15 | # - results/check.$TSTNAME.$BINNMAE.$SETNAME.res 16 | # - results/check.$TSTNAME.$BINNMAE.$SETNAME.err 17 | # 18 | 19 | QUEUETYPE = srun 20 | QUEUE = small 21 | PPN = -1 22 | CLIENTTMPDIR = /tmp 23 | NOWAITCLUSTER = 1 24 | EXCLUSIVE = false 25 | 26 | .PHONY: cancelcluster 27 | cancelcluster: 28 | scancel --user=$(USER) 29 | -------------------------------------------------------------------------------- /make/local/make.targets: -------------------------------------------------------------------------------- 1 | # this local Makefile includes the cluster targets 2 | 3 | OPTHOST := $(shell uname -n | sed 's/\(.zib.de\)//g' | sed 's/\(portal\|test\)//g' | tr -cd '[:alpha:]') 4 | 5 | -include $(PAPILODIR)/make/local/make.$(OPTHOST) 6 | 7 | # ------------------------------------------------------------------------------------------------- 8 | # scripts for testing on cluster 9 | # ------------------------------------------------------------------------------------------------- 10 | 11 | # solvers using the general scripts setting up tmpfiles: 12 | 13 | .PHONY: testcluster 14 | testcluster: check/check_cluster.sh check/configuration_cluster.sh check/configuration_set.sh check/configuration_logfiles.sh check/evalcheck_cluster.sh check/run.sh 15 | cd check; \ 16 | $(SHELL) ./check_cluster.sh $(TEST) $(EXECUTABLE) $(SETTINGS) $(BINID) \ 17 | $(OUTPUTDIR) $(TIME) $(NODES) $(MEM) $(FEASTOL) $(LPS) $(DISPFREQ) $(CONTINUE) \ 18 | $(QUEUETYPE) $(QUEUE) $(PPN) $(CLIENTTMPDIR) $(NOWAITCLUSTER) $(EXCLUSIVE) \ 19 | $(PERMUTE) $(SEEDS) $(GLBSEEDSHIFT) $(STARTPERM) $(DEBUGTOOL) $(REOPT) $(PAPILO_OPT_COMMAND) \ 20 | $(SETCUTOFF) $(VISUALIZE) $(CLUSTERNODES) $(SLURMACCOUNT) $(SOLVE_EXECUTABLE) $(SKIP_PRESOLVE); 21 | -------------------------------------------------------------------------------- /make/make.detecthost: -------------------------------------------------------------------------------- 1 | #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 | #* * 3 | #* This file is part of the program and library * 4 | #* SCIP --- Solving Constraint Integer Programs * 5 | #* * 6 | #* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) * 7 | #* * 8 | #* SCIP is distributed under the terms of the ZIB Academic License. * 9 | #* * 10 | #* You should have received a copy of the ZIB Academic License * 11 | #* along with SCIP; see the file COPYING. If not email to scip@zib.de. * 12 | #* * 13 | #* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 14 | 15 | #@file Makefile include to detect host system 16 | #@brief SCIP Makefile 17 | #@author Thorsten Koch 18 | #@author Tobias Achterberg 19 | 20 | 21 | ARCH := $(shell uname -m | \ 22 | sed \ 23 | -e 's/sun../sparc/' \ 24 | -e 's/i.86/x86/' \ 25 | -e 's/i86pc/x86/' \ 26 | -e 's/[0-9]86/x86/' \ 27 | -e 's/amd64/x86_64/' \ 28 | -e 's/IP../mips/' \ 29 | -e 's/9000..../hppa/' \ 30 | -e 's/Power\ Macintosh/ppc/' \ 31 | -e 's/00........../pwr4/'\ 32 | -e 's/arm.*/arm/' \ 33 | -e 's/aarch64/arm/') 34 | OSTYPE := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \ 35 | sed \ 36 | -e 's/cygwin.*/cygwin/' \ 37 | -e 's/irix../irix/' \ 38 | -e 's/windows.*/windows/' \ 39 | -e 's/mingw.*/mingw/') 40 | HOSTNAME := $(shell uname -n | tr '[:upper:]' '[:lower:]') 41 | -------------------------------------------------------------------------------- /make/make.project: -------------------------------------------------------------------------------- 1 | 2 | #----------------------------------------------------------------------------- 3 | # detect host architecture 4 | #----------------------------------------------------------------------------- 5 | include $(PAPILODIR)/make/make.detecthost 6 | 7 | #----------------------------------------------------------------------------- 8 | # get real path to PAPILO 9 | #----------------------------------------------------------------------------- 10 | ifeq ($(OSTYPE),mingw) 11 | SCIPREALPATH = $(PAPILODIR) 12 | else 13 | SCIPREALPATH = $(realpath $(PAPILODIR)) 14 | endif 15 | 16 | #----------------------------------------------------------------------------- 17 | # default settings 18 | #----------------------------------------------------------------------------- 19 | 20 | # check and testing parameters 21 | TIME = 3600 22 | NODES = 2100000000 23 | MEM = 6144 24 | PERMUTE = 0 25 | SEEDS = 0 26 | GLBSEEDSHIFT = 0 27 | STARTPERM = 0 28 | DISPFREQ = 10000 29 | FEASTOL = default 30 | TEST = short 31 | SETTINGS = default 32 | CONTINUE = false 33 | LOCK = false 34 | DEBUGTOOL = none 35 | CLIENTTMPDIR = /tmp 36 | REOPT = false 37 | PAPILO_OPT_COMMAND = presolve 38 | SOLVE_EXECUTABLE = off 39 | SKIP_PRESOLVE = false 40 | SETCUTOFF = 0 41 | VISUALIZE = false 42 | MAXJOBS = 1 43 | EXECUTABLE = build/bin/papilo 44 | BINID = $(notdir $(EXECUTABLE)) 45 | OUTPUTDIR = results 46 | CLUSTERNODES = all 47 | SLURMACCOUNT = default 48 | 49 | # set PAPILO version here for external projects 50 | VERSION = 2.4.3 51 | 52 | ## compiling and linking parameters 53 | #VERBOSE = false 54 | #OPT = opt 55 | #COMP = gnu 56 | LPS = none 57 | #TPI = none 58 | #SYM = none 59 | #PAPILO = false 60 | #STATICLIBEXT = a 61 | #SHAREDLIBEXT = so 62 | #LIBEXT = $(STATICLIBEXT) 63 | #LINKER = C 64 | #SHARED = false 65 | #NOBLKMEM = false 66 | #NOBUFMEM = false 67 | #NOBLKBUFMEM = false 68 | 69 | ## system parameters 70 | SHELL = bash 71 | READ = read -e 72 | LN_s = ln -s 73 | LN_sf = ln -sf 74 | -------------------------------------------------------------------------------- /papilo-config.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT TARGET papilo) 2 | include(${CMAKE_CURRENT_LIST_DIR}/papilo-targets.cmake) 3 | endif() 4 | set(PAPILO_IMPORTED_TARGETS papilo) 5 | set(PAPILO_FOUND 1) 6 | 7 | # For `find_dependency` function. 8 | include(CMakeFindDependencyMacro) 9 | 10 | list(APPEND CMAKE_MODULE_PATH @EXTRA_CMAKE_MODULE_PATH@) 11 | 12 | # If PAPILO was built with Quadmath then we also need it. 13 | set(PAPILO_HAVE_FLOAT128 @PAPILO_HAVE_FLOAT128@) 14 | if(PAPILO_HAVE_FLOAT128) 15 | if(NOT Quadmath_FOUND) 16 | find_dependency(Quadmath) 17 | endif() 18 | endif() 19 | 20 | # If PAPILO was built with GMP then we also need it. 21 | set(PAPILO_HAVE_GMP @PAPILO_HAVE_GMP@) 22 | if(PAPILO_HAVE_GMP AND PAPILO_FOUND) 23 | if(NOT GMP_FOUND) 24 | if(NOT GMP_DIR) 25 | set(GMP_DIR @GMP_DIR@) 26 | endif() 27 | find_dependency(GMP) 28 | endif() 29 | endif() 30 | 31 | # If PAPILO was built with TBB then we also need it. 32 | set(PAPILO_TBB @PAPILO_TBB@) 33 | if(PAPILO_TBB AND PAPILO_FOUND) 34 | if(NOT TBB_FOUND) 35 | if(NOT TBB_DIR) 36 | set(TBB_DIR @TBB_DIR@) 37 | endif() 38 | find_dependency(TBB 2018 COMPONENTS tbb tbbmalloc HINTS ${CMAKE_CURRENT_LIST_DIR}/_deps/local/ ${CMAKE_CURRENT_LIST_DIR}/_deps/local/lib) 39 | endif() 40 | endif() 41 | 42 | # If PAPILO uses the standard hashmap then we also do. 43 | set(PAPILO_USE_STANDARD_HASHMAP @PAPILO_USE_STANDARD_HASHMAP@) 44 | 45 | # If PAPILO was built with iostreams / program_options / serialization then we also need it. 46 | set(PAPILO_HAVE_BOOST_IOSTREAMS @PAPILO_HAVE_BOOST_IOSTREAMS@) 47 | set(PAPILO_USE_BOOST_IOSTREAMS_WITH_ZLIB @PAPILO_USE_BOOST_IOSTREAMS_WITH_ZLIB@) 48 | set(PAPILO_USE_BOOST_IOSTREAMS_WITH_BZIP2 @PAPILO_USE_BOOST_IOSTREAMS_WITH_BZIP2@) 49 | set(PAPILO_COMMAND_LINE_AVAILABLE @PAPILO_COMMAND_LINE_AVAILABLE@) 50 | set(PAPILO_SERIALIZATION_AVAILABLE @PAPILO_SERIALIZATION_AVAILABLE@) 51 | set(BOOST_COMPONENTS) 52 | if(PAPILO_HAVE_BOOST_IOSTREAMS) 53 | set(BOOST_COMPONENTS ${BOOST_COMPONENTS} iostreams) 54 | endif() 55 | if(PAPILO_COMMAND_LINE_AVAILABLE) 56 | set(BOOST_COMPONENTS ${BOOST_COMPONENTS} program_options) 57 | endif() 58 | if(PAPILO_SERIALIZATION_AVAILABLE) 59 | set(BOOST_COMPONENTS ${BOOST_COMPONENTS} serialization) 60 | endif() 61 | if(BOOST_COMPONENTS AND PAPILO_FOUND) 62 | if((NOT Boost_PROGRAM_OPTIONS_FOUND AND PAPILO_COMMAND_LINE_AVAILABLE) OR (NOT Boost_SERIALIZATION_FOUND AND PAPILO_SERIALIZATION_AVAILABLE) OR (NOT Boost_IOSTREAMS_FOUND AND PAPILO_HAVE_BOOST_IOSTREAMS)) 63 | if(NOT BOOST_ROOT) 64 | set(BOOST_ROOT @BOOST_ROOT@) 65 | endif() 66 | find_dependency(Boost @BOOST_MIN_VERSION@ COMPONENTS ${BOOST_COMPONENTS}) 67 | endif() 68 | endif() 69 | 70 | # We also need Threads. 71 | if(PAPILO_FOUND) 72 | if(NOT Threads_FOUND) 73 | find_dependency(Threads) 74 | endif() 75 | endif() 76 | 77 | if(@PAPILO_HAVE_LUSOL@ AND PAPILO_FOUND) 78 | enable_language(Fortran) 79 | endif() 80 | 81 | if(PAPILO_FOUND) 82 | find_package_message(PAPILO "Found PAPILO: ${CMAKE_CURRENT_LIST_FILE} (found suitable version \"@papilo_VERSION@\")" 83 | "[${PAPILO_FOUND}][${TBB_FOUND}]") 84 | endif() 85 | 86 | -------------------------------------------------------------------------------- /scripts/change_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IFS='.' read -ra version <<< "$1" 4 | 5 | for (( i=${#version[*]}; i<4; i++ )) 6 | do 7 | version[$i]=0 8 | done 9 | 10 | versionstring="${version[0]}.${version[1]}.${version[2]}" 11 | cmakefile=`dirname $0`/../CMakeLists.txt 12 | dummyconfig=`dirname $0`/../src/papilo/Config.hpp 13 | makeproject=`dirname $0`/../make/make.project 14 | 15 | sed -i "s/^set(PAPILO_VERSION_MAJOR .*/set(PAPILO_VERSION_MAJOR ${version[0]})/g" $cmakefile 16 | sed -i "s/^set(PAPILO_VERSION_MINOR .*/set(PAPILO_VERSION_MINOR ${version[1]})/g" $cmakefile 17 | sed -i "s/^set(PAPILO_VERSION_PATCH .*/set(PAPILO_VERSION_PATCH ${version[2]})/g" $cmakefile 18 | 19 | sed -i "s/^#define PAPILO_VERSION_MAJOR .*/#define PAPILO_VERSION_MAJOR ${version[0]}/g" $dummyconfig 20 | sed -i "s/^#define PAPILO_VERSION_MINOR .*/#define PAPILO_VERSION_MINOR ${version[1]}/g" $dummyconfig 21 | sed -i "s/^#define PAPILO_VERSION_PATCH .*/#define PAPILO_VERSION_PATCH ${version[2]}/g" $dummyconfig 22 | sed -i "s/^#define PAPILO_VERSION_TWEAK .*/#define PAPILO_VERSION_TWEAK ${version[3]}/g" $dummyconfig 23 | 24 | sed -i "s/VERSION = .*/VERSION = ${versionstring}/g" $makeproject 25 | -------------------------------------------------------------------------------- /scripts/increment_apiversion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cmakefile=`dirname $0`/../CMakeLists.txt 4 | dummyconfig=`dirname $0`/../src/papilo/Config.hpp 5 | 6 | lineapiversion=$(sed -n '/PAPILO_API_VERSION/p' $cmakefile) 7 | 8 | version=$(echo "$lineapiversion" | grep -o -E '[0-9]+') 9 | 10 | echo "Raising to API version $((version + 1))!" 11 | 12 | sed -i "s/^set(PAPILO_API_VERSION .*/set(PAPILO_API_VERSION $((version + 1)))/g" $cmakefile 13 | 14 | sed -i "s/^#define PAPILO_API_VERSION .*/#define PAPILO_API_VERSION $((version + 1))/g" $dummyconfig 15 | -------------------------------------------------------------------------------- /scripts/makedist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # create tarball for release 4 | # usage: ./scripts/makedist.sh 5 | 6 | V_MAJOR=$(grep PAPILO_VERSION_MAJOR CMakeLists.txt | head -n 1 | grep -o [0-9]*) 7 | V_MINOR=$(grep PAPILO_VERSION_MINOR CMakeLists.txt | head -n 1 | grep -o [0-9]*) 8 | V_PATCH=$(grep PAPILO_VERSION_PATCH CMakeLists.txt | head -n 1 | grep -o [0-9]*) 9 | VERSION=${V_MAJOR}.${V_MINOR}.${V_PATCH} 10 | NAME="papilo-${VERSION}" 11 | rm -f $NAME.tgz 12 | rm -f $NAME.tar 13 | 14 | echo ">>> Packaging $NAME." 15 | 16 | # echo "store git hash" 17 | GITHASH=`git rev-parse --short HEAD` 18 | sed -i "s/undef PAPILO_GITHASH_AVAILABLE/define PAPILO_GITHASH_AVAILABLE/g" src/papilo/Config.hpp 19 | sed -i "s/undef PAPILO_GITHASH/define PAPILO_GITHASH \"$GITHASH\"/g" src/papilo/Config.hpp 20 | 21 | # Before we create a tarball change the directory and file rights in a command way 22 | echo "adjust file modes" 23 | git ls-files | xargs dirname | sort -u | xargs chmod 750 24 | git ls-files | xargs chmod 640 25 | git ls-files "*.sh" "*.py" "scripts/*" | grep -v external | xargs chmod 750 26 | 27 | # pack files tracked by git and append $NAME to the front 28 | git ls-files -c | xargs tar --transform "s|^|${NAME}/|" -cvhf $NAME.tar \ 29 | --exclude="*~" \ 30 | --exclude=".*" 31 | 32 | # compress the archive 33 | gzip -c $NAME.tar > $NAME.tgz 34 | 35 | # remove temporary archive 36 | rm -f $NAME.tar 37 | 38 | echo "" 39 | echo "check version numbers ($VERSION):" 40 | grep -H "VERSION" src/papilo/Config.hpp 41 | grep -H project.papilo CMakeLists.txt 42 | # tail src/presol/git_hash.cpp 43 | -------------------------------------------------------------------------------- /scripts/scip_solve: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -ne 2 ]; then 4 | echo "Expected two arguments: instance file and log file" 5 | exit 6 | fi 7 | 8 | instance=$1 9 | base_name=$(basename -- "$instance") 10 | instance_name="${base_name%.*}" 11 | reduced_problem="${instance_name}.mps" 12 | solution_file="${instance_name}.sol" 13 | archive_file="${instance_name}.postsolve" 14 | log_file=$2 15 | 16 | if [$SCIP_PATH == ""]; then 17 | SCIP_PATH="./scip" 18 | if [ ! -e "$SCIP_PATH" ]; then 19 | echo "Couldn't find scip in current directory" 20 | exit 21 | fi 22 | fi 23 | 24 | if [$PRESOLVE_PATH == ""]; then 25 | PRESOLVE_PATH="./presolve" 26 | if [ ! -e "$PRESOLVE_PATH" ]; then 27 | echo "Couldn't find presolve in current directory" 28 | exit 29 | fi 30 | fi 31 | 32 | if [$POSTSOLVE_PATH == ""]; then 33 | POSTSOLVE_PATH="./postsolve" 34 | if [ ! -e "$POSTSOLVE_PATH" ]; then 35 | echo "Couldn't find postsolve in current directory" 36 | exit 37 | fi 38 | fi 39 | 40 | echo "::::::::::::::::::::::::::::" 41 | echo "solving instance: $instance_name" |tee /dev/tty >> $log_file 42 | echo "::::::::::::::::::::::::::::" 43 | 44 | $PRESOLVE_PATH $instance $instance_name 45 | $SCIP_PATH -c "read $reduced_problem" -c "optimize" -c "write solution $solution_file" -c "quit" |tee /dev/tty |grep "Solving Time" |sed 's/Solving Time (sec) : //' >> $log_file 46 | $POSTSOLVE_PATH $solution_file $archive_file 47 | echo "done" 48 | -------------------------------------------------------------------------------- /scripts/solve_instances: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -ne 3 ]; then 4 | echo "Expected three arguments: solver script, instance folder and log file" 5 | exit 6 | fi 7 | 8 | if [ ! -e "$1" ]; then 9 | echo "Couldn't find solver script $1" 10 | exit 11 | fi 12 | 13 | if [ ! -d "$2" ]; then 14 | echo "Couldn't find instance folder $2" 15 | exit 16 | fi 17 | 18 | solver=$1 19 | log_file=$3 20 | for file in $2/*; do 21 | source $solver $file $log_file 22 | read -rsp $'Press any key or wait 3 seconds to continue...\n' -n 1 -t 3; 23 | done 24 | -------------------------------------------------------------------------------- /scripts/updatedates.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # This bash script updates all copyrights in files that are under version 4 | # control (git) and have a ZIB copyright. 5 | # 6 | # You just have to run this script. There is nothing to adjust. 7 | # The correct year is detected through the 'date' function 8 | # 9 | # Note that not all files (usually scripts) contain a copyright. A copyright is only 10 | # needed for those files which are part of a SCIP distribution (see scripts/makedist.sh) 11 | # 12 | # USAGE: ./scripts/updatedates.sh 13 | 14 | set -euo pipefail 15 | 16 | NEWYEAR=`date +"%Y"` 17 | 18 | echo "Updating copyright of all files under version control and list findings of possibly incorrect copyright string." 19 | 20 | for f in `git ls-files` ; do 21 | 22 | # skip binary files 23 | grep -Iq . $f || continue 24 | 25 | # skip this file 26 | [[ $f =~ "updatedates.sh" ]] && continue 27 | 28 | # skip symbolic links 29 | if `test -L $f`; then 30 | echo "Skipping symbolic link $f" 31 | continue 32 | fi 33 | 34 | # process files with ZIB copyright string that do not include current year 35 | if grep -o 'Copyright (C) [0-9]*-[0-9]* Zuse Institute Berlin (ZIB)' $f | grep -vq $NEWYEAR ; then 36 | echo "Updating $f" 37 | sed -i "s/Copyright (C) \([0-9]*\)-[0-9]* Zuse Institute Berlin (ZIB)/Copyright (C) \1-$NEWYEAR Zuse Institute Berlin (ZIB)/g" $f 38 | fi 39 | 40 | # print matches for lines that have "Copyright" and "Zuse" but are not a valid ZIB copyright 41 | grep -iH "Copyright.*Zuse" $f | grep -v "Copyright (C) [0-9]*-$NEWYEAR Zuse Institute Berlin (ZIB)" || true 42 | 43 | done 44 | -------------------------------------------------------------------------------- /settings/16_threads.set: -------------------------------------------------------------------------------- 1 | presolve.threads = 16 -------------------------------------------------------------------------------- /settings/2_threads.set: -------------------------------------------------------------------------------- 1 | presolve.threads = 2 2 | -------------------------------------------------------------------------------- /settings/32_threads.set: -------------------------------------------------------------------------------- 1 | presolve.threads = 32 -------------------------------------------------------------------------------- /settings/4_threads.set: -------------------------------------------------------------------------------- 1 | presolve.threads = 4 -------------------------------------------------------------------------------- /settings/8_threads.set: -------------------------------------------------------------------------------- 1 | presolve.threads = 8 -------------------------------------------------------------------------------- /settings/default.set: -------------------------------------------------------------------------------- 1 | #colsingleton.enabled = 0 2 | #propagation.enabled = 0 3 | #coefftightening.enabled = 0 4 | 5 | #parallelcols.symmetries_enabled = 0 6 | #parallelrows.enabled = 0 7 | #stuffing.enabled = 0 8 | #doubletoneq.enabled = 0 9 | #dualfix.enabled = 0 10 | #simplifyineq.enabled = 0 11 | #simpleprobing.enabled = 0 12 | #fixcontinuous.enabled = 0 13 | 14 | #probing.enabled = 0 15 | #implint.enabled = 0 16 | #domcol.enabled = 0 17 | #sparsify.enabled = 0 18 | #substitution.enabled = 0 19 | 20 | #message.verbosity = 4 21 | -------------------------------------------------------------------------------- /settings/lp_presolvers_with_basis.set: -------------------------------------------------------------------------------- 1 | presolve.componentsmaxint = -1 2 | presolve.detectlindep = 0 3 | 4 | doubletoneq.enabled = 0 5 | dualinfer.enabled = 0 6 | substitution.enabled = 0 7 | sparsify.enabled = 0 -------------------------------------------------------------------------------- /settings/lp_presolvers_without_basis.set: -------------------------------------------------------------------------------- 1 | presolve.componentsmaxint = -1 2 | presolve.detectlindep = 0 3 | 4 | doubletoneq.enabled = 0 5 | dualinfer.enabled = 0 6 | substitution.enabled = 0 7 | sparsify.enabled = 0 8 | 9 | calculate_basis_for_dual = 0 10 | -------------------------------------------------------------------------------- /settings/lp_presolvers_without_basis_glop.set: -------------------------------------------------------------------------------- 1 | presolve.componentsmaxint = -1 2 | presolve.detectlindep = 0 3 | 4 | doubletoneq.enabled = 0 5 | dualinfer.enabled = 0 6 | substitution.enabled = 0 7 | sparsify.enabled = 0 8 | 9 | calculate_basis_for_dual = 0 10 | 11 | ortools.solver_id = GLOP 12 | -------------------------------------------------------------------------------- /settings/no_strong_dual_reductions.set: -------------------------------------------------------------------------------- 1 | presolve.dualreds = 1 2 | -------------------------------------------------------------------------------- /settings/roundingsat.set: -------------------------------------------------------------------------------- 1 | doubletoneq.enabled = 0 2 | parallelcols.enabled = 0 3 | substitution.enabled = 0 4 | sparsify.enabled = 0 5 | -------------------------------------------------------------------------------- /settings/scip_no_strong_dual_reductions.set: -------------------------------------------------------------------------------- 1 | presolve.threads = 1 2 | numerics.useabsfeas = 0 3 | parallelcols.enabled = 0 4 | sparsify.enabled = 0 5 | presolve.removeslackvars = 0 6 | presolve.detectlindep = 0 7 | substitution.binarieswithints = 0 8 | substitution.maxfillin = 3 9 | probing.maxbadgesize = 15000 10 | presolve.dualreds = 1 11 | -------------------------------------------------------------------------------- /settings/scip_settings.set: -------------------------------------------------------------------------------- 1 | presolve.threads = 1 2 | parallelcols.enabled = 0 3 | sparsify.enabled = 0 4 | presolve.removeslackvars = 0 5 | presolve.detectlindep = 0 6 | substitution.binarieswithints = 0 7 | substitution.maxfillin = 3 8 | probing.maxbadgesize = 15000 9 | numerics.useabsfeas = 0 10 | -------------------------------------------------------------------------------- /settings/sequential.set: -------------------------------------------------------------------------------- 1 | # maximal number of threads to use (0: automatic) [Integer: [0,2147483647]] 2 | presolve.threads = 1 3 | 4 | # if only one thread (presolve.threads = 1) is used, apply the reductions immediately afterwards 5 | presolve.apply_results_immediately_if_run_sequentially = 1 -------------------------------------------------------------------------------- /settings/sequential_not_immediately.set: -------------------------------------------------------------------------------- 1 | # maximal number of threads to use (0: automatic) [Integer: [0,2147483647]] 2 | presolve.threads = 1 3 | 4 | # if only one thread (presolve.threads = 1) is used, apply the reductions immediately afterwards 5 | presolve.apply_results_immediately_if_run_sequentially = 0 6 | -------------------------------------------------------------------------------- /settings/trivial.set: -------------------------------------------------------------------------------- 1 | verification_with_VeriPB = 1 2 | colsingleton.enabled = 0 3 | propagation.enabled = 0 4 | coefftightening.enabled = 0 5 | 6 | parallelcols.symmetries_enabled = 0 7 | parallelrows.enabled = 0 8 | stuffing.enabled = 0 9 | doubletoneq.enabled = 0 10 | dualfix.enabled = 0 11 | simplifyineq.enabled = 0 12 | simpleprobing.enabled = 0 13 | fixcontinuous.enabled = 0 14 | 15 | probing.enabled = 0 16 | implint.enabled = 0 17 | domcol.enabled = 0 18 | sparsify.enabled = 0 19 | substitution.enabled = 0 20 | 21 | presolve.dualreds = 0 22 | 23 | 24 | #message.verbosity = 4 25 | -------------------------------------------------------------------------------- /settings/verification.set: -------------------------------------------------------------------------------- 1 | verification_with_VeriPB = 1 2 | -------------------------------------------------------------------------------- /settings/verification_add.set: -------------------------------------------------------------------------------- 1 | verification_with_VeriPB = 1 2 | veripb.verify_propagation = 1 3 | -------------------------------------------------------------------------------- /src/papilo/CMakeConfig.hpp.in: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_CMAKE_CONFIG_HPP_ 24 | #define _PAPILO_CMAKE_CONFIG_HPP_ 25 | 26 | #cmakedefine PAPILO_HAVE_FLOAT128 27 | #cmakedefine PAPILO_HAVE_GMP 28 | #cmakedefine PAPILO_COMMAND_LINE_AVAILABLE 29 | #cmakedefine PAPILO_SERIALIZATION_AVAILABLE 30 | #cmakedefine PAPILO_HAVE_LUSOL 31 | #cmakedefine PAPILO_USE_STANDARD_HASHMAP 32 | #cmakedefine PAPILO_USE_BOOST_IOSTREAMS_WITH_ZLIB 33 | #cmakedefine PAPILO_USE_BOOST_IOSTREAMS_WITH_BZIP2 34 | #cmakedefine PAPILO_GITHASH_AVAILABLE 35 | #cmakedefine BOOST_FOUND 36 | #cmakedefine PAPILO_TBB 37 | 38 | #define PAPILO_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ 39 | #define PAPILO_VERSION_MINOR @PROJECT_VERSION_MINOR@ 40 | #define PAPILO_VERSION_PATCH @PROJECT_VERSION_PATCH@ 41 | #define PAPILO_VERSION_TWEAK @PROJECT_VERSION_TWEAK@ 42 | #define PAPILO_API_VERSION @PAPILO_API_VERSION@ 43 | 44 | #ifdef PAPILO_HAVE_GMP 45 | #define GMP_VERSION "@GMP_VERSION@" 46 | #endif 47 | 48 | #ifdef PAPILO_GITHASH_AVAILABLE 49 | #define PAPILO_GITHASH "@PAPILO_GITHASH@" 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/papilo/Config.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_CONFIG_HPP_ 24 | #define _PAPILO_CONFIG_HPP_ 25 | 26 | #ifndef PAPILO_NO_CMAKE_CONFIG 27 | 28 | #include "papilo/CMakeConfig.hpp" 29 | 30 | #else 31 | 32 | #define PAPILO_VERSION_MAJOR 2 33 | #define PAPILO_VERSION_MINOR 4 34 | #define PAPILO_VERSION_PATCH 3 35 | #define PAPILO_VERSION_TWEAK 0 36 | 37 | #define PAPILO_API_VERSION 3 38 | 39 | #undef PAPILO_GITHASH_AVAILABLE 40 | #undef PAPILO_GITHASH 41 | 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/papilo/core/ConstraintMatrix.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/ConstraintMatrix.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class ConstraintMatrix; 29 | template class ConstraintMatrix; 30 | template class ConstraintMatrix; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/core/Objective.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_CORE_OBJECTIVE_HPP_ 24 | #define _PAPILO_CORE_OBJECTIVE_HPP_ 25 | 26 | #include "papilo/misc/Vec.hpp" 27 | 28 | namespace papilo 29 | { 30 | 31 | /// type to store an objective function 32 | template 33 | struct Objective 34 | { 35 | /// dense vector of objective coefficients 36 | Vec coefficients; 37 | 38 | /// offset of objective function 39 | REAL offset; 40 | 41 | template 42 | void 43 | serialize( Archive& ar, const unsigned int version ) 44 | { 45 | ar& coefficients; 46 | ar& offset; 47 | } 48 | }; 49 | 50 | } // namespace papilo 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/papilo/core/Presolve.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/Presolve.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class Presolve; 29 | template class Presolve; 30 | template class Presolve; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/core/ProbingView.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/ProbingView.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class ProbingView; 29 | template class ProbingView; 30 | template class ProbingView; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/core/ProblemFlag.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_PROBLEM_TYPE_HPP_ 24 | #define _PAPILO_PROBLEM_TYPE_HPP_ 25 | 26 | #include "papilo/misc/Flags.hpp" 27 | 28 | namespace papilo 29 | { 30 | 31 | enum class ProblemFlag : uint8_t 32 | { 33 | kMixedInteger = 1 << 0, 34 | kInteger = 1 << 1, 35 | kLinear = 1 << 2, 36 | kBinary = 1 << 3, 37 | }; 38 | 39 | using ProblemFlags = Flags; 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/papilo/core/ProblemUpdate.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/ProblemUpdate.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class ProblemUpdate; 29 | template class ProblemUpdate; 30 | template class ProblemUpdate; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/core/RowFlags.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_CORE_ROW_FLAGS_HPP_ 24 | #define _PAPILO_CORE_ROW_FLAGS_HPP_ 25 | 26 | #include "papilo/misc/Flags.hpp" 27 | 28 | namespace papilo 29 | { 30 | 31 | enum class RowFlag : uint8_t 32 | { 33 | kLhsInf = 1 << 0, 34 | kRhsInf = 1 << 1, 35 | kEquation = 1 << 2, 36 | kIntegral = 1 << 3, 37 | kRedundant = 1 << 4, 38 | }; 39 | 40 | using RowFlags = Flags; 41 | 42 | } // namespace papilo 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/papilo/core/Solution.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_CORE_SOLUTION_HPP_ 24 | #define _PAPILO_CORE_SOLUTION_HPP_ 25 | 26 | #include "papilo/misc/Vec.hpp" 27 | 28 | namespace papilo 29 | { 30 | 31 | enum class SolutionType 32 | { 33 | kPrimal, 34 | kPrimalDual 35 | }; 36 | 37 | enum class VarBasisStatus : int 38 | { 39 | ON_UPPER = 0, 40 | ON_LOWER = 1, 41 | FIXED = 2, 42 | ZERO = 3, 43 | BASIC = 4, 44 | UNDEFINED = 5 45 | }; 46 | 47 | template 48 | class Solution 49 | { 50 | public: 51 | SolutionType type; 52 | Vec primal; 53 | Vec dual; 54 | Vec reducedCosts; 55 | Vec slack; 56 | bool basisAvailabe; 57 | Vec varBasisStatus; 58 | Vec rowBasisStatus; 59 | 60 | // Default type primal only. 61 | Solution() : type( SolutionType::kPrimal ), basisAvailabe( false ) {} 62 | 63 | explicit Solution( SolutionType type_ ) : type( type_ ), basisAvailabe( false ) {} 64 | 65 | Solution( SolutionType type_, Vec values ) 66 | : type( type_ ), primal( std::move( values ) ), basisAvailabe( false ) 67 | { 68 | } 69 | 70 | explicit Solution( Vec values ) 71 | : type( SolutionType::kPrimal ), primal( std::move( values ) ), 72 | basisAvailabe( false ) 73 | { 74 | } 75 | 76 | Solution( Vec primal_values, Vec dual_values, 77 | Vec reduced_values, Vec slack_values, 78 | bool basisAvailabe_value, 79 | Vec var_basis_status, 80 | Vec row_basis_status 81 | ) 82 | : type( SolutionType::kPrimalDual ), 83 | primal( std::move( primal_values ) ), 84 | dual( std::move( dual_values ), 85 | reducedCosts( std::move( reduced_values ) ), 86 | slack( std::move( slack_values ) ) ), 87 | basisAvailabe( basisAvailabe_value ), 88 | varBasisStatus( std::move( var_basis_status )), 89 | rowBasisStatus( std::move( row_basis_status )) 90 | 91 | { 92 | } 93 | }; 94 | 95 | } // namespace papilo 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /src/papilo/core/SparseStorage.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/SparseStorage.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class SparseStorage; 29 | template class SparseStorage; 30 | template class SparseStorage; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/core/VariableDomains.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/VariableDomains.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template struct VariableDomains; 29 | template struct VariableDomains; 30 | template struct VariableDomains; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/core/postsolve/Postsolve.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/postsolve/Postsolve.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class Postsolve; 29 | template class Postsolve; 30 | template class Postsolve; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/core/postsolve/PostsolveStatus.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_CORE_POSTSOLVE_STATUS_HPP_ 24 | #define _PAPILO_CORE_POSTSOLVE_STATUS_HPP_ 25 | 26 | namespace papilo 27 | { 28 | 29 | /// possible types of post solving 30 | enum class PostsolveStatus : int 31 | { 32 | kOk = 0, 33 | kFailed = 1 34 | }; 35 | 36 | } 37 | 38 | /// @deprecated Use papilo::PostsolveStatus instead. 39 | using PostsolveStatus = papilo::PostsolveStatus; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/papilo/core/postsolve/PostsolveStorage.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/postsolve/PostsolveStorage.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class PostsolveStorage; 29 | template class PostsolveStorage; 30 | template class PostsolveStorage; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/core/postsolve/PostsolveType.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_CORE_POSTSOLVE_TYPE_HPP_ 24 | #define _PAPILO_CORE_POSTSOLVE_TYPE_HPP_ 25 | 26 | 27 | /// possible types of post solving 28 | enum class PostsolveType : int 29 | { 30 | kPrimal = 0, 31 | kFull = 1, 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/papilo/core/postsolve/ReductionType.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_CORE_REDUCTION_TYPE_HPP_ 24 | #define _PAPILO_CORE_REDUCTION_TYPE_HPP_ 25 | 26 | 27 | /// possible types of post solving 28 | enum class ReductionType : int 29 | { 30 | kFixedCol = 0, 31 | kFixedInfCol = 5, 32 | kParallelCol = 2, 33 | kSubstitutedColWithDual = 3, 34 | kSubstitutedCol = 1, 35 | kVarBoundChange = 4, 36 | 37 | kRedundantRow = 7, 38 | kRowBoundChange = 8, 39 | kReasonForRowBoundChangeForcedByRow = 9, 40 | kRowBoundChangeForcedByRow = 10, 41 | 42 | kSaveRow = 11, 43 | 44 | kReducedBoundsCost = 12, 45 | kColumnDualValue = 13, 46 | kRowDualValue = 14, 47 | kCoefficientChange = 15, 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/papilo/external/catch/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /src/papilo/external/catch/README.md: -------------------------------------------------------------------------------- 1 | 2 | ![catch logo](artwork/catch2-logo-small.png) 3 | 4 | [![Github Releases](https://img.shields.io/github/release/catchorg/catch2.svg)](https://github.com/catchorg/catch2/releases) 5 | [![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=master)](https://travis-ci.org/catchorg/Catch2) 6 | [![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true)](https://ci.appveyor.com/project/catchorg/catch2) 7 | [![codecov](https://codecov.io/gh/catchorg/Catch2/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2) 8 | [![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/zDKMK3eGMC9IP2jy) 9 | 10 | The latest version of the single header can be downloaded directly using this link 11 | 12 | ## Catch2 is released! 13 | 14 | If you've been using an earlier version of Catch, please see the 15 | Breaking Changes section of [the release notes](https://github.com/catchorg/Catch2/releases/tag/v2.0.1) 16 | before moving to Catch2. You might also like to read [this blog post](http://www.levelofindirection.com/journal/2017/11/3/catch2-released.html) for more details. 17 | 18 | ## What's the Catch? 19 | 20 | Catch2 stands for C++ Automated Test Cases in a Header and is a 21 | multi-paradigm test framework for C++. which also supports Objective-C 22 | (and maybe C). 23 | It is primarily distributed as a single header file, although certain 24 | extensions may require additional headers. 25 | 26 | ## How to use it 27 | This documentation comprises these three parts: 28 | 29 | * [Why do we need yet another C++ Test Framework?](docs/why-catch.md#top) 30 | * [Tutorial](docs/tutorial.md#top) - getting started 31 | * [Reference section](docs/Readme.md#top) - all the details 32 | 33 | ## More 34 | * Issues and bugs can be raised on the [Issue tracker on GitHub](https://github.com/catchorg/Catch2/issues) 35 | * For discussion or questions please use [the dedicated Google Groups forum](https://groups.google.com/forum/?fromgroups#!forum/catch-forum) 36 | * See [who else is using Catch2](docs/opensource-users.md#top) 37 | -------------------------------------------------------------------------------- /src/papilo/external/fmt/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing to {fmt} 2 | ===================== 3 | 4 | By submitting a pull request or a patch, you represent that you have the right 5 | to license your contribution to the {fmt} project owners and the community, 6 | agree that your contributions are licensed under the {fmt} license, and agree 7 | to future changes to the licensing. 8 | 9 | All C++ code must adhere to [Google C++ Style Guide]( 10 | https://google.github.io/styleguide/cppguide.html) with the following 11 | exceptions: 12 | 13 | * Exceptions are permitted 14 | * snake_case should be used instead of UpperCamelCase for function and type 15 | names 16 | 17 | All documentation must adhere to the [Google Developer Documentation Style 18 | Guide](https://developers.google.com/style). 19 | 20 | Thanks for contributing! 21 | -------------------------------------------------------------------------------- /src/papilo/external/fmt/LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. 28 | -------------------------------------------------------------------------------- /src/papilo/external/fmt/locale.h: -------------------------------------------------------------------------------- 1 | // Formatting library for C++ - std::locale support 2 | // 3 | // Copyright (c) 2012 - present, Victor Zverovich 4 | // All rights reserved. 5 | // 6 | // For the license information refer to format.h. 7 | 8 | #ifndef FMT_LOCALE_H_ 9 | #define FMT_LOCALE_H_ 10 | 11 | #include 12 | 13 | #include "format.h" 14 | 15 | FMT_BEGIN_NAMESPACE 16 | 17 | namespace detail { 18 | template 19 | std::basic_string vformat( 20 | const std::locale& loc, basic_string_view format_str, 21 | basic_format_args>> args) { 22 | basic_memory_buffer buffer; 23 | detail::vformat_to(buffer, format_str, args, detail::locale_ref(loc)); 24 | return fmt::to_string(buffer); 25 | } 26 | } // namespace detail 27 | 28 | template > 29 | inline std::basic_string vformat( 30 | const std::locale& loc, const S& format_str, 31 | basic_format_args>> args) { 32 | return detail::vformat(loc, to_string_view(format_str), args); 33 | } 34 | 35 | template > 36 | inline std::basic_string format(const std::locale& loc, 37 | const S& format_str, Args&&... args) { 38 | return detail::vformat(loc, to_string_view(format_str), 39 | fmt::make_args_checked(format_str, args...)); 40 | } 41 | 42 | template , 44 | FMT_ENABLE_IF(detail::is_output_iterator::value)> 45 | inline OutputIt vformat_to( 46 | OutputIt out, const std::locale& loc, const S& format_str, 47 | basic_format_args>> args) { 48 | decltype(detail::get_buffer(out)) buf(detail::get_buffer_init(out)); 49 | vformat_to(buf, to_string_view(format_str), args, detail::locale_ref(loc)); 50 | return detail::get_iterator(buf); 51 | } 52 | 53 | template >::value> 55 | inline auto format_to(OutputIt out, const std::locale& loc, 56 | const S& format_str, Args&&... args) -> 57 | typename std::enable_if::type { 58 | const auto& vargs = fmt::make_args_checked(format_str, args...); 59 | return vformat_to(out, loc, to_string_view(format_str), vargs); 60 | } 61 | 62 | FMT_END_NAMESPACE 63 | 64 | #endif // FMT_LOCALE_H_ 65 | -------------------------------------------------------------------------------- /src/papilo/external/fmt/posix.h: -------------------------------------------------------------------------------- 1 | #include "os.h" 2 | #warning "fmt/posix.h is deprecated; use fmt/os.h instead" 3 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.dylib 4 | *.mod 5 | *__pycache__* 6 | *~ 7 | matlab/clusol.h 8 | include/clusol.h 9 | matlab/libclusol_proto*.m 10 | *.DS_Store 11 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/CHANGES.md: -------------------------------------------------------------------------------- 1 | ## 2016-01-26 2 | 3 | * `makefile` now works on OSX 10.11 with `gfortran` version 5.3 installed with 4 | homebrew 5 | * Updated LUSOL code to fix zero-column bug 6 | 7 | ## 2014-05-18 8 | 9 | * Updated build code to work on Mac OS X 10.9 & Matlab 2014a 10 | * Removed compiler selection from `matlab/lusol_build.m` 11 | * `mex` is now required to be setup to specify C compiler 12 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/LICENSE.md: -------------------------------------------------------------------------------- 1 | # LUSOL License 2 | 3 | LUSOL Fortran code and Matlab interface files are distributed under the terms of 4 | the BSD license or the MIT license copied below. 5 | 6 | ## MIT 7 | 8 | ``` 9 | Copyright (c) 2016 Systems Optimization Laboratory 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy of 12 | this software and associated documentation files (the "Software"), to deal in 13 | the Software without restriction, including without limitation the rights to 14 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | the Software, and to permit persons to whom the Software is furnished to do so, 16 | subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all 19 | copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 23 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 24 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 25 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 26 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | ``` 28 | 29 | ## BSD 30 | 31 | ``` 32 | BSD License for SOL Numerical Software 33 | http://www.opensource.org/licenses/bsd-license.php 34 | 35 | This notice applies to the software packages 36 | 37 | cgLanczos, cgls, lsmr, lsqr, lumod, lusol, minres, minres-qlp, pdco, symmlq 38 | 39 | made available at 40 | http://www.stanford.edu/group/SOL/software.html 41 | by the 42 | Systems Optimization Laboratory (SOL) 43 | Dept of Management Science and Engineering 44 | Stanford University, 45 | Stanford, CA 94305-4026, USA 46 | 47 | Copyright (c) 2010, Systems Optimization Laboratory 48 | All rights reserved. 49 | 50 | Redistribution and use in source and binary forms, with or without 51 | modification, are permitted provided that the following conditions are 52 | met: 53 | 54 | * Redistributions of source code must retain the above copyright 55 | notice, this list of conditions and the following disclaimer. 56 | 57 | * Redistributions in binary form must reproduce the above 58 | copyright notice, this list of conditions and the following 59 | disclaimer in the documentation and/or other materials provided 60 | with the distribution. 61 | 62 | * Neither the name of Stanford University nor the names of its 63 | contributors may be used to endorse or promote products derived 64 | from this software without specific prior written permission. 65 | 66 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 67 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 68 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 69 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 70 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 71 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 72 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 73 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 74 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 75 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 76 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 77 | ``` 78 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/README.md: -------------------------------------------------------------------------------- 1 | ## Interface generation files 2 | 3 | The files in this directory are used to generate the `clusol.h` and `clusol.c` 4 | interface code. 5 | 6 | ## Contents 7 | 8 | * `interface_files.org`: list of interface functions to include 9 | * `interface.py`: python3 script to generate `clusol` interface code 10 | * `lu1fac.org`: specification for LUSOL factorization function 11 | * `lu6mul.org`: specification for LUSOL multipy function 12 | * `lu6sol.org`: specification for LUSOL solve function 13 | * `lu8adc.org`: specification for LUSOL add column function 14 | * `lu8adr.org`: specification for LUSOL add row function 15 | * `lu8dlc.org`: specification for LUSOL delete column function 16 | * `lu8dlr.org`: specification for LUSOL delete row function 17 | * `lu8mod.org`: specification for LUSOL rank 1 modification function 18 | * `lu8rpc.org`: specification for LUSOL replace column function 19 | * `lu8rpr.org`: specification for LUSOL replace row function 20 | 21 | ## Note 22 | 23 | The interface generation script is called by `make` during the build process. 24 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/interface_files.org: -------------------------------------------------------------------------------- 1 | | interface_file | format | 2 | |----------------+--------| 3 | | gen/lu1fac.org | f90 | 4 | | gen/lu6sol.org | f90 | 5 | | gen/lu8rpc.org | f90 | 6 | | gen/lu6mul.org | f77 | 7 | | gen/lu8adc.org | f77 | 8 | | gen/lu8adr.org | f77 | 9 | | gen/lu8dlc.org | f77 | 10 | | gen/lu8dlr.org | f77 | 11 | | gen/lu8mod.org | f77 | 12 | | gen/lu8rpr.org | f77 | 13 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu1fac.org: -------------------------------------------------------------------------------- 1 | lu1fac 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+-------------------------------------------------------------| 4 | | m | int64_t | 1 | number of rows | 5 | | n | int64_t | 1 | number of columns | 6 | | nelem | int64_t | 1 | number of matrix entries | 7 | | lena | int64_t | 1 | dimension of a, indc, and indr | 8 | | luparm | int64_t | 30 | parameter vector | 9 | | parmlu | double | 30 | parameter vector | 10 | | a | double | lena | nonzero entries | 11 | | indc | int64_t | lena | indices | 12 | | indr | int64_t | lena | indices | 13 | | p | int64_t | m | row permutations | 14 | | q | int64_t | n | column permutations | 15 | | lenc | int64_t | n | number of entries in nontrivial columns of L in pivot order | 16 | | lenr | int64_t | m | number of entries in each row of U in original order | 17 | | locc | int64_t | n | "ready for LU update routines" | 18 | | locr | int64_t | m | "points to the beginning of the rows of U in a, indr" | 19 | | iploc | int64_t | n | | 20 | | iqloc | int64_t | m | | 21 | | ipinv | int64_t | m | | 22 | | iqinv | int64_t | n | | 23 | | w | double | n | | 24 | | inform | int64_t | 1 | | 25 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu6mul.org: -------------------------------------------------------------------------------- 1 | lu6mul 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+---------| 4 | | mode | int64_t | 1 | | 5 | | m | int64_t | 1 | | 6 | | n | int64_t | 1 | | 7 | | v | double | m | | 8 | | w | double | n | | 9 | | lena | int64_t | 1 | | 10 | | luparm | int64_t | 30 | | 11 | | parmlu | double | 30 | | 12 | | a | double | lena | | 13 | | indc | int64_t | lena | | 14 | | indr | int64_t | lena | | 15 | | p | int64_t | m | | 16 | | q | int64_t | n | | 17 | | lenc | int64_t | n | | 18 | | lenr | int64_t | m | | 19 | | locc | int64_t | n | | 20 | | locr | int64_t | m | | 21 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu6sol.org: -------------------------------------------------------------------------------- 1 | lu6sol 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+--------------------| 4 | | mode | int64_t | 1 | subroutine mode | 5 | | m | int64_t | 1 | number of rows | 6 | | n | int64_t | 1 | number of rows | 7 | | v | double | m | io vector | 8 | | w | double | n | io vector | 9 | | lena | int64_t | 1 | length of storage | 10 | | luparm | int64_t | 30 | integer parameters | 11 | | parmlu | double | 30 | double parameters | 12 | | a | double | lena | non-zeros | 13 | | indc | int64_t | lena | indices | 14 | | indr | int64_t | lena | indices | 15 | | p | int64_t | m | row permutation | 16 | | q | int64_t | n | col permutation | 17 | | lenc | int64_t | n | | 18 | | lenr | int64_t | m | | 19 | | locc | int64_t | n | | 20 | | locr | int64_t | m | | 21 | | inform | int64_t | 1 | | 22 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu8adc.org: -------------------------------------------------------------------------------- 1 | lu8adc 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+---------------| 4 | | mode | int64_t | 1 | function mode | 5 | | m | int64_t | 1 | num rows | 6 | | n | int64_t | 1 | num columns | 7 | | v | double | m | | 8 | | w | double | n | | 9 | | lena | int64_t | 1 | | 10 | | luparm | int64_t | 30 | | 11 | | parmlu | double | 30 | | 12 | | a | double | lena | | 13 | | indc | int64_t | lena | | 14 | | indr | int64_t | lena | | 15 | | p | int64_t | m | | 16 | | q | int64_t | n | | 17 | | lenc | int64_t | n | | 18 | | lenr | int64_t | m | | 19 | | locc | int64_t | n | | 20 | | locr | int64_t | m | | 21 | | inform | int64_t | 1 | | 22 | | diag | double | 1 | | 23 | | vnorm | double | 1 | | 24 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu8adr.org: -------------------------------------------------------------------------------- 1 | lu8adr 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+-------------| 4 | | m | int64_t | 1 | num rows | 5 | | n | int64_t | 1 | num columns | 6 | | w | double | n | | 7 | | lena | int64_t | 1 | | 8 | | luparm | int64_t | 30 | | 9 | | parmlu | double | 30 | | 10 | | a | double | lena | | 11 | | indc | int64_t | lena | | 12 | | indr | int64_t | lena | | 13 | | p | int64_t | m | | 14 | | q | int64_t | n | | 15 | | lenc | int64_t | n | | 16 | | lenr | int64_t | m | | 17 | | locc | int64_t | n | | 18 | | locr | int64_t | m | | 19 | | inform | int64_t | 1 | | 20 | | diag | double | 1 | | 21 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu8dlc.org: -------------------------------------------------------------------------------- 1 | lu8dlc 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+------------------| 4 | | m | int64_t | 1 | num rows | 5 | | n | int64_t | 1 | num columns | 6 | | jdel | int64_t | 1 | column to delete | 7 | | lena | int64_t | 1 | | 8 | | luparm | int64_t | 30 | | 9 | | parmlu | double | 30 | | 10 | | a | double | lena | | 11 | | indc | int64_t | lena | | 12 | | indr | int64_t | lena | | 13 | | p | int64_t | m | | 14 | | q | int64_t | n | | 15 | | lenc | int64_t | n | | 16 | | lenr | int64_t | m | | 17 | | locc | int64_t | n | | 18 | | locr | int64_t | m | | 19 | | inform | int64_t | 1 | | 20 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu8dlr.org: -------------------------------------------------------------------------------- 1 | lu8dlr 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+------------------| 4 | | mode | int64_t | 1 | | 5 | | m | int64_t | 1 | num rows | 6 | | n | int64_t | 1 | num columns | 7 | | idel | int64_t | 1 | column to delete | 8 | | v | double | m | | 9 | | w | double | n | | 10 | | lena | int64_t | 1 | | 11 | | luparm | int64_t | 30 | | 12 | | parmlu | double | 30 | | 13 | | a | double | lena | | 14 | | indc | int64_t | lena | | 15 | | indr | int64_t | lena | | 16 | | p | int64_t | m | | 17 | | q | int64_t | n | | 18 | | lenc | int64_t | n | | 19 | | lenr | int64_t | m | | 20 | | locc | int64_t | n | | 21 | | locr | int64_t | m | | 22 | | inform | int64_t | 1 | | 23 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu8mod.org: -------------------------------------------------------------------------------- 1 | lu8mod 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+-------------| 4 | | mode | int64_t | 1 | | 5 | | m | int64_t | 1 | num rows | 6 | | n | int64_t | 1 | num columns | 7 | | beta | double | 1 | | 8 | | v | double | m | | 9 | | w | double | n | | 10 | | lena | int64_t | 1 | | 11 | | luparm | int64_t | 30 | | 12 | | parmlu | double | 30 | | 13 | | a | double | lena | | 14 | | indc | int64_t | lena | | 15 | | indr | int64_t | lena | | 16 | | p | int64_t | m | | 17 | | q | int64_t | n | | 18 | | lenc | int64_t | n | | 19 | | lenr | int64_t | m | | 20 | | locc | int64_t | n | | 21 | | locr | int64_t | m | | 22 | | inform | int64_t | 1 | | 23 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu8rpc.org: -------------------------------------------------------------------------------- 1 | lu8rpc 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+-----------------------| 4 | | mode1 | int64_t | 1 | function mode | 5 | | mode2 | int64_t | 1 | function mode | 6 | | m | int64_t | 1 | num rows | 7 | | n | int64_t | 1 | num columns | 8 | | jrep | int64_t | 1 | column to be replaced | 9 | | v | double | m | | 10 | | w | double | n | | 11 | | lena | int64_t | 1 | | 12 | | luparm | int64_t | 30 | | 13 | | parmlu | double | 30 | | 14 | | a | double | lena | | 15 | | indc | int64_t | lena | | 16 | | indr | int64_t | lena | | 17 | | p | int64_t | m | | 18 | | q | int64_t | n | | 19 | | lenc | int64_t | n | | 20 | | lenr | int64_t | m | | 21 | | locc | int64_t | n | | 22 | | locr | int64_t | m | | 23 | | inform | int64_t | 1 | | 24 | | diag | double | 1 | | 25 | | vnorm | double | 1 | | 26 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/gen/lu8rpr.org: -------------------------------------------------------------------------------- 1 | lu8rpr 2 | | var_name | c_type | length | comment | 3 | |----------+---------+--------+-----------------------| 4 | | mode1 | int64_t | 1 | function mode | 5 | | mode2 | int64_t | 1 | function mode | 6 | | m | int64_t | 1 | num rows | 7 | | n | int64_t | 1 | num columns | 8 | | irep | int64_t | 1 | column to be replaced | 9 | | v | double | m | | 10 | | w | double | n | | 11 | | wnew | double | n | | 12 | | lena | int64_t | 1 | | 13 | | luparm | int64_t | 30 | | 14 | | parmlu | double | 30 | | 15 | | a | double | lena | | 16 | | indc | int64_t | lena | | 17 | | indr | int64_t | lena | | 18 | | p | int64_t | m | | 19 | | q | int64_t | n | | 20 | | lenc | int64_t | n | | 21 | | lenr | int64_t | m | | 22 | | locc | int64_t | n | | 23 | | locr | int64_t | m | | 24 | | inform | int64_t | 1 | | 25 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/src/README.md: -------------------------------------------------------------------------------- 1 | ## LUSOL fortran code 2 | 3 | This directory contains LUSOL fortran 77 and fortran 90 code. 4 | 5 | ## Contents 6 | 7 | * `clusol.c`: generated interface code 8 | * `clusol.h`: generated interface header 9 | * `lusol6b.f`: contains lu6mul 10 | * `lusol7b.f`: contains lusol helper functions 11 | * `lusol8b.f`: contains lusol update functions (not lu8rpc) 12 | * `lusol.f90`: fortran 90 code for factorization, solve, and replace column 13 | * `lusol_precision.f90`: fortran 90 module to specify precision 14 | * `lusol.txt`: some LUSOL documentation and history 15 | * `lusol_util.f`: fortran 77 code for factorization, solve, and replace column 16 | * `symbols.osx`: list of symbols to export in osx dynamic library 17 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/src/lusol_precision.f90: -------------------------------------------------------------------------------- 1 | !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 | ! File lusol_recision.f90 3 | ! 4 | ! SNOPT module for defining integer(ip), real(rp). 5 | ! snPrecision.f90 should be one of the following 3 files: 6 | ! 7 | ! snPrecision32.f90 sets ip=4, rp = 8 8 | ! snPrecision64.f90 sets ip=8, rp = 8 9 | ! snPrecision128.f90 sets ip=8, rp = 16 10 | ! 11 | ! ip huge 12 | ! 4 2147483647 13 | ! 8 9223372036854775807 14 | ! 15 | ! rp huge 16 | ! 4 3.40282347E+38 17 | ! 8 1.79769313486231571E+308 18 | ! 16 1.18973149535723176508575932662800702E+4932 19 | ! 20 | ! rp eps 21 | ! 4 1.19209290E-07 22 | ! 8 2.22044604925031308E-016 23 | ! 16 1.92592994438723585305597794258492732E-0034 24 | ! 25 | ! We don't need selected_int_kind or selected_real_kind now. 26 | ! Previously we used these values: 27 | ! ip = integer precision int_kind( 7) = integer(4) 28 | ! int_kind(15) = integer(8) 29 | ! rp = real precision real_kind( 6) = real(4) (not used in SNOPT) 30 | ! real_kind(15) = real(8) 31 | ! real_kind(30) = real(16) 32 | ! 33 | ! 11 Mar 2008: First version. 34 | ! 20 Apr 2012: First quad version. 35 | ! 22 Apr 2012: Made three versions of snPrecision.f90. 36 | ! See README.QUAD for use with configure and make. 37 | !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 38 | 39 | module lusol_precision 40 | use iso_fortran_env 41 | implicit none 42 | public 43 | 44 | integer(4), parameter :: ip = int64, rp = real64 45 | 46 | end module lusol_precision 47 | -------------------------------------------------------------------------------- /src/papilo/external/lusol/src/lusol_util.f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipopt/papilo/0bb6562dc4a12d11b563a5ed90030a9aedac6e1d/src/papilo/external/lusol/src/lusol_util.f -------------------------------------------------------------------------------- /src/papilo/external/lusol/src/symbols.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | clu1fac; 4 | clu6mul; 5 | clu6sol; 6 | clu8adc; 7 | clu8adr; 8 | clu8dlc; 9 | clu8dlr; 10 | clu8mod; 11 | clu8rpc; 12 | clu8rpr; 13 | local: 14 | *; 15 | }; -------------------------------------------------------------------------------- /src/papilo/external/lusol/src/symbols.osx: -------------------------------------------------------------------------------- 1 | _clu1fac 2 | _clu6sol 3 | _clu8rpc 4 | _clu6mul 5 | _clu8adc 6 | _clu8adr 7 | _clu8dlc 8 | _clu8dlr 9 | _clu8mod 10 | _clu8rpr 11 | -------------------------------------------------------------------------------- /src/papilo/external/pdqsort/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Orson Peters 2 | 3 | This software is provided 'as-is', without any express or implied warranty. In no event will the 4 | authors be held liable for any damages arising from the use of this software. 5 | 6 | Permission is granted to anyone to use this software for any purpose, including commercial 7 | applications, and to alter it and redistribute it freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the 10 | original software. If you use this software in a product, an acknowledgment in the product 11 | documentation would be appreciated but is not required. 12 | 13 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as 14 | being the original software. 15 | 16 | 3. This notice may not be removed or altered from any source distribution. 17 | -------------------------------------------------------------------------------- /src/papilo/external/ska/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /src/papilo/io/BoundType.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef PAPILO_BOUNDTYPE_HPP 24 | #define PAPILO_BOUNDTYPE_HPP 25 | 26 | namespace papilo 27 | { 28 | 29 | enum BoundType 30 | { 31 | kLE, 32 | kEq, 33 | kGE 34 | }; 35 | 36 | } // namespace papilo 37 | 38 | #endif // PAPILO_BOUNDTYPE_HPP 39 | -------------------------------------------------------------------------------- /src/papilo/io/ParseKey.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef PAPILO_PARSEKEY_HPP 24 | #define PAPILO_PARSEKEY_HPP 25 | 26 | namespace papilo 27 | { 28 | 29 | enum ParseKey 30 | { 31 | kRows, 32 | kCols, 33 | kRhs, 34 | kRanges, 35 | kBounds, 36 | kNone, 37 | kEnd, 38 | kFail, 39 | kComment 40 | }; 41 | 42 | } // namespace papilo 43 | 44 | #endif // PAPILO_PARSEKEY_HPP 45 | -------------------------------------------------------------------------------- /src/papilo/io/Parser.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_IO_PARSER_HPP_ 24 | #define _PAPILO_IO_PARSER_HPP_ 25 | 26 | #include "papilo/Config.hpp" 27 | #include "papilo/io/MpsParser.hpp" 28 | #include "papilo/io/OpbParser.hpp" 29 | #ifdef PAPILO_USE_BOOST_IOSTREAMS_WITH_BZIP2 30 | #include 31 | #endif 32 | #ifdef PAPILO_USE_BOOST_IOSTREAMS_WITH_ZLIB 33 | #include 34 | #endif 35 | 36 | namespace papilo 37 | { 38 | 39 | template 40 | class Parser 41 | { 42 | 43 | public: 44 | static boost::optional> 45 | loadProblem( const std::string& filename ) 46 | { 47 | if( filename.find(".mps") != std::string::npos) 48 | return MpsParser::loadProblem( filename ); 49 | else if( filename.find(".opb") != std::string::npos) 50 | return OpbParser::loadProblem( filename ); 51 | else 52 | return boost::none; 53 | } 54 | }; 55 | }; // namespace papilo 56 | 57 | #endif /* _PARSING_MPS_PARSER_HPP_ */ 58 | -------------------------------------------------------------------------------- /src/papilo/misc/Alloc.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_ALLOC_HPP_ 24 | #define _PAPILO_MISC_ALLOC_HPP_ 25 | 26 | #include 27 | 28 | namespace papilo 29 | { 30 | 31 | template 32 | struct AllocatorTraits 33 | { 34 | using type = std::allocator; 35 | }; 36 | 37 | template 38 | using Allocator = typename AllocatorTraits::type; 39 | 40 | } // namespace papilo 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/papilo/misc/Array.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_ARRAY_HPP_ 24 | #define _PAPILO_MISC_ARRAY_HPP_ 25 | 26 | #include "papilo/misc/Alloc.hpp" 27 | #include 28 | #include 29 | 30 | namespace papilo 31 | { 32 | 33 | template 34 | struct ArrayDeleter 35 | { 36 | std::size_t size; 37 | 38 | ArrayDeleter( std::size_t _size ) : size( _size ) {} 39 | 40 | void 41 | operator()( T* p ) 42 | { 43 | Allocator().deallocate( p, size ); 44 | } 45 | }; 46 | 47 | template 48 | class Array 49 | { 50 | public: 51 | Array( std::size_t n ) 52 | : ptr( Allocator().allocate( n ), ArrayDeleter( n ) ) 53 | { 54 | } 55 | 56 | std::size_t 57 | getSize() const 58 | { 59 | return ptr.get_deleter().size; 60 | } 61 | 62 | T& 63 | operator[]( int i ) 64 | { 65 | return ptr[i]; 66 | } 67 | 68 | const T& 69 | operator[]( int i ) const 70 | { 71 | return ptr[i]; 72 | } 73 | 74 | private: 75 | std::unique_ptr> ptr; 76 | }; 77 | 78 | } // namespace papilo 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /src/papilo/misc/Flags.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_FLAGS_HPP_ 24 | #define _PAPILO_MISC_FLAGS_HPP_ 25 | 26 | #include 27 | #include 28 | 29 | namespace papilo 30 | { 31 | 32 | template 33 | class Flags 34 | { 35 | public: 36 | Flags( BaseType t ) : state( static_cast( t ) ) {} 37 | 38 | Flags() : state( 0 ) {} 39 | 40 | template 41 | void 42 | set( Args... flags ) 43 | { 44 | state |= joinFlags( flags... ); 45 | } 46 | 47 | void 48 | clear() 49 | { 50 | state = 0; 51 | } 52 | 53 | template 54 | void 55 | unset( Args... flags ) 56 | { 57 | state &= ~joinFlags( flags... ); 58 | } 59 | 60 | template 61 | bool 62 | test( Args... flags ) const 63 | { 64 | return state & joinFlags( flags... ); 65 | } 66 | 67 | template 68 | bool 69 | equal( Args... flags ) const 70 | { 71 | return state == joinFlags( flags... ); 72 | } 73 | 74 | template 75 | void 76 | serialize( Archive& ar, const unsigned int version ) 77 | { 78 | ar& state; 79 | } 80 | 81 | private: 82 | using UnderlyingType = typename std::underlying_type::type; 83 | 84 | static UnderlyingType 85 | joinFlags( BaseType f1 ) 86 | { 87 | return static_cast( f1 ); 88 | } 89 | 90 | template 91 | static UnderlyingType 92 | joinFlags( BaseType f1, Args... other ) 93 | { 94 | return static_cast( f1 ) | joinFlags( other... ); 95 | } 96 | 97 | UnderlyingType state; 98 | }; 99 | 100 | } // namespace papilo 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /src/papilo/misc/Signature.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_SIGNATURE_HPP_ 24 | #define _PAPILO_MISC_SIGNATURE_HPP_ 25 | 26 | #include "papilo/misc/Hash.hpp" 27 | #include 28 | #include 29 | #include 30 | 31 | namespace papilo 32 | { 33 | 34 | template 35 | class Signature 36 | { 37 | public: 38 | Signature() : state( 0 ) {} 39 | 40 | template 41 | void 42 | add( U elem ) 43 | { 44 | state |= 45 | 1 << ( ( uint32_t( elem ) * 46 | HashHelpers::fibonacci_muliplier() ) >> 47 | ( 32 - static_cast( std::log2( 8 * sizeof( T ) ) ) ) ); 48 | } 49 | 50 | // template 51 | // void 52 | // add( U elem ) 53 | //{ 54 | // state |= 1 << ( uint32_t( elem ) % ( sizeof( T ) * 8 ) ); 55 | //} 56 | 57 | bool 58 | isSubset( Signature other ) 59 | { 60 | return ( state & ~other.state ) == 0; 61 | } 62 | 63 | bool 64 | isSuperset( Signature other ) 65 | { 66 | return ( other.state & ~state ) == 0; 67 | } 68 | 69 | bool 70 | isEqual( Signature other ) 71 | { 72 | return state == other.state; 73 | } 74 | 75 | private: 76 | T state; 77 | }; 78 | 79 | using Signature32 = Signature; 80 | using Signature64 = Signature; 81 | 82 | } // namespace papilo 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /src/papilo/misc/StableSum.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_STABLE_SUM_HPP_ 24 | #define _PAPILO_MISC_STABLE_SUM_HPP_ 25 | 26 | #include "papilo/misc/Num.hpp" 27 | 28 | namespace papilo 29 | { 30 | 31 | template ::is_floating_point> 32 | class StableSum; 33 | 34 | template 35 | class StableSum 36 | { 37 | REAL sum = 0; 38 | REAL c = 0; 39 | 40 | public: 41 | StableSum() = default; 42 | 43 | explicit StableSum( const REAL& init ) : sum( init ), c( 0 ) {} 44 | 45 | void 46 | add( const REAL& input ) 47 | { 48 | REAL t = sum + input; 49 | REAL z = t - sum; 50 | REAL y = ( sum - ( t - z ) ) + ( input - z ); 51 | c += y; 52 | 53 | sum = t; 54 | } 55 | 56 | REAL 57 | get() const 58 | { 59 | return sum + c; 60 | } 61 | }; 62 | 63 | template 64 | class StableSum 65 | { 66 | REAL sum = 0; 67 | 68 | public: 69 | StableSum() = default; 70 | 71 | explicit StableSum( const REAL& init ) : sum( init ) {} 72 | 73 | void 74 | add( const REAL& input ) 75 | { 76 | sum += input; 77 | } 78 | 79 | REAL 80 | get() const 81 | { 82 | return sum; 83 | } 84 | }; 85 | 86 | } // namespace papilo 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /src/papilo/misc/String.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_STRING_HPP_ 24 | #define _PAPILO_MISC_STRING_HPP_ 25 | 26 | #include "papilo/misc/Alloc.hpp" 27 | #include 28 | 29 | namespace papilo 30 | { 31 | 32 | using String = std::basic_string, Allocator>; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/papilo/misc/Timer.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_TIMER_HPP_ 24 | #define _PAPILO_MISC_TIMER_HPP_ 25 | #include "papilo/Config.hpp" 26 | 27 | #ifdef PAPILO_TBB 28 | #include "papilo/misc/tbb.hpp" 29 | #else 30 | #include 31 | #endif 32 | 33 | namespace papilo 34 | { 35 | 36 | #ifdef PAPILO_TBB 37 | class Timer 38 | { 39 | public: 40 | Timer( double& time_ ) : time( time_ ) { start = tbb::tick_count::now(); } 41 | 42 | double 43 | getTime() const 44 | { 45 | return ( tbb::tick_count::now() - start ).seconds(); 46 | } 47 | 48 | ~Timer() { time += ( tbb::tick_count::now() - start ).seconds(); } 49 | 50 | private: 51 | tbb::tick_count start; 52 | double& time; 53 | }; 54 | #else 55 | class Timer 56 | { 57 | public: 58 | Timer( double& time_ ) : time( time_ ) { start = std::chrono::steady_clock::now(); } 59 | 60 | double 61 | getTime() const 62 | { 63 | return std::chrono::duration_cast( 64 | std::chrono::steady_clock::now() - start ) 65 | .count() /1000.0; 66 | } 67 | 68 | ~Timer() { 69 | time += std::chrono::duration_cast( 70 | std::chrono::steady_clock::now() - start ) 71 | .count() /1000.0; 72 | } 73 | 74 | private: 75 | std::chrono::steady_clock::time_point start; 76 | double& time; 77 | }; 78 | #endif 79 | 80 | } // namespace papilo 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/papilo/misc/Vec.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_VEC_HPP_ 24 | #define _PAPILO_MISC_VEC_HPP_ 25 | 26 | #include "papilo/misc/Alloc.hpp" 27 | #include 28 | #include 29 | namespace papilo 30 | { 31 | template 32 | using Vec = std::vector>; 33 | 34 | template 35 | using SmallVec = boost::container::small_vector>; 36 | 37 | } // namespace papilo 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/papilo/misc/compress_vector.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_COMPRESS_VECTOR_HPP_ 24 | #define _PAPILO_MISC_COMPRESS_VECTOR_HPP_ 25 | 26 | #include "papilo/misc/Vec.hpp" 27 | #include 28 | 29 | namespace papilo 30 | { 31 | 32 | /// helper function to compress a vector-like container using the given mapping 33 | template 34 | void 35 | compress_vector( const Vec& mapping, VEC& vec ) 36 | { 37 | assert( vec.size() == mapping.size() ); 38 | 39 | int newSize = 0; 40 | for( int i = 0; i != static_cast( vec.size() ); ++i ) 41 | { 42 | assert( mapping[i] <= i ); 43 | 44 | if( mapping[i] != -1 ) 45 | { 46 | vec[mapping[i]] = vec[i]; 47 | newSize++; 48 | } 49 | } 50 | vec.resize( newSize ); 51 | } 52 | 53 | /// helper function to compress a vector-like container of indicies using the 54 | /// given mapping 55 | template 56 | void 57 | compress_index_vector( const Vec& mapping, VEC& vec ) 58 | { 59 | int offset = 0; 60 | for( std::size_t i = 0; i < vec.size(); ++i ) 61 | { 62 | int newindex = mapping[vec[i]]; 63 | if( newindex != -1 ) 64 | vec[i - offset] = newindex; 65 | else 66 | ++offset; 67 | } 68 | 69 | vec.resize( vec.size() - offset ); 70 | } 71 | 72 | } // namespace papilo 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/papilo/misc/extended_euclidean.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Copyright Nick Thompson 2018. 3 | * Use, modification and distribution are subject to the 4 | * Boost Software License, Version 1.0. (See accompanying file 5 | * LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | #ifndef BOOST_INTEGER_EXTENDED_EUCLIDEAN_HPP 8 | #define BOOST_INTEGER_EXTENDED_EUCLIDEAN_HPP 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace boost { namespace integer { 16 | 17 | // From "The Joy of Factoring", Algorithm 2.7, with a small optimization to remove tmps from Wikipedia. 18 | // Solves mx + ny = gcd(m,n). Returns tuple with (gcd(m,n), x, y). 19 | 20 | template 21 | struct euclidean_result_t 22 | { 23 | Z gcd; 24 | Z x; 25 | Z y; 26 | }; 27 | 28 | template 29 | typename boost::enable_if_c< std::numeric_limits< Z >::is_signed, euclidean_result_t< Z > >::type 30 | extended_euclidean(Z m, Z n) 31 | { 32 | if (m < 1 || n < 1) 33 | { 34 | BOOST_THROW_EXCEPTION(std::domain_error("extended_euclidean: arguments must be strictly positive")); 35 | } 36 | 37 | bool swapped = false; 38 | if (m < n) 39 | { 40 | swapped = true; 41 | boost::swap(m, n); 42 | } 43 | Z u0 = m; 44 | Z u1 = 1; 45 | Z u2 = 0; 46 | Z v0 = n; 47 | Z v1 = 0; 48 | Z v2 = 1; 49 | Z w0; 50 | Z w1; 51 | Z w2; 52 | while(v0 > 0) 53 | { 54 | Z q = u0/v0; 55 | w0 = u0 - q*v0; 56 | w1 = u1 - q*v1; 57 | w2 = u2 - q*v2; 58 | u0 = v0; 59 | u1 = v1; 60 | u2 = v2; 61 | v0 = w0; 62 | v1 = w1; 63 | v2 = w2; 64 | } 65 | 66 | euclidean_result_t< Z > result; 67 | result.gcd = u0; 68 | if (!swapped) 69 | { 70 | result.x = u1; 71 | result.y = u2; 72 | } 73 | else 74 | { 75 | result.x = u2; 76 | result.y = u1; 77 | } 78 | 79 | return result; 80 | } 81 | 82 | }} 83 | #endif 84 | -------------------------------------------------------------------------------- /src/papilo/misc/fmt.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_FMT_HPP_ 24 | #define _PAPILO_MISC_FMT_HPP_ 25 | 26 | #ifndef FMT_HEADER_ONLY 27 | #define FMT_HEADER_ONLY 28 | #endif 29 | 30 | /* if those macros are not defined and fmt includes windows.h 31 | * then many macros are defined that can interfere with standard C++ code 32 | */ 33 | #ifndef NOMINMAX 34 | #define NOMINMAX 35 | #define PAPILO_DEFINED_NOMINMAX 36 | #endif 37 | 38 | #ifndef WIN32_LEAN_AND_MEAN 39 | #define WIN32_LEAN_AND_MEAN 40 | #define PAPILO_DEFINED_WIN32_LEAN_AND_MEAN 41 | #endif 42 | 43 | #ifndef NOGDI 44 | #define NOGDI 45 | #define PAPILO_DEFINED_NOGDI 46 | #endif 47 | 48 | #include "papilo/external/fmt/format.h" 49 | #include "papilo/external/fmt/ostream.h" 50 | 51 | #ifdef PAPILO_DEFINED_NOGDI 52 | #undef NOGDI 53 | #undef PAPILO_DEFINED_NOGDI 54 | #endif 55 | 56 | #ifdef PAPILO_DEFINED_NOMINMAX 57 | #undef NOMINMAX 58 | #undef PAPILO_DEFINED_NOMINMAX 59 | #endif 60 | 61 | #ifdef PAPILO_DEFINED_WIN32_LEAN_AND_MEAN 62 | #undef WIN32_LEAN_AND_MEAN 63 | #undef PAPILO_DEFINED_WIN32_LEAN_AND_MEAN 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/papilo/misc/tbb.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_MISC_TBB_HPP_ 24 | #define _PAPILO_MISC_TBB_HPP_ 25 | 26 | /* if those macros are not defined and tbb includes windows.h 27 | * then many macros are defined that can interfere with standard C++ code 28 | */ 29 | #ifndef NOMINMAX 30 | #define NOMINMAX 31 | #define PAPILO_DEFINED_NOMINMAX 32 | #endif 33 | 34 | #ifndef WIN32_LEAN_AND_MEAN 35 | #define WIN32_LEAN_AND_MEAN 36 | #define PAPILO_DEFINED_WIN32_LEAN_AND_MEAN 37 | #endif 38 | 39 | #ifndef WIN32_LEAN_AND_MEAN 40 | #define WIN32_LEAN_AND_MEAN 41 | #define PAPILO_DEFINED_WIN32_LEAN_AND_MEAN 42 | #endif 43 | 44 | #ifndef NOGDI 45 | #define NOGDI 46 | #define PAPILO_DEFINED_NOGDI 47 | #endif 48 | 49 | #ifdef _MSC_VER 50 | #pragma push_macro( "__TBB_NO_IMPLICIT_LINKAGE" ) 51 | #define __TBB_NO_IMPLICIT_LINKAGE 1 52 | #endif 53 | 54 | #include "tbb/blocked_range.h" 55 | #include "tbb/combinable.h" 56 | #include "tbb/concurrent_vector.h" 57 | #include "tbb/parallel_for.h" 58 | #include "tbb/parallel_invoke.h" 59 | #include "tbb/partitioner.h" 60 | #include "tbb/task_arena.h" 61 | #include "tbb/tick_count.h" 62 | 63 | #ifdef _MSC_VER 64 | #pragma pop_macro( "__TBB_NO_IMPLICIT_LINKAGE" ) 65 | #endif 66 | 67 | #ifdef PAPILO_DEFINED_NOGDI 68 | #undef NOGDI 69 | #undef PAPILO_DEFINED_NOGDI 70 | #endif 71 | 72 | #ifdef PAPILO_DEFINED_NOMINMAX 73 | #undef NOMINMAX 74 | #undef PAPILO_DEFINED_NOMINMAX 75 | #endif 76 | 77 | #ifdef PAPILO_DEFINED_WIN32_LEAN_AND_MEAN 78 | #undef WIN32_LEAN_AND_MEAN 79 | #undef PAPILO_DEFINED_WIN32_LEAN_AND_MEAN 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/papilo/presolvers/CoefficientStrengthening.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/CoefficientStrengthening.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class CoefficientStrengthening; 29 | template class CoefficientStrengthening; 30 | template class CoefficientStrengthening; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/ConstraintPropagation.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/ConstraintPropagation.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class ConstraintPropagation; 29 | template class ConstraintPropagation; 30 | template class ConstraintPropagation; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/DominatedCols.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/DominatedCols.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class DominatedCols; 29 | template class DominatedCols; 30 | template class DominatedCols; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/DualFix.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/DualFix.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class DualFix; 29 | template class DualFix; 30 | template class DualFix; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/DualInfer.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/DualInfer.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class DualInfer; 29 | template class DualInfer; 30 | template class DualInfer; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/FixContinuous.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/FixContinuous.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class FixContinuous; 29 | template class FixContinuous; 30 | template class FixContinuous; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/FreeVarSubstitution.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/FreeVarSubstitution.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class Substitution; 29 | template class Substitution; 30 | template class Substitution; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/ImplIntDetection.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/ImplIntDetection.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class ImplIntDetection; 29 | template class ImplIntDetection; 30 | template class ImplIntDetection; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/ParallelColDetection.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/ParallelColDetection.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class ParallelColDetection; 29 | template class ParallelColDetection; 30 | template class ParallelColDetection; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/ParallelRowDetection.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/ParallelRowDetection.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class ParallelRowDetection; 29 | template class ParallelRowDetection; 30 | template class ParallelRowDetection; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/Probing.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/Probing.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class Probing; 29 | template class Probing; 30 | template class Probing; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/SimpleProbing.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/SimpleProbing.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class SimpleProbing; 29 | template class SimpleProbing; 30 | template class SimpleProbing; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/SimpleSubstitution.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/SimpleSubstitution.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class SimpleSubstitution; 29 | template class SimpleSubstitution; 30 | template class SimpleSubstitution; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/SimplifyInequalities.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/SimplifyInequalities.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class SimplifyInequalities; 29 | template class SimplifyInequalities; 30 | template class SimplifyInequalities; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/SingletonCols.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/SingletonCols.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class SingletonCols; 29 | template class SingletonCols; 30 | template class SingletonCols; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/SingletonStuffing.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/SingletonStuffing.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class SingletonStuffing; 29 | template class SingletonStuffing; 30 | template class SingletonStuffing; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/presolvers/Sparsify.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/presolvers/Sparsify.hpp" 24 | 25 | namespace papilo 26 | { 27 | 28 | template class Sparsify; 29 | template class Sparsify; 30 | template class Sparsify; 31 | 32 | } // namespace papilo 33 | -------------------------------------------------------------------------------- /src/papilo/verification/ArgumentType.hpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #ifndef _PAPILO_VERI_ARGUMENT_TYPE_HPP_ 24 | #define _PAPILO_VERI_ARGUMENT_TYPE_HPP_ 25 | 26 | 27 | enum class ArgumentType : int 28 | { 29 | kPrimal = 0, 30 | kDual = 1, 31 | kSymmetry = 2, 32 | kAggregation = 3, 33 | kWeakening = 4, 34 | kSaturation = 5, 35 | kPropagation = 6, 36 | kRedundant = 7, 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /suppressions.valgrind: -------------------------------------------------------------------------------- 1 | { 2 | filtersqp-bqpd-uninitvalue 3 | Memcheck:Cond 4 | fun:bqpd_ 5 | fun:qpsolve_ 6 | } 7 | { 8 | filtersqp-ratio-uninitvalue 9 | Memcheck:Cond 10 | fun:ratio_ 11 | fun:bqpd_ 12 | fun:qpsolve_ 13 | } 14 | { 15 | filtersqp-rshift-uninitvalue 16 | Memcheck:Cond 17 | fun:r_shift_ 18 | fun:update_l_ 19 | fun:pivot_ 20 | fun:bqpd_ 21 | } 22 | { 23 | filtersqp-infnlp-uninitvalue 24 | Memcheck:Cond 25 | fun:inf_nlp_ 26 | fun:filtersqp1_ 27 | fun:filtersqp_ 28 | fun:nlpiSolveFilterSQP 29 | } 30 | { 31 | filtersqp-main-uninitvalue 32 | Memcheck:Cond 33 | fun:filtersqp1_ 34 | fun:filtersqp_ 35 | fun:nlpiSolveFilterSQP 36 | } 37 | { 38 | filtersqp-writestr1-uninitvalue 39 | Memcheck:Cond 40 | fun:__memcmp_sse4_1 41 | fun:_gfortran_compare_string 42 | fun:filtersqp1_ 43 | fun:filtersqp_ 44 | fun:nlpiSolveFilterSQP 45 | } 46 | { 47 | filtersqp-writestr2-uninitvalue 48 | Memcheck:Cond 49 | fun:_gfortran_compare_string 50 | fun:filtersqp1_ 51 | fun:filtersqp_ 52 | fun:nlpiSolveFilterSQP 53 | } 54 | { 55 | Pthread_Stack_Leaks_Ignore 56 | Memcheck:Leak 57 | match-leak-kinds: possible 58 | fun:calloc 59 | fun:allocate_dtv 60 | fun:_dl_allocate_tls 61 | fun:allocate_stack 62 | fun:pthread_create@@GLIBC_2.2.5 63 | fun:_ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE 64 | fun:_ZNSt6threadC1IRFPvS1_EJRP18SolverThreadData_tEEEOT_DpOT0_ 65 | fun:main 66 | } 67 | -------------------------------------------------------------------------------- /test/TestMain.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #define CATCH_CONFIG_MAIN 24 | 25 | #include "papilo/external/catch/catch_amalgamated.hpp" 26 | #include "papilo/external/catch/catch_amalgamated.cpp" 27 | -------------------------------------------------------------------------------- /test/check_CmakeConfig_includes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Project DIR 3 | path=$1 4 | expression=$2 5 | 6 | # shellcheck disable=SC2086 7 | FILES_WITH_EXPRESSION="$(grep -ilR $expression "$path"/src)" 8 | FILES_WITH_IMPORT_CONFIG="$(grep -ilR "papilo/Config.hpp" "$path"/src)" 9 | 10 | for FILE_WITHEXPRESSION in ${FILES_WITH_EXPRESSION[@]}; do 11 | echo "$FILE_WITHEXPRESSION" 12 | found=false 13 | if [[ "$FILE_WITHEXPRESSION" = *in ]]; then 14 | continue 15 | fi 16 | if [[ "$FILE_WITHEXPRESSION" = *Config.hpp ]]; then 17 | continue 18 | fi 19 | for i in ${FILES_WITH_IMPORT_CONFIG[@]}; do 20 | if [ "$i" = "$FILE_WITHEXPRESSION" ]; then 21 | found=true 22 | break 23 | fi 24 | done 25 | if [ $found = true ]; then 26 | echo "found" 27 | else 28 | echo "\"#import papilo/Config.hpp\" is missing in the last printed file!" 29 | exit 1 30 | fi 31 | done 32 | 33 | -------------------------------------------------------------------------------- /test/instances/dual_fix_neg_inf.mps: -------------------------------------------------------------------------------- 1 | NAME TESTPROB 2 | ROWS 3 | N COST 4 | L CON1 5 | L CON2 6 | G CON3 7 | COLUMNS 8 | XONE CON1 1 CON2 1 9 | XONE CON3 -2 10 | YTWO COST 1 CON1 1 11 | YTWO CON3 2 12 | ZTHREE COST 1 CON2 1 13 | ZTHREE CON3 1 14 | RHS 15 | RHS1 CON1 8 CON2 -4 16 | LHS1 CON3 6 17 | BOUNDS 18 | UI BND1 XONE 4 19 | MI BND1 XONE 1 20 | LO BND1 YTWO -5 21 | UP BND1 YTWO 5 22 | LO BND1 ZTHREE -5 23 | UP BND1 ZTHREE 5 24 | ENDATA -------------------------------------------------------------------------------- /test/instances/dual_fix_pos_inf.mps: -------------------------------------------------------------------------------- 1 | NAME TESTPROB 2 | ROWS 3 | N COST 4 | G CON1 5 | L CON2 6 | G CON3 7 | L CON4 8 | G CON5 9 | G CON6 10 | COLUMNS 11 | XONE CON1 1 CON2 -1 12 | XONE CON6 1 13 | YTWO CON1 1 CON3 2 14 | ZTHREE COST 1 CON2 1 15 | ZTHREE CON3 -1 CON4 1 16 | ZTHREE CON5 -1 17 | WFOUR COST 1 CON4 -1 18 | WFOUR CON5 2 CON6 1 19 | RHS 20 | LHS1 CON1 8 CON3 -4 21 | LHS1 CON5 0 CON6 10 22 | RHS1 CON2 6 CON4 5 23 | BOUNDS 24 | LI BND1 XONE 0 25 | LI BND1 YTWO 9 26 | LO BND1 ZTHREE -5 27 | UP BND1 ZTHREE 5 28 | LO BND1 WFOUR -5 29 | UP BND1 WFOUR 5 30 | ENDATA -------------------------------------------------------------------------------- /test/instances/simple_subsitution_gdc_detection.mps: -------------------------------------------------------------------------------- 1 | ROWS 2 | N COST 3 | E INF 4 | % G CON1 5 | % L CON2 6 | COLUMNS 7 | X INF 3 COST 1 8 | % X CON1 1 CON2 1 9 | Y INF 8 COST 1 10 | % Y CON1 1 CON2 1 11 | 12 | RHS 13 | RHS1 INF 37 CON1 5 14 | LHS1 CON2 0 15 | BOUNDS 16 | UI BND1 X 5 17 | LI BND1 X 0 18 | LI BND1 Y 0 19 | UI BND1 Y 5 20 | ENDATA -------------------------------------------------------------------------------- /test/instances/test.mps: -------------------------------------------------------------------------------- 1 | NAME TESTPROB 2 | ROWS 3 | N OBJ 4 | G CON1 5 | G CON2 6 | COLUMNS 7 | XONE CON1 1 CON2 1 8 | XONE OBJ 1 9 | YTWO CON1 1 CON2 -1 10 | YTWO OBJ 2 11 | RHS 12 | RHS1 CON1 1 CON2 -1 13 | BOUNDS 14 | LO BND1 XONE 0 15 | LO BND1 YTWO 0 16 | ENDATA 17 | -------------------------------------------------------------------------------- /test/papilo/core/PostsolveTest.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include "papilo/core/postsolve/Postsolve.hpp" 24 | #include "papilo/external/catch/catch_amalgamated.hpp" 25 | #include "papilo/core/postsolve/PostsolveStatus.hpp" 26 | #include 27 | 28 | using namespace papilo; 29 | 30 | TEST_CASE( "finding-the-right-value-in-postsolve-for-a-column-fixed-neg-inf", 31 | "[core]" ) 32 | { 33 | 34 | const Num num{}; 35 | Message msg{}; 36 | PostsolveStorage postsolveStorage{}; 37 | 38 | std::ifstream inArchiveFile( "./resources/dual_fix_neg_inf.postsolve", 39 | std::ios_base::binary ); 40 | boost::archive::binary_iarchive inputArchive( inArchiveFile ); 41 | inputArchive >> postsolveStorage; 42 | inArchiveFile.close(); 43 | Solution reduced_solution{}; 44 | Solution original_solution{}; 45 | Postsolve postsolve{msg, num}; 46 | 47 | REQUIRE( postsolve.undo( reduced_solution, original_solution, postsolveStorage) == 48 | PostsolveStatus::kOk ); 49 | papilo::Vec values = original_solution.primal; 50 | papilo::Vec expected_values{ -11, -5, -5 }; 51 | REQUIRE( values == expected_values ); 52 | } 53 | 54 | TEST_CASE( "finding-the-right-value-in-postsolve-for-a-column-fixed-pos-inf", 55 | "[core]" ) 56 | { 57 | 58 | const Num num{}; 59 | Message msg{}; 60 | PostsolveStorage postsolveStorage{}; 61 | 62 | std::ifstream inArchiveFile( "./resources/dual_fix_pos_inf.postsolve", 63 | std::ios_base::binary ); 64 | boost::archive::binary_iarchive inputArchive( inArchiveFile ); 65 | inputArchive >> postsolveStorage; 66 | inArchiveFile.close(); 67 | Solution reduced_solution{}; 68 | Solution original_solution{}; 69 | Postsolve postsolve{msg, num}; 70 | 71 | REQUIRE( postsolve.undo( reduced_solution, original_solution, postsolveStorage ) == 72 | PostsolveStatus::kOk ); 73 | papilo::Vec values = original_solution.primal; 74 | papilo::Vec expected_values{ 13, 9, -5, -2.5 }; 75 | REQUIRE( values == expected_values ); 76 | 77 | } 78 | -------------------------------------------------------------------------------- /test/papilo/io/MpsParserTest.cpp: -------------------------------------------------------------------------------- 1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 | /* */ 3 | /* This file is part of the program and library */ 4 | /* PaPILO --- Parallel Presolve for Integer and Linear Optimization */ 5 | /* */ 6 | /* Copyright (C) 2020-2025 Zuse Institute Berlin (ZIB) */ 7 | /* */ 8 | /* This program is free software: you can redistribute it and/or modify */ 9 | /* it under the terms of the GNU Lesser General Public License as published */ 10 | /* by the Free Software Foundation, either version 3 of the License, or */ 11 | /* (at your option) any later version. */ 12 | /* */ 13 | /* This program is distributed in the hope that it will be useful, */ 14 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 15 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 16 | /* GNU Lesser General Public License for more details. */ 17 | /* */ 18 | /* You should have received a copy of the GNU Lesser General Public License */ 19 | /* along with this program. If not, see . */ 20 | /* */ 21 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 22 | 23 | #include 24 | #include "papilo/io/MpsParser.hpp" 25 | #include "papilo/external/catch/catch_amalgamated.hpp" 26 | #include "papilo/core/PresolveMethod.hpp" 27 | #include "papilo/core/Problem.hpp" 28 | 29 | using namespace papilo; 30 | 31 | Problem 32 | setupProblemForCoefficientStrengthening(); 33 | 34 | TEST_CASE( "mps-parser-loading-simple-problem", "[io]" ) 35 | { 36 | boost::optional> optional = MpsParser::loadProblem( 37 | "./resources/dual_fix_neg_inf.mps" ); 38 | REQUIRE( optional.is_initialized() == true ); 39 | Problem problem = optional.get(); 40 | Vec expected_row_sizes{2,2,3}; 41 | Vec expected_col_sizes{3,2,2}; 42 | REQUIRE(problem.getConstraintMatrix().getRowSizes() == expected_row_sizes); 43 | REQUIRE(problem.getConstraintMatrix().getColSizes() == expected_col_sizes); 44 | } 45 | -------------------------------------------------------------------------------- /test/resources/dual_fix_neg_inf.postsolve: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipopt/papilo/0bb6562dc4a12d11b563a5ed90030a9aedac6e1d/test/resources/dual_fix_neg_inf.postsolve -------------------------------------------------------------------------------- /test/resources/dual_fix_pos_inf.postsolve: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipopt/papilo/0bb6562dc4a12d11b563a5ed90030a9aedac6e1d/test/resources/dual_fix_pos_inf.postsolve -------------------------------------------------------------------------------- /test/resources/kb2.bas: -------------------------------------------------------------------------------- 1 | NAME soplex.bas 2 | XL BAL.3EBW BAL...BW 3 | XL BN4.3EBW BHC...BW 4 | XL BP8.3EBW BLC...BW 5 | XL BTO.3EBW BLV...BW 6 | XL BLC.3PBW BP8...BW 7 | XL BN4.3PBW BTO...BW 8 | XL BP8.3PBW B3E...BW 9 | XL BAL.3RBW B3P...BW 10 | XL BHC.3RBW B3R...BW 11 | XL BLC.3RBW B3E.VOBW 12 | XL BLV.3RBW B3P.VOBW 13 | XL BN4.3RBW B3R.VOBW 14 | XL BP8.3RBW HML.3EBW 15 | XL M3..3TBW HRM.3EBW 16 | XL QPB73EBW HML.3RBW 17 | XL QVO73EBW HMM.3RBW 18 | XL QVO73PBW HRM.3RBW 19 | XL QPB73RBW NOI.3EBW 20 | XL QVO73RBW NOI.3PBW 21 | XL WMO73EBW NOI.3RBW 22 | XL WRO73EBW WMO.3PBW 23 | XL WMO73PBW WRO.3PBW 24 | XU WRO73PBW XRV.3EBW 25 | XU WMO73RBW XRV.3PBW 26 | XU WRO73RBW XRV.3RBW 27 | ENDATA 28 | -------------------------------------------------------------------------------- /test/resources/kb2.postsolve: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scipopt/papilo/0bb6562dc4a12d11b563a5ed90030a9aedac6e1d/test/resources/kb2.postsolve -------------------------------------------------------------------------------- /test/resources/kb2_dual.solution: -------------------------------------------------------------------------------- 1 | Dual solution (name, value): 2 | BAL...BW 17.2692081872936498 3 | BHC...BW 17.2141017646819989 4 | BLC...BW 16.9420456503489021 5 | BLV...BW 16.6598384937267596 6 | BP8...BW 17.2093689712325393 7 | BTO...BW 1.4257791126092545 8 | B3E...BW 16.5934706738862765 9 | B3P...BW 16.4601853349822882 10 | B3R...BW 16.4623370326407219 11 | B3E.VOBW 14.4906642324519712 12 | B3P.VOBW 15.0409670440865302 13 | B3R.VOBW 15.1487581025332787 14 | HML.3EBW 0.0203676286542896 15 | HRM.3EBW 0.0114393530798065 16 | HML.3RBW 0.0117238087817341 17 | HMM.3RBW 0.0063931639304328 18 | HRM.3RBW 0.0069336562231750 19 | NOI.3EBW 0.0279008611702597 20 | NOI.3PBW 0.0241566400322516 21 | NOI.3RBW 0.0223666329779838 22 | WMO.3PBW 0.0202915776270913 23 | WRO.3PBW 0.0065222928087079 24 | XRV.3EBW -0.0790062708026841 25 | XRV.3PBW -0.0778233345538221 26 | XRV.3RBW -0.0792668586711622 27 | -------------------------------------------------------------------------------- /test/resources/kb2_primal.solution: -------------------------------------------------------------------------------- 1 | Primal solution (name, value): 2 | BAL.3EBW 8.1182352513046396e-01 3 | BN4.3EBW 4.6725522679209011e+00 4 | BP8.3EBW 2.5061124206948623e+01 5 | BTO.3EBW 5.0000000000000000e+00 6 | BLC.3PBW 9.5509680736943476e+00 7 | BN4.3PBW 2.5065523126695974e+00 8 | BP8.3PBW 8.7794968550153634e+00 9 | BAL.3RBW 9.1881764748695360e+00 10 | BHC.3RBW 2.0000000000000000e+01 11 | BLC.3RBW 1.5449031926305652e+01 12 | BLV.3RBW 1.2000000000000000e+01 13 | BN4.3RBW 8.3915850745819096e+00 14 | BP8.3RBW 1.1593789380359849e+00 15 | M3..3TBW 1.2257068965517239e+02 16 | QPB73EBW 1.5050888231589852e+01 17 | QVO73EBW 3.5545499999999990e+01 18 | QVO73PBW 2.0837017241379311e+01 19 | QPB73RBW 4.9674172200865542e+01 20 | QVO73RBW 6.6188172413793097e+01 21 | WMO73EBW 3.2148891842210332e+03 22 | WRO73EBW 3.5975196476064511e+03 23 | WMO73PBW 1.7703610137811411e+03 24 | WRO73PBW 2.0097429552096291e+03 25 | WMO73RBW 5.6519931502389036e+03 26 | WRO73RBW 6.2626468744035719e+03 27 | -------------------------------------------------------------------------------- /test/resources/kb2_reduced.solution: -------------------------------------------------------------------------------- 1 | Reduced costs (name, value): 2 | BHC.3EBW 0.0638118155945726 3 | BLC.3EBW 0.0489617011797441 4 | BLV.3EBW 0.1020832780736463 5 | BAL.3PBW 0.0464332185480105 6 | BHC.3PBW 0.0339528443045474 7 | BLV.3PBW 0.0888019608377846 8 | BTO.3PBW 0.0035169068596470 9 | BTO.3RBW 0.0163425707632492 10 | --------------------------------------------------------------------------------