Code covered by the BSD License  

Highlights from
Universal MEX wrapper

Universal MEX wrapper

by

 

Call any function in a shared library from Matlab (with some limits on the function signature).

lu_test.m
%Tests the basic l-u factorization with partial pivoting.  

%dl_load(0) doesn't lead memory, so don't worry about how many times we call it.
dl_load(0);
n = 1000
A = rand(n);
B = rand(n,1);
intT = 'int64';
tic
[M N A2 LDA IPIV INFO] = dl_exec('dgetrf_', cast(n,intT),...
cast(n,intT), A, cast(n,intT), cast(zeros(n,1), intT), ...
cast(0,intT)); 
toc
tic
[L U P]  = lu(A);
toc
temp = U+tril(L,-1);
norm(A2-temp,1)

Contact us