From af23d72cb17b1481f707ac1d8f1bc84c721efc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Mon, 19 Nov 2012 17:43:59 +0100 Subject: [PATCH] Allow economy-size decomposition with qr2 routine. --- matlab/qr2.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/qr2.m b/matlab/qr2.m index 95379a5b7..de429f36a 100644 --- a/matlab/qr2.m +++ b/matlab/qr2.m @@ -1,4 +1,4 @@ -function [Q,R] = qr2(X) +function [Q,R] = qr2(varargin) % This routine performs a qr decomposition of matrix X such that the % diagonal scalars of the upper-triangular matrix R are positive. If X % is a full (column) rank matrix, then R is also the cholesky @@ -34,7 +34,7 @@ function [Q,R] = qr2(X) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -[Q,R] = qr(X); +[Q,R] = qr(varargin{:}); indx = find(diag(R)<0); if ~isempty(indx) Q(:,indx) = -Q(:,indx);