qr2.m was missing !
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1158 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
bcedf81d59
commit
bc90be074a
|
@ -0,0 +1,11 @@
|
|||
function [Q,R] = qr2(X)
|
||||
% stephane.adjemian@ens.fr [12-07-2005]
|
||||
%
|
||||
% This routine performs a qr decomposition of matrix X such that the
|
||||
% diagonal scalars of the upper-triangular matrix R are positive.
|
||||
[Q,R] = qr(X);
|
||||
indx = find(diag(R)<0);
|
||||
if ~isempty(indx)
|
||||
Q(:,indx) = -Q(:,indx);
|
||||
R(indx,:) = -R(indx,:);
|
||||
end
|
Loading…
Reference in New Issue