|Anonymous | Login | Signup for a new account||2018-06-21 02:26 CEST|
|Main | My View | View Issues | Change Log | Roadmap | My Account|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000217||ILNumerics||[All Projects] Feature Requests||public||2015-03-11 12:01||2015-03-11 14:00|
|Summary||0000217: Change ".Length" property to exclude empty dimensions|
|Description||ILArray<T>.Length currently gives the length of the longest dimension. This is specified (http://ilnumerics.net/apidoc/?topic=html/P_ILNumerics_ILBaseArray_Length.htm [^]) and working as expected in version 4.7. |
If there is any empty dimension in the array, Length should give 0.
Please comment below and vote for or against that change. Thanks!
|Tags||No tags attached.|
|Edit: redefined the change request definition|
|highly in favor of this - the current behavior is not intuitive. in which use cases it makes sense that length(zeros(1, 0)) == 1 or length(zeros(0)) == 1? at the same time one would think that if a given array returns true on isempty, it would also return 0 on length. it would also be consistent with Matlab behavior.|
|I agree with it, it is not intuitive. But why zeros(0) is size [0,1]? Which should be [0,0] in my opinion. I'd go with Matlab's behavior on Length.|
This change would potentially break existing implementations which rely on the current implementation. It does not make the change impossible but somewhat less favorable.
Let me try to get closer to a potential re-definition. What about that:
A.Length gives the number of elements in the first dimension of A with an individual length of 'max(size(A))'.
Since there are no element in empty arrays it would return 0 in the above mentioned cases.
Btw: we do not create square matrices on zeros(0) or ones(0). Instead we encourage the user to be as specific as possible to prevent from ambiguities. zero(0) would create a 2nd dimension implicitly. Implicitly created dimension are of length 1. Therefore: length(zeros(0),1) == 1.
|2015-03-11 12:01||ho||New Issue|
|2015-03-11 12:21||ho||Description Updated||View Revisions|
|2015-03-11 12:22||ho||Note Added: 0000215|
|2015-03-11 13:07||arnaud||Note Added: 0000216|
|2015-03-11 13:30||b.kurtan||Note Added: 0000217|
|2015-03-11 14:00||ho||Note Added: 0000218|
|Copyright © 2000 - 2011 MantisBT Group|