<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Ksenia</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you for your answer. That helps!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Krishnan</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Ksenia Bestuzheva <bestuzheva@zib.de><br>
<b>Sent:</b> 21 August 2020 3:07 PM<br>
<b>To:</b> Krishnan Nampoothiri <Krishnan.nampoothiri@outlook.com>; scip@zib.de <scip@zib.de><br>
<b>Subject:</b> Re: [SCIP] Bin packing reader</font>
<div> </div>
</div>
<div>
<p>Hi Krishnan,<br>
<br>
On the line that you have mentioned, SCIP_DECL_READERREAD is a macro. It is defined on line 78 in src/scip/type_reader.h, where you can see the return type and parameters that the functions defined with the use of this macro will have (finding this if you do
not know where to look can be made easier by using grep, an IDE or whatever tool you prefer that can search in the whole project). The reason this is done like this is that we want to have several functions of a similar type. That is, SCIP has a few reader
plugins, and each provides its own version of the same methods: for example, each reader reads a problem. SCIP can call the "read" function in a way that is similar to all readers, which is possible because the functions have similar return types and arguments.
By the way, this type of function is referred to as a "callback" and they are an important part of SCIP's design.<br>
<br>
This also answers the question about the "filename" variable: if you look at the macro, you can see it in the list of arguments.<br>
<br>
</p>
<div class="x_moz-cite-prefix">On 19.08.20 16:59, Krishnan Nampoothiri wrote:<br>
</div>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); text-align:left">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif; text-align:start; background-color:rgb(255,255,255); display:inline!important">Secondly, I see usage of <span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">a
few SCIP-implemented functions in the code. For example, </span><span style="">SCIPfgets(), SCIPallocBufferArray(), SCIPfeof(), SCIPfreeBufferArray()
</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">etc. How are these different from the library standards -
</span><span style="font-family:"Courier New",monospace; background-color:rgb(255,255,255); display:inline!important">fgets(), malloc/calloc(), feof(), free()</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">
?</span></span></div>
</blockquote>
<p><br>
</p>
<p>There is an explanation of SCIP's memory functions and why it uses its own rather than the standard ones here:
<a class="x_moz-txt-link-freetext" href="https://www.scipopt.org/doc/html/MEMORY.php">
https://www.scipopt.org/doc/html/MEMORY.php</a>.<br>
</p>
<p><br>
</p>
<blockquote type="cite">
<div dir="ltr" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); text-align:left">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif; text-align:start; background-color:rgb(255,255,255); display:inline!important"><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important"></span></span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; text-align:start; background-color:rgb(255,255,255); display:inline!important"><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">Thirdly,
some of the functions seem to require a </span><span style="font-family:"Courier New",monospace; background-color:rgb(255,255,255); display:inline!important">SCIP*</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">
object passed in them, despite not being directly (seemingly) connected to the optimization model. For example,
</span><span style="font-family:"Courier New",monospace; background-color:rgb(255,255,255); display:inline!important">SCIPwarningMessage()</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">
or </span><span style="font-family:"Courier New",monospace; background-color:rgb(255,255,255); display:inline!important">SCIPallocBufferArray()
</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">while the others like
</span><span style="font-family:"Courier New",monospace; background-color:rgb(255,255,255); display:inline!important">SCIPfeof()</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">
or </span><span style="font-family:"Courier New",monospace; background-color:rgb(255,255,255); display:inline!important">SCIPfgets()</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">
don't seem to require a </span><span style="font-family:"Courier New",monospace; background-color:rgb(255,255,255); display:inline!important">SCIP*</span><span style="font-family:Calibri,Arial,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">
passed to the function. </span></span><br>
</div>
</blockquote>
<p><br>
</p>
<p>The SCIP structure has more than just the problem information. For example, it also stores a message handler and a structure used for managing memory, which is why the functions you mentioned need it.<br>
<br>
Kind regards,<br>
Ksenia<br>
<br>
</p>
</div>
</body>
</html>