R/Ainv.R

Defines functions Ainv

Documented in Ainv

Ainv <-
function(GAB, x, tol=1e-12 )
  {
    ###  need something to make up for the lame-o
    ##   matlab code that does this h = G\x to get the inverse
    if(missing(tol)) tol = .Machine$double.eps
#    gsvd=svd(GAB,LINPACK=FALSE)
#    desolve=(gsvd$v%*%(diag(1/gsvd$d))%*%t(gsvd$u))%*%x
#    desolve = solve(t(GAB)%*%GAB ,  t(GAB) %*% x , tol=defaulttol)  
 ###    qg=base::qr(GAB,tol=defaulttol,LAPACK=TRUE)

    desolve= qr.solve(GAB, x, tol = tol)

    
    ### desolve=solve(qg,x)
    
    return(desolve)   
  }

Try the PEIP package in your browser

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

PEIP documentation built on Jan. 20, 2018, 9:03 a.m.