help-octave
[Top][All Lists]
Advanced

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

Re: is_complex_nd_array() ?


From: Max Brister
Subject: Re: is_complex_nd_array() ?
Date: Thu, 16 Aug 2012 19:04:20 -0500

On Thu, Aug 16, 2012 at 6:53 PM, jjg <address@hidden> wrote:
>
> Max Brister wrote
>>
>>> Bizzarely, is_matrix_type() is true for matrices and NDarrays.
>>>
>>> I could see that is_nd_array_type() (which does not exist)
>>> would be true for matrices, but an NDarray is a matrix type???
>>
>> Matrix is a subclass of NDArray in Octave. I'm not sure why
>> is_real_nd_array even exists, it looks like it always returns false.
>>
>
> If Matrix is a subclass of NDArray, then one would expect that
> is_nd_array() would be true for matrices (since they are a
> subclass).  But NDArray is not a subclass of Matrix, so finding
> that is_matrix() is true for an NDArray is, well, freakish.

What you have here is an octave_value containing a Matrix (which is
also an NDArray).

> The principle of least surprise is violated here!

Yes, and it has been fixed on the development branch by removing
is_real_nd_array [1]. Thank you for reporting the issue.

[1] http://hg.savannah.gnu.org/hgweb/octave/rev/8367f326fa29

-- 
Max Brister


reply via email to

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