/[ascend]/trunk/lp_solve_2.0/debug.c
ViewVC logotype

Annotation of /trunk/lp_solve_2.0/debug.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations) (download) (as text)
Fri Oct 29 20:54:12 2004 UTC (21 years, 1 month ago) by aw0a
File MIME type: text/x-csrc
File size: 1669 byte(s)
Setting up web subdirectory in repository
1 aw0a 1 #include "lpkit.h"
2     #include "lpglob.h"
3     #include <stdarg.h>
4    
5    
6     static void print_indent(void)
7     {
8     int i;
9    
10     fprintf(stderr, "%2d", Level);
11     if(Level < 50) /* useless otherwise */
12     for(i = Level; i > 0; i--)
13     fprintf(stderr, "--");
14     else
15     fprintf(stderr, " *** too deep ***");
16     fprintf(stderr, "> ");
17     } /* print_indent */
18    
19    
20     void debug_print_solution()
21     {
22     int i;
23    
24     if(Lp->debug)
25     for (i = Rows + 1; i <= Sum; i++)
26     {
27     print_indent();
28     if (Lp->names_used)
29     fprintf(stderr, "%-10s%16.5g\n", Lp->col_name[i - Rows],
30     (double)Solution[i]);
31     else
32     fprintf(stderr, "Var[%5d] %16.5g\n", i - Rows,
33     (double)Solution[i]);
34     }
35     } /* debug_print_solution */
36    
37    
38     void debug_print_bounds(REAL *upbo, REAL *lowbo)
39     {
40     int i;
41    
42     if(Lp->debug)
43     for(i = Rows + 1; i <= Sum; i++)
44     {
45     if(lowbo[i] != 0)
46     {
47     print_indent();
48     if (Lp->names_used)
49     fprintf(stderr, "%s > %10.3g\n", Lp->col_name[i - Rows],
50     (double)lowbo[i]);
51     else
52     fprintf(stderr, "Var[%5d] > %10.3g\n", i - Rows,
53     (double)lowbo[i]);
54     }
55     if(upbo[i] != Infinite)
56     {
57     print_indent();
58     if (Lp->names_used)
59     fprintf(stderr, "%s < %10.3g\n", Lp->col_name[i - Rows],
60     (double)upbo[i]);
61     else
62     fprintf(stderr, "Var[%5d] < %10.3g\n", i - Rows,
63     (double)upbo[i]);
64     }
65     }
66     } /* debug_print_bounds */
67    
68    
69     void debug_print(char *format, ...)
70     {
71     va_list ap;
72    
73     if(Lp->debug)
74     {
75     va_start(ap, format);
76     print_indent();
77     vfprintf(stderr, format, ap);
78     fputc('\n', stderr);
79     va_end(ap);
80     }
81     } /* debug_print */
82    

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22