Mercurial > octave
diff liboctave/array/Array.h @ 23386:f1ea44e92df8
improve compatibility for single index indexing (bug #50776)
* dim-vector.h (dim_vector::make_nd_vector, dim_vector::is_nd_vector):
New functions.
* idx-vector.cc: Preserve nd-vector orientation for logical indices.
* Array.cc (Array<T>::index): Simplify.
* Array.h (Array<T>::is_nd_vector): New function.
* test/single-index.tst: New file.
* test/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 12 Apr 2017 10:04:05 -0400 |
parents | 092078913d54 |
children | e0c20a22da7e |
line wrap: on
line diff
--- a/liboctave/array/Array.h Tue Apr 11 08:00:23 2017 +0200 +++ b/liboctave/array/Array.h Wed Apr 12 10:04:05 2017 -0400 @@ -576,6 +576,8 @@ bool is_vector (void) const { return dimensions.is_vector (); } + bool is_nd_vector (void) const { return dimensions.is_nd_vector (); } + Array<T> transpose (void) const; Array<T> hermitian (T (*fcn) (const T&) = 0) const;