octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for union.m


From: Rik
Subject: Re: patch for union.m
Date: Fri, 31 Jul 2015 11:14:59 -0700

On 07/31/2015 09:00 AM, address@hidden wrote:
Subject:
Re: an unreported fix to union.m
From:
Juan Pablo Carbajal <address@hidden>
Date:
07/31/2015 05:08 AM
To:
Maintainers GNU Octave <address@hidden>
List-Post:
<mailto:address@hidden>
Precedence:
list
MIME-Version:
1.0
References:
<address@hidden>
In-Reply-To:
<address@hidden>
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=UTF-8
Message:
5

On Fri, Jul 31, 2015 at 1:02 PM, Juan Pablo Carbajal
<address@hidden> wrote:

        
I have condensed the changes into a single line correction and added
some tests. Please verify that indeed the output is compatible with
Matlab's

https://savannah.gnu.org/patch/index.php?8710


Juan,

I know you were following the code that was already there, but I think it can be simplified further.  There is no need to check both isvector() and isrow() since isrow already checks that the input is a vector.

+  isrowvec = ( isempty(a) || (isvector (a) && isrow (a)) ) && ...
+             ( isempty(b) || (isvector (b) && isrow (b)) );

=>

  isrowvec = (isrow (a) || isempty (a)) && (isrow (b) || isempty (b));

--Rik

reply via email to

[Prev in Thread] Current Thread [Next in Thread]