Commit cab8941c authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

qzcomplex and ordschur oct-files:

- added embedded tests
- minor cosmetic changes
parent 2239d9f1
......@@ -97,7 +97,7 @@ eigenvalues as they appear along @math{T}'s diagonal.\n\
if (info != 0)
{
error("qzcomplex: zgges failed");
error("ordschur: dtrsen failed");
return retval;
}
......@@ -105,3 +105,13 @@ eigenvalues as they appear along @math{T}'s diagonal.\n\
retval(1) = octave_value(T);
return retval;
}
/*
%!test
%! A = [1 2 3 -2; 4 5 6 -5 ; 7 8 9 -5; 10 11 12 4 ];
%! [U, T] = schur(A);
%! [US, TS] = ordschur(U, T, [ 0 0 1 1 ]);
%! assert(US*TS*US', A, sqrt(eps))
*/
......@@ -51,14 +51,9 @@ Computes the complex QZ decomposition of @math{(A, B)}, satisfying:\n\
int nargin = args.length();
octave_value_list retval;
if (nargin != 2)
if (nargin != 2 || nargout != 4)
{
error("qzcomplex: needs two input arguments");
return retval;
}
if (nargout != 4)
{
error("qzcomplex: needs four output arguments");
print_usage();
return retval;
}
......@@ -102,3 +97,14 @@ Computes the complex QZ decomposition of @math{(A, B)}, satisfying:\n\
retval(3) = octave_value(vsr);
return retval;
}
/*
%!test
%! A = [ 1 2 3+1i; 4 5-1i 0; -1 -5 3];
%! B = [ -2 -8i 4; 1 5+3i 5; 7 -10 -2];
%! [AA,BB,Q,Z] = qzcomplex(A,B);
%! assert(Q'*A*Z, AA, sqrt(eps))
%! assert(Q'*B*Z, BB, sqrt(eps))
*/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment