eliminate {lintools} | R Documentation |
Eliminate a variable from a set of edit rules
Description
Eliminating a variable amounts to deriving all (non-redundant) linear (in)equations not containing that variable. Geometrically, it can be interpreted as a projection of the solution space (vectors satisfying all equations) along the eliminated variable's axis.
Usage
eliminate(
A,
b,
neq = nrow(A),
nleq = 0,
variable,
H = NULL,
h = 0,
eps = 1e-08
)
Arguments
A |
|
b |
|
neq |
[ |
nleq |
[ |
variable |
|
H |
|
h |
|
eps |
|
Value
A list
with the folowing components
A
: theA
corresponding to the system with variables eliminated.b
: the constant vector corresponding to the resulting systemneq
: the number of equationsH
: The memory matrix storing how each row was derivedh
: The number of variables eliminated from the original system.
Details
For equalities Gaussian elimination is applied. If inequalities are involved,
Fourier-Motzkin elimination is used. In principle, FM-elimination can
generate a large number of redundant inequations, especially when applied
recursively. Redundancies can be recognized by recording how new inequations
have been derived from the original set. This is stored in the H
matrix
when multiple variables are to be eliminated (Kohler, 1967).
References
D.A. Kohler (1967) Projections of convex polyhedral sets, Operational Research Center Report , ORC 67-29, University of California, Berkely.
H.P. Williams (1986) Fourier's method of linear programming and its dual. American Mathematical Monthly 93, pp 681-695.
Examples
# Example from Williams (1986)
A <- matrix(c(
4, -5, -3, 1,
-1, 1, -1, 0,
1, 1, 2, 0,
-1, 0, 0, 0,
0, -1, 0, 0,
0, 0, -1, 0),byrow=TRUE,nrow=6)
b <- c(0,2,3,0,0,0)
L <- eliminate(A=A, b=b, neq=0, nleq=6, variable=1)