Dip  0.92.4
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 
28 typedef struct COL_ORDERED {
29  int colnum; /* number of columns when this column
30  ordered matrix was created */
31  int rownum; /* same for number of rows */
32  int active_colnum; /* number of cols not marked for del */
33  int nzcnt; /* number of nonzeros in the matrix */
34  int *colnames;
35  char *col_deleted; /* a sequence of bits indicating which
36  columns are deleted */
37  double *obj; /* obj function coeffs */
38  int *matbeg; /* pos of beginning of cols in matind */
39  row_ind_type *matind; /* indices of rows listed for each col */
41 
42 
43 typedef struct ROW_ORDERED {
44  int rownum; /* number of rows when this row ordered
45  matrix was created. */
46  int colnum; /* same for cols */
47  int active_rownum; /* number of rows not marked for del */
48  int nzcnt; /* nonzero_count */
49  int *rownames;
50  char *row_deleted; /* delete bits */
51  int *rmatbeg; /* pos of beginning of rows in rmatind */
52  int *rmatind; /* indices of cols listed for each row */
54 
55 
56 /* define bit manipulating macros. (a,i): starting at the memory location
57  where a points to, find bit i; the order of bits is the following:
58  7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 ...
59  setbit sets this bit to 1; clrbit clears this bit; isset returns 0 (false)
60  if the bit is not set, and non-zero if it is set; isclr returns 1 (true)
61  if the bit is not set and 0 (false) if the bit is set. */
62 #ifndef setbit
63 #define setbit(a,i) ((a)[(i)/BITSPERBYTE] |= 1<<((i)%BITSPERBYTE))
64 #define clrbit(a,i) ((a)[(i)/BITSPERBYTE] &= ~(1<<((i)%BITSPERBYTE)))
65 #define isset(a,i) ((a)[(i)/BITSPERBYTE] & (1<<((i)%BITSPERBYTE)))
66 #define isclr(a,i) (((a)[(i)/BITSPERBYTE] & (1<<((i)%BITSPERBYTE))) == 0)
67 #endif
68 
69 
70 #endif
char * col_deleted
Definition: spp_types.h:35
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
int colnum
Definition: spp_types.h:46
#define row_ind_type
Definition: spp_types.h:20
struct COL_ORDERED col_ordered
struct STATISTICS statistics
double time
Definition: spp_types.h:24
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:38
int rownum
Definition: spp_types.h:44
int colnum
Definition: spp_types.h:29