Apple doesn't document LAPACK code at all, I think, because they just implement the standard interface from netlib.org . Itβs a shame that you cannot look for these function names from the built-in Xcode documents, however the solution is pretty straightforward: just provide the function name in the URL, for example. for dgetrf_() go to http://www.netlib.org/clapack/what/double/dgetrf.c .
To invert the matrix, two LAPACK functions are needed: dgetrf_() , which performs LU factorization, and dgetri_() , which displays the result of the previous function and performs the actual inversion.
I created a standard application project using Xcode, added the Accelerate Framework, created two C files: matinv.h, matinv.c, and edited the main.m file to remove Cocoa stuff:
// main.m
Now the header file,
// matinv.h int matrix_invert(int N, double *matrix);
and then the source file,
int matrix_invert(int N, double *matrix) { int error=0; int *pivot = malloc(N*sizeof(int));
Daniel farrell
source share