annotate liboctave/numeric/oct-spparms.cc @ 27923:bd51beb6205e

update formatting of copyright notices * Use <https://octave.org/copyright/> instead of <https://octave.org/COPYRIGHT.html/>. * For consistency with other comments in the Octave sources, use C++-style comments for copyright blocks in C and C++ files. * Use delimiters above and below copyright blocks that are appropriate for the language used in the file. * Eliminate extra spacing inside copyright blocks. * lex.ll (looks_like_copyright): Also allow newlines and carriage returns before the word "Copyright". * scripts/mk-doc.pl (gethelp): Also skip empty comment lines. * bp-table.cc, type.m: Adjust tests.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Jan 2020 11:59:41 -0500
parents 1891570abac8
children 0a5b15007766
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 // Copyright (C) 1998-2020 The Octave Project Developers
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
25
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21723
diff changeset
26 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21202
diff changeset
27 # include "config.h"
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
28 #endif
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
29
23475
d691ed308237 maint: Clean up #includes in liboctave/numeric directory.
Rik <rik@octave.org>
parents: 23457
diff changeset
30 #include <ostream>
d691ed308237 maint: Clean up #includes in liboctave/numeric directory.
Rik <rik@octave.org>
parents: 23457
diff changeset
31
d691ed308237 maint: Clean up #includes in liboctave/numeric directory.
Rik <rik@octave.org>
parents: 23457
diff changeset
32 #include "dNDArray.h"
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
33 #include "lo-error.h"
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
34 #include "lo-ieee.h"
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
35 #include "oct-spparms.h"
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
36 #include "singleton-cleanup.h"
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
37
23457
21baad6b35c4 maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents: 23220
diff changeset
38 octave_sparse_params *octave_sparse_params::instance = nullptr;
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
39
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
40 bool
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
41 octave_sparse_params::instance_ok (void)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
42 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
43 bool retval = true;
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
44
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
45 if (! instance)
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
46 {
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
47 instance = new octave_sparse_params ();
26369
0249ba4c9589 Fix static analyzer detected V668 issues (bug #55347).
Andreas Weber <octave@josoansi.de>
parents: 25054
diff changeset
48 singleton_cleanup_list::add (cleanup_instance);
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
49 }
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
50
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
51 return retval;
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
52 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
53
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
54 void
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
55 octave_sparse_params::defaults (void)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
56 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
57 if (instance_ok ())
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
58 instance->do_defaults ();
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
59 }
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
60
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
61 void
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
62 octave_sparse_params::tight (void)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
63 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
64 if (instance_ok ())
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
65 instance->do_tight ();
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
66 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
67
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
68 string_vector
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
69 octave_sparse_params::get_keys (void)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
70 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
71 return instance_ok () ? instance->do_get_keys () : string_vector ();
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
72 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
73
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
74 ColumnVector
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
75 octave_sparse_params::get_vals (void)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
76 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
77 return instance_ok () ? instance->do_get_vals () : ColumnVector ();
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
78 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
79
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
80 bool
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
81 octave_sparse_params::set_vals (const NDArray& vals)
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
82 {
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
83 return instance_ok () ? instance->do_set_vals (vals) : false;
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
84 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
85
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
86 bool
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
87 octave_sparse_params::set_key (const std::string& key, const double& val)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
88 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
89 return instance_ok () ? instance->do_set_key (key, val) : false;
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
90 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
91
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
92 double
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
93 octave_sparse_params::get_key (const std::string& key)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
94 {
22402
4caa7b28d183 maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents: 22323
diff changeset
95 return instance_ok () ? instance->do_get_key (key)
4caa7b28d183 maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents: 22323
diff changeset
96 : octave::numeric_limits<double>::NaN ();
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
97 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
98
6460
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
99 double
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
100 octave_sparse_params::get_bandden (void)
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
101 {
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
102 return instance_ok () ? instance->do_get_bandden () : 0.0;
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
103 }
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
104
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
105 void
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
106 octave_sparse_params::print_info (std::ostream& os, const std::string& prefix)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
107 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
108 if (instance_ok ())
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
109 instance->do_print_info (os, prefix);
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
110 }
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
111
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
112 void
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
113 octave_sparse_params::do_defaults (void)
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
114 {
7515
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
115 params(0) = 0; // spumoni
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
116 params(1) = 1; // ths_rel
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
117 params(2) = 1; // ths_abs
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
118 params(3) = 0; // exact_d
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
119 params(4) = 3; // supernd
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
120 params(5) = 3; // rreduce
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
121 params(6) = 0.5; // wh_frac
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
122 params(7) = 1; // autommd
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
123 params(8) = 1; // autoamd
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
124 params(9) = 0.1; // piv_tol
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
125 params(10) = 0.5; // bandden
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
126 params(11) = 1; // umfpack
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
127 params(12) = 0.001; // sym_tol
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
128 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
129
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
130 void
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
131 octave_sparse_params::do_tight (void)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
132 {
7515
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
133 params(0) = 0; // spumoni
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
134 params(1) = 1; // ths_rel
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
135 params(2) = 0; // ths_abs
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
136 params(3) = 1; // exact_d
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
137 params(4) = 1; // supernd
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
138 params(5) = 1; // rreduce
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
139 params(6) = 0.5; // wh_frac
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
140 params(7) = 1; // autommd
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
141 params(8) = 1; // autoamd
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
142 params(9) = 0.1; // piv_tol
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
143 params(10) = 0.5; // bandden
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
144 params(11) = 1; // umfpack
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
145 params(12) = 0.001; // sym_tol
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
146 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
147
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
148 void
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
149 octave_sparse_params::init_keys (void)
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
150 {
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
151 keys(0) = "spumoni";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
152 keys(1) = "ths_rel";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
153 keys(2) = "ths_abs";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
154 keys(3) = "exact_d";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
155 keys(4) = "supernd";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
156 keys(5) = "rreduce";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
157 keys(6) = "wh_frac";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
158 keys(7) = "autommd";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
159 keys(8) = "autoamd";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
160 keys(9) = "piv_tol";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
161 keys(10) = "bandden";
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
162 keys(11) = "umfpack";
7515
f3c00dc0912b Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
163 keys(12) = "sym_tol";
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
164 }
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
165
6460
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
166 double
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
167 octave_sparse_params::do_get_bandden (void)
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
168 {
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
169 return params(10);
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
170 }
fa6312d93730 [project @ 2007-03-26 21:23:00 by dbateman]
dbateman
parents: 5893
diff changeset
171
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
172 bool
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
173 octave_sparse_params::do_set_vals (const NDArray& vals)
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
174 {
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 19697
diff changeset
175 octave_idx_type len = vals.numel ();
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
176
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
177 if (len > OCTAVE_SPARSE_CONTROLS_SIZE)
21136
7cac4e7458f2 maint: clean up code around calls to current_liboctave_error_handler.
Rik <rik@octave.org>
parents: 20232
diff changeset
178 (*current_liboctave_error_handler)
7cac4e7458f2 maint: clean up code around calls to current_liboctave_error_handler.
Rik <rik@octave.org>
parents: 20232
diff changeset
179 ("octave_sparse_params::do_set_vals: too many values");
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
180
21136
7cac4e7458f2 maint: clean up code around calls to current_liboctave_error_handler.
Rik <rik@octave.org>
parents: 20232
diff changeset
181 for (int i = 0; i < len; i++)
7cac4e7458f2 maint: clean up code around calls to current_liboctave_error_handler.
Rik <rik@octave.org>
parents: 20232
diff changeset
182 params(i) = vals(i);
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
183
21136
7cac4e7458f2 maint: clean up code around calls to current_liboctave_error_handler.
Rik <rik@octave.org>
parents: 20232
diff changeset
184 return true;
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
185 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
186
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
187 bool
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
188 octave_sparse_params::do_set_key (const std::string& key, const double& val)
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
189 {
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
190 for (int i = 0; i < OCTAVE_SPARSE_CONTROLS_SIZE; i++)
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
191 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
192 if (keys (i) == key)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
193 {
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
194 params(i) = val;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
195 return true;
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
196 }
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
197 }
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
198
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
199 return false;
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
200 }
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
201
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
202 double
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
203 octave_sparse_params::do_get_key (const std::string& key)
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
204 {
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
205 for (int i = 0; i < OCTAVE_SPARSE_CONTROLS_SIZE; i++)
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
206 {
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
207 if (keys (i) == key)
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
208 return params(i);
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
209 }
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
210
21723
bae585228161 use namespace for numeric_limits
John W. Eaton <jwe@octave.org>
parents: 21721
diff changeset
211 return octave::numeric_limits<double>::NaN ();
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
212 }
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
213
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
214 void
5893
d73ffe42f2c8 [project @ 2006-07-16 07:48:19 by jwe]
jwe
parents: 5307
diff changeset
215 octave_sparse_params::do_print_info (std::ostream& os,
10314
07ebe522dac2 untabify liboctave C++ sources
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
216 const std::string& prefix) const
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
217 {
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
218 for (int i = 0; i < OCTAVE_SPARSE_CONTROLS_SIZE; i++)
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
219 os << prefix << keys(i) << ": " << params(i) << "\n";
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents:
diff changeset
220 }