> > ILOG CPLEX File Formats > Solution Files > Format of a Binary Solution File |
Format of a Binary Solution File |
INDEX PREVIOUS NEXT |
A Binary solution file is created in the Callable Library with the CPXwritesol
routine, or in the Interactive Optimizer via the write
command. (The Binary solution file format is not supported by Concert Technology.) In all cases the file type BIN should be specified. If a file name with a .bin
extension is specified, the file type may be omitted. The file is called binary because all the numbers in the file are in their internal, binary representations and the records are not text-type records. Consequently, a binary file cannot be read by a text editor; nor can it be printed.
Binary files are used as an efficient and accurate means to provide data to another program, for example, a report writer. Binary representation of real numbers is more precise than the corresponding ASCII representation. Binary representation retains more significant places. In addition, reading the file is faster since there is no ASCII-to-binary conversion needed.
The binary solution file consists of variable-length records divided into sections. The format for each record is an integer-length entry giving the length of the record in bytes, the data, and another integer-length entry giving the length. The length of the record excludes the two length entries. The format is:
| (length) | ------data------ | (length) | |
The first record in a binary solution file is:
Data bytes 1 - 8: 'NAME ' 9 - 16: (first 8 characters of problem name) |
The last record in a binary solution file is:
Data bytes 1 - 8: 'ENDATA ' 9 - 16: ' ' |
Three sections are written between the first and last records. Each section starts with three description records:
Data Bytes | 1 - 8 | section name |
9 - 12 | number of data items | |
13 - 16 | zero |
Data Bytes | 1 - 8 | first field name |
9 - 16 | second field name | |
17 - 24 | third field name | |
etc. |
Data Bytes | 1 - 4 | first field type |
5 - 8 | first field size | |
9 - 12 | second field type | |
13 - 16 | second field size | |
17 - 20 | third field type | |
21 - 24 | third field size | |
etc. |
The field types are represented by integer codes:
1 | integer |
2 | character |
3 | floating point |
The field sizes are the number of bytes for the data item.
The final record of each section contains the string $ENDSEC$
. This record is the same length as the other data records within that section, but only the first eight characters are used.
In summary, each of the three sections starts with three description records followed by any number of data records. The $ENDSEC$
string marks the end of a section. A summary of the information specified on the three description records for each of the three sections follows.
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |