R/fn.isSingular.R

## Function which checks whether a square matrix is singular
## __input__
## A   : [kxk matrix]
## tol : [double] tolerance for the determinant (default: 1e25)
## __output__
## [logical] is the matrix singular?
## __20080502__
'fn.isSingular' <- function(A, tol=1e25)
  {
    tmp <- abs(det(A))
    as.logical(tmp>=tol | tmp<=1/tol)
  }
    

Try the AdMit package in your browser

Any scripts or data that you put into this service are public.

AdMit documentation built on Aug. 21, 2026, 5:14 p.m.