Dip  0.92.4
sym_dg.h
Go to the documentation of this file.
1 /*===========================================================================*/
2 /* */
3 /* This file is part of the SYMPHONY MILP Solver Framework. */
4 /* */
5 /* SYMPHONY was jointly developed by Ted Ralphs (ted@lehigh.edu) and */
6 /* Laci Ladanyi (ladanyi@us.ibm.com). */
7 /* */
8 /* (c) Copyright 2000-2019 Ted Ralphs. All Rights Reserved. */
9 /* */
10 /* This software is licensed under the Eclipse Public License. Please see */
11 /* accompanying file for terms. */
12 /* */
13 /*===========================================================================*/
14 
15 #ifndef _INTERMEDIARY_H
16 #define _INTERMEDIARY_H
17 
18 #include <stdio.h>
19 
20 #include "sym_proto.h"
21 #include "sym_dg_params.h"
22 #include "sym_dg_u.h"
23 
24 #ifndef PIPE_ERROR
25 #define PIPE_ERROR {printf("PIPE_ERROR !!!!!!!!!!!"); }
26 #endif
27 
28 /*===========================================================================*/
29 
30 typedef struct WINDOW_DESCRIPTION{
43  double scale_factor;
47 }win_desc;
48 
49 /*===========================================================================*/
50 
51 typedef struct DG_NODE{
52  int node_id;
53  int posx;
54  int posy;
55  int radius;
56  char deleted; /* 1/0 */
57  char label[MAX_LABEL_LENGTH +1]; /*watch out, terminating character
58  is a zero!*/
61 }dg_node;
62 
63 /*===========================================================================*/
64 
65 typedef struct DG_EDGE{
66  int edge_id;
67  int tail;
68  int head;
69  char deleted;
72 }dg_edge;
73 
74 /*===========================================================================*/
75 
76 typedef struct DG_GRAPH{
77  int nodenum;
80  int edgenum;
83 }dg_graph;
84 
85 /*===========================================================================*/
86 
87 typedef struct BUF_FIFO{
88  int *bufid;
89  int bufspace;
90  int bufwrite;
91  int bufread;
92 }buf_fifo;
93 
94 /*===========================================================================*/
95 
96 typedef struct WINDOW{
98  unsigned int id;
99  void *user;
100 
101  int owner_tid; /* tid of process that initiated this */
102  buf_fifo buf; /* structure to store buffer id's in a FIFO */
103  int window_displayed; /* T/F T if window is displayed */
104  int wait_for_click; /* 0:don't wait, 1:wait, no report,
105  2:wait and report */
109  int copy_status; /*0:nothing, 1:waiting to be copied, 2:waiting to
110  get a copy. */
111  char source[MAX_NAME_LENGTH +1]; /* set if copy_status=2 */
112  char target[MAX_NAME_LENGTH +1]; /* set if copy_status=1 */
113 
115  char *text;
116 }window;
117 
118 /*===========================================================================*/
119 
120 typedef struct DRAW_GRAPH_PROBLEM{
121  void *user;
122  int master;
125  unsigned int next_id;
126  int window_num; /* the number of windows */
128 
130  char *message;
131 }dg_prob;
132 
133 /*===========================================================================*/
134 
135 void INTERMED_ERROR PROTO((char *window_name, int old_msgtag,
136  int receiver, int msgtag));
137 int spprint PROTO((FILE *write_to, const char *format, ...));
138 
139 int start_child PROTO((char *cmd, FILE **readpipe, FILE **writepipe));
140 int find_window PROTO((int window_num, window **windows, char *name));
141 void read_node_desc_from_pvm PROTO((dg_node *nod, window *win));
142 void read_edge_desc_from_pvm PROTO((dg_edge *edg, window *win));
143 int find_node PROTO((int node_id, dg_graph *g));
144 int find_edge PROTO((int edge_id, dg_graph *g));
145 void compress_graph PROTO((dg_graph *g));
146 void copy_window_structure PROTO((window *target_win, window *source_win));
147 void display_graph_on_canvas PROTO((window *win, FILE *write_to));
148 void free_window PROTO((int *pwindow_num, window **windows, int i));
149 void copy_win_desc_from_par PROTO((window *win, dg_params *par));
150 void set_window_desc_pvm PROTO((int key, window *win));
151 void wait_for_you_can_die PROTO((dg_prob *dgp, FILE *write_to));
152 window *init_dgwin PROTO((dg_prob *dgp, int sender, char *name, char *title));
153 void add_msg PROTO((window *win, int bufid));
154 int get_next_msg PROTO((window *win));
155 
156 //FILE *fdopen PROTO((int, const char *));
157 
158 #endif
int posy
Definition: sym_dg.h:54
int node_id
Definition: sym_dg.h:52
char weight[MAX_WEIGHT_LENGTH+1]
Definition: sym_dg.h:59
int deleted_edgenum
Definition: sym_dg.h:81
int disp_nodelabels
Definition: sym_dg.h:35
#define PROTO(x)
Definition: sym_proto.h:27
dg_params par
Definition: sym_dg.h:123
char source[MAX_NAME_LENGTH+1]
Definition: sym_dg.h:111
int mouse_tracking
Definition: sym_dg.h:42
char target[MAX_NAME_LENGTH+1]
Definition: sym_dg.h:112
unsigned int next_id
Definition: sym_dg.h:125
void * user
Definition: sym_dg.h:99
win_desc desc
Definition: sym_dg.h:106
int copy_status
Definition: sym_dg.h:109
char * message
Definition: sym_dg.h:130
Definition: sym_dg.h:51
int radius
Definition: sym_dg.h:55
int bufread
Definition: sym_dg.h:91
char dash[MAX_DASH_PATTERN_LENGTH+1]
Definition: sym_dg.h:71
struct DRAW_GRAPH_PROBLEM dg_prob
#define MAX_LABEL_LENGTH
Definition: sym_dg_params.h:41
char edge_dash[MAX_DASH_PATTERN_LENGTH+1]
Definition: sym_dg.h:39
int owner_tid
Definition: sym_dg.h:101
dg_graph g
Definition: sym_dg.h:108
int * bufid
Definition: sym_dg.h:88
int text_length
Definition: sym_dg.h:114
int posx
Definition: sym_dg.h:53
unsigned int id
Definition: sym_dg.h:98
#define MAX_FONT_LENGTH
Definition: sym_dg_params.h:40
int head
Definition: sym_dg.h:68
int edge_id
Definition: sym_dg.h:66
char name[MAX_NAME_LENGTH+1]
Definition: sym_dg.h:97
int viewable_height
Definition: sym_dg.h:34
struct WINDOW window
struct DG_EDGE dg_edge
int deleted_nodenum
Definition: sym_dg.h:78
#define MAX_DASH_PATTERN_LENGTH
Definition: sym_dg_params.h:39
#define MAX_TITLE_LENGTH
Definition: sym_dg_params.h:38
char edgeweight_font[MAX_FONT_LENGTH+1]
Definition: sym_dg.h:46
int tail
Definition: sym_dg.h:67
#define MAX_WEIGHT_LENGTH
Definition: sym_dg_params.h:42
int interactive_mode
Definition: sym_dg.h:41
int nodenum
Definition: sym_dg.h:77
dg_edge * edges
Definition: sym_dg.h:82
char nodeweight_font[MAX_FONT_LENGTH+1]
Definition: sym_dg.h:45
struct BUF_FIFO buf_fifo
char deleted
Definition: sym_dg.h:69
char title[MAX_TITLE_LENGTH+1]
Definition: sym_dg.h:107
int bufwrite
Definition: sym_dg.h:90
int window_displayed
Definition: sym_dg.h:103
struct WINDOW_DESCRIPTION win_desc
int disp_nodeweights
Definition: sym_dg.h:36
char dash[MAX_DASH_PATTERN_LENGTH+1]
Definition: sym_dg.h:60
char node_dash[MAX_DASH_PATTERN_LENGTH+1]
Definition: sym_dg.h:38
dg_node * nodes
Definition: sym_dg.h:79
int bufspace
Definition: sym_dg.h:89
#define MAX_NAME_LENGTH
Definition: sym_dg_params.h:37
int disp_edgeweights
Definition: sym_dg.h:37
char weight[MAX_WEIGHT_LENGTH+1]
Definition: sym_dg.h:70
char waiting_to_die
Definition: sym_dg.h:124
Definition: sym_dg.h:96
char label[MAX_LABEL_LENGTH+1]
Definition: sym_dg.h:57
int wait_for_click
Definition: sym_dg.h:104
buf_fifo buf
Definition: sym_dg.h:102
struct DG_NODE dg_node
char nodelabel_font[MAX_FONT_LENGTH+1]
Definition: sym_dg.h:44
struct DG_GRAPH dg_graph
double scale_factor
Definition: sym_dg.h:43
char * text
Definition: sym_dg.h:115
char deleted
Definition: sym_dg.h:56
Definition: sym_dg.h:65
window ** windows
Definition: sym_dg.h:127
int edgenum
Definition: sym_dg.h:80
int viewable_width
Definition: sym_dg.h:33