Skip to content

Commit 607673e

Browse files
committed
v0.7.1a
1 parent d8b723a commit 607673e

File tree

170 files changed

+6537
-1992
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+6537
-1992
lines changed

2nash.c

100644100755
File mode changed.

COPYING

100644100755
File mode changed.

README

100644100755
Lines changed: 140 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,147 @@ Documentation is currently being maintained at the URL:
44

55
http://cgm.cs.mcgill.ca/~avis/C/lrs.html
66
-----------------------------------------------------------------------------
7+
8+
Version 7.1
9+
manual: http://cgm.cs.mcgill.ca/~avis/C/lrslib/USERGUIDE71.html
10+
11+
2020.10.17
12+
13+
Memory leak in countonly option fixed for mplrs/lrs.
14+
15+
2020.5.25
16+
Version 7.1 is a major revision completing the move to an all C library begun
17+
in 7.0 which was work in progress and has been removed from distribution.
18+
19+
Major changes to lrs:
20+
1. redund function is now performed by lrs via options, but legacy redund maintained
21+
2. extract option to extract columns from the input especially with linearities
22+
3. hvref makes a cross reference list between H and V representations
23+
24+
Major changes to mplrs:
25+
1. Temporary files no longer used for communicating with workers.
26+
2. Parallel version of redund is now available
27+
28+
Thanks to David Bremner and Jerry James for advice, patches and other help!
29+
30+
Details below
31+
32+
2020.5.19
33+
34+
redund binaries are no longer produced and lrs does redund
35+
functioning via the redund option. For a standard redund run (ie all lines checked)
36+
set up a link:
37+
%ln -s lrs redund and if needed %ln -s lrs1 redund1 etc. for single arithmetic
38+
Now no options are needed and
39+
40+
% redund filename
41+
42+
will remove all redundant inequalities
43+
44+
In mplrs this can be achieved by:
45+
46+
% mpirun -np <procs> mplrs -redund filename
47+
48+
2020.4.27
49+
50+
Changes in mplrs relative to 7.0:
51+
1. All C++ code removed or rewritten in C; C++ compiler no longer required.
52+
2. mplrs uses the new lrslib API (2019.11.8) instead of temporary files for
53+
parallel jobs.
54+
3. Support for parallel redund runs using the redund option in input files.
55+
4. Compiler warnings removed.
56+
5. Additional warning and informational messages printed when relevant.
57+
6. New option -redund, for redund runs without adding option to file.
58+
7. Avoid duplicate output lines that were possible on an overflow in
59+
hybrid mode.
60+
8. Fix a rare bug that could omit output lines at the start of a run.
61+
62+
2020.2.5
63+
The extract option is a preprocessing step to remove linearities (if any) and resize
64+
the A matrix using standard lrs processing, which is output as a valid lrs input file.
65+
The resulting file will not contain any equations but may not be full dimensional.
66+
Options in the input file are stripped.
67+
User can specify the cols to retain (where this possible by linear independence).
68+
If there are no linearities in the input file the columns in the option are retained
69+
and the other ones are deleted. This is useful for projecting a V-representation.
70+
71+
extract 0
72+
73+
retains columns in order 1,2,...,n
74+
75+
extract k i1 .. ik
76+
77+
retains columns in order i1,...,ik then the missing 1..n as necessary
78+
Column 0 is always retained.
79+
80+
Use redund to remove redundancies from the output as necessary.
81+
A full lrs run is not performed, however output can be piped:
82+
83+
% lrs file | redund | lrs
84+
85+
2019.12.30
86+
87+
hvref makes a cross reference list between H and V reps
88+
Usage (same for ext file):
89+
90+
Add printcobasis and incidence options to cube.ine
91+
92+
% lrs cube.ine cube.ext
93+
% xref cube.ext
94+
95+
Edit the output file cube.ext.x so that the second line contains two integers
96+
97+
rows maxindex
98+
99+
where rows >= # output lines in cube.ext.x
100+
maxindex >= # input lines in cube.ine
101+
102+
or just use 0 0 and the program will tell you which values to use
103+
104+
% hvref cube.ext.x
105+
106+
107+
2019.11.8
108+
109+
New redund option causes lrs to perform redund function:
110+
111+
redund start end
112+
113+
limits redundancy checking to input rows numbered start,...,end.
114+
Defaults start=1 and end=m is legacy redund and can be obtained by
115+
116+
redund 0 0
117+
118+
lrs_main has been rewritten as lrsv2_main to avoid temporary files in mplrs.
119+
It now passes pointers to P and Q back to mplrs and is called 3 times
120+
according to the stage flag.
121+
122+
stage=0 performs problem setup and reads the input file
123+
stage=1 performs reverse search or redund function
124+
stage=2 performs clean up and closes files
125+
126+
2019.6.13
127+
128+
If lrs is compiled with -DLRS_QUIET lrs produces an ouput file with only the data
129+
between the begin and end lines, ie. a matrix of the V or H representation.
130+
The only exception is if the input is a V-rep and output has linearities
131+
in which case line one has the linearity information
132+
133+
--------------------------------------------------------------------------------------
134+
2019.1.5
135+
Various pivot rules are implemented for solving LPs using variations of the lponly option.
136+
To get pivot counts correct it is best to use lrsgmp at least for now
137+
138+
lponly default, currently Dantzig's rule
139+
lponly_b Bland's rule, which is used for vertex enumeration
140+
lponly_d Dantzig's rule, the only rule used up to Version 7.1
141+
lponly_r random edge rule
142+
lponly_rd alernates random edege and Dantzig
143+
144+
-----------------------------------------------------------------------------
145+
7146
2018.7.1
8-
Version 7.0 (Beta release) (lrslib-070)
147+
Version 7.0 (lrslib-070)
9148

10149
User's guide: http://cgm.cs.mcgill.ca/~avis/C/lrslib/USERGUIDE70.html
11150

buffer.c

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
2+
/* buffer.c Reads standard input and builds a circular buffer of maxbuffer lines */
3+
/* input line should have max length maxline and is printed only if it is not in the buffer */
4+
/* calling arguments: maxline maxbuffer */
5+
/* defaults: 50000 500 */
6+
#include <stdio.h>
7+
#include <string.h>
8+
#include <stdlib.h>
9+
#define MAXBUFFER 5000 /*max number of lines in buffer */
10+
char *line;
11+
12+
int maxline;
13+
int Getline(void);
14+
void notimpl(char s[]);
15+
16+
int
17+
main(int argc, char *argv[])
18+
{
19+
extern int maxline;
20+
extern char *line;
21+
int i;
22+
int bufsize;
23+
int next;
24+
int count, counton;
25+
char *c;
26+
char *buffer [MAXBUFFER];
27+
int maxbuffer=500;
28+
void *calloc();
29+
30+
maxline=50000;
31+
/* allocate space for buffer */
32+
if (argc >= 2 ) maxline=atoi(argv[1])+2; /* allow for \n and \0 */
33+
if (maxline <= 2 ) notimpl("line length must be greater than zero");
34+
if (argc >= 3 ) maxbuffer=atoi(argv[2]);
35+
if (maxbuffer <= 0 ) notimpl("buffer length must be greater than zero");
36+
for(i=0;i<maxbuffer;i++) buffer[i]=calloc(maxline,sizeof(char));
37+
line=calloc(maxline,sizeof(char));
38+
39+
next= -1; /*next location to write in buffer*/
40+
bufsize= -1; /*upper index of buffer size*/
41+
count=-1; /* count lines output "begin" before "end" minus 1*/
42+
counton=0;
43+
while ( Getline() > 0 )
44+
{
45+
i=0;
46+
if(strncmp(line,"end",3)==0) counton=0;
47+
while ( i <= bufsize && (strcmp(line,buffer[i])) != 0 )
48+
i++;
49+
if ( i > bufsize ) /* write out line and put in buffer */
50+
{
51+
next++;
52+
if ( next > maxbuffer-1 ) next=0;
53+
if ( bufsize < maxbuffer-1 ) bufsize++;
54+
c=strcpy(buffer[next],line);
55+
printf("%s",line);
56+
if(counton)count++;
57+
}
58+
if(strncmp(line,"begin",5)==0) counton=1;
59+
}
60+
printf("\n*Number of output lines between begin/end = %d",count);
61+
if(count > maxbuffer )
62+
printf("\n*Buffer size of %d lines exceeded-some duplicates may remain",maxbuffer);
63+
else
64+
printf("\n*All duplicates removed");
65+
66+
printf("\n");
67+
return 0;
68+
}
69+
70+
/* getline from KR P.32 */
71+
int Getline(void)
72+
{
73+
int c,i;
74+
extern int maxline;
75+
extern char *line;
76+
77+
for (i=0;i<maxline-1
78+
&& (c=getchar()) != EOF && c != '\n'; ++i)
79+
line[i]=c;
80+
81+
if (i == maxline-1 ) {
82+
fprintf(stderr,"\n%s ",line);
83+
fprintf(stderr,"\nmaximum line length = %d ",maxline-2);
84+
notimpl("maximum line length exceded");
85+
}
86+
if (c == '\n' ) {
87+
line[i]=c;
88+
++i;
89+
}
90+
line[i]= '\0';
91+
return i;
92+
}
93+
void notimpl( char s[])
94+
{fprintf(stderr,"\n%s\n",s);
95+
exit(1);
96+
}

c30-15.ext

100644100755
-38 Bytes
Binary file not shown.

chdemo.c

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <stdio.h>
88
#include <string.h>
9+
#include "lrsdriver.h"
910
#include "lrslib.h"
1011

1112
#define MAXCOL 1000 /* maximum number of colums */

cube.ext

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
cube.ext
1+
cube
22
V-representation
33
begin
44
8 4 rational
55
1 1 1 1
66
1 -1 1 1
7-
1 1 -1 1
8-
1 -1 -1 1
97
1 1 1 -1
108
1 -1 1 -1
119
1 1 -1 -1
1210
1 -1 -1 -1
11+
1 1 -1 1
12+
1 -1 -1 1
1313
end

cube.ine

100644100755
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
cube.ine
1+
cube
22
H-representation
3-
linearity 1 1
43
begin
54
6 4 rational
65
1 1 0 0

ext/metric/cp4.ext

100644100755
File mode changed.

ext/metric/cp5.ext

100644100755
File mode changed.

0 commit comments

Comments
 (0)