Dip  0.92.3
spp_types.h
Go to the documentation of this file.
1 /*===========================================================================*/
2 /* */
3 /* This file is part of a demonstration application for use with the */
4 /* SYMPHONY Branch, Cut, and Price Library. This application is a solver for */
5 /* the Set Partitioning Problem. */
6 /* */
7 /* (c) Copyright 2005-2013 Marta Eso and Ted Ralphs. All Rights Reserved. */
8 /* */
9 /* This application was originally developed by Marta Eso and was modified */
10 /* Ted Ralphs (ted@lehigh.edu) */
11 /* */
12 /* This software is licensed under the Eclipse Public License. Please see */
13 /* accompanying file for terms. */
14 /* */
15 /*===========================================================================*/
16 
17 #ifndef _SPP_TYPES_H_
18 #define _SPP_TYPES_H_
19 
20 #define row_ind_type short
21 
22 typedef struct STATISTICS {
23  int freq; /* how many times the routine was invoked */
24  double time; /* how much time was spent in this routine */
25 }statistics;
26 
27 typedef struct SPARSE_MATRIX {
28  int ncol;
29  int nrow;
30  int *matbeg;
31  int *matind;
32  double *matval;
34 
35 typedef struct COL_ORDERED {
36  int colnum; /* number of columns when this column
37  ordered matrix was created */
38  int rownum; /* same for number of rows */
39  int active_colnum; /* number of cols not marked for del */
40  int nzcnt; /* number of nonzeros in the matrix */
41  int *colnames;
42  char *col_deleted; /* a sequence of bits indicating which
43  columns are deleted */
44  double *obj; /* obj function coeffs */
45  int *matbeg; /* pos of beginning of cols in matind */
46  row_ind_type *matind; /* indices of rows listed for each col */
48 
49 typedef struct ROW_ORDERED {
50  int rownum; /* number of rows when this row ordered
51  matrix was created. */
52  int colnum; /* same for cols */
53  int active_rownum; /* number of rows not marked for del */
54  int nzcnt; /* nonzero_count */
55  int *rownames;
56  char *row_deleted; /* delete bits */
57  int *rmatbeg; /* pos of beginning of rows in rmatind */
58  int *rmatind; /* indices of cols listed for each row */
60 
61 /* define bit manipulating macros. (a,i): starting at the memory location
62  where a points to, find bit i; the order of bits is the following:
63  7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 ...
64  setbit sets this bit to 1; clrbit clears this bit; isset returns 0 (false)
65  if the bit is not set, and non-zero if it is set; isclr returns 1 (true)
66  if the bit is not set and 0 (false) if the bit is set. */
67 #ifndef setbit
68 #define setbit(a,i) ((a)[(i)/BITSPERBYTE] |= 1<<((i)%BITSPERBYTE))
69 #define clrbit(a,i) ((a)[(i)/BITSPERBYTE] &= ~(1<<((i)%BITSPERBYTE)))
70 #define isset(a,i) ((a)[(i)/BITSPERBYTE] & (1<<((i)%BITSPERBYTE)))
71 #define isclr(a,i) (((a)[(i)/BITSPERBYTE] & (1<<((i)%BITSPERBYTE))) == 0)
72 #endif
73 
74 
75 #endif
char * col_deleted
Definition: spp_types.h:35
int * matind
Definition: spp_types.h:31
int * rmatbeg
Definition: spp_types.h:51
struct ROW_ORDERED row_ordered
int freq
Definition: spp_types.h:23
int * rownames
Definition: spp_types.h:49
int active_rownum
Definition: spp_types.h:47
int * colnames
Definition: spp_types.h:34
#define row_ind_type
Definition: spp_types.h:20
struct SPARSE_MATRIX sparse_matrix
int colnum
Definition: spp_types.h:46
struct COL_ORDERED col_ordered
struct STATISTICS statistics
double time
Definition: spp_types.h:24
double * matval
Definition: spp_types.h:32
row_ind_type * matind
Definition: spp_types.h:39
char * row_deleted
Definition: spp_types.h:50
int * rmatind
Definition: spp_types.h:52
double * obj
Definition: spp_types.h:37
int rownum
Definition: spp_types.h:31
int active_colnum
Definition: spp_types.h:32
int * matbeg
Definition: spp_types.h:30
int * matbeg
Definition: spp_types.h:38
int rownum
Definition: spp_types.h:44
int colnum
Definition: spp_types.h:29