# HG changeset patch # User jwe # Date 1196722521 0 # Node ID da540e715d056ece1acbfcf6258b323263db0f25 # Parent 3a695b7adf8e39b1f23dfb9739127f0281fe3b6c [project @ 2007-12-03 22:55:20 by jwe] diff -r 3a695b7adf8e -r da540e715d05 liboctave/Array-util.cc --- a/liboctave/Array-util.cc Mon Dec 03 20:16:36 2007 +0000 +++ b/liboctave/Array-util.cc Mon Dec 03 22:55:21 2007 +0000 @@ -451,6 +451,16 @@ return retval; } +int +permute_vector_compare (const void *a, const void *b) +{ + const permute_vector *pva = static_cast (a); + const permute_vector *pvb = static_cast (b); + + return pva->pidx > pvb->pidx; +} + + void gripe_nonconformant (const char *op, int op1_len, int op2_len) { diff -r 3a695b7adf8e -r da540e715d05 liboctave/Array-util.h --- a/liboctave/Array-util.h Mon Dec 03 20:16:36 2007 +0000 +++ b/liboctave/Array-util.h Mon Dec 03 22:55:21 2007 +0000 @@ -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, diff -r 3a695b7adf8e -r da540e715d05 liboctave/Array.cc --- a/liboctave/Array.cc Mon Dec 03 20:16:36 2007 +0000 +++ b/liboctave/Array.cc Mon Dec 03 22:55:21 2007 +0000 @@ -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 (a); - const permute_vector *pvb = static_cast (b); - - return pva->pidx > pvb->pidx; -} + template Array diff -r 3a695b7adf8e -r da540e715d05 liboctave/ChangeLog --- a/liboctave/ChangeLog Mon Dec 03 20:16:36 2007 +0000 +++ b/liboctave/ChangeLog Mon Dec 03 22:55:21 2007 +0000 @@ -1,3 +1,9 @@ +2007-12-03 Moritz Borgmann + + * 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 * Sparse.cc (template int assign