# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1361994681 18000 # Node ID c6b2409672e9271eb12e4b2c9f92f229416682db # Parent 797ac81586d1da502243583eb4f78c6a08a00367# Parent 2fd39ab122091adb1e824cb5f7ad2ff5632a5b39 Merge in Julien's changes diff -r 2fd39ab12209 -r c6b2409672e9 doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in Wed Feb 27 13:09:33 2013 -0500 +++ b/doc/interpreter/contributors.in Wed Feb 27 14:51:21 2013 -0500 @@ -10,6 +10,7 @@ Alexander Barth David Bateman Heinz Bauschke +Julien Bect Roman Belov Karl Berry David Billinghurst diff -r 2fd39ab12209 -r c6b2409672e9 libinterp/parse-tree/pt-mat.cc --- a/libinterp/parse-tree/pt-mat.cc Wed Feb 27 13:09:33 2013 -0500 +++ b/libinterp/parse-tree/pt-mat.cc Wed Feb 27 14:51:21 2013 -0500 @@ -402,7 +402,7 @@ first_elem = false; dv = this_elt_dv; } - else if (! dv.hvcat (this_elt_dv, 1)) + else if ((! any_class) && (! dv.hvcat (this_elt_dv, 1))) { eval_error ("horizontal dimensions mismatch", dv, this_elt_dv); break; @@ -644,7 +644,7 @@ dv(1) = this_elt_nc; dv(0) += this_elt_nr; } - else if (! dv.hvcat (this_elt_dv, 0)) + else if ((!any_class) && (!dv.hvcat (this_elt_dv, 0))) { eval_error ("vertical dimensions mismatch", dv, this_elt_dv); return; diff -r 2fd39ab12209 -r c6b2409672e9 test/classes/classes.tst --- a/test/classes/classes.tst Wed Feb 27 13:09:33 2013 -0500 +++ b/test/classes/classes.tst Wed Feb 27 14:51:21 2013 -0500 @@ -304,6 +304,10 @@ %!assert (s1 >= (x1 - 1)) %!assert (x1 >= (s1 - 1)) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Testing horizontal & vertical concatenation %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %% Test overloaded vertcat() for the Snork class %% See bug #38170 (http://savannah.gnu.org/bugs/?38170) %!test s = [s1; s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1; x2])); @@ -316,6 +320,20 @@ %!xtest s = [s1 x2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1 x2])); %!xtest s = [x1 s2]; assert (isa (s, 'Snork') && isequal (s.gick, [x1 x2])); +%% Test with the Blork class, where neither vertcat() nor horzcat() is overloaded +%!shared x1, x2, x3 +%!test x1 = Blork(); +%!test x2 = [x1 x1]; +%!assert (isa (x2, 'Blork') && isequal (size (x2), [1 2])); +%!test x2 = [x1 51]; +%!assert (isa (x2, 'Blork') && isequal (size (x2), [1 2])); +%!test x3 = [x2; x2]; +%!assert (isa (x3, 'Blork') && isequal (size (x3), [2 2])); +%!test x3 = [x2; [51 x1]]; +%!assert (isa (x3, 'Blork') && isequal (size (x3), [2 2])); +%!error x4 = [x1 x3]; +%!error x4 = [x1; x3]; + %%%%%%%%%%%%%%%%%%%%%%%% %% Testing precedence %% %%%%%%%%%%%%%%%%%%%%%%%%