Learn R Programming

lintools (version 0.1.7)

block_index: Find independent blocks of equations.

Description

Find independent blocks of equations.

Usage

block_index(A, eps = 1e-08)

Value

A list containing numeric vectors, each vector indexing an independent block of rows in the system Ax <= b.

Arguments

A

[numeric] Matrix

eps

[numeric] Coefficients with absolute value < eps are treated as zero.

Examples

Run this code

 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