{"id":21962420,"url":"https://github.com/scipopt/jscipopt","last_synced_at":"2025-04-06T03:11:57.221Z","repository":{"id":38085157,"uuid":"65582895","full_name":"scipopt/JSCIPOpt","owner":"scipopt","description":"Java interface for the SCIP Optimization Suite","archived":false,"fork":false,"pushed_at":"2024-10-19T02:15:31.000Z","size":171,"stargazers_count":64,"open_issues_count":10,"forks_count":36,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-30T02:09:29.302Z","etag":null,"topics":["interface","java","minlp","scip","solver","swig"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scipopt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2016-08-12T20:51:32.000Z","updated_at":"2025-03-23T18:46:33.000Z","dependencies_parsed_at":"2024-10-18T08:26:11.152Z","dependency_job_id":"8f9a12d4-a93f-4f4a-bef5-380beff04843","html_url":"https://github.com/scipopt/JSCIPOpt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FJSCIPOpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FJSCIPOpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FJSCIPOpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scipopt%2FJSCIPOpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scipopt","download_url":"https://codeload.github.com/scipopt/JSCIPOpt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427012,"owners_count":20937214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["interface","java","minlp","scip","solver","swig"],"created_at":"2024-11-29T10:39:48.786Z","updated_at":"2025-04-06T03:11:57.181Z","avatar_url":"https://github.com/scipopt.png","language":"C++","readme":" This project provides an interface from the Java programming language to the [SCIP](http://scip.zib.de) solver software.\n\nHow to build a model using JSCIPOpt\n===================================\n\nThere are several examples provided in the `examples` folder. These display some functionality of the interface and can\nserve as an entry point for writing more complex code. The following steps are always required when using the interface:\n\n1) It is necessary to add\n\n    `import jscip.*;`\n\nto the beginning of your Java file. This imports all needed classes to use the interfaces.\n\n2) Create a solver instance and initialize the internal C data structures with\n\n    ```\n    Scip scip = new SCIP();\n    scip.create(\"Example\");\n    ```\n\nThis is the equivalent to calling `SCIPcreate(\u0026scip)` and `SCIPcreateProbBasic(scip, \"Example\")` in C.\n\n3) The most important classes are Scip.java, Variable.java, Constraint.java, and Solution.java. They represent the C\ndata structs `SCIP`, `SCIP_VAR`, `SCIP_CONS`,`SCIP_SOL` and provide some basic functionality. Using the Java classes\nworks similar to C , e.g.,\n\n    ```\n    Variable vars = new Variables[2];\n    vars[0] = scip.createVar(\"x\", 1.0, 2.0, -1.0, SCIP_Vartype.SCIP_VARTYPE_INTEGER);\n    vars[1] = scip.createVar(\"y\", 3.0, 4.0, -2.0, SCIP_Vartype.SCIP_VARTYPE_CONTINUOUS);\n\n    double[] vals = {1.0, -3.6};\n    Constraint lincons = scip.createConsLinear(\"lincons\", vars, vals, -scip.infinity(), 10.0);\n    scip.addCons(lincons);\n    scip.releaseCons(lincons);\n\n    scip.solve();\n    scip.free();\n    ```\n\nwhich creates two variables, a linear constraint, adds it to SCIP, solves the problem and finally frees it.\n\n\nHow to extend the interface\n===========================\n\nThe package already contains an interface to SCIP created with the Simplified Wrapper and Interface Generator\n[SWIG](http://www.swig.org/). Extending the interface requires to install SWIG. The following steps are necessary to add\na new function to the interface:\n\n1) Add the signature of an interface function to src/scipjni.i, e.g.,\n\n    `SCIP_Real SCIPfeastol(SCIP* scip);`\n\n2) Implement the function, depending on its signature, in `java/jscip/{Scip,Variable,Constraint,Solution}.java`, e.g.,\n\n    ```\n    public class Scip\n    {\n       private SWIGTYPE_p_SCIP _scipptr;\n\n       ...\n\n       public double feastol()\n       {\n          return SCIPJNI.SCIPfeastol(_scipptr);\n       }\n    }\n    ```\n\n3) Follow the steps in INSTALL.md to compile JSCIPOpt.\n\nNote that each of the four mentioned classes hold their own C pointer in a class generated by SWIG. The object of this\nclass needs to be passed to the new implemented interface function.\n\n\nAfter all previous steps it is now possible to call the function via\n```\ndouble ftol = scip.feastol();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscipopt%2Fjscipopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscipopt%2Fjscipopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscipopt%2Fjscipopt/lists"}