5164
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 2004, 2005, 2007 David Bateman |
7016
|
4 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Andy Adler |
|
5 |
|
6 This file is part of Octave. |
5164
|
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. |
5164
|
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/>. |
5164
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
|
28 // Instantiate Sparse matrix of double values. |
|
29 |
7433
|
30 #include "lo-mappers.h" |
5164
|
31 #include "Sparse.h" |
|
32 #include "Sparse.cc" |
7433
|
33 #include "oct-sort.cc" |
|
34 |
|
35 template <> |
|
36 bool |
|
37 sparse_ascending_compare (double a, double b) |
|
38 { |
|
39 return (xisnan (b) || (a < b)); |
|
40 } |
|
41 |
|
42 template <> |
|
43 bool |
|
44 sparse_ascending_compare (vec_index<double> *a, vec_index<double> *b) |
|
45 { |
|
46 return (xisnan (b->vec) || (a->vec < b->vec)); |
|
47 } |
|
48 |
|
49 template <> |
|
50 bool |
|
51 sparse_descending_compare (double a, double b) |
|
52 { |
|
53 return (xisnan (a) || (a > b)); |
|
54 } |
|
55 |
|
56 template <> |
|
57 bool |
|
58 sparse_descending_compare (vec_index<double> *a, vec_index<double> *b) |
|
59 { |
|
60 return (xisnan (b->vec) || (a->vec > b->vec)); |
|
61 } |
|
62 |
6708
|
63 INSTANTIATE_SPARSE_AND_ASSIGN (double, OCTAVE_API); |
5164
|
64 |
|
65 #if 0 |
|
66 template std::ostream& operator << (std::ostream&, const Sparse<double>&); |
|
67 #endif |
|
68 |
|
69 /* |
|
70 ;;; Local Variables: *** |
|
71 ;;; mode: C++ *** |
|
72 ;;; End: *** |
|
73 */ |