Removed @dynTimeIndex class (unused).
parent
ab9b512021
commit
1a8cba5d26
|
@ -1,20 +0,0 @@
|
||||||
function display(t)
|
|
||||||
|
|
||||||
% 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/>.
|
|
||||||
|
|
||||||
fprintf('%s = <dynTimeIndex: %s>\n', inputname(1), int2str(t.index));
|
|
|
@ -1,61 +0,0 @@
|
||||||
function t = dynTimeIndex() % --*-- Unitary tests --*--
|
|
||||||
|
|
||||||
% t = dynTimeIndex()
|
|
||||||
%
|
|
||||||
% Constructor for the dynTimeIndex class.
|
|
||||||
%
|
|
||||||
% INPUTS:
|
|
||||||
% None.
|
|
||||||
%
|
|
||||||
% OUTPUTS:
|
|
||||||
% * t, dynTimeIndex object.
|
|
||||||
%
|
|
||||||
% DESCRIPTION:
|
|
||||||
% The dynTimeIndex object is used to shift backward or forward dseries objects. For instance, if ts
|
|
||||||
% is a dseries object and t is a dynTimeIndex object then the following expressions are equivalent:
|
|
||||||
%
|
|
||||||
% us = ts.lag()
|
|
||||||
% us = ts.lag(1)
|
|
||||||
% us = lag(ts,1)
|
|
||||||
% us = ts(t-1)
|
|
||||||
%
|
|
||||||
% This class has only one member: t = int8(0) when instantiated.
|
|
||||||
|
|
||||||
% 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/>.
|
|
||||||
|
|
||||||
t = struct();
|
|
||||||
|
|
||||||
t.index = int8(0);
|
|
||||||
|
|
||||||
t = class(t,'dynTimeIndex');
|
|
||||||
|
|
||||||
%@test:1
|
|
||||||
%$ % Instantiate a dynTimeIndex object
|
|
||||||
%$ try
|
|
||||||
%$ u = dynTimeIndex();
|
|
||||||
%$ t(1) = 1;
|
|
||||||
%$ catch
|
|
||||||
%$ t(1) = 0;
|
|
||||||
%$ end
|
|
||||||
%$
|
|
||||||
%$ if t(1)
|
|
||||||
%$ t(2) = isa(u,'dynTimeIndex');
|
|
||||||
%$ end
|
|
||||||
%$
|
|
||||||
%$ T = all(t);
|
|
||||||
%@eof:1
|
|
|
@ -1,62 +0,0 @@
|
||||||
function C = minus(A,B) % --*-- Unitary tests --*--
|
|
||||||
|
|
||||||
% C = minus(A,B)
|
|
||||||
%
|
|
||||||
% Overloads binary minus operator.
|
|
||||||
%
|
|
||||||
% INPUTS:
|
|
||||||
% * A, dynTimeIndex object.
|
|
||||||
% * B, integer scalar.
|
|
||||||
%
|
|
||||||
% OUTPUTS:
|
|
||||||
% * C, dynTimeIndex object.
|
|
||||||
%
|
|
||||||
% EXAMPLE:
|
|
||||||
%
|
|
||||||
% >> t = dynTimeIndex();
|
|
||||||
% >> t.index
|
|
||||||
%
|
|
||||||
% ans =
|
|
||||||
%
|
|
||||||
% 0
|
|
||||||
%
|
|
||||||
% >> s = t-1;
|
|
||||||
% >> s.index
|
|
||||||
%
|
|
||||||
% ans =
|
|
||||||
%
|
|
||||||
% -1
|
|
||||||
%
|
|
||||||
|
|
||||||
% 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/>.
|
|
||||||
|
|
||||||
if ~(isa(A,'dynTimeIndex') || isint(B))
|
|
||||||
error(['dynTimeIndex::plus: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' must be a dynTimeIndex object and an integer!'])
|
|
||||||
end
|
|
||||||
|
|
||||||
C = struct();
|
|
||||||
C.index = A.index-B;
|
|
||||||
C = class(C,'dynTimeIndex');
|
|
||||||
|
|
||||||
%@test:1
|
|
||||||
%$ a = dynTimeIndex();
|
|
||||||
%$ b = a-1;
|
|
||||||
%$ t(1) = isa(b,'dynTimeIndex');
|
|
||||||
%$ t(2) = isequal(b.index,-int8(1));
|
|
||||||
%$ T = all(t);
|
|
||||||
%@eof:1
|
|
|
@ -1,74 +0,0 @@
|
||||||
function C = mpower(A,B) % --*-- Unitary tests --*--
|
|
||||||
|
|
||||||
% C = mpower(A,B)
|
|
||||||
%
|
|
||||||
% Overloads binary mpower operator (^).
|
|
||||||
%
|
|
||||||
% INPUTS :
|
|
||||||
% * A, dynTimeIndex object.
|
|
||||||
% * B, integer scalar.
|
|
||||||
%
|
|
||||||
% OUTPUTS :
|
|
||||||
% * C, dynTimeIndex object.
|
|
||||||
%
|
|
||||||
% EXAMPLE 1 :
|
|
||||||
%
|
|
||||||
% >> B = dynTimeIndex()-1;
|
|
||||||
% >> B
|
|
||||||
% B = <dynTimeIndex: -1>
|
|
||||||
% >> B^4
|
|
||||||
% ans = <dynTimeIndex: -4>
|
|
||||||
% >>
|
|
||||||
%
|
|
||||||
% EXAMPLE 2 :
|
|
||||||
% This method can be used to apply the lead and lag methods an arbitrary number of times to a dseries object. For instance, if
|
|
||||||
% ts is a dseries object, and if we define
|
|
||||||
%
|
|
||||||
% >> B = dynTimeIndex()-1;
|
|
||||||
% >> F = dynTimeIndex()+1;
|
|
||||||
%
|
|
||||||
% B and F can be used as lag and lead operators and the following syntax:
|
|
||||||
%
|
|
||||||
% >> us = ts(F^2);
|
|
||||||
%
|
|
||||||
% is equivalent to
|
|
||||||
%
|
|
||||||
% >> us = ts.lead(2)
|
|
||||||
%
|
|
||||||
% or
|
|
||||||
%
|
|
||||||
% >> us = ts.lead.lead
|
|
||||||
%
|
|
||||||
|
|
||||||
% 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/>.
|
|
||||||
|
|
||||||
if ~(isa(A,'dynTimeIndex') || isint(B))
|
|
||||||
error(['dynTimeIndex::mpower: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' must be a dynTimeIndex object and an integer!'])
|
|
||||||
end
|
|
||||||
|
|
||||||
C = struct();
|
|
||||||
C.index = A.index*B;
|
|
||||||
C = class(C,'dynTimeIndex');
|
|
||||||
|
|
||||||
%@test:1
|
|
||||||
%$ a = dynTimeIndex()+1;
|
|
||||||
%$ b = a^2;
|
|
||||||
%$ t(1) = isa(b,'dynTimeIndex');
|
|
||||||
%$ t(2) = isequal(b.index,int8(2));
|
|
||||||
%$ T = all(t);
|
|
||||||
%@eof:1
|
|
|
@ -1,62 +0,0 @@
|
||||||
function C = plus(A,B) % --*-- Unitary tests --*--
|
|
||||||
|
|
||||||
% C = plus(A,B)
|
|
||||||
%
|
|
||||||
% Overloads binary plus operator.
|
|
||||||
%
|
|
||||||
% INPUTS:
|
|
||||||
% * A, dynTimeIndex object.
|
|
||||||
% * B, integer scalar.
|
|
||||||
%
|
|
||||||
% OUTPUTS:
|
|
||||||
% * C, dynTimeIndex object.
|
|
||||||
%
|
|
||||||
% EXAMPLE:
|
|
||||||
%
|
|
||||||
% >> t = dynTimeIndex();
|
|
||||||
% >> t.index
|
|
||||||
%
|
|
||||||
% ans =
|
|
||||||
%
|
|
||||||
% 0
|
|
||||||
%
|
|
||||||
% >> s = t+1;
|
|
||||||
% >> s.index
|
|
||||||
%
|
|
||||||
% ans =
|
|
||||||
%
|
|
||||||
% 1
|
|
||||||
%
|
|
||||||
|
|
||||||
% 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/>.
|
|
||||||
|
|
||||||
if ~(isa(A,'dynTimeIndex') || isint(B))
|
|
||||||
error(['dynTimeIndex::plus: Input arguments ''' inputname(1) ''' and ''' inputname(2) ''' must be a dynTimeIndex object and an integer!'])
|
|
||||||
end
|
|
||||||
|
|
||||||
C = struct();
|
|
||||||
C.index = A.index+B;
|
|
||||||
C = class(C,'dynTimeIndex');
|
|
||||||
|
|
||||||
%@test:1
|
|
||||||
%$ a = dynTimeIndex();
|
|
||||||
%$ b = a+1;
|
|
||||||
%$ t(1) = isa(b,'dynTimeIndex');
|
|
||||||
%$ t(2) = isequal(b.index,int8(1));
|
|
||||||
%$ T = all(t);
|
|
||||||
%@eof:1
|
|
|
@ -1,20 +0,0 @@
|
||||||
function val = subsasgn(val, idx, rhs)
|
|
||||||
|
|
||||||
% 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/>.
|
|
||||||
|
|
||||||
error('dynTimeIndex::subsasgn: Members of dynTimeIndex class are private!')
|
|
|
@ -1,54 +0,0 @@
|
||||||
function B = subsref(A,S) % --*-- Unitary tests --*--
|
|
||||||
|
|
||||||
% B = subsref(A,S)
|
|
||||||
%
|
|
||||||
% Overloads the subsref method for dynTimeIndex class. This method only allows to get
|
|
||||||
% the value of the field `index`.
|
|
||||||
|
|
||||||
% 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/>.
|
|
||||||
|
|
||||||
if length(S)>1
|
|
||||||
error('dynTimeIndex::subsref: Something is wrong in your syntax!')
|
|
||||||
end
|
|
||||||
|
|
||||||
if isequal(S.type,'.')
|
|
||||||
if isequal(S.subs,'index')
|
|
||||||
B = builtin('subsref', A, S(1));
|
|
||||||
else
|
|
||||||
error(['dynTimeIndex::subsref: ' S.subs ' is not a known member!'])
|
|
||||||
end
|
|
||||||
else
|
|
||||||
error('dynTimeIndex::subsref: Something is wrong in your syntax!')
|
|
||||||
end
|
|
||||||
|
|
||||||
%@test:1
|
|
||||||
%$ % Instantiate a dynTimeIndex object
|
|
||||||
%$ u = dynTimeIndex();
|
|
||||||
%$ try
|
|
||||||
%$ v = u.index;
|
|
||||||
%$ t(1) = 1;
|
|
||||||
%$ catch
|
|
||||||
%$ t(1) = 0;
|
|
||||||
%$ end
|
|
||||||
%$
|
|
||||||
%$ if t(1)
|
|
||||||
%$ t(2) = isequal(v,int8(0));
|
|
||||||
%$ end
|
|
||||||
%$
|
|
||||||
%$ T = all(t);
|
|
||||||
%@eof:1
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit cd4bfdcf296033c3263a3346491cfd478a508a52
|
Subproject commit aa2fd884c09411a1bd1a58e458f80546a7b3cbf6
|
Loading…
Reference in New Issue