octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: issorted & sortrows


From: dbateman
Subject: Re: issorted & sortrows
Date: Thu, 12 Feb 2009 09:04:05 -0800 (PST)



Jaroslav Hajek-2 wrote:
> 
> On Thu, Feb 12, 2009 at 9:54 AM, John W. Eaton <address@hidden> wrote:
>> On 12-Feb-2009, Jaroslav Hajek wrote:
>>
>> | On Thu, Feb 12, 2009 at 9:02 AM, John W. Eaton <address@hidden> wrote:
>> |
>> | > removes
>> | > the strange comparison functions for octave_value objects from the
>> | > src/TEMPLATE-INST/Array-tc.cc file.
>> |
>> | Just when I was compiling my own version ... :)
>> | But yours is better - I've been long missing lo-traits.h, I just
>> | lacked the courage to create it (my version puts the traits to
>> | oct-sort.h). I guess maybe some of the stuff inside oct-inttypes.h can
>> | be moved here, so I'll abandon my version.
>>
>> OK.
>>
>> I had to undo the part of my change that removed the strange
>> comparison functions for octave_value objects from the
>> src/TEMPLATE-INST/Array-tc.cc file because without them I was reliably
>> seeing
>>
>>  src/data.cc ............................................error: `pso'
>> undefined near line 252 column 23
>> error: evaluating argument list element number 1
>> error: evaluating argument list element number 1
>> error: called from:
>> error:   /home/jwe/src/octave/test/fntests.m at line 252, column 3
>>
>> but make check succeeds with them.  I added a FIXME in this file
>> because these functions just seem wrong:
>>
>>  // FIXME -- these comparisons don't look right.  Where do we sort
>>  // octave_value objects and expect them to be character strings?
>>
>>  template <>
>>  bool
>>  octave_sort<octave_value>::ascending_compare (const octave_value& a,
>> const octave_value& b)
>>  {
>>    return (a.string_value () < b.string_value ());
>>  }
>>
>>  template <>
>>  bool
>>  octave_sort<octave_value>::descending_compare (const octave_value& a,
>> const octave_value& b)
>>  {
>>    return (a.string_value () > b.string_value ());
>>  }
>>
>> I don't see where they are used.  Does anyone have some clues for me?
>>
>> jwe
>>
> 
> I think these are used for sorting cell arrays.
> 
> 
> -- 
> RNDr. Jaroslav Hajek
> computing expert
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz
> 
> 

I confirm that they are used to sort cell string arrays

D.

-- 
View this message in context: 
http://www.nabble.com/issorted---sortrows-tp21956391p21980287.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]