eliminate | R Documentation |
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.
eliminate( A, b, neq = nrow(A), nleq = 0, variable, H = NULL, h = 0, eps = 1e-08 )
A |
|
b |
|
neq |
[ |
nleq |
[ |
variable |
|
H |
|
h |
|
eps |
|
A list
with the folowing components
A
: the A
corresponding to the system with variables eliminated.
b
: the constant vector corresponding to the resulting system
neq
: the number of equations
H
: The memory matrix storing how each row was derived
h
: The number of variables eliminated from the original system.
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).
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.