Rewrote @dynDates::eq method so that it handles correctly objects with only one element.
parent
74d7bcbc71
commit
21fa2b949d
|
@ -41,7 +41,7 @@ function C = eq(A,B) % --*-- Unitary tests --*--
|
||||||
% You should have received a copy of the GNU General Public License
|
% You should have received a copy of the GNU General Public License
|
||||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if nargin~=2
|
if ~isequal(nargin,2)
|
||||||
error('dynDates::eq: I need exactly two input arguments!')
|
error('dynDates::eq: I need exactly two input arguments!')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -54,13 +54,16 @@ if ~isequal(A.freq,B.freq)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if ~isequal(A.ndat,B.ndat)
|
if isequal(A.ndat, B.ndat)
|
||||||
C = 0;
|
C = isequal(A.time, B.time);
|
||||||
return
|
else
|
||||||
|
if isequal(A.ndat,1) || isequal(B.ndat,1)
|
||||||
|
C = transpose(all(transpose(bsxfun(@eq,A.time,B.time))));
|
||||||
|
else
|
||||||
|
C = 0;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
C = isequal(A.time,B.time);
|
|
||||||
|
|
||||||
%@test:1
|
%@test:1
|
||||||
%$ % Define some dynDates objects
|
%$ % Define some dynDates objects
|
||||||
%$ d1 = dynDate('1950Q1'):dynDate('1959Q4') ;
|
%$ d1 = dynDate('1950Q1'):dynDate('1959Q4') ;
|
||||||
|
|
Loading…
Reference in New Issue