octave-maintainers
[Top][All Lists]
Advanced

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

Re: important for OF maintainer - ismatrix backwards incompatible change


From: siko1056
Subject: Re: important for OF maintainer - ismatrix backwards incompatible change in octave 4.0
Date: Fri, 13 Feb 2015 01:28:13 -0800 (PST)

The recent change of ismatrix() is for me a step towards the clear
distinction of data types and dimension for input checking. I was surprised
when I noticed in my input checking, that a 3D-Array was seen as a Matrix by
Octave, which to my understanding was clearly a 2D-Object.

As far as I figured out, an Object (=Array?) x always has at least 2
nonnegative dimensions and a data type. 

2-D Dimension (with M,N >= 0):
MxN - ismatrix(x)
MxM - issquare(x) 
1x1 - isscalar(x)
(1xN XOR Mx1) - isvector(x)
Mx1 - iscolumn(x)
1xN - isrow(x)

For higher dimension (N-D) checks the user has to take care of the dimension
on his own (even has to struggle with singleton dimensions) using:
K = ndims(x) with K >= 2
[M, N, ...] = size(x)  // I just noticed the documentation on the website is
misleading with only 2 dimensions here!
MxMxMx... - size_equal(x)

Data type:
ischar()
isnumeric()
isstruct()
....

To get to the point. Does it make sense to group data types, that might
change in the future, or with the next Matlab release?  Is an 3D-Array of
structures not an Array? A potential "isarray" should not mix up data type
and dimension checking. This is very likely to break the interface in the
future again.

My suggestion is to leave the state as it is and to improve the
documentation regarding:

1. Dimesion checks
2. Data type checks
3. A clear terminology what an "array", "matrix", etc. is

Kai



--
View this message in context: 
http://octave.1599824.n4.nabble.com/important-for-OF-maintainer-ismatrix-backwards-incompatible-change-in-octave-4-0-tp4668565p4668571.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.




reply via email to

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