[SCIP] Exporting the solution to a file.

Daniel Herl Carrero dherl at fen.uchile.cl
Fri Apr 21 03:28:06 CEST 2017


I already did that, I printed the solution in the console with
SCIPprintBestSol(scip,NULL,FALSE) and worked fine. The function fails when
I try to use it giving it a file to write in.

2017-04-18 16:30 GMT-03:00 Gregor Hendel <hendel at zib.de>:

> Dear Daniel,
>
> I can definitely tell that this file is open. However, you may have
> overread the profi advise to your stack overflow question to check if there
> is a best solution. Please check this using either SCIPgetBestSol() or
> SCIPgetNSols() prior to calling SCIPprintBestSol().
>
> Happy printing,
> Gregor
>
>
> Am 18.04.2017 um 20:57 schrieb Daniel Herl Carrero:
>
> Dear SCIPers,
>
> I`m using the scip (3.2.1) API for C++ (in VS 2013) and resolving a simple
> LP. After SCIP reaches a solution I try to store the results in a file with
> the following code:
>
> FILE* file;
>     if ((file = fopen("Solution.sol", "w")) != nullptr){
>         SCIP_CALL(SCIPprintBestSol(scip, file, FALSE));
>         fclose(file);
>     }
>
> But the code throws me an Access Violation Error. The code succesfully
> creates the file but fails trying to execute the SCIPprintBestSol()
> function. I used the function to print the solution in the console and it
> works ( SCIP_CALL(SCIPprintBestSol(scip, NULL, FALSE)); ) but it fails
> when I try to use it to write this solution to a file (like in the code
> above).
>
> Has anyone encountered the same problem before? I really need to export
> the solutions and any help will be much appreciated.
>
> Thanks!
> Daniel
>
>
> _______________________________________________
> Scip mailing listScip at zib.dehttps://listserv.zib.de/mailman/listinfo/scip
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20170420/254c800c/attachment.html>


More information about the Scip mailing list