diff --git a/src/@dates/eq.m b/src/@dates/eq.m index 4f5b7f6dec4d18a9f5d24e7d00ca4a1703b9b967..69866795bf30f9fdadb27571142a12162633a9e5 100644 --- a/src/@dates/eq.m +++ b/src/@dates/eq.m @@ -1,24 +1,22 @@ -function C = eq(A,B) % --*-- Unitary tests --*-- +function l = eq(varargin) % --*-- Unitary tests --*-- % Overloads == operator for dates objects. % -% INPUTS -% o A dates object with n or 1 elements. -% o B dates object with n or 1 elements. +% INPUTS +% - o [dates] dates object with n or 1 elements. +% - p [dates] dates object with n or 1 elements. % -% OUTPUTS -% o C column vector of max(n,1) elements (zeros or ones). +% OUTPUTS +% - l [logical] column vector of max(n,1) elements (zeros or ones). -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % -% This file is part of Dynare. -% -% Dynare is free software: you can redistribute it and/or modify +% This code is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % -% Dynare is distributed in the hope that it will be useful, +% Dynare dates submodule is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. @@ -26,27 +24,12 @@ function C = eq(A,B) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -if ~isequal(nargin,2) - error('dates::eq: I need exactly two input arguments!') -end - -if ~isa(A,'dates') || ~isa(B,'dates') - error(['dates::eq: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' have to be a dates objects!']) -end - -if ~isequal(A.freq,B.freq) - C = false; - return -end +[o, p] = comparison_arg_checks(varargin{:}); -if isequal(A.ndat, B.ndat) - C = logical(transpose(all(transpose(eq(A.time,B.time))))); +if isequal(o.ndat, p.ndat) + l = logical(transpose(all(transpose(eq(o.time,p.time))))); else - if isequal(A.ndat,1) || isequal(B.ndat,1) - C = logical(transpose(all(transpose(bsxfun(@eq,A.time,B.time))))); - else - C = false; - end + l = logical(transpose(all(transpose(bsxfun(@eq,o.time,p.time))))); end %@test:1 diff --git a/src/@dates/ge.m b/src/@dates/ge.m index 6593bc1910b38b14186d74449a6ee94015913be1..cf3d289dbea6d02575615e6d25a6949fbf5ac5e5 100644 --- a/src/@dates/ge.m +++ b/src/@dates/ge.m @@ -1,24 +1,22 @@ -function C = ge(A,B) % --*-- Unitary tests --*-- +function l = ge(varargin) % --*-- Unitary tests --*-- % Overloads the >= operator for dates objects. % % INPUTS -% o A dates object with n or 1 elements. -% o B dates object with n or 1 elements. +% - o [dates] dates object with n or 1 elements. +% - p [dates] dates object with n or 1 elements. % % OUTPUTS -% o C column vector of max(n,1) elements (zeros or ones). +% - l [logical] column vector of max(n,1) elements (zeros or ones). -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % -% This file is part of Dynare. -% -% Dynare is free software: you can redistribute it and/or modify +% This code is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % -% Dynare is distributed in the hope that it will be useful, +% Dynare dates submodule is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. @@ -26,57 +24,27 @@ function C = ge(A,B) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -if ~isequal(nargin,2) - error('dates::ge: I need exactly two input arguments!') -end - -if ~isa(A,'dates') || ~isa(B,'dates') - error(['dates::ge: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' have to be a dates objects!']) -end +[o, p] = comparison_arg_checks(varargin{:}); -if ~isequal(A.freq,B.freq) - C = false; - return -end - -if isequal(A.ndat, B.ndat) - C = (A==B); - idx = find(C==0); +if isequal(o.ndat, p.ndat) + l = (o==p); + idx = find(l==false); for i=1:length(idx) - C(idx(i)) = greaterorequal(A.time(idx(i),:), B.time(idx(i),:)); + l(idx(i)) = greaterorequal(o.time(idx(i),:), p.time(idx(i),:)); end else - if isequal(A.ndat,1) - C = false(B.ndat,1); - for i=1:B.ndat - C(i) = greaterorequal(A.time, B.time(i,:)); - end - elseif isequal(B.ndat,1) - C = false(A.ndat,1); - for i=1:A.ndat - C(i) = greaterorequal(A.time(i,:), B.time); + if isequal(o.ndat,1) + l = false(p.ndat,1); + for i=1:p.ndat + l(i) = greaterorequal(o.time, p.time(i,:)); end else - C = false; - end -end - - -function c = greaterorequal(a,b) - if a(1)>b(1) - c = true; - else - if a(1)<b(1) - c = false; - else - if a(2)>=b(2) - c = true; - else - c = false; - end + l = false(o.ndat,1); + for i=1:o.ndat + l(i) = greaterorequal(o.time(i,:), p.time); end end - +end %@test:1 %$ % Define some dates diff --git a/src/@dates/gt.m b/src/@dates/gt.m index fbf36fbf369cfc3a160ab49cb3a7b5c261c52e82..36d553ef436479ae77a85ecd67b5e52f7d33bf78 100644 --- a/src/@dates/gt.m +++ b/src/@dates/gt.m @@ -1,24 +1,22 @@ -function C = gt(A,B) % --*-- Unitary tests --*-- +function l = gt(varargin) % --*-- Unitary tests --*-- % Overloads the > operator for dates objects. % -% INPUTS -% o A dates object with n or 1 elements. -% o B dates object with n or 1 elements. +% INPUTS +% - o [dates] dates object with n or 1 elements. +% - p [dates] dates object with n or 1 elements. % -% OUTPUTS -% o C column vector of max(n,1) elements (zeros or ones). +% OUTPUTS +% - l [logical] column vector of max(n,1) elements (zeros or ones). -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % -% This file is part of Dynare. -% -% Dynare is free software: you can redistribute it and/or modify +% This code is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % -% Dynare is distributed in the hope that it will be useful, +% Dynare dates submodule is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. @@ -26,55 +24,26 @@ function C = gt(A,B) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -if ~isequal(nargin,2) - error('dates::gt: I need exactly two input arguments!') -end - -if ~isa(A,'dates') || ~isa(B,'dates') - error(['dates::gt: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' have to be a dates objects!']) -end +[o, p] = comparison_arg_checks(varargin{:}); -if ~isequal(A.freq,B.freq) - C = false; - return -end - -if isequal(A.ndat, B.ndat) - C = false(A.ndat,1); - for i=1:A.ndat - C(i) = greaterthan(A.time(i,:), B.time(i,:)); +if isequal(o.ndat, p.ndat) + l = false(o.ndat,1); + for i=1:o.ndat + l(i) = greaterthan(o.time(i,:), p.time(i,:)); end else - if isequal(A.ndat,1) - C = false(B.ndat,1); - for i=1:B.ndat - C(i) = greaterthan(A.time, B.time(i,:)); - end - elseif isequal(B.ndat,1) - C = false(A.ndat,1); - for i=1:A.ndat - C(i) = greaterthan(A.time(i,:), B.time); + if isequal(o.ndat,1) + l = false(p.ndat,1); + for i=1:p.ndat + l(i) = greaterthan(o.time, p.time(i,:)); end else - C = false; - end -end - - -function c = greaterthan(a,b) - if a(1)>b(1) - c = true; - else - if a(1)<b(1) - c = false; - else - if a(2)>b(2) - c = true; - else - c = false; - end + l = false(o.ndat,1); + for i=1:o.ndat + l(i) = greaterthan(o.time(i,:), p.time); end end +end %@test:1 %$ % Define some dates diff --git a/src/@dates/le.m b/src/@dates/le.m index 031f424597c358dce0e10b5a45276eae879b321a..4d18b0b991bff6e234706c998e1a4f043444cc9c 100644 --- a/src/@dates/le.m +++ b/src/@dates/le.m @@ -1,24 +1,22 @@ -function C = le(A,B) % --*-- Unitary tests --*-- +function l = le(varargin) % --*-- Unitary tests --*-- % Overloads the <= operator for dates objects. % % INPUTS -% o A dates object with n or 1 elements. -% o B dates object with n or 1 elements. +% - o [dates] dates object with n or 1 elements. +% - p [dates] dates object with n or 1 elements. % % OUTPUTS -% o C column vector of max(n,1) elements (zeros or ones). +% - l [logical] column vector of max(n,1) elements (zeros or ones). -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % -% This file is part of Dynare. -% -% Dynare is free software: you can redistribute it and/or modify +% This code is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % -% Dynare is distributed in the hope that it will be useful, +% Dynare dates submodule is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. @@ -26,57 +24,27 @@ function C = le(A,B) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -if ~isequal(nargin,2) - error('dates::le: I need exactly two input arguments!') -end - -if ~isa(A,'dates') || ~isa(B,'dates') - error(['dates::le: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' have to be a dates objects!']) -end +[o, p] = comparison_arg_checks(varargin{:}); -if ~isequal(A.freq,B.freq) - C = false; - return -end - -if isequal(A.ndat, B.ndat) - C = (A==B); - idx = find(C==0); +if isequal(o.ndat, p.ndat) + l = (o==p); + idx = find(l==0); for i=1:length(idx) - C(idx(i)) = lessorequal(A.time(idx(i),:), B.time(idx(i),:)); + l(idx(i)) = lessorequal(o.time(idx(i),:), p.time(idx(i),:)); end else - if isequal(A.ndat,1) - C = false(B.ndat,1); - for i=1:B.ndat - C(i) = lessorequal(A.time, B.time(i,:)); - end - elseif isequal(B.ndat,1) - C = false(A.ndat,1); - for i=1:A.ndat - C(i) = lessorequal(A.time(i,:), B.time); + if isequal(o.ndat,1) + l = false(p.ndat,1); + for i=1:p.ndat + l(i) = lessorequal(o.time, p.time(i,:)); end else - C = false; - end -end - - -function c = lessorequal(a, b) - if a(1)<b(1) - c = true; - else - if a(1)>b(1) - c = false; - else - if a(2)<=b(2) - c = true; - else - c = false; - end + l = false(o.ndat,1); + for i=1:o.ndat + l(i) = lessorequal(o.time(i,:), p.time); end end - +end %@test:1 %$ % Define some dates diff --git a/src/@dates/lt.m b/src/@dates/lt.m index 86097a6f5a35a1a7325a38504c59b3a50ad6fb39..10b12bcbe40c8f3c155b509d867cd32c70736a7b 100644 --- a/src/@dates/lt.m +++ b/src/@dates/lt.m @@ -1,24 +1,22 @@ -function C = lt(A,B) % --*-- Unitary tests --*-- +function l = lt(varargin) % --*-- Unitary tests --*-- % Overloads the < operator for dates objects. % % INPUTS -% o A dates object with n or 1 elements. -% o B dates object with n or 1 elements. +% - o [dates] dates object with n or 1 elements. +% - p [dates] dates object with n or 1 elements. % % OUTPUTS -% o C column vector of max(n,1) elements (zeros or ones). +% - l [logical] column vector of max(n,1) elements (zeros or ones). -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % -% This file is part of Dynare. -% -% Dynare is free software: you can redistribute it and/or modify +% This code is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % -% Dynare is distributed in the hope that it will be useful, +% Dynare dates submodule is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. @@ -26,54 +24,26 @@ function C = lt(A,B) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -if ~isequal(nargin,2) - error('dates::lt: I need exactly two input arguments!') -end - -if ~isa(A,'dates') || ~isa(B,'dates') - error(['dates::lt: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' have to be a dates objects!']) -end - -if ~isequal(A.freq,B.freq) - C = false; - return -end +[o, p] = comparison_arg_checks(varargin{:}); -if isequal(A.ndat, B.ndat) - C = false(A.ndat,1); - for i=1:A.ndat - C(i) = lessthan(A.time(i,:),B.time(i,:)); +if isequal(o.ndat, p.ndat) + l = false(o.ndat,1); + for i=1:o.ndat + l(i) = lessthan(o.time(i,:),p.time(i,:)); end else - if isequal(A.ndat,1) - C = false(B.ndat,1); - for i=1:B.ndat - C(i) = lessthan(A.time,B.time(i,:)); + if isequal(o.ndat,1) + l = false(p.ndat,1); + for i=1:p.ndat + l(i) = lessthan(o.time,p.time(i,:)); end - elseif isequal(B.ndat,1) - C = false(A.ndat,1); - for i=1:A.ndat - C(i) = lessthan(A.time(i,:),B.time); - end - else - C = false; - end -end - -function c = lessthan(a,b) - if a(1)<b(1) - c = true; else - if a(1)>b(1) - c = false; - else - if a(2)<b(2) - c = true; - else - c = false; - end + l = false(o.ndat,1); + for i=1:o.ndat + l(i) = lessthan(o.time(i,:),p.time); end end +end %@test:1 %$ % Define some dates @@ -119,4 +89,4 @@ function c = lessthan(a,b) %$ t(5) = dassert(dates(B5)<dd,false(4,1)); %$ t(6) = dassert(dates(B1)<dd,[false; true(3,1)]); %$ T = all(t); -%@eof:2 +%@eof:2 \ No newline at end of file diff --git a/src/@dates/ne.m b/src/@dates/ne.m index 0fdf4f8c9152d48f9eda598854b4f41d48bd542b..b8e2a6800e87d86d55ce052e292d62ac57aec335 100644 --- a/src/@dates/ne.m +++ b/src/@dates/ne.m @@ -1,24 +1,22 @@ -function C = ne(A,B) % --*-- Unitary tests --*-- +function l = ne(varargin) % --*-- Unitary tests --*-- % Overloads ~= operator for dates objects. % -% INPUTS -% o A dates object with n or 1 elements. -% o B dates object with n or 1 elements. +% INPUTS +% - o [dates] dates object with n or 1 elements. +% - p [dates] dates object with n or 1 elements. % -% OUTPUTS -% o C column vector of max(n,1) elements (zeros or ones). +% OUTPUTS +% - l [logical] column vector of max(n,1) elements (zeros or ones). -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % -% This file is part of Dynare. -% -% Dynare is free software: you can redistribute it and/or modify +% This code is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % -% Dynare is distributed in the hope that it will be useful, +% Dynare dates submodule is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. @@ -26,27 +24,12 @@ function C = ne(A,B) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -if ~isequal(nargin,2) - error('dates::ne: I need exactly two input arguments!') -end - -if ~isdates(A) || ~isdates(B) - error(['dates::ne: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' have to be dates objects!']) -end - -if ~isequal(A.freq,B.freq) - C = false; - return -end +[o, p] = comparison_arg_checks(varargin{:}); -if isequal(A.ndat, B.ndat) - C = logical(transpose(any(transpose(ne(A.time,B.time))))); +if isequal(o.ndat, p.ndat) + l = logical(transpose(any(transpose(ne(o.time,p.time))))); else - if isequal(A.ndat,1) || isequal(B.ndat,1) - C = logical(transpose(any(transpose(bsxfun(@ne,A.time,B.time))))); - else - C = false; - end + l = logical(transpose(any(transpose(bsxfun(@ne,o.time,p.time))))); end %@test:1 diff --git a/src/@dates/private/comparison_arg_checks.m b/src/@dates/private/comparison_arg_checks.m new file mode 100644 index 0000000000000000000000000000000000000000..ee86ff097ffbeb52c1553c1d574b383affe37faf --- /dev/null +++ b/src/@dates/private/comparison_arg_checks.m @@ -0,0 +1,44 @@ +function [o, p] = comparison_arg_checks(varargin) + +% Returns two dates objects or an error if objects to be compared are not compatible. +% +% INPUTS +% - varargin +% +% OUTPUTS +% - o [dates] dates object with n or 1 elements. +% - p [dates] dates object with n or 1 elements. + +% Copyright (C) 2014 Dynare Team +% +% This code is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare dates submodule is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. + +if ~isequal(nargin,2) + error('dates:ge:ArgCheck','I need exactly two input arguments!') +end + +if ~isa(varargin{1},'dates') || ~isa(varargin{2},'dates') + error('dates:ge:ArgCheck','Input arguments have to be dates objects!') +end + +if ~isequal(varargin{1}.freq,varargin{2}.freq) + error('dates:ge:ArgCheck','Input arguments must have common frequency!') +end + +if ~isequal(varargin{1}.ndat, varargin{2}.ndat) && ~(isequal(varargin{1}.ndat,1) || isequal(varargin{2}.ndat,1)) + error('dates:ge:ArgCheck','Dimensions are not consistent!') +end + +o = varargin{1}; +p = varargin{2}; \ No newline at end of file diff --git a/src/@dates/private/greaterorequal.m b/src/@dates/private/greaterorequal.m new file mode 100644 index 0000000000000000000000000000000000000000..00d35982b1822115a7d7dc8439ad993017721bd4 --- /dev/null +++ b/src/@dates/private/greaterorequal.m @@ -0,0 +1,30 @@ +function c = greaterorequal(a,b) + +% Copyright (C) 2013-2014 Dynare Team +% +% This code is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare dates submodule is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. + +if a(1)>b(1) + c = true; +else + if a(1)<b(1) + c = false; + else + if a(2)>=b(2) + c = true; + else + c = false; + end + end +end \ No newline at end of file diff --git a/src/@dates/private/greaterthan.m b/src/@dates/private/greaterthan.m new file mode 100644 index 0000000000000000000000000000000000000000..ae0b4173ec7776d7bd72159c742ac5c99b501a9e --- /dev/null +++ b/src/@dates/private/greaterthan.m @@ -0,0 +1,30 @@ +function c = greaterthan(a,b) + +% Copyright (C) 2013-2014 Dynare Team +% +% This code is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare dates submodule is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. + +if a(1)>b(1) + c = true; +else + if a(1)<b(1) + c = false; + else + if a(2)>b(2) + c = true; + else + c = false; + end + end +end \ No newline at end of file diff --git a/src/@dates/private/lessorequal.m b/src/@dates/private/lessorequal.m new file mode 100644 index 0000000000000000000000000000000000000000..7f85bb95ad15ef65151a1d69e444f9f4722c8aab --- /dev/null +++ b/src/@dates/private/lessorequal.m @@ -0,0 +1,30 @@ +function c = lessorequal(a, b) + +% Copyright (C) 2013-2014 Dynare Team +% +% This code is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare dates submodule is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. + +if a(1)<b(1) + c = true; +else + if a(1)>b(1) + c = false; + else + if a(2)<=b(2) + c = true; + else + c = false; + end + end +end \ No newline at end of file diff --git a/src/@dates/private/lessthan.m b/src/@dates/private/lessthan.m new file mode 100644 index 0000000000000000000000000000000000000000..549199efc718c9c4b8d416da35d9cd5efca11bab --- /dev/null +++ b/src/@dates/private/lessthan.m @@ -0,0 +1,30 @@ +function c = lessthan(a,b) + +% Copyright (C) 2013-2014 Dynare Team +% +% This code is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare dates submodule is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. + +if a(1)<b(1) + c = true; +else + if a(1)>b(1) + c = false; + else + if a(2)<b(2) + c = true; + else + c = false; + end + end +end