Mercurial > hg > octave-lyh
changeset 7241:da540e715d05
[project @ 2007-12-03 22:55:20 by jwe]
author | jwe |
---|---|
date | Mon, 03 Dec 2007 22:55:21 +0000 |
parents | 3a695b7adf8e |
children | e4398e3903be |
files | liboctave/Array-util.cc liboctave/Array-util.h liboctave/Array.cc liboctave/ChangeLog |
diffstat | 4 files changed, 26 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array-util.cc +++ b/liboctave/Array-util.cc @@ -451,6 +451,16 @@ return retval; } +int +permute_vector_compare (const void *a, const void *b) +{ + const permute_vector *pva = static_cast<const permute_vector *> (a); + const permute_vector *pvb = static_cast<const permute_vector *> (b); + + return pva->pidx > pvb->pidx; +} + + void gripe_nonconformant (const char *op, int op1_len, int op2_len) {
--- a/liboctave/Array-util.h +++ b/liboctave/Array-util.h @@ -78,6 +78,15 @@ const dim_vector& dimensions, int resize_ok); +struct +permute_vector +{ + octave_idx_type pidx; + octave_idx_type iidx; +}; + +extern int permute_vector_compare (const void *a, const void *b); + extern void OCTAVE_API gripe_nonconformant (const char *op, int op1_len, int op2_len); extern void OCTAVE_API gripe_nonconformant (const char *op, int op1_nr, int op1_nc,
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -401,21 +401,7 @@ return retval; } -struct -permute_vector -{ - octave_idx_type pidx; - octave_idx_type iidx; -}; - -static int -permute_vector_compare (const void *a, const void *b) -{ - const permute_vector *pva = static_cast<const permute_vector *> (a); - const permute_vector *pvb = static_cast<const permute_vector *> (b); - - return pva->pidx > pvb->pidx; -} + template <class T> Array<T>
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2007-12-03 Moritz Borgmann <octave@moriborg.de> + + * Array-util.cc (permute_vector_compare): Move here from Array.cc. + * Array-util.h (permute_vector, permute_vector_compare): Provide decls. + * Array.cc (permute_vector, permute_vector_compare): Delete. + 2007-12-03 David Bateman <dbateman@free.fr> * Sparse.cc (template <class LT, class RT> int assign