Universal MEX wrapper
19 Mar 2012
Call any function in a shared library from Matlab (with some limits on the function signature).
%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.
n = 1000
A = rand(n);
B = rand(n,1);
intT = 'int64';
[M N A2 LDA IPIV INFO] = dl_exec('dgetrf_', cast(n,intT),...
cast(n,intT), A, cast(n,intT), cast(zeros(n,1), intT), ...
[L U P] = lu(A);
temp = U+tril(L,-1);