{"id":21962430,"url":"https://github.com/scipopt/scippp","last_synced_at":"2026-02-19T19:32:39.151Z","repository":{"id":184140603,"uuid":"664722751","full_name":"scipopt/SCIPpp","owner":"scipopt","description":"A C++ wrapper for SCIP","archived":false,"fork":false,"pushed_at":"2025-12-18T14:34:15.000Z","size":2092,"stargazers_count":30,"open_issues_count":3,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-12-21T17:56:12.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scipopt.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-10T15:45:59.000Z","updated_at":"2025-12-18T14:30:38.000Z","dependencies_parsed_at":"2023-09-22T07:19:02.914Z","dependency_job_id":"00ac2cf1-ef92-492e-9e2c-c0a1c6daae91","html_url":"https://github.com/scipopt/SCIPpp","commit_stats":null,"previous_names":["scipopt/scippp"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/scipopt/SCIPpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FSCIPpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FSCIPpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FSCIPpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FSCIPpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scipopt","download_url":"https://codeload.github.com/scipopt/SCIPpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FSCIPpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29628820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T10:40:08.675Z","updated_at":"2026-02-19T19:32:39.137Z","avatar_url":"https://github.com/scipopt.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SCIP++: A C++ wrapper for SCIP\n\n![CI Status](https://github.com/scipopt/SCIPpp/actions/workflows/main.yml/badge.svg)\n[![Coverage](https://img.shields.io/codecov/c/github/scipopt/SCIPpp)](https://app.codecov.io/github/scipopt/SCIPpp)\n[![Doxygen](https://img.shields.io/badge/documentation-Doxygen-blue)](https://scipopt.github.io/SCIPpp/)\n[![Conan Center](https://img.shields.io/conan/v/scippp)](https://conan.io/center/recipes/scippp)\n\nSCIP++ is a C++ wrapper for SCIP's C interface.\nIt automatically manages the memory, and provides a simple interface to create linear expressions and inequalities.\n\n## Usage\n\nThe documentation can be found at https://scipopt.github.io/SCIPpp/\n\nHere is a simple example where we create a new model, add two variables, add a linear inequality as constraint, and ask\nSCIP to solve the maximization problem.\n\n```cpp\n#include \u003cscippp/model.hpp\u003e\nusing namespace scippp;\nint main() {\n    Model model(\"Simple\");\n    auto x1 = model.addVar(\"x_1\", 1);\n    auto x2 = model.addVar(\"x_2\", 1);\n    model.addConstr(3 * x1 + 2 * x2 \u003c= 1, \"capacity\");\n    model.setObjsense(Sense::MAXIMIZE);\n    model.solve();\n}\n```\n\n### Model Creation\n\nA model can be created\n\n* without an existing SCIP environment,\n* with an existing SCIP environment where all default plugins should be added to, and\n* with an existing SCIP environment where no additional plugins should be added to.\n\n```cpp\nModel m1(\"ModelWithoutExistingSCIPEnvironment\");\n\nSCIP* scip2;\nSCIPcreate(\u0026scip2);\nModel m2(\"ModelWithExistingSCIPEnvironmentWhereDefaultPluginsWillBeAdded\", scip2);\n\nSCIP* scip3;\nSCIPcreate(\u0026scip3);\nSCIPincludeDefaultPlugins(scip3);\nModel m3(\"ModelWithExistingSCIPEnvironmentWhereNoPluginsWillBeAdded\", scip3, false);\n```\n\n### Adding Variables\n\nVariables can be added\n\n* one at a time,\n* multiple in a vector, and\n* multiple when the number is known at compile time.\n\n```cpp\nModel model(\"Example\");\n\nauto x = model.addVar(\"x\");\nauto vec = model.addVars(\"x_\", 42);\nconst auto\u0026 [x0, x1] = model.addVars\u003c2\u003e(\"x_\");\n```\n\nWhen adding multiple variables simultaneously to the model, they all have a coefficient of zero in the objective\nfunction by default.\nThis can be changed to one by `scippp::COEFF_ONE`:\n```cpp\nconst auto\u0026 [x1, x2] = model.addVars\u003c2\u003e(\"x_\", COEFF_ONE);\n```\n\nFor the coefficient, any object providing an index operator can be used:\n```cpp\ndouble operator[](std::size_t index) const\n```\n\n### Adding Constraints\n\nLinear inequalities can be added to the model. They can be built from linear expressions:\n\n```cpp\nconst auto\u0026 [x0, x1, x2, x3] = model.addVars\u003c4\u003e(\"x_\");\n\nLinExpr sum1;\nsum1 += 42 * x0;\nsum1 += x1;\nmodel.addConstr(sum1 \u003c= 0.5, \"constraint1\");\n\nLinExpr sum2 = x1 + x2;\nmodel.addConstr(sum2 == 1.25, \"constraint2\");\n\nmodel.addConstr(1 \u003c= x2 + 2 * x3, \"constraint3\");\n```\n\n### Setting Parameters\n\nThe namespace `scippp::params` contains all parameters shown https://www.scipopt.org/doc/html/PARAMETERS.php in the\nheader `parameters.hpp`. They are strongly typed, so that no string can be set as the value for a parameter expecting an\ninteger. Instead of using the predefined parameters, one can also use `scippp::params::Param\u003cT\u003e` directly.\n\n```cpp\nmodel.setParam(params::LIMITS::MAXSOL, 1);\nmodel.setParam(params::DISPLAY::VERBLEVEL, 0);\nmodel.setParam(params::Param\u003cbool\u003e(\"write/printzeros\"), true);\n```\n\nThe optimization goal can be changed by:\n```cpp\nmodel.setObjsense(Sense::MAXIMIZE);\n```\n\n### Accessing a Solution\n\nA model can be asked for the status and the number of solutions.\nA variable can be asked for its value in a given solution as\n\n* floating point number via `getSolVal(sol)`.\n* integer via `getSolValAsInt(sol)`.\n* long integer via `getSolValAsLongInt(sol)`, and\n* it can be checked for zero via `isZero(sol)`.\n\n```cpp\nconst auto\u0026 [x0, x1] = model.addVars\u003c2\u003e(\"x_\");\nmodel.solve();\nif (model.getNSols() \u003e 0 \u0026\u0026 model.getStatus() == SCIP_STATUS_OPTIMAL) {\n    Solution sol { model.getBestSol() };\n    cout \u003c\u003c \"x0 + x1 =\" \u003c\u003c x0.getSolVal(sol) + x1.getSolVal(sol) \u003c\u003c endl;\n}\n```\n\n### IO\n\nA model can be written to file via `Model::writeOrigProblem` if a `std::filesystem::directory_entry` is given as\nargument. If it is just a string representing a file extension, it is written to standard output.\n\n### Numerics\n\nThe model exposes\n\n* `SCIPepsilon` via `epsilon()`,\n* `SCIPround` via `round(double)`, and\n* `SCIPisZero` via `isZero(double)`\n\n### Access Solving Statistics\n\nUse the `Statistics\u003cT\u003e` objects from the header [solving_statistics.hpp](include/scippp/solving_statistics.hpp) to\naccess solving statistics in a type-safe way:\n\n```cpp\n...\nmodel.solve();\nauto pb { model.getSolvingStatistic(statistics::PRIMALBOUND) };\n```\n\n### Features Not Yet Supported\n\nFor features not yet supported by SCIP++, one can access the underlying raw SCIP object via\n\n```cpp\nSCIP* scip = model.scip();\n```\n\n## Build\n\n### Without Conan\n\nWe use [Conan](https://conan.io/center/) as package manager.\nThat is not required! As long as `find_package(scip CONFIG REQUIRED)` (and `find_package(Boost CONFIG REQUIRED)` for\nthe tests) work(s), any kind of dependency management system can be used.\n\nBuild and install:\n\n```bash\ncmake .\nmake ScipPP\nmake install\n```\n\nBuild and run tests:\n\n```bash\ncmake -DBUILD_TESTS=ON .\nmake tests\n./test/tests\n```\n\n### With Conan v2 and CMake v3.19 or later\n\nBuild and install:\n\n```bash\nconan install .\ncmake --preset conan-release .\ncmake --build build/Release --target ScipPP\ncmake --install build/Release\n```\n\nBuild and run tests:\n\n```bash\nconan install -o with_tests=True .\ncmake --preset conan-release .\ncmake --build build/Release --target tests\nbuild/Release/test/tests\n```\n\nIf your setting of OS, compiler, C++ or stdlib version is one where conan-center does not host pre-compiled binaries,\nadd `--build=missing` when you run `conan install`. The dependencies will then be built from source (don't worry, they\nwill be available only for projects using conan, they do not interfere with versions you might already have installed\non the system). So, when you see an error message like\n\n```\nERROR: Missing prebuilt package for 'bliss/0.77', 'boost/1.81.0', 'bzip2/1.0.8', 'gmp/6.2.1', 'libbacktrace/cci.20210118', 'scip/8.0.3', 'soplex/6.0.3', 'zlib/1.2.13'\nCheck the available packages using 'conan list bliss/0.77:* -r=remote'\nor try to build locally from sources using the '--build=missing' argument\n```\n\nchange the install-command to\n\n```bash\nconan install --build=missing .\n```\n\n### With Conan v2 and CMake v3.18 or earlier\n\nWhen CMake presets are not support, use the toolchain file that conan generates.\n\nBuild and install:\n\n```bash\nconan install .\ncmake . -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=./build/Release/generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release\nmake ScipPP\nmake install\n```\n\nBuild and run tests:\n\n```bash\nconan install -o with_tests=True .\ncmake . -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=./build/Release/generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release\nmake tests\n./build/Release/test/tests\n```\n\n## Utils\n\nUse `gen_constexpr_parameters` to transform all SCIP parameters into constexpr `scippp::params::Param\u003cT\u003e` objects which\ncan be added to the `parameters.hpp` header.\n\nUse `extract_solvingstats` to transform all SCIP methods that access solving statistics into static const\n`scippp::statistics::Statistic\u003cT\u003e` objects which can be added to the `solving_statistics.hpp` header.\n\n## Maintainer\n\nThis project is maintained by Tilo Wiedera `tilo (dot) wiedera (at) dbschenker (dot) com`.\n\n## Code of Conduct\n\nSCIP++ follows the Contributor Covenant Code of Conduct v2, see [code_of_conduct.md](code_of_conduct.md).\n\n## Contributor License Agreement\n\nThis project does not use a CLA.\n\n## License\n\nSCIP++ is licensed under the Apache-2 license, see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscipopt%2Fscippp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscipopt%2Fscippp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscipopt%2Fscippp/lists"}