A system of linear (in)equations can be compactified by removing
zero-rows and zero-columns (=variables). Such rows and columns may
arise after substitution (see subst_value) or eliminaton
of a variable (see eliminate).
compact(
A,
b,
x = NULL,
neq = nrow(A),
nleq = 0,
eps = 1e-08,
remove_columns = TRUE,
remove_rows = TRUE,
deduplicate = TRUE,
implied_equations = TRUE
)A list with the following elements.
A: The compactified version of input A
b: The compactified version of input b
x: The compactified version of input x
neq: number of equations in new system
nleq: number of inequations of the form a.x<=b in the new system
cols_removed: [logical] indicates what elements of x (columns of A) have been removed
[numeric] matrix
[numeric] vector
[numeric] vector
[numeric] The first neq rows in A and
b are treated as linear equalities.
[numeric] The nleq rows after neq are treated as
inequations of the form a.x<=b. All remaining rows are treated as strict inequations
of the form a.x<b.
[numeric] Anything with absolute value < eps is considered zero.
[logical] Toggle remove spurious columns from A and variables from x
[logical] Toggle remove spurious rows
[logical] Toggle remove duplicate rows
[logical] replace cases of a.x<=b and a.x>=b with
a.x==b.
It is assumend that the system of equations is in normalized form (see link{normalize}).