Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (19 sloc) 0.449 kb
function y = inverse(A)
%% inverse(A)
%% This function returns the inverse of A.
n = length(A);
IP = zeros(n,1);
info = -1;
calllib('CLAPACK', 'dgetrf_', n,n,A,n,IP,info);
if info != 0
error("problem occurred during factorizarion!");
end
info = -1;
lwork = n * 8;
WORK = zeros(lwork, 1);
calllib('CLAPACK', 'dgetri_', n, A, n, IP, WORK, lwork, info);
if info != 0
error("problem occurred during inversion!");
end
y = A;
endfunction
Jump to Line
Something went wrong with that request. Please try again.