comparison src/TEMPLATE-INST/Array-tc.cc @ 8651:ea8e65ca234f

reduce memory usage in sorting
author Jaroslav Hajek <highegg@gmail.com>
date Tue, 03 Feb 2009 08:16:39 +0100
parents 402168152bb9
children 314be237cd5b
comparison
equal deleted inserted replaced
8650:a1ae2aae903e 8651:ea8e65ca234f
51 return (a.string_value () < b.string_value ()); 51 return (a.string_value () < b.string_value ());
52 } 52 }
53 53
54 template <> 54 template <>
55 bool 55 bool
56 ascending_compare (vec_index<octave_value> *a, vec_index<octave_value> *b) 56 ascending_compare (const octave_value *a, const octave_value *b)
57 { 57 {
58 return (a->vec.string_value () < b->vec.string_value ()); 58 return (a->string_value () < b->string_value ());
59 } 59 }
60 60
61 template <> 61 template <>
62 bool 62 bool
63 descending_compare (octave_value a, octave_value b) 63 descending_compare (octave_value a, octave_value b)
65 return (a.string_value () > b.string_value ()); 65 return (a.string_value () > b.string_value ());
66 } 66 }
67 67
68 template <> 68 template <>
69 bool 69 bool
70 descending_compare (vec_index<octave_value> *a, vec_index<octave_value> *b) 70 descending_compare (const octave_value *a, const octave_value *b)
71 { 71 {
72 return (a->vec.string_value () > b->vec.string_value ()); 72 return (a->string_value () > b->string_value ());
73 } 73 }
74 74
75 INSTANTIATE_ARRAY_SORT (octave_value); 75 INSTANTIATE_ARRAY_SORT (octave_value);
76 76
77 template class OCTINTERP_API Array<octave_value>; 77 template class OCTINTERP_API Array<octave_value>;