1 %======================================================================
2 % Test
function for the MEX file zggev generated from the LAPACKE package.
4 % Copyright (C) 2009-2015 Peter Rakyta, Ph.D.
6 % This program is free software: you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation, either version 3 of the License, or
9 % (at your option) any later version.
11 % This program is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 % GNU General Public License
for more details.
16 % You should have received a copy of the GNU General Public License
17 % along with
this program. If not, see http:
22 A = rand(dim) + 1i*rand(dim);
23 B = rand(dim) + 1i*rand(dim);
26 filename = mfilename(
'fullpath');
27 [directory, fncname] = fileparts( filename );
28 fncname = fncname(1:end-length(
'_test'));
29 filename = fullfile( directory, [fncname,
'.', mexext] );
32 % Call the newly compiled
function.
34 [ALPHA,BETA,lvec,rvec] = feval(fncname, A, B);
36 warning([fncname,
' failed to run. Deleting the compiled MEX file.']);
38 disp( err.identifier )
44 %
test the calculated eigenvalues
45 eig_values = eig(A,B);
47 error_num = norm( sort(eig_values) - sort((ALPHA)./BETA) );
49 display('***************************************************************************')
50 disp(['Test of ', fncname, ' passed.'])
52 warning(['Test of ', fncname, ' failed with an error ', num2str(error_num), '. Deleting the compiled MEX file.'])
function test(arg1, arg2)
Brief description of the function.