/home/coin/SVN-release/CoinAll-1.1.0/SYMPHONY/include/sym_dg.h

Go to the documentation of this file.
00001 /*===========================================================================*/
00002 /*                                                                           */
00003 /* This file is part of the SYMPHONY MILP Solver Framework.                  */
00004 /*                                                                           */
00005 /* SYMPHONY was jointly developed by Ted Ralphs (tkralphs@lehigh.edu) and    */
00006 /* Laci Ladanyi (ladanyi@us.ibm.com).                                        */
00007 /*                                                                           */
00008 /* (c) Copyright 2000-2008 Ted Ralphs. All Rights Reserved.                  */
00009 /*                                                                           */
00010 /* This software is licensed under the Common Public License. Please see     */
00011 /* accompanying file for terms.                                              */
00012 /*                                                                           */
00013 /*===========================================================================*/
00014 
00015 #ifndef _INTERMEDIARY_H
00016 #define _INTERMEDIARY_H
00017 
00018 #include <stdio.h>
00019 
00020 #include "sym_proto.h"
00021 #include "sym_dg_params.h"
00022 #include "sym_dg_u.h"
00023 
00024 #ifndef PIPE_ERROR
00025 #define PIPE_ERROR {printf("PIPE_ERROR !!!!!!!!!!!"); }
00026 #endif
00027 
00028 /*===========================================================================*/
00029 
00030 typedef struct WINDOW_DESCRIPTION{
00031    int         canvas_width;
00032    int         canvas_height;
00033    int         viewable_width;
00034    int         viewable_height;
00035    int         disp_nodelabels;
00036    int         disp_nodeweights;
00037    int         disp_edgeweights;
00038    char        node_dash[MAX_DASH_PATTERN_LENGTH +1];
00039    char        edge_dash[MAX_DASH_PATTERN_LENGTH +1];
00040    int         node_radius;
00041    int         interactive_mode;
00042    int         mouse_tracking;
00043    double      scale_factor;
00044    char        nodelabel_font[MAX_FONT_LENGTH +1];
00045    char        nodeweight_font[MAX_FONT_LENGTH +1];
00046    char        edgeweight_font[MAX_FONT_LENGTH +1];
00047 }win_desc;
00048 
00049 /*===========================================================================*/
00050 
00051 typedef struct DG_NODE{
00052    int     node_id;
00053    int     posx;
00054    int     posy;
00055    int     radius;
00056    char    deleted;   /* 1/0 */
00057    char    label[MAX_LABEL_LENGTH +1]; /*watch out, terminating character
00058                                       is a zero!*/
00059    char    weight[MAX_WEIGHT_LENGTH +1];
00060    char    dash[MAX_DASH_PATTERN_LENGTH +1];
00061 }dg_node;
00062 
00063 /*===========================================================================*/
00064 
00065 typedef struct DG_EDGE{
00066    int     edge_id;
00067    int     tail;
00068    int     head;
00069    char    deleted;
00070    char    weight[MAX_WEIGHT_LENGTH +1];
00071    char    dash[MAX_DASH_PATTERN_LENGTH +1];
00072 }dg_edge;
00073       
00074 /*===========================================================================*/
00075    
00076 typedef struct DG_GRAPH{
00077    int         nodenum;
00078    int         deleted_nodenum;
00079    dg_node    *nodes;
00080    int         edgenum;
00081    int         deleted_edgenum;
00082    dg_edge    *edges;
00083 }dg_graph;
00084 
00085 /*===========================================================================*/
00086 
00087 typedef struct BUF_FIFO{
00088    int        *bufid;
00089    int         bufspace;
00090    int         bufwrite;
00091    int         bufread;
00092 }buf_fifo;
00093 
00094 /*===========================================================================*/
00095 
00096 typedef struct WINDOW{
00097    char        name[MAX_NAME_LENGTH +1];
00098    unsigned int id;
00099    void       *user;
00100 
00101    int         owner_tid;     /* tid of process that initiated this */
00102    buf_fifo    buf;      /* structure to store buffer id's in a FIFO */
00103    int         window_displayed;  /* T/F T if window is displayed */
00104    int         wait_for_click;  /* 0:don't wait, 1:wait, no report,
00105                                    2:wait and report */
00106    win_desc    desc;
00107    char        title[MAX_TITLE_LENGTH +1];
00108    dg_graph    g;
00109    int         copy_status; /*0:nothing, 1:waiting to be copied, 2:waiting to
00110                               get a copy. */
00111    char        source[MAX_NAME_LENGTH +1]; /* set if copy_status=2 */
00112    char        target[MAX_NAME_LENGTH +1]; /* set if copy_status=1 */
00113 
00114    int         text_length;
00115    char       *text;
00116 }window;
00117 
00118 /*===========================================================================*/
00119 
00120 typedef struct DRAW_GRAPH_PROBLEM{
00121    void         *user;
00122    int           master;
00123    dg_params     par;
00124    char          waiting_to_die;
00125    unsigned int  next_id;
00126    int           window_num;    /* the number of windows */
00127    window      **windows;
00128 
00129    int           message_length;
00130    char         *message;
00131 }dg_prob;
00132 
00133 /*===========================================================================*/
00134 
00135 void INTERMED_ERROR PROTO((char *window_name, int old_msgtag,
00136                            int receiver, int msgtag));
00137 int spprint PROTO((FILE *write_to, const char *format, ...));
00138 
00139 int start_child PROTO((char *cmd, FILE **readpipe, FILE **writepipe));
00140 int find_window PROTO((int window_num, window **windows, char *name));
00141 void read_node_desc_from_pvm PROTO((dg_node *nod, window *win));
00142 void read_edge_desc_from_pvm PROTO((dg_edge *edg, window *win));
00143 int find_node PROTO((int node_id, dg_graph *g));
00144 int find_edge PROTO((int edge_id, dg_graph *g));
00145 void compress_graph PROTO((dg_graph *g));
00146 void copy_window_structure PROTO((window *target_win, window *source_win));
00147 void display_graph_on_canvas PROTO((window *win, FILE *write_to));
00148 void free_window PROTO((int *pwindow_num, window **windows, int i));
00149 void copy_win_desc_from_par PROTO((window *win, dg_params *par));
00150 void set_window_desc_pvm PROTO((int key, window *win));
00151 void wait_for_you_can_die PROTO((dg_prob *dgp, FILE *write_to));
00152 window *init_dgwin PROTO((dg_prob *dgp, int sender, char *name, char *title));
00153 void add_msg PROTO((window *win, int bufid));
00154 int get_next_msg PROTO((window *win));
00155 
00156 //FILE *fdopen PROTO((int, const char *));
00157 
00158 #endif

Generated on Sun Nov 14 14:06:42 2010 for Coin-All by  doxygen 1.4.7