forked from yanliu/pgap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.h
26 lines (21 loc) · 988 Bytes
/
data.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/******************************************************************************
* data.h: read problem instance data; define macros to access matrix *
* Author: Yan Y. Liu <[email protected]> *
* Date: 2014/08/17 *
* Copyright and license of this source file are specified in LICENSE.TXT *
* under the root directory of this software package. *
******************************************************************************/
#ifndef DATA_H
#define DATA_H
/* read data into memory
* data format conforms OR-LIB format
*/
typedef int VTYPE; // type of value
typedef int WTYPE; // type of weight
// matrix access: size of a row is implicitly decided as n
#define M(matrix, i, j) (matrix[n * i + j])
// transposed matrix access
#define MT(matrix, i, j) (matrix[m * i + j])
#define Mr(matrix, i) (matrix[n * i])
void readData(char *fileName);
#endif