From 2c38a1913c6516d05c2bf68d653d6233b20aaae2 Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtanb@gmail.com> Date: Wed, 22 Sep 2010 11:40:13 +0200 Subject: [PATCH] change element-wise OR (|) to short-circuit OR (||) --- matlab/kronecker/A_times_B_kronecker_C.m | 4 ++-- matlab/qz/mjdgges.m | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/matlab/kronecker/A_times_B_kronecker_C.m b/matlab/kronecker/A_times_B_kronecker_C.m index 3d9b99f63..738123684 100644 --- a/matlab/kronecker/A_times_B_kronecker_C.m +++ b/matlab/kronecker/A_times_B_kronecker_C.m @@ -16,7 +16,7 @@ function D = A_times_B_kronecker_C(A,B,C) % SPECIAL REQUIREMENTS % none. -% Copyright (C) 1996-2008 Dynare Team +% Copyright (C) 1996-2010 Dynare Team % % This file is part of Dynare. % @@ -34,7 +34,7 @@ function D = A_times_B_kronecker_C(A,B,C) % along with Dynare. If not, see <http://www.gnu.org/licenses/>. % Chek number of inputs and outputs. -if nargin>3 | nargin<2 +if nargin>3 || nargin<2 error('Two or Three input arguments required!') end if nargout>1 diff --git a/matlab/qz/mjdgges.m b/matlab/qz/mjdgges.m index 3004091de..db231449d 100644 --- a/matlab/qz/mjdgges.m +++ b/matlab/qz/mjdgges.m @@ -21,7 +21,7 @@ function [ss,tt,w,sdim,eigval,info] = mjdgges(e,d,qz_criterium) % SPECIAL REQUIREMENTS % none. -% Copyright (C) 1996-2009 Dynare Team +% Copyright (C) 1996-2010 Dynare Team % % This file is part of Dynare. % @@ -39,7 +39,7 @@ function [ss,tt,w,sdim,eigval,info] = mjdgges(e,d,qz_criterium) % along with Dynare. If not, see <http://www.gnu.org/licenses/>. % Chek number of inputs and outputs. -if nargin>3 | nargin<2 +if nargin>3 || nargin<2 error('Three or two input arguments required!') end if nargout>6 @@ -48,7 +48,7 @@ end % Check the first two inputs. [me,ne] = size(e); [md,nd] = size(d); -if ( ~isreal(e) | ~isreal(d) | me~=ne | md~=nd | me~=nd) +if ( ~isreal(e) || ~isreal(d) || me~=ne || md~=nd || me~=nd) % info should be negative in this case, see dgges.f. error('MJDGGES requires two square real matrices of the same dimension.') end -- GitLab