powered by
Find independent blocks of equations.
block_index(A, eps = 1e-08)
A list containing numeric vectors, each vector indexing an independent block of rows in the system Ax <= b.
list
numeric
Ax <= b
[numeric] Matrix
[numeric]
[numeric] Coefficients with absolute value < eps are treated as zero.
< eps
A <- matrix(c( 1,0,2,0,0, 3,0,4,0,0, 0,5,0,6,7, 0,8,0,0,9 ),byrow=TRUE,nrow=4) b <- rep(0,4) bi <- block_index(A) lapply(bi,function(ii) compact(A[ii,,drop=FALSE],b=b[ii])$A)
Run the code above in your browser using DataLab