changeset 20456:6dc15d4cc17e

Backout cset 2edd668e7784 and return column orientation for union.m. * union.m: Backout cset 2edd668e7784.
author Rik <rik@octave.org>
date Mon, 03 Aug 2015 07:43:28 -0700
parents 6cfbf412a2c3
children 4262598620ae
files scripts/set/union.m
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/set/union.m	Sat Aug 01 18:42:25 2015 -0400
+++ b/scripts/set/union.m	Mon Aug 03 07:43:28 2015 -0700
@@ -51,7 +51,7 @@
   [a, b] = validsetargs ("union", a, b, varargin{:});
 
   by_rows = nargin == 3;
-  isrowvec = (isrow (a) || isempty (a)) && (isrow (b) || isempty (b));
+  isrowvec = isvector (a) && isvector (b) && isrow (a) && isrow (b);
 
   if (by_rows)
     y = [a; b];
@@ -94,12 +94,6 @@
 %! assert (y, [1; 2; 3; 4; 5]);
 %! assert (y, sort ([a(ia)'; b(ib)']));
 
-## Test format when input is empty
-%!assert (union ([],[1,2]), [1,2])
-%!assert (union ([1,2],[]), [1,2])
-%!assert (union ([],[1;2]), [1;2])
-%!assert (union ([1;2],[]), [1;2])
-
 ## Test common input validation for set routines contained in validsetargs
 %!error <cell array of strings cannot be combined> union ({"a"}, 1)
 %!error <A and B must be arrays or cell arrays> union (@sin, 1)
@@ -108,3 +102,4 @@
 %!error <A and B must be arrays or cell arrays> union (@sin, 1, "rows")
 %!error <A and B must be 2-dimensional matrices> union (rand(2,2,2), 1, "rows")
 %!error <number of columns in A and B must match> union ([1 2], 1, "rows")
+