Mercurial > hg > octave-lyh
annotate liboctave/Array-f.cc @ 11498:367bfee35ba0
data member initialization fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 13 Jan 2011 02:37:45 -0500 |
parents | 4d1fc073fbb7 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
1 /* |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
2 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
3 Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2003, 2004, |
8920 | 4 2005, 2006, 2007, 2008, 2009 John W. Eaton |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10374
diff
changeset
|
5 Copyright (C) 2009 VZLU Prague |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
6 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
7 This file is part of Octave. |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
8 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
9 Octave is free software; you can redistribute it and/or modify it |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
10 under the terms of the GNU General Public License as published by the |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
11 Free Software Foundation; either version 3 of the License, or (at your |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
12 option) any later version. |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
13 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
14 Octave is distributed in the hope that it will be useful, but WITHOUT |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
17 for more details. |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
18 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
19 You should have received a copy of the GNU General Public License |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
20 along with Octave; see the file COPYING. If not, see |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
21 <http://www.gnu.org/licenses/>. |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
22 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
23 */ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
24 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
25 #ifdef HAVE_CONFIG_H |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
26 #include <config.h> |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
27 #endif |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
28 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
29 // Instantiate Arrays of float values. |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
30 |
9003
0631d397fbe0
replace lo_ieee_isnan by xisnan, add missing includes
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
31 #include "lo-mappers.h" |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
32 #include "Array.h" |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
33 #include "Array.cc" |
8377
25bc2d31e1bf
improve OCTAVE_LOCAL_BUFFER
Jaroslav Hajek <highegg@gmail.com>
parents:
8290
diff
changeset
|
34 #include "oct-locbuf.h" |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
35 |
8700 | 36 #define INLINE_ASCENDING_SORT |
37 #define INLINE_DESCENDING_SORT | |
38 #include "oct-sort.cc" | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
39 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
40 template <> |
8725 | 41 inline bool |
42 sort_isnan<float> (float x) | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
43 { |
9003
0631d397fbe0
replace lo_ieee_isnan by xisnan, add missing includes
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
44 return xisnan (x); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
45 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
46 |
8725 | 47 static bool |
48 nan_ascending_compare (float x, float y) | |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
49 { |
9003
0631d397fbe0
replace lo_ieee_isnan by xisnan, add missing includes
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
50 return xisnan (y) ? ! xisnan (x) : x < y; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
51 } |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
52 |
8725 | 53 static bool |
54 nan_descending_compare (float x, float y) | |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
55 { |
9003
0631d397fbe0
replace lo_ieee_isnan by xisnan, add missing includes
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
56 return xisnan (x) ? ! xisnan (y) : x > y; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
57 } |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
58 |
8725 | 59 Array<float>::compare_fcn_type |
9920
56fbe170d354
fix issorted with NaNs in middle
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
60 safe_comparator (sortmode mode, const Array<float>& a , bool allow_chk) |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
61 { |
8725 | 62 Array<float>::compare_fcn_type result = 0; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
63 |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
64 if (allow_chk) |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
65 { |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
66 octave_idx_type k = 0; |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
67 for (; k < a.numel () && ! xisnan (a(k)); k++) ; |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
68 if (k == a.numel ()) |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
69 { |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
70 if (mode == ASCENDING) |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
71 result = octave_sort<float>::ascending_compare; |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
72 else if (mode == DESCENDING) |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
73 result = octave_sort<float>::descending_compare; |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
74 } |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
75 } |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
76 |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
77 if (! result) |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
78 { |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
79 if (mode == ASCENDING) |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
80 result = nan_ascending_compare; |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
81 else if (mode == DESCENDING) |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
82 result = nan_descending_compare; |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
83 } |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
84 |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
85 return result; |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
86 } |
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
87 |
9922
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
88 // The default solution using NaN-safe comparator is OK, but almost twice as |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
89 // slow than this code. |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
90 template <> |
9941
1369f13ae6b2
several fixes by M. Goffioul
Jaroslav Hajek <highegg@gmail.com>
parents:
9922
diff
changeset
|
91 OCTAVE_API |
9922
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
92 sortmode |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
93 Array<float>::is_sorted (sortmode mode) const |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
94 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
95 octave_idx_type n = numel (); |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
96 |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
97 const float *el = data (); |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
98 |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
99 if (n <= 1) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
100 return mode ? mode : ASCENDING; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
101 |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
102 if (! mode) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
103 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
104 // Auto-detect mode. |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
105 if (el[n-1] < el[0] || xisnan (el[0])) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
106 mode = DESCENDING; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
107 else |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
108 mode = ASCENDING; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
109 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
110 |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
111 if (mode == DESCENDING) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
112 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
113 octave_idx_type j = 0; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
114 float r; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
115 // Sort out NaNs. |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
116 do |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
117 r = el[j++]; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
118 while (xisnan (r) && j < n); |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
119 |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
120 // Orient the test so that NaN will not pass through. |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
121 for (; j < n; j++) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
122 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
123 if (r >= el[j]) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
124 r = el[j]; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
125 else |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
126 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
127 mode = UNSORTED; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
128 break; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
129 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
130 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
131 |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
132 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
133 else if (mode == ASCENDING) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
134 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
135 // Sort out NaNs. |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
136 while (n > 0 && xisnan (el[n-1])) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
137 n--; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
138 |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
139 if (n > 0) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
140 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
141 // Orient the test so that NaN will not pass through. |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
142 float r = el[0]; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
143 for (octave_idx_type j = 1; j < n; j++) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
144 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
145 if (r <= el[j]) |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
146 r = el[j]; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
147 else |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
148 { |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
149 mode = UNSORTED; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
150 break; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
151 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
152 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
153 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
154 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
155 |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
156 return mode; |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
157 } |
3a8327d51ed4
optimize issorted for doubles & floats
Jaroslav Hajek <highegg@gmail.com>
parents:
9920
diff
changeset
|
158 |
8710 | 159 INSTANTIATE_ARRAY_SORT (float); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
160 |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8710
diff
changeset
|
161 INSTANTIATE_ARRAY (float, OCTAVE_API); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
162 |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9287
diff
changeset
|
163 template OCTAVE_API std::ostream& operator << (std::ostream&, const Array<float>&); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
164 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
165 #include "DiagArray2.h" |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
166 #include "DiagArray2.cc" |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
167 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
168 template class OCTAVE_API DiagArray2<float>; |