Mercurial > hg > octave-lyh
annotate src/TEMPLATE-INST/Array-tc.cc @ 8730:474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 12 Feb 2009 03:44:41 -0500 |
parents | d5af326a3ede |
children | a669df7beb73 |
rev | line source |
---|---|
2928 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, |
4 2007 John W. Eaton | |
2928 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2928 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2928 | 21 |
22 */ | |
23 | |
24 // Instantiate Arrays of octave_values. | |
25 | |
26 #ifdef HAVE_CONFIG_H | |
27 #include <config.h> | |
28 #endif | |
29 | |
30 #include "Array.h" | |
31 #include "Array.cc" | |
32 | |
3354 | 33 #include "Array2.h" |
34 | |
4513 | 35 #include "ArrayN.h" |
36 #include "ArrayN.cc" | |
37 | |
3354 | 38 #include "DiagArray2.h" |
39 #include "DiagArray2.cc" | |
40 | |
4055 | 41 #include "oct-obj.h" |
2928 | 42 |
7433 | 43 #include "oct-sort.cc" |
44 | |
8730
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
45 // FIXME -- these comparisons don't look right. Where do we sort |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
46 // octave_value objects and expect them to be character strings? |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
47 |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
48 template <> |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
49 bool |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
50 octave_sort<octave_value>::ascending_compare (const octave_value& a, const octave_value& b) |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
51 { |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
52 return (a.string_value () < b.string_value ()); |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
53 } |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
54 |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
55 template <> |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
56 bool |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
57 octave_sort<octave_value>::descending_compare (const octave_value& a, const octave_value& b) |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
58 { |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
59 return (a.string_value () > b.string_value ()); |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
60 } |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
61 |
474f64ab905f
src/TEMPLATE-INST/Array-tc.cc: undo previous change
John W. Eaton <jwe@octave.org>
parents:
8725
diff
changeset
|
62 INSTANTIATE_ARRAY_SORT (octave_value); |
7433 | 63 |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8700
diff
changeset
|
64 INSTANTIATE_ARRAY (octave_value, OCTINTERP_API); |
4598 | 65 |
6109 | 66 template class OCTINTERP_API Array2<octave_value>; |
2928 | 67 |
6109 | 68 template class OCTINTERP_API ArrayN<octave_value>; |
4513 | 69 |
2928 | 70 /* |
71 ;;; Local Variables: *** | |
72 ;;; mode: C++ *** | |
73 ;;; End: *** | |
74 */ |