eg_ddpconstraint.h

Go to the documentation of this file.
00001 #ifndef _DDPCONSTRAINT
00002 #define _DDPCONSTRAINT
00003 
00004 #define DDPCONSTRAINT_MAXVIOL_EPSILON 0.0001
00005 #define EG_DP_SELECT_DEBUG 500
00006 
00007 #include<stdio.h>
00008 #include<stdlib.h>
00009 #include<math.h>
00010 
00011 #include "eg_timer.h"
00012 #include "eg_mempool.h"
00013 #include "eg_list.h"
00014 
00015 #include "eg_heap.h"
00016 #include "eg_dgraph.h"
00017 #include "eg_dijkstra.h"
00018 #include "eg_dijkstra_app.h"
00019 #include "eg_ddomino.h"
00020 
00021 #include "graph_boyer.h"
00022 
00023 typedef struct
00024 {
00025 
00026   EGdijkstraCost_t weight;
00027   unsigned int pweight;
00028 
00029   EGddomino_t *ddom;
00030   EGdGraphEdge_t *e;
00031 
00032 }
00033 EGcycleData_t;
00034 
00035 typedef struct
00036 {
00037 
00038   unsigned int nF,
00039     ndom;
00040 
00041   /* the slack and the LHS have the dp suffix indicating 
00042    * that they are dual-primal values. This means that in
00043    * the case of edge elimination, they use the primalValue
00044    * entries of the weights for the dual-dominoes, rather
00045    * than the dual values.                                  */
00046 
00047   double slack_dp;
00048   EGdijkstraCost_t LHS_dp;
00049 
00050   EGddomino_t **ddom;
00051   EGdGraphEdge_t **F;
00052 }
00053 EGddpConstraint_t;
00054 
00055 typedef const EGdGraphEdge_t *cep_t;
00056 typedef const cep_t *ccep_t;
00057 
00058 typedef const EGddomino_t *cddomp_t;
00059 typedef const cddomp_t *ccddomp_t;
00060 
00061 void EGfreeCycleDataMP (void *v,
00062                         EGmemPool_t * mem);
00063 
00064 /* EGddpAddHeuristicCuts_3
00065  marray:  used to mark which nodes have been traversed by the random walk.
00066  odd_num: used to indicate how many odd edges have been traversed in order 
00067  to get to each node */
00068 int EGddpAddHeuristicCuts_3 (EGddpConstraint_t ** ddpc_array,
00069                              double *const ddpc_dist,
00070                              double *const ddpc_angle_norm,
00071                              double *const *const ddpc_angle,
00072                              unsigned int *const ddpc_size,
00073                              unsigned int const ddpc_max_size,
00074                              double *const ddpc_best_angle,
00075                              double *const ddpc_worst_angle,
00076                              unsigned int *const ddpc_worst_angle_id,
00077                              int const nedges,
00078                              EGdGraphNode_t * start_node,
00079                              EGdGraphEdge_t * start_edge,
00080                              int k,
00081                              double ubound,
00082                              EGdGraph_t * cycleG,
00083                              EGdGraphEdge_t ** dij_sol,
00084                              unsigned int *marray,
00085                              char *sarray,
00086                              unsigned int *odd_num,
00087                              unsigned int nddom,
00088                              int *ddom_markers,
00089                              size_t * os,
00090                              double max_node_time,
00091                              EGmemPool_t * mem);
00092 
00093 /* create a new cycle graph. max_val is an upper bouind on 'feasible' edges,
00094  * then, any edge (real or fake) with value more than max_val will be discarded
00095  * and not included in the graph */
00096 EGdGraph_t *EGnewCycleGraph (EGmemPool_t * mem,
00097                              EGlist_t * dlist,
00098                              EGdGraph_t * bdG,
00099                              EGdijkstraCost_t max_val);
00100 
00101 void EGfreeDDPconstraintMP (void *v,
00102                             EGmemPool_t * mem);
00103 
00104 int EGboyerEdgeNumber (const EGdGraphEdge_t * e);
00105 
00106 int EGedgeCompare (const void *p1,
00107                    const void *p2);
00108 
00109 int EGddpcComputeAll (EGmemPool_t * mem,
00110                       EGdGraph_t * bdG,
00111                       EGlist_t * dlist,
00112                       EGlist_t * ddpc_list,
00113                       int const nedges,
00114                       int k);
00115 
00116 int EGddpSetMaxWeight (EGdGraph_t * cycleG,
00117                        double *max_weight);
00118 
00119 void EGddpcDisplay (EGddpConstraint_t * ddpc,
00120                     FILE * file);
00121 
00122 #endif

Generated on Thu Oct 20 14:58:40 2005 for DominoParitySeparator by  doxygen 1.4.5