Verified Commit ef923e41 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Moved +dseries/initialize.m to @dseries/initialize.m

To initialize the toolbox:

 - Add the `src` folder in the path
 - run `dseries().initialize()`

This is an Octave compatibily workaround, Octrave cannot handle
simultaneously +folder (namespace) and @folder (class).
parent f19b0931
function initialize() function initialize(fake)
% Copyright (C) 2015-2018 Dynare Team % Copyright (C) 2015-2018 Dynare Team
% %
...@@ -16,7 +16,7 @@ function initialize() ...@@ -16,7 +16,7 @@ function initialize()
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% Get the path to the dseries toolbox. % Get the path to the dseries toolbox.
dseries_src_root = strrep(which('dseries.initialize'),'+dseries/initialize.m',''); dseries_src_root = strrep(which('@dseries/initialize'),'@dseries/initialize.m','');
% Check that the x13 binary is available % Check that the x13 binary is available
nox13 = false; nox13 = false;
...@@ -65,8 +65,7 @@ if ~exist('isint','file') ...@@ -65,8 +65,7 @@ if ~exist('isint','file')
end end
if ~exist('isoctave','file') if ~exist('isoctave','file')
addpath([dseries_src_root 'utilities/missing/isoctave']); p{end+1} = 'utilities/missing/isoctave';
%p{end+1} = 'utilities/missing/isoctave';
end end
if ~exist('shiftS','file') if ~exist('shiftS','file')
...@@ -85,7 +84,7 @@ if ~exist('ndim','file') ...@@ -85,7 +84,7 @@ if ~exist('ndim','file')
p{end+1} = 'utilities/missing/ndim'; p{end+1} = 'utilities/missing/ndim';
end end
if ~isoctave && (~exist('rows','file') || ~exist('columns','file')) if ~exist('OCTAVE_VERSION') && (~exist('rows','file') || ~exist('columns','file'))
p{end+1} = 'utilities/missing/dims'; p{end+1} = 'utilities/missing/dims';
end end
...@@ -97,7 +96,7 @@ if ~exist('get_file_extension','file') ...@@ -97,7 +96,7 @@ if ~exist('get_file_extension','file')
p{end+1} = 'utilities/missing/get_file_extension'; p{end+1} = 'utilities/missing/get_file_extension';
end end
if isoctave && ~exist('user_has_octave_forge_package','file') if exist('OCTAVE_VERSION') && ~exist('user_has_octave_forge_package','file')
p{end+1} = 'utilities/missing/user_has_octave_forge_package'; p{end+1} = 'utilities/missing/user_has_octave_forge_package';
end end
......
...@@ -83,6 +83,8 @@ switch S(1).type ...@@ -83,6 +83,8 @@ switch S(1).type
end end
case 'struct' case 'struct'
r = dseries2struct(o); r = dseries2struct(o);
case 'initialize'
initialize(o);
case {'baxter_king_filter', 'baxter_king_filter_', ... case {'baxter_king_filter', 'baxter_king_filter_', ...
'cumsum','cumsum_', ... 'cumsum','cumsum_', ...
'insert', ... 'insert', ...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment