Skip to content

matrix inverse in C

1 message · FMGCFMGC

#
Hello!

For calculating the Choleski factor, you should look at:

LINPACK: dpofa, dchdc, (dppfa, although i think this one is not 
included with R)

The R code of function chol() is a good starting point. It is located at
%RHOME%/library/base/R/base (line 4115 on the windows version of R 
1.8.1 patched)

LAPACK: dpotrf, dpotf2, dpptrf

For matrix inversion you have:

LAPACK: dgesv, dposv, dsysv for general, positive definite or symmetric 
matrices, respectively.

For instructions on how to use this subroutines, look at the comments 
in the code, available at:

LINPACK: http://www.netlib.org/linpack/
LAPACK:  http://www.netlib.org/lapack/

Good luck!
Francisco

----- Mensaje Original -----
De  "Liaw, Andy" <andy_liaw at merck.com> 
Fecha  Sat, 28 Feb 2004 08:40:41 -0500 
A  "'Kosuke Imai'" <kimai at princeton.edu>, r-help at stat.math.ethz.ch 
Asunto  RE: [R] matrix inverse in C 


In section 5.7 of the `Writing R Extensions' manual, it mentions the
interface to numerical linear algebra routines (LINPACK, etc.).  You 
will
need to figure out which are the ones you need and how to call them.  As
these are expressed as Fortran routines, you can call them from C using 
the
F77_CALL() macro mentioned in that manual.

I believe many would say that routines in Numerical Recipes are not 
really
`industrial strength'...

HTH,
Andy