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 #define IFLT(a, b) if (compare ? compare ((a), (b)) : true) |
|
44 |
|
45 #include "oct-sort.cc" |
|
46 |
|
47 template <> |
|
48 bool |
|
49 ascending_compare (octave_value a, octave_value b) |
|
50 { |
|
51 return (a.string_value () < b.string_value ()); |
|
52 } |
|
53 |
|
54 template <> |
|
55 bool |
|
56 ascending_compare (vec_index<octave_value> *a, vec_index<octave_value> *b) |
|
57 { |
|
58 return (a->vec.string_value () < b->vec.string_value ()); |
|
59 } |
|
60 |
|
61 template <> |
|
62 bool |
|
63 descending_compare (octave_value a, octave_value b) |
|
64 { |
|
65 return (a.string_value () > b.string_value ()); |
|
66 } |
|
67 |
|
68 template <> |
|
69 bool |
|
70 descending_compare (vec_index<octave_value> *a, vec_index<octave_value> *b) |
|
71 { |
|
72 return (a->vec.string_value () > b->vec.string_value ()); |
|
73 } |
|
74 |
|
75 INSTANTIATE_ARRAY_SORT (octave_value); |
|
76 |
6109
|
77 template class OCTINTERP_API Array<octave_value>; |
|
78 |
6708
|
79 INSTANTIATE_ARRAY_ASSIGN (octave_value, octave_value, OCTINTERP_API); |
4598
|
80 |
6109
|
81 template class OCTINTERP_API Array2<octave_value>; |
2928
|
82 |
6109
|
83 template class OCTINTERP_API ArrayN<octave_value>; |
4513
|
84 |
2928
|
85 /* |
|
86 ;;; Local Variables: *** |
|
87 ;;; mode: C++ *** |
|
88 ;;; End: *** |
|
89 */ |