diff --git a/matlab/reports/@page/addSection.m b/matlab/reports/@page/addSection.m index b24c16b89e3e9c574eca8fd8c27226f23f7f1e4f..958940f1c7044e778a42db7f4c2c33f78d5690ed 100644 --- a/matlab/reports/@page/addSection.m +++ b/matlab/reports/@page/addSection.m @@ -13,7 +13,7 @@ function p = addSection(p, varargin) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % % This file is part of Dynare. % @@ -30,5 +30,6 @@ function p = addSection(p, varargin) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -p.sections = p.sections.addSection(varargin{:}); +fprintf(1, '/'); +p.sections{end+1} = section(varargin{:}); end diff --git a/matlab/reports/@page/numSections.m b/matlab/reports/@page/numSections.m index faa61e7b72e3945d06ac7fa510763df2fc5520fc..aa0b0a1bed8052a87079e6bdfbd825041affa82e 100644 --- a/matlab/reports/@page/numSections.m +++ b/matlab/reports/@page/numSections.m @@ -11,7 +11,7 @@ function ns = numSections(p) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % % This file is part of Dynare. % @@ -28,5 +28,5 @@ function ns = numSections(p) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -ns = p.sections.numSections(); +ns = length(p.sections); end \ No newline at end of file diff --git a/matlab/reports/@page/page.m b/matlab/reports/@page/page.m index b36adb1c5f5a128c27e693bbddc62cf77615c181..2f2b9a67d810722a4f1adb0f7162963fe0295e5d 100644 --- a/matlab/reports/@page/page.m +++ b/matlab/reports/@page/page.m @@ -12,7 +12,7 @@ function o = page(varargin) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % % This file is part of Dynare. % @@ -35,7 +35,7 @@ o.title = {}; o.titleFormat = {}; o.orientation = ''; o.footnote = {}; -o.sections = sections(); +o.sections = {}; if nargin == 1 assert(isa(varargin{1}, 'page'), ['@page.page: with one arg to Page ' ... diff --git a/matlab/reports/@page/write.m b/matlab/reports/@page/write.m index 09a7f62184836a5ed57fca9d68201026b02abc4c..12ab8673d23b4c446ed129290bceafe24aa708fc 100644 --- a/matlab/reports/@page/write.m +++ b/matlab/reports/@page/write.m @@ -12,7 +12,7 @@ function o = write(o, fid) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % % This file is part of Dynare. % @@ -46,7 +46,10 @@ for i=1:length(o.title) fprintf(fid,'\\multicolumn{1}{c}{%s %s}\\\\\n', o.titleFormat{i}, o.title{i}); end -o.sections.write(fid); +nps = length(o.sections); +for i=1:nps + o.sections{i}.write(fid); +end if strcmpi(o.orientation, 'landscape') fprintf(fid, '\\end{landscape}\n'); diff --git a/matlab/reports/@report/addGraph.m b/matlab/reports/@report/addGraph.m index 6311eb53e4dbf158a84837c33f46c996823e5ced..9e0e691e88cad9e5adcb238c5c946388c7cb7520 100644 --- a/matlab/reports/@report/addGraph.m +++ b/matlab/reports/@report/addGraph.m @@ -29,6 +29,6 @@ function o = addGraph(o, varargin) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -o.pages{end}.sections(end) = ... - o.pages{end}.sections(end).addGraph(varargin{:}); +o.pages{end}.sections{end} = ... + o.pages{end}.sections{end}.addGraph(varargin{:}); end diff --git a/matlab/reports/@report/addSeries.m b/matlab/reports/@report/addSeries.m index 27db253e0e1eafce5f27c17647e5887dee28d80c..a72470a18755dc42571238843d5119d3e07da5d3 100644 --- a/matlab/reports/@report/addSeries.m +++ b/matlab/reports/@report/addSeries.m @@ -29,10 +29,10 @@ function o = addSeries(o, varargin) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -assert(isa(o.pages{end}.sections(end).elements(end), 'graph') || ... - isa(o.pages{end}.sections(end).elements(end), 'report_table'), ... +assert(isa(o.pages{end}.sections{end}.elements(end), 'graph') || ... + isa(o.pages{end}.sections{end}.elements(end), 'report_table'), ... '@report.addSeries: you can only add a series to a report_table or graph object'); -o.pages{end}.sections(end).elements(end) = ... - o.pages{end}.sections(end).elements(end).addSeries(varargin{:}); +o.pages{end}.sections{end}.elements(end) = ... + o.pages{end}.sections{end}.elements(end).addSeries(varargin{:}); end diff --git a/matlab/reports/@report/addTable.m b/matlab/reports/@report/addTable.m index 16e9b539da3804c8b54b6d470939db0c3202fa87..4b1f8c0d4d7812f9faa2c1787d931e31b058650b 100644 --- a/matlab/reports/@report/addTable.m +++ b/matlab/reports/@report/addTable.m @@ -29,6 +29,6 @@ function o = addTable(o, varargin) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -o.pages{end}.sections(end) = ... - o.pages{end}.sections(end).addTable(varargin{:}); +o.pages{end}.sections{end} = ... + o.pages{end}.sections{end}.addTable(varargin{:}); end diff --git a/matlab/reports/@report/addVspace.m b/matlab/reports/@report/addVspace.m index 04c95c15fc94f7e5f6f490a8e48e0dba05ea33cc..f4ca186d6c6296d6c92356a0c28b630a6d6c99fb 100644 --- a/matlab/reports/@report/addVspace.m +++ b/matlab/reports/@report/addVspace.m @@ -29,6 +29,6 @@ function o = addVspace(o, varargin) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. -o.pages{end}.sections(end) = ... - o.pages{end}.sections(end).addVspace(varargin{:}); +o.pages{end}.sections{end} = ... + o.pages{end}.sections{end}.addVspace(varargin{:}); end diff --git a/matlab/reports/@section/subsasgn.m b/matlab/reports/@section/subsasgn.m index a0a7a1164e655abdf32379cc9fafca5fe75a858f..a26dc612b9116a387a8ce4fad6e5d864037bbd99 100644 --- a/matlab/reports/@section/subsasgn.m +++ b/matlab/reports/@section/subsasgn.m @@ -1,7 +1,7 @@ function B = subsasgn(A, S, V) % function B = subsasgn(A, S, V) -% Copyright (C) 2013 Dynare Team +% Copyright (C) 2013-2014 Dynare Team % % This file is part of Dynare. % @@ -33,6 +33,10 @@ switch S.type index = S.subs{:}; assert(isnumeric(index)); B.elements(index) = V; + case '{}' + index = S.subs{:}; + assert(isnumeric(index)); + B{index} = V; case '.' switch S.subs case fieldnames(A) diff --git a/matlab/reports/@sections/addSection.m b/matlab/reports/@sections/addSection.m deleted file mode 100644 index bdf1c1e0d8b074eb25b81bf3db9e2f2f11798196..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/addSection.m +++ /dev/null @@ -1,23 +0,0 @@ -function o = addSection(o, varargin) -% function o = addSection(o, varargin) - -% Copyright (C) 2013-2014 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(1, '/'); -o.objArray = o.objArray.addObj(section(varargin{:})); -end \ No newline at end of file diff --git a/matlab/reports/@sections/display.m b/matlab/reports/@sections/display.m deleted file mode 100644 index 0e344d000051dd07c1431a92e3be756d95773046..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/display.m +++ /dev/null @@ -1,32 +0,0 @@ -function display(o) -%function display(o) -% Display a Sections object -% -% INPUTS -% o [sections] sections object -% -% OUTPUTS -% none -% -% SPECIAL REQUIREMENTS -% none - -% 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/>. - -reporting_object_display(o); -end \ No newline at end of file diff --git a/matlab/reports/@sections/end.m b/matlab/reports/@sections/end.m deleted file mode 100644 index c9fc0cd92edc60d08d09a2f8aed508cf9779e4d8..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/end.m +++ /dev/null @@ -1,35 +0,0 @@ -function lastIndex = end(o, k, n) -% function lastIndex = end(o, k, n) -% End keyword -% -% INPUTS -% o [sections] sections object -% k [integer] index where end appears -% n [integer] number of indices -% -% OUTPUTS -% lastIndex [integer] last sections index -% -% SPECIAL REQUIREMENTS -% none - -% 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/>. - -assert(k==1 && n==1, '@sections/end: sections only has one dimension'); -lastIndex = numSections(o); -end \ No newline at end of file diff --git a/matlab/reports/@sections/getSections.m b/matlab/reports/@sections/getSections.m deleted file mode 100644 index e60f2270d22b11cbb1773bea47783de38c58012f..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/getSections.m +++ /dev/null @@ -1,22 +0,0 @@ -function e = getSections(ss, varargin) -% function e = getSections(ss, varargin) - -% 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/>. - -e = ss.objArray.getObjs(varargin{:}); -end \ No newline at end of file diff --git a/matlab/reports/@sections/numSections.m b/matlab/reports/@sections/numSections.m deleted file mode 100644 index 2eb27007730fb996249d30b57bc42fed3f1e931c..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/numSections.m +++ /dev/null @@ -1,22 +0,0 @@ -function n = numSections(o) -% function n = numSections(o) - -% 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/>. - -n = o.objArray.numObjArray(); -end \ No newline at end of file diff --git a/matlab/reports/@sections/sections.m b/matlab/reports/@sections/sections.m deleted file mode 100644 index 00110fb6406fbbb2d28c7e783a5ba1c720f9d097..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/sections.m +++ /dev/null @@ -1,43 +0,0 @@ -function s = sections(varargin) -%function s = sections(varargin) -% Sections Class Constructor -% -% INPUTS -% varargin 0 args : empty sections object -% 1 arg : must be sections object (return a copy of arg) -% -% OUTPUTS -% ps [sections] sections object -% -% SPECIAL REQUIREMENTS -% none - -% 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/>. - -switch nargin - case 0 - s = class(struct, 'sections', objArray()); - case 1 - assert(isa(varargin{1}, 'sections'), ['@sections.sections: the ' ... - 'only valid arguments are sections objects']); - s = varargin{1}; - otherwise - error('@sections.sections: invalid number of arguments'); -end -end - diff --git a/matlab/reports/@sections/subsasgn.m b/matlab/reports/@sections/subsasgn.m deleted file mode 100644 index 2782f7e1c7670feb9e60a5c9775ae67522756cf0..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/subsasgn.m +++ /dev/null @@ -1,39 +0,0 @@ -function B = subsasgn(A, S, V) -% function B = subsasgn(A, S, V) - -% 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/>. - -B = A; -if length(S) > 1 - for i=1:(length(S)-1) - B = subsref(B, S(i)); - end - B = subsasgn(B, S(end), V); - B = subsasgn(A, S(1:(end-1)), B); - return -end - -switch S.type - case '()' - index = S.subs{:}; - assert(isnumeric(index)); - B.objArray(index) = V; - otherwise - error('@sections.subsasgn: syntax error') -end -end \ No newline at end of file diff --git a/matlab/reports/@sections/subsref.m b/matlab/reports/@sections/subsref.m deleted file mode 100644 index 92e0c262a9fa612dfc8d36c32383c40d97c20698..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/subsref.m +++ /dev/null @@ -1,48 +0,0 @@ -function A = subsref(A, S) -%function A = subsref(A, S) - -% Copyright (C) 2013-2014 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/>. - -switch S(1).type - case '.' - switch S(1).subs - case fieldnames(A) - A = A.(S(1).subs); - case methods(A) - if areParensNext(S) - A = feval(S(1).subs, A, S(2).subs{:}); - S = shiftS(S,1); - else - A = feval(S(1).subs, A); - end - otherwise - error(['@sections.subsref unknown field or method: ' S(1).subs]); - end - case '()' - A = getSections(A, S(1).subs{:}); - case '{}' - error(['@sections.subsref ' S(1).type ' indexing not supported.']); - otherwise - error('@sections.subsref subsref.m impossible case') -end - -S = shiftS(S,1); -if length(S) >= 1 - A = subsref(A, S); -end -end diff --git a/matlab/reports/@sections/write.m b/matlab/reports/@sections/write.m deleted file mode 100644 index 6c87a43eaa41f8c1805b80047594d820ea90c027..0000000000000000000000000000000000000000 --- a/matlab/reports/@sections/write.m +++ /dev/null @@ -1,39 +0,0 @@ -function o = write(o, fid) -%function o = write(o, fid) -% Write Sections object -% -% INPUTS -% o [sections] sections object -% fid [integer] file id -% -% OUTPUTS -% o [sections] sections object -% -% SPECIAL REQUIREMENTS -% none - -% Copyright (C) 2013-2014 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/>. - -assert(fid ~= -1); -fprintf(fid, '\n%% Sections Object\n'); -nps = numSections(o); -for i=1:nps - o.objArray(i).write(fid); -end -fprintf(fid, '%% End Sections Object\n\n'); -end \ No newline at end of file