Unverified Commit c160d240 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Octave 6 implements intersect(…, 'stable')

[skip ci]
parent 3bfb0cf0
......@@ -151,7 +151,7 @@ if M_.exo_nbr > 1
end
skipline();
if ~all(diag(M_.H)==0)
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_name_requested_vars, varlist_pos] = intersect_stable(var_list_, options_.varobs);
else
[observable_name_requested_vars, varlist_pos] = intersect(var_list_, options_.varobs, 'stable');
......
......@@ -89,7 +89,7 @@ end
% Measurement error
if ~all(diag(StateSpaceModel.measurement_error)==0)
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_pos,index_subset,index_observables]=intersect_stable(SubsetOfVariables,StateSpaceModel.observable_pos);
else
[observable_pos,index_subset,index_observables]=intersect(SubsetOfVariables,StateSpaceModel.observable_pos,'stable');
......
......@@ -63,7 +63,7 @@ if isempty(exogenous_variable_index)
end
end
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(var_list,options_.varobs);
else
[observable_pos_requested_vars,index_subset,index_observables]=intersect(var_list,options_.varobs,'stable');
......
......@@ -50,7 +50,7 @@ y = y(ivar,options_.drop+1:end)';
ME_present=0;
if ~all(M_.H==0)
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_pos_requested_vars, index_subset, index_observables] = intersect_stable(ivar, options_.varobs_id);
else
[observable_pos_requested_vars, index_subset, index_observables] = intersect(ivar, options_.varobs_id, 'stable');
......
......@@ -55,7 +55,7 @@ oo_.var = oo_.gamma_y{1};
ME_present=0;
if ~all(diag(M_.H)==0)
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id);
else
[observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable');
......@@ -105,7 +105,7 @@ if size(stationary_vars, 1) > 0
lh = cellofchararraymaxlength(M_.endo_names(ivar(stationary_vars)))+2;
dyntable(options_, title, headers, M_.endo_names(ivar(stationary_vars)), 100*oo_.gamma_y{options_.ar+2}(stationary_vars,:), lh, 8, 2);
if ME_present
if isoctave
if isoctave && octave_ver_less_than('6')
[stationary_observables, pos_index_subset] = intersect_stable(index_subset, stationary_vars);
else
[stationary_observables, pos_index_subset] = intersect(index_subset, stationary_vars, 'stable');
......
......@@ -83,7 +83,7 @@ MaXNumberOfConditionalDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSaved
ME_present=0;
if ~all(diag(M_.H)==0)
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id);
else
[observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable');
......
......@@ -86,7 +86,7 @@ MaXNumberOfDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSavedElementsPer
ME_present=0;
if ~all(diag(M_.H)==0)
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_pos_requested_vars,index_subset,index_observables]=intersect_stable(ivar,options_.varobs_id);
else
[observable_pos_requested_vars,index_subset,index_observables]=intersect(ivar,options_.varobs_id,'stable');
......
......@@ -88,8 +88,8 @@ if isoctave && octave_ver_less_than('5')
p{end+1} = '/missing/ordeig';
end
%% intersect(…, 'stable') doesn't exist in Octave
if isoctave
%% intersect(…, 'stable') doesn't exist in Octave < 6
if isoctave && octave_ver_less_than('6')
p{end+1} = '/missing/intersect_stable';
end
......
......@@ -66,7 +66,7 @@ switch type
M_.exo_names,arg2,vartan,arg1,options_.mh_conf_sig,oo_,options_);
if ~all(diag(M_.H)==0)
if strmatch(arg1,options_.varobs,'exact')
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_name_requested_vars,index_subset,index_observables]=intersect_stable(vartan,options_.varobs);
else
[observable_name_requested_vars,index_subset,index_observables]=intersect(vartan,options_.varobs,'stable');
......
......@@ -76,7 +76,7 @@ for i=1:nvar
SubsetOfVariables(i) = i_tmp;
end
if isoctave
if isoctave && octave_ver_less_than('6')
[observable_pos,index_observables,index_subset]=intersect_stable(SubsetOfVariables,options_.varobs_id);
else
[observable_pos,index_observables,index_subset]=intersect(SubsetOfVariables,options_.varobs_id,'stable');
......
Supports Markdown
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