[Scip] some questions about the file readers in the coloring example

Xiangyong Li lixiangyong at 163.com
Mon Dec 21 18:33:57 MET 2009


Dear Gerald,

Thanks.  I understand the definition of READERREAD.  If we look at the coloring example. The author did not define "reader" and "filename" either in SCIP_DECL_READERREAD(readerReadCol), or while calling it. So we need not define them before we call it. 

Please refer to function SCIP_DECL_READERREAD and SCIPincludeReaderCol(where the READERREAD is called)

static SCIP_DECL_READERREAD(readerReadCol)
{  
   assert(reader != NULL);
   assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
   assert(scip != NULL);
   assert(result != NULL);
   
   SCIP_CALL( readCol(scip, filename) );
   
   *result = SCIP_SUCCESS;
   
   return SCIP_OKAY;
}

SCIP_RETCODE SCIPincludeReaderCol(
   SCIP*                 scip                /**< SCIP data structure */
   )
{
  SCIP_READERDATA* readerdata;

  /* create col reader data */
  readerdata = NULL;

  /* include col reader */
  SCIP_CALL( SCIPincludeReader(scip, READER_NAME, READER_DESC, READER_EXTENSION,
        readerFreeCol, readerReadCol, NULL, readerdata) );
  return SCIP_OKAY;
} 


Thanks.


Xiangyong




在2009-12-21,gamrath at zib.de 写道:
>Hi Xiangyong,
>
>for each kind of plugin, you can look in the type_xyz.h file in the
>src/scip/ directory in your SCIP folder in order to get the definitions of
>the callbacks for this plugin. For example, in the type_reader.h file, you
>will find the following line:
>#define SCIP_DECL_READERREAD(x) SCIP_RETCODE x (SCIP* scip, SCIP_READER*
>reader, const char* filename, SCIP_RESULT* result)
>together with a description of the parameters and possible return values.
>
>So, the scip, reader, filename and result pointers are all parameters of
>the method you defined.
>
>Best, Gerald
>
>> Dear all,
>>
>> I tried to understand the file reader "READERREAD" in the coloring example
>> given below.
>>
>>
>> /** problem reading method of reader */
>> static
>> SCIP_DECL_READERREAD(readerReadCol)
>> {  /*lint --e{715}*/
>>    assert(reader != NULL);
>>    assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
>>    assert(scip != NULL);
>>    assert(result != NULL);
>>
>>    SCIP_CALL( readCol(scip, filename) );
>>
>>    *result = SCIP_SUCCESS;
>>
>>    return SCIP_OKAY;
>> }
>>
>> I have some questions:
>> (1) in the aboer "READERREAD", are reader and result the reserverd words
>> in SCIP system?  If not, why we can use them without definition.
>> (2) in the calling of subroutine "readCol", where the filename is defined?
>>
>>
>> Thanks for your help.
>>
>> Xiangyong
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de
>> http://listserv.zib.de/mailman/listinfo/scip
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.zib.de/mailman/private/scip/attachments/20091221/0a2e4f20/attachment.html


More information about the Scip mailing list