00001 /*===========================================================================*/ 00002 /* */ 00003 /* This file is part of a demonstration application for use with the */ 00004 /* SYMPHONY Branch, Cut, and Price Library. This application is a solver for */ 00005 /* the Set Partitioning Problem. */ 00006 /* */ 00007 /* (c) Copyright 2005-2008 Marta Eso and Ted Ralphs. All Rights Reserved. */ 00008 /* */ 00009 /* This application was originally developed by Marta Eso and was modified */ 00010 /* Ted Ralphs (tkralphs@lehigh.edu) */ 00011 /* */ 00012 /* This software is licensed under the Common Public License. Please see */ 00013 /* accompanying file for terms. */ 00014 /* */ 00015 /*===========================================================================*/ 00016 00017 #ifndef _SPP_TYPES_H_ 00018 #define _SPP_TYPES_H_ 00019 00020 #define row_ind_type short 00021 00022 typedef struct STATISTICS { 00023 int freq; /* how many times the routine was invoked */ 00024 double time; /* how much time was spent in this routine */ 00025 }statistics; 00026 00027 00028 typedef struct COL_ORDERED { 00029 int colnum; /* number of columns when this column 00030 ordered matrix was created */ 00031 int rownum; /* same for number of rows */ 00032 int active_colnum; /* number of cols not marked for del */ 00033 int nzcnt; /* number of nonzeros in the matrix */ 00034 int *colnames; 00035 char *col_deleted; /* a sequence of bits indicating which 00036 columns are deleted */ 00037 double *obj; /* obj function coeffs */ 00038 int *matbeg; /* pos of beginning of cols in matind */ 00039 row_ind_type *matind; /* indices of rows listed for each col */ 00040 }col_ordered; 00041 00042 00043 typedef struct ROW_ORDERED { 00044 int rownum; /* number of rows when this row ordered 00045 matrix was created. */ 00046 int colnum; /* same for cols */ 00047 int active_rownum; /* number of rows not marked for del */ 00048 int nzcnt; /* nonzero_count */ 00049 int *rownames; 00050 char *row_deleted; /* delete bits */ 00051 int *rmatbeg; /* pos of beginning of rows in rmatind */ 00052 int *rmatind; /* indices of cols listed for each row */ 00053 }row_ordered; 00054 00055 00056 /* define bit manipulating macros. (a,i): starting at the memory location 00057 where a points to, find bit i; the order of bits is the following: 00058 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 ... 00059 setbit sets this bit to 1; clrbit clears this bit; isset returns 0 (false) 00060 if the bit is not set, and non-zero if it is set; isclr returns 1 (true) 00061 if the bit is not set and 0 (false) if the bit is set. */ 00062 #ifndef setbit 00063 #define setbit(a,i) ((a)[(i)/BITSPERBYTE] |= 1<<((i)%BITSPERBYTE)) 00064 #define clrbit(a,i) ((a)[(i)/BITSPERBYTE] &= ~(1<<((i)%BITSPERBYTE))) 00065 #define isset(a,i) ((a)[(i)/BITSPERBYTE] & (1<<((i)%BITSPERBYTE))) 00066 #define isclr(a,i) (((a)[(i)/BITSPERBYTE] & (1<<((i)%BITSPERBYTE))) == 0) 00067 #endif 00068 00069 00070 #endif