Mercurial > hg > octave-nkf
diff liboctave/Array.h @ 8721:e9cb742df9eb
imported patch sort3.diff
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 11 Feb 2009 15:25:53 +0100 |
parents | 314be237cd5b |
children | d5af326a3ede |
line wrap: on
line diff
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -554,6 +554,15 @@ Array<T> sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const; + // Ordering is auto-detected or can be specified. + sortmode is_sorted (sortmode mode = UNSORTED) const; + + // Sort by rows returns only indices. + Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const; + + // Ordering is auto-detected or can be specified. + sortmode is_sorted_rows (sortmode mode = UNSORTED) const; + Array<T> diag (octave_idx_type k = 0) const; template <class U, class F> @@ -578,30 +587,6 @@ } }; -#define INSTANTIATE_ARRAY(T, API) \ - template class API Array<T> - -// FIXME -- these are here for compatibility. In the current -// implementation, only homogeneous array assignments are actually -// instantiated. I think heterogeneous indexed assignments are rare -// enough to be implemented via conversion first. This decision may -// still be revised, that's why these macros stay here. -#define INSTANTIATE_ARRAY_AND_ASSIGN(T, API) \ - INSTANTIATE_ARRAY(T, API) - -#define INSTANTIATE_ARRAY_ASSIGN(LT, RT, API) - // do nothing - -#define INSTANTIATE_ARRAY_SORT(T) \ - template class octave_sort<T>; \ - -#define NO_INSTANTIATE_ARRAY_SORT(T) \ - template <> Array<T> Array<T>::sort \ - (octave_idx_type, sortmode) const { return *this; } \ - template <> Array<T> Array<T>::sort (Array<octave_idx_type> &sidx, \ - octave_idx_type, sortmode) const \ - { sidx = Array<octave_idx_type> (); return *this; } - #endif /*