Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to interface SCIP using C-like functions #58

Closed
SanPen opened this issue Jul 27, 2023 · 4 comments
Closed

How to interface SCIP using C-like functions #58

SanPen opened this issue Jul 27, 2023 · 4 comments

Comments

@SanPen
Copy link

SanPen commented Jul 27, 2023

Hello,

I am writing a software that uses MIP solvers interchangeably and I would like to include SCIP as an option.

I have been looking for an example of how to build a problem and run it without much luck.

The documentation points nowhere, and the MIP example is about reading files. Not exactly what I need.

To be precise:

I would like to pass all the problem information by memory using C-style functions since I need to link scip dynamically.

An example of what I need, but using Highs is this.

Any help figuring how to interface SCIP from C is appreciated.

@ambros-gleixner
Copy link
Member

Hi, please have a look at

https://scipopt.org/doc/html/FAQ.php#howtocreateproblem

The example https://github.com/scipopt/scip/tree/master/examples/CallableLibrary contains several examples for how to construct an MINLP. In order to create linear constraints, you can call SCIPcreateConsLinear()

https://scipopt.org/doc/html/group__CONSHDLRS.php#gaa7aed137a4130b35b168812414413481

with the default flags TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE.

@SanPen
Copy link
Author

SanPen commented Jul 27, 2023

I see that vars and constraints are added one by one.

Is it possible to pass the coefficients matrix by directly filling the internal CSC or CSR sparse structure?

@ambros-gleixner
Copy link
Member

No, see #56 .

@ambros-gleixner
Copy link
Member

Please feel free to reopen if you have any further concrete questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants