[Pkg-octave-commit] r2973 - dynare/trunk/debian/patches

Sébastien Villemot sebastien-guest at alioth.debian.org
Fri Apr 24 14:57:29 UTC 2009


Author: sebastien-guest
Date: 2009-04-24 14:57:28 +0000 (Fri, 24 Apr 2009)
New Revision: 2973

Added:
   dynare/trunk/debian/patches/rows-name-clash
   dynare/trunk/debian/patches/table-name-clash
Modified:
   dynare/trunk/debian/patches/series
Log:
Added patches fixing name clashes for rows.m and table.m

Added: dynare/trunk/debian/patches/rows-name-clash
===================================================================
--- dynare/trunk/debian/patches/rows-name-clash	                        (rev 0)
+++ dynare/trunk/debian/patches/rows-name-clash	2009-04-24 14:57:28 UTC (rev 2973)
@@ -0,0 +1,186 @@
+Fixes the name clash of Dynare rows.m function with Octave's by renaming it to dynrows.m
+--- a/matlab/compute_moments_varendo.m
++++ b/matlab/compute_moments_varendo.m
+@@ -31,7 +31,7 @@
+ %
+ % You should have received a copy of the GNU General Public License
+ % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.    
+-    NumberOfEndogenousVariables = rows(var_list_);
++    NumberOfEndogenousVariables = dynrows(var_list_);
+     NumberOfExogenousVariables = M_.exo_nbr;
+     list_of_exogenous_variables = M_.exo_names;
+     NumberOfLags = options_.ar;
+--- a/matlab/correlation_posterior_analysis.m
++++ b/matlab/correlation_posterior_analysis.m
+@@ -72,7 +72,7 @@
+     i1 = 1; tmp = zeros(SampleSize,1);
+     for file = 1:NumberOfFiles
+         load([ dname '/metropolis/'  fname '_PosteriorCorrelations' int2str(file) '.mat']);
+-        i2 = i1 + rows(Correlation_array) - 1;
++        i2 = i1 + dynrows(Correlation_array) - 1;
+         tmp(i1:i2) = Correlation_array(:,indx1,indx2,nar);
+         i1 = i2+1;
+     end
+--- a/matlab/covariance_posterior_analysis.m
++++ b/matlab/covariance_posterior_analysis.m
+@@ -58,7 +58,7 @@
+     i1 = 1; tmp = zeros(NumberOfSimulations,1);
+     for file = 1:NumberOfFiles
+         load([ dname '/metropolis/'  fname '_Posterior2ndOrderMoments' int2str(file) '.mat']);
+-        i2 = i1 + rows(Covariance_matrix) - 1;
++        i2 = i1 + dynrows(Covariance_matrix) - 1;
+         tmp(i1:i2) = Covariance_matrix(:,symmetric_matrix_index(indx1,indx2,nvar));
+         i1 = i2+1;
+     end
+--- a/matlab/dsge_posterior_theoretical_correlation.m
++++ b/matlab/dsge_posterior_theoretical_correlation.m
+@@ -63,14 +63,14 @@
+     NumberOfCorrFiles = ceil(SampleSize/MaXNumberOfCorrLines);
+ end
+ 
+-NumberOfCorrLines = rows(Correlation_array);
++NumberOfCorrLines = dynrows(Correlation_array);
+ CorrFileNumber = 1;
+ 
+ % Compute 2nd order moments and save them in *_PosteriorCorrelations* files
+ linea = 0;
+ for file = 1:NumberOfDrawsFiles
+     load([M_.dname '/metropolis/' DrawsFiles(file).name ]);
+-    NumberOfDraws = rows(pdraws);
++    NumberOfDraws = dynrows(pdraws);
+     isdrsaved = cols(pdraws)-1;
+     for linee = 1:NumberOfDraws
+         linea = linea+1;
+--- a/matlab/dsge_posterior_theoretical_covariance.m
++++ b/matlab/dsge_posterior_theoretical_covariance.m
+@@ -62,14 +62,14 @@
+     NumberOfCovarFiles = ceil(SampleSize/MaXNumberOfCovarLines);
+ end
+ 
+-NumberOfCovarLines = rows(Covariance_matrix);
++NumberOfCovarLines = dynrows(Covariance_matrix);
+ CovarFileNumber = 1;
+ 
+ % Compute 2nd order moments and save them in *_Posterior2ndOrderMoments* files
+ linea = 0;
+ for file = 1:NumberOfDrawsFiles
+     load([M_.dname '/metropolis/' DrawsFiles(file).name ],'pdraws');
+-    NumberOfDraws = rows(pdraws);
++    NumberOfDraws = dynrows(pdraws);
+     isdrsaved = cols(pdraws)-1;
+     for linee = 1:NumberOfDraws
+         linea = linea+1;
+--- a/matlab/dsge_posterior_theoretical_variance_decomposition.m
++++ b/matlab/dsge_posterior_theoretical_variance_decomposition.m
+@@ -52,7 +52,7 @@
+ nexo = M_.exo_nbr;
+ 
+ 
+-NumberOfDrawsFiles = rows(DrawsFiles);
++NumberOfDrawsFiles = dynrows(DrawsFiles);
+ NumberOfSavedElementsPerSimulation = nvar*(nexo+1);
+ MaXNumberOfDecompLines = ceil(options_.MaxNumberOfBytes/NumberOfSavedElementsPerSimulation/8);
+ 
+@@ -65,7 +65,7 @@
+     NumberOfDecompFiles = ceil(SampleSize/MaXNumberOfDecompLines);
+ end
+ 
+-NumberOfDecompLines = rows(Decomposition_array);
++NumberOfDecompLines = dynrows(Decomposition_array);
+ DecompFileNumber = 1;
+ 
+ 
+@@ -75,7 +75,7 @@
+ for file = 1:NumberOfDrawsFiles
+     load([M_.dname '/metropolis/' DrawsFiles(file).name ]);
+     isdrsaved = cols(pdraws)-1;
+-    NumberOfDraws = rows(pdraws);
++    NumberOfDraws = dynrows(pdraws);
+     for linee = 1:NumberOfDraws
+         linea = linea+1;
+         if isdrsaved
+--- /dev/null
++++ b/matlab/dynrows.m
+@@ -0,0 +1,20 @@
++function nr=dynrows(x)
++
++% Copyright (C) 2005 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/>.
++
++  nr = size(x,1);
+\ No newline at end of file
+--- a/matlab/generalized_cholesky.m
++++ b/matlab/generalized_cholesky.m
+@@ -21,7 +21,7 @@
+ % You should have received a copy of the GNU General Public License
+ % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
+ 
+-n = rows(A);
++n = dynrows(A);
+ R = eye(n);
+ E = zeros(n,n);
+ norm_A = max(transpose(sum(abs(A))));
+--- a/matlab/rows.m
++++ /dev/null
+@@ -1,20 +0,0 @@
+-function nr=rows(x)
+-
+-% Copyright (C) 2005 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/>.
+-
+-  nr = size(x,1);
+\ No newline at end of file
+--- a/matlab/set_stationary_variables_list.m
++++ b/matlab/set_stationary_variables_list.m
+@@ -39,7 +39,7 @@
+     varlist = options_.varobs;
+     options_.varlist = varlist;
+ end
+-nvar = rows(varlist);
++nvar = dynrows(varlist);
+ if ~isempty(options_.unit_root_vars)
+     vartan = [];
+     for i=1:nvar
+--- a/matlab/variance_decomposition_posterior_analysis.m
++++ b/matlab/variance_decomposition_posterior_analysis.m
+@@ -31,10 +31,10 @@
+     tmp = dir([ dname '/metropolis/'  fname '_PosteriorVarianceDecomposition*.mat']);
+     NumberOfFiles = length(tmp);
+     i1 = 1; tmp = zeros(NumberOfSimulations,1);
+-    indice = (indx-1)*rows(exonames)+jndx;
++    indice = (indx-1)*dynrows(exonames)+jndx;
+     for file = 1:NumberOfFiles
+         load([dname '/metropolis/' fname '_PosteriorVarianceDecomposition' int2str(file) '.mat']);
+-        i2 = i1 + rows(Decomposition_array) - 1;
++        i2 = i1 + dynrows(Decomposition_array) - 1;
+         tmp(i1:i2) = Decomposition_array(:,indice);
+         i1 = i2+1;
+     end

Modified: dynare/trunk/debian/patches/series
===================================================================
--- dynare/trunk/debian/patches/series	2009-04-23 14:46:43 UTC (rev 2972)
+++ dynare/trunk/debian/patches/series	2009-04-24 14:57:28 UTC (rev 2973)
@@ -1,3 +1,5 @@
 extra-addpath # Add an extra addpath at the top of dynare.m for making the $(MDIR) symlink work
 fhs-compliance # Modifies dynare_config.m to reflect FHS compliance of the package
 bashisms-in-makefiles
+table-name-clash
+rows-name-clash

Added: dynare/trunk/debian/patches/table-name-clash
===================================================================
--- dynare/trunk/debian/patches/table-name-clash	                        (rev 0)
+++ dynare/trunk/debian/patches/table-name-clash	2009-04-24 14:57:28 UTC (rev 2973)
@@ -0,0 +1,171 @@
+Fixes the name clash of Dynare table.m with Octave's by renaming it to dyntable.m
+--- a/matlab/table.m
++++ /dev/null
+@@ -1,42 +0,0 @@
+-function table(title,headers,labels,values,label_width,val_width, ...
+-	       val_precis)
+-
+-% Copyright (C) 2002 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/>.
+-
+-  label_width = max(size(deblank(strvcat(headers(1,:),labels)),2)+2, ...
+-		    label_width);
+-  val_width = max(size(deblank(headers(2:end,:)),2)+2,val_width);
+-  label_fmt = sprintf('%%-%ds',label_width);
+-  header_fmt = sprintf('%%-%ds',val_width);
+-  val_fmt = sprintf('%%%d.%df',val_width,val_precis);
+-  if length(title) > 0
+-    disp(sprintf('\n\n%s\n',title));
+-  end
+-  if length(headers) > 0
+-    hh = sprintf(label_fmt,headers(1,:));
+-    hh = [hh char(32*ones(1,floor(val_width/4)))];
+-    for i=2:size(headers,1)
+-      hh = [hh sprintf(header_fmt,headers(i,:))];
+-    end
+-    disp(hh);
+-  end
+-  for i=1:size(values,1)
+-    disp([sprintf(label_fmt,labels(i,:)) sprintf(val_fmt,values(i,:))]);
+-  end
+-  
+-% 10/30/02 MJ
+\ No newline at end of file
+--- /dev/null
++++ b/matlab/dyntable.m
+@@ -0,0 +1,42 @@
++function dyntable(title,headers,labels,values,label_width,val_width, ...
++	       val_precis)
++
++% Copyright (C) 2002 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/>.
++
++  label_width = max(size(deblank(strvcat(headers(1,:),labels)),2)+2, ...
++		    label_width);
++  val_width = max(size(deblank(headers(2:end,:)),2)+2,val_width);
++  label_fmt = sprintf('%%-%ds',label_width);
++  header_fmt = sprintf('%%-%ds',val_width);
++  val_fmt = sprintf('%%%d.%df',val_width,val_precis);
++  if length(title) > 0
++    disp(sprintf('\n\n%s\n',title));
++  end
++  if length(headers) > 0
++    hh = sprintf(label_fmt,headers(1,:));
++    hh = [hh char(32*ones(1,floor(val_width/4)))];
++    for i=2:size(headers,1)
++      hh = [hh sprintf(header_fmt,headers(i,:))];
++    end
++    disp(hh);
++  end
++  for i=1:size(values,1)
++    disp([sprintf(label_fmt,labels(i,:)) sprintf(val_fmt,values(i,:))]);
++  end
++  
++% 10/30/02 MJ
+\ No newline at end of file
+--- a/matlab/disp_moments.m
++++ b/matlab/disp_moments.m
+@@ -57,7 +57,7 @@
+     end
+     headers=strvcat('VARIABLE','MEAN','STD. DEV.','VARIANCE','SKEWNESS', ...
+ 		    'KURTOSIS');
+-    table(title,headers,labels,z,size(labels,2)+2,16,6);
++    dyntable(title,headers,labels,z,size(labels,2)+2,16,6);
+   end
+   
+   if options_.nocorr == 0
+@@ -68,7 +68,7 @@
+ 	       int2str(options_.hp_filter) ')'];
+     end
+     headers = strvcat('VARIABLE',M_.endo_names(ivar,:));
+-    table(title,headers,labels,corr,size(labels,2)+2,8,4);
++    dyntable(title,headers,labels,corr,size(labels,2)+2,8,4);
+   end
+   
+   ar = options_.ar;
+@@ -86,7 +86,7 @@
+ 	       int2str(options_.hp_filter) ')'];
+     end
+     headers = strvcat('VARIABLE',int2str([1:ar]'));
+-    table(title,headers,labels,autocorr,size(labels,2)+2,8,4);
++    dyntable(title,headers,labels,autocorr,size(labels,2)+2,8,4);
+   end
+   
+   warning(warning_old_state);
+--- a/matlab/disp_th_moments.m
++++ b/matlab/disp_th_moments.m
+@@ -57,7 +57,7 @@
+       title = [title ' (HP filter, lambda = ' int2str(options_.hp_filter) ')'];
+     end
+     headers=strvcat('VARIABLE','MEAN','STD. DEV.','VARIANCE');
+-    table(title,headers,deblank(M_.endo_names(ivar,:)),z,lh,11,4);
++    dyntable(title,headers,deblank(M_.endo_names(ivar,:)),z,lh,11,4);
+     if M_.exo_nbr > 1
+       disp(' ')
+       title='VARIANCE DECOMPOSITION (in percent)';
+@@ -68,7 +68,7 @@
+       headers = M_.exo_names;
+       headers(M_.exo_names_orig_ord,:) = headers;
+       headers = strvcat(' ',headers);
+-      table(title,headers,deblank(M_.endo_names(ivar(i1),:)),100*oo_.gamma_y{options_.ar+2}(i1,:), ...
++      dyntable(title,headers,deblank(M_.endo_names(ivar(i1),:)),100*oo_.gamma_y{options_.ar+2}(i1,:), ...
+ 	    lh,8,2);
+     end
+   end
+@@ -82,7 +82,7 @@
+     labels = deblank(M_.endo_names(ivar,:));
+     headers = strvcat('Variables',labels(i1,:));
+     corr = oo_.gamma_y{1}(i1,i1)./(sd(i1)*sd(i1)');
+-    table(title,headers,labels(i1,:),corr,lh,8,4);
++    dyntable(title,headers,labels(i1,:),corr,lh,8,4);
+   end
+   
+   if options_.ar > 0
+@@ -98,7 +98,7 @@
+       oo_.autocorr{i} = oo_.gamma_y{i+1};
+       z(:,i) = diag(oo_.gamma_y{i+1}(i1,i1));
+     end
+-    table(title,headers,labels,z,0,8,4);
++    dyntable(title,headers,labels,z,0,8,4);
+   end
+   
+ % 10/09/02 MJ 
+--- a/matlab/stoch_simul.m
++++ b/matlab/stoch_simul.m
+@@ -60,7 +60,7 @@
+     labels = deblank(M_.exo_names);
+     headers = strvcat('Variables',labels);
+     lh = size(labels,2)+2;
+-    table(my_title,headers,labels,M_.Sigma_e,lh,10,6);
++    dyntable(my_title,headers,labels,M_.Sigma_e,lh,10,6);
+     disp(' ')
+     disp_dr(oo_.dr,options_.order,var_list);
+   end




More information about the Pkg-octave-commit mailing list