Merge branch 'master' into maxit

time-shift
Stéphane Adjemian (Charybdis) 2013-10-09 15:43:43 +02:00
commit f3334357a5
10 changed files with 34 additions and 13 deletions

View File

@ -0,0 +1,23 @@
function y = dynDates2decimal(dd)
% function y = dynDates2decimal(dd)
% returns a vector of doubles with the fractional part corresponding
% to the subperiod. Mostly used for plots.
% Copyright (C) 2013 Dynare Team
%
% This file is part of Dynare.
%
% Dynare 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,
% 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/>.
y = dd.time(:,1)+(dd.time(:,2)-1)/dd.freq;

View File

@ -80,16 +80,14 @@ if last_a>last_b
n = last_a-last_b;
b.data = [b.data; NaN(n,b.vobs)];
b.nobs = b.nobs+n;
return
end
if last_a<last_b
elseif last_a<last_b
n = last_b-last_a;
a.data = [a.data; NaN(n,a.vobs)];
a.nobs = a.nobs+n;
return
end
a.time = a.init:a.init+(a.nobs-1);
%@test:1
%$ % Define a datasets.
%$ A = rand(8,3); B = rand(7,2);

View File

@ -95,7 +95,7 @@ end
ts.data = tmp(K+1:end-K,:);
ts.nobs = ts.nobs-2*K;
ts.init = ts.init+K;
ts.time = ts.init:ts.init+ts.nobs;
ts.time = ts.init:ts.init+(ts.nobs-1);
%@test:1
%$ plot_flag = 0;

View File

@ -146,7 +146,6 @@ switch nargin
[ts.nobs, ts.vobs] = size(ts.data);
ts.freq = 1;
ts.init = dynDate(1);
ts.time = ts.init:ts.init+ts.nobs;
ts.name = default_name(ts.vobs);
ts.tex = name2tex(ts.name);
end
@ -212,7 +211,7 @@ switch nargin
error('dynSeries::dynSeries: Can''t instantiate the class, wrong calling sequence!')
end
ts.time = ts.init:(ts.init+ts.nobs);
ts.time = ts.init:ts.init+(ts.nobs-1);
%@test:1
%$ % Test if we can instantiate an empty dynSeries object.

View File

@ -83,7 +83,7 @@ else
A.init = B.init;
end
A.time = A.init:A.init+A.nobs;
A.time = A.init:A.init+(A.nobs-1);
%@test:1
%$ % Define a datasets.

View File

@ -116,7 +116,7 @@ for i=1:A.vobs
A.tex(i) = {['(' B.tex{idB(i)} '+' C.tex{idC(i)} ')']};
end
A.data = bsxfun(@plus,B.data,C.data);
A.time = A.init:A.init+A.nobs;
A.time = A.init:A.init+(A.nobs-1);
%@test:1
%$ % Define a datasets.

View File

@ -103,7 +103,7 @@ switch length(S)
A.init = B;
% ... and update freq and time members.
A.freq = A.init.freq;
A.time = A.init:(A.init+(A.nobs-1));
A.time = A.init:A.init+(A.nobs-1);
return
elseif isequal(S(1).subs,'time') && isa(B,'dynDates')
% Overwrite the time member...

View File

@ -19,5 +19,5 @@ function s = getName(o)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
assert(~isempty(o.data) && size(o.data, 2) == 1);
s = o.data(1).name();
s = o.data.name;
end

View File

@ -19,5 +19,5 @@ function s = getTexName(o)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
assert(~isempty(o.data) && size(o.data, 2) == 1);
s = o.data(1).tex();
s = o.data.tex;
end

1
tests/.gitignore vendored
View File

@ -11,6 +11,7 @@
*.dat
*.prn
*_simul
*-macroexp.mod
wsOct
/run_test_octave_output.txt