Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
cab8941c
Commit
cab8941c
authored
Oct 21, 2010
by
Sébastien Villemot
Browse files
qzcomplex and ordschur oct-files:
- added embedded tests - minor cosmetic changes
parent
2239d9f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
mex/sources/ordschur/ordschur.cc
View file @
cab8941c
...
...
@@ -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))
*/
mex/sources/qzcomplex/qzcomplex.cc
View file @
cab8941c
...
...
@@ -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))
*/
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment