SCIP-SDP  4.0.0
Macros | Typedefs | Functions
reader_sdpa.c File Reference

file reader for mixed-integer semidefinite programs in SDPA format More...

Go to the source code of this file.

Macros

#define READER_NAME   "sdpareader"
 
#define READER_DESC   "file reader and writer for MISDPs in sdpa format"
 
#define READER_EXTENSION   "dat-s"
 
#define SDPA_MIN_BUFFERLEN   65536 /* minimal size of buffer */
 

Typedefs

typedef struct SDPA_Data SDPA_DATA
 

Functions

static SCIP_RETCODE readLine (SCIP *scip, SCIP_FILE *file, char **buffer, int *bufferlen, SCIP_Bool *success)
 
static SCIP_RETCODE readNextLine (SCIP *scip, SCIP_FILE *file, char **buffer, int *bufferlen, SCIP_Longint *linecount, SCIP_Bool *success)
 
static SCIP_RETCODE readNextLineStar (SCIP *scip, SCIP_FILE *file, char **buffer, int *bufferlen, SCIP_Longint *linecount, SCIP_Bool *success)
 
static SCIP_RETCODE readLineDoubles (SCIP *scip, SCIP_FILE *file, char **buffer, int *bufferlen, SCIP_Longint *linecount, int nvals, SCIP_Real *values, int *nread)
 
static SCIP_RETCODE readLineInts (SCIP *scip, SCIP_FILE *file, char **buffer, int *bufferlen, SCIP_Longint *linecount, int nvals, int *values, int *nread)
 
static SCIP_RETCODE SDPAfreeData (SCIP *scip, SCIP_FILE *file, SDPA_DATA *data)
 
static SCIP_RETCODE SDPAreadNVars (SCIP *scip, SCIP_FILE *file, SCIP_Longint *linecount, SDPA_DATA *data)
 
static SCIP_RETCODE SDPAreadNBlocks (SCIP *scip, SCIP_FILE *file, SCIP_Longint *linecount, SDPA_DATA *data)
 
static SCIP_RETCODE SDPAreadBlockSize (SCIP *scip, SCIP_FILE *file, SCIP_Longint *linecount, SDPA_DATA *data)
 
static SCIP_RETCODE SDPAreadObjVals (SCIP *scip, SCIP_FILE *file, SCIP_Longint *linecount, SDPA_DATA *data)
 
static SCIP_RETCODE SDPAreadBlocks (SCIP *scip, SCIP_FILE *file, SCIP_Longint *linecount, SDPA_DATA *data)
 
static SCIP_RETCODE SDPAreadInt (SCIP *scip, SCIP_FILE *file, SCIP_Longint *linecount, SDPA_DATA *data)
 
static SCIP_RETCODE SDPAreadRank1 (SCIP *scip, SCIP_FILE *file, SCIP_Longint *linecount, SDPA_DATA *data)
 
static SCIP_DECL_READERCOPY (readerCopySdpa)
 
static SCIP_DECL_READERREAD (readerReadSdpa)
 
static SCIP_DECL_READERWRITE (readerWriteSdpa)
 
SCIP_RETCODE SCIPincludeReaderSdpa (SCIP *scip)
 

Detailed Description

file reader for mixed-integer semidefinite programs in SDPA format

Author
Tim Schmidt
Frederic Matter
Marc Pfetsch

Definition in file reader_sdpa.c.

Macro Definition Documentation

#define READER_NAME   "sdpareader"

Definition at line 57 of file reader_sdpa.c.

Referenced by SCIPincludeReaderSdpa().

#define READER_DESC   "file reader and writer for MISDPs in sdpa format"

Definition at line 58 of file reader_sdpa.c.

Referenced by SCIPincludeReaderSdpa().

#define READER_EXTENSION   "dat-s"

Definition at line 59 of file reader_sdpa.c.

Referenced by SCIPincludeReaderSdpa().

#define SDPA_MIN_BUFFERLEN   65536 /* minimal size of buffer */

Definition at line 61 of file reader_sdpa.c.

Referenced by readLine().

Typedef Documentation

typedef struct SDPA_Data SDPA_DATA

Definition at line 97 of file reader_sdpa.c.

Function Documentation

static SCIP_RETCODE readLine ( SCIP *  scip,
SCIP_FILE *  file,
char **  buffer,
int *  bufferlen,
SCIP_Bool *  success 
)
static

reads the next line from the input file into the line buffer, possibly reallocating buffer

Parameters
scipSCIP data structure
filefile
bufferbuffer to read into
bufferlenbuffer length
successpointer to store whether reading was successful (no error or EOF occured)

Definition at line 105 of file reader_sdpa.c.

References SDPA_MIN_BUFFERLEN.

Referenced by readLineDoubles(), readLineInts(), readNextLine(), and readNextLineStar().

static SCIP_RETCODE readNextLine ( SCIP *  scip,
SCIP_FILE *  file,
char **  buffer,
int *  bufferlen,
SCIP_Longint *  linecount,
SCIP_Bool *  success 
)
static

reads next non-commentary line in given file

Parameters
scipSCIP data structure
filefile to read from
bufferbuffer to read into
bufferlenbuffer length
linecountcurrent linecount
successpointer to store whether reading was successful (no error or EOF occured)

Definition at line 169 of file reader_sdpa.c.

References readLine().

Referenced by SDPAreadBlocks(), SDPAreadNBlocks(), and SDPAreadNVars().

static SCIP_RETCODE readNextLineStar ( SCIP *  scip,
SCIP_FILE *  file,
char **  buffer,
int *  bufferlen,
SCIP_Longint *  linecount,
SCIP_Bool *  success 
)
static

reads next line in given file, each line starting with '*'

Parameters
scipSCIP data structure
filefile to read from
bufferbuffer to read into
bufferlenbuffer length
linecountcurrent linecount
successpointer to store whether reading was successful (no error or EOF occured)

Definition at line 211 of file reader_sdpa.c.

References readLine().

Referenced by SDPAreadInt(), and SDPAreadRank1().

static SCIP_RETCODE readLineDoubles ( SCIP *  scip,
SCIP_FILE *  file,
char **  buffer,
int *  bufferlen,
SCIP_Longint *  linecount,
int  nvals,
SCIP_Real *  values,
int *  nread 
)
static

method for reading a given list of double numbers from file

Parameters
scipSCIP data structure
filefile to read from
bufferpointer to buffer
bufferlenpointer to bufferlne
linecountcurrent linecount
nvalsnumber of values to read
valuesvalues that have been read
nreadpointer to store the number of read doubles

Definition at line 246 of file reader_sdpa.c.

References readLine().

Referenced by SDPAreadObjVals().

static SCIP_RETCODE readLineInts ( SCIP *  scip,
SCIP_FILE *  file,
char **  buffer,
int *  bufferlen,
SCIP_Longint *  linecount,
int  nvals,
int *  values,
int *  nread 
)
static

method for reading a list of integer numbers from a file

Parameters
scipSCIP data structure
filefile to read from
bufferpointer to buffer
bufferlenpointer to bufferlne
linecountcurrent linecount
nvalsnumber of values to read
valuesvalues that have been read
nreadpointer to store the number of read ints

Definition at line 340 of file reader_sdpa.c.

References readLine().

Referenced by SDPAreadBlockSize().

static SCIP_RETCODE SDPAfreeData ( SCIP *  scip,
SCIP_FILE *  file,
SDPA_DATA data 
)
static

frees all data allocated for the SDPA-data-struct

Parameters
scipSCIP data structure
filefile
datadata pointer to save the results in

Definition at line 425 of file reader_sdpa.c.

Referenced by SCIP_DECL_READERREAD(), SDPAreadBlocks(), SDPAreadBlockSize(), SDPAreadInt(), SDPAreadNBlocks(), SDPAreadNVars(), SDPAreadObjVals(), and SDPAreadRank1().

static SCIP_RETCODE SDPAreadNVars ( SCIP *  scip,
SCIP_FILE *  file,
SCIP_Longint *  linecount,
SDPA_DATA data 
)
static

reads the number of variables from given SDPA-file

Parameters
scipSCIP data structure
filefile to read from
linecountcurrent linecount
datadata pointer to save the results in

Definition at line 498 of file reader_sdpa.c.

References readNextLine(), and SDPAfreeData().

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE SDPAreadNBlocks ( SCIP *  scip,
SCIP_FILE *  file,
SCIP_Longint *  linecount,
SDPA_DATA data 
)
static

reads the number of constraint blocks from given SDPA-file

Parameters
scipSCIP data structure
filefile to read from
linecountcurrent linecount
datadata pointer to save the results in

Definition at line 574 of file reader_sdpa.c.

References readNextLine(), and SDPAfreeData().

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE SDPAreadBlockSize ( SCIP *  scip,
SCIP_FILE *  file,
SCIP_Longint *  linecount,
SDPA_DATA data 
)
static

reads SDP-constraint sizes and number of linear constraints from given SDPA-file

Parameters
scipSCIP data structure
filefile to read from
linecountcurrent linecount
datadata pointer to save the results in

Definition at line 620 of file reader_sdpa.c.

References readLineInts(), and SDPAfreeData().

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE SDPAreadObjVals ( SCIP *  scip,
SCIP_FILE *  file,
SCIP_Longint *  linecount,
SDPA_DATA data 
)
static

reads objective values for scalar variables from given SDPA-file

Parameters
scipSCIP data structure
filefile to read from
linecountcurrent linecount
datadata pointer to save the results in

Definition at line 758 of file reader_sdpa.c.

References readLineDoubles(), and SDPAfreeData().

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE SDPAreadBlocks ( SCIP *  scip,
SCIP_FILE *  file,
SCIP_Longint *  linecount,
SDPA_DATA data 
)
static

reads the SDP-constraint blocks and the linear constraint block

Parameters
scipSCIP data structure
filefile to read from
linecountcurrent linecount
datadata pointer to save the results in

Definition at line 826 of file reader_sdpa.c.

References readNextLine(), and SDPAfreeData().

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE SDPAreadInt ( SCIP *  scip,
SCIP_FILE *  file,
SCIP_Longint *  linecount,
SDPA_DATA data 
)
static

reads integrality conditions from given SDPA-file

Parameters
scipSCIP data structure
filefile to read from
linecountcurrent linecount
datadata pointer to save the results in

Definition at line 1461 of file reader_sdpa.c.

References readNextLineStar(), and SDPAfreeData().

Referenced by SCIP_DECL_READERREAD().

static SCIP_RETCODE SDPAreadRank1 ( SCIP *  scip,
SCIP_FILE *  file,
SCIP_Longint *  linecount,
SDPA_DATA data 
)
static

reads rank1 conditions from given SDPA-file

Parameters
scipSCIP data structure
filefile to read from
linecountcurrent linecount
datadata pointer to save the results in

Definition at line 1542 of file reader_sdpa.c.

References readNextLineStar(), and SDPAfreeData().

Referenced by SCIP_DECL_READERREAD().

static SCIP_DECL_READERCOPY ( readerCopySdpa  )
static

copy method for reader plugins (called when SCIP copies plugins)

Definition at line 1642 of file reader_sdpa.c.

References SCIPincludeReaderSdpa().

static SCIP_DECL_READERREAD ( readerReadSdpa  )
static
static SCIP_DECL_READERWRITE ( readerWriteSdpa  )
static

problem writing method of reader

Definition at line 1812 of file reader_sdpa.c.

References SCIPconsSdpGetBlocksize(), SCIPconsSdpGetData(), SCIPconsSdpGetNNonz(), and SCIPconsSdpShouldBeRankOne().

SCIP_RETCODE SCIPincludeReaderSdpa ( SCIP *  scip)

includes the SDPA file reader in SCIP

Parameters
scipSCIP data structure

Definition at line 2272 of file reader_sdpa.c.

References READER_DESC, READER_EXTENSION, and READER_NAME.

Referenced by SCIP_DECL_READERCOPY(), and SCIPSDPincludeDefaultPlugins().