sort error with ranges

John W. Eaton jwe at bevo.che.wisc.edu
Thu Feb 7 21:43:14 CST 2008


On  5-Feb-2008, David Bateman wrote:

| Michael Goffioul wrote:
| > With CVS from yesterday:
| >
| > octave.exe:7> complement([1,2,3],[1,2,3,4,5])
| > ans =
| >
| >    4   5
| >
| > octave.exe:8> complement([1,2,3],1:5)
| > error: octave_base_value::sort (): wrong type argument `range'
| > error: evaluating if command near line 62, column 3
| > error: called from `unique' in file
| > `D:\Software\VCLibs\local\octave-vc8-debug\share\octave\3.0.0+\m\set\unique.m'
| > error: evaluating postfix operator `.'' near line 55, column 19
| > error: evaluating assignment expression near line 55, column 7
| > error: evaluating if command near line 54, column 3
| > error: called from `create_set' in file
| > `D:\Software\VCLibs\local\octave-vc8-debug\share\octave\3.0.0+\m\set\create_set.m'
| > error: evaluating assignment expression near line 48, column 7
| > error: evaluating if command near line 42, column 3
| > error: called from `complement' in file
| > `D:\Software\VCLibs\local\octave-vc8-debug\share\octave\3.0.0+\m\set\complement.m'
| >
| >
| >   
| What about the attached

I think that's fine for the release-3-0-x branch as it works and
is a very small change, so I applied that changeset from your archive
to mine.

But how about the following for the development sources?  These changes
avoid converting the range to a matrix just to sort the values.  We
should probably do the same for the any and all functions defined in
ov-range.cc.

Also, shouldn't the sortmode enum be inside the octave_sort class?

How is an UNDEFINED sortmode used?  Should we maybe just have only
ASCENDING and DESCENDING, with the default ASCENDING instead of
UNDEFINED?

Thanks,

jwe


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080207/780d0b03/attachment.ksh 


More information about the Bug-octave mailing list