Mercurial > octave
annotate liboctave/numeric/oct-spparms.h @ 31249:de6fc38c78c6
Make Jacobian types offered by dlsode.f accessible by lsode (bug #31626).
* liboctave/numeric/LSODE-opts.in: Add options "jacobian type", "lower jacobian
subdiagonals", and "upper jacobian subdiagonals".
* liboctave/numeric/LSODE.cc (file scope, lsode_j,
LSODE::do_integrate (double)): Handle new configurable Jacobian types.
* build-aux/mk-opts.pl: Don't implicitly convert to integer in condition.
author | Olaf Till <olaf.till@uni-jena.de> |
---|---|
date | Fri, 12 Nov 2010 08:53:05 +0100 |
parents | 796f54d4ddbf |
children | db8735ee84da e88a07dec498 |
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 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30429
diff
changeset
|
3 // Copyright (C) 1998-2022 The Octave Project Developers |
27923
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 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #if ! defined (octave_oct_spparms_h) |
5164 | 27 #define octave_oct_spparms_h 1 |
28 | |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
30 |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
31 #include <iosfwd> |
23475
d691ed308237
maint: Clean up #includes in liboctave/numeric directory.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
32 #include <string> |
5164 | 33 |
30429
e38202d3628d
provide header file for forward declaration of Array<T> template
John W. Eaton <jwe@octave.org>
parents:
29954
diff
changeset
|
34 #include "Array-fwd.h" |
5164 | 35 #include "str-vec.h" |
36 #include "dColVector.h" | |
23475
d691ed308237
maint: Clean up #includes in liboctave/numeric directory.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
37 |
7515
f3c00dc0912b
Eliminate the rest of the dispatched sparse functions
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
38 #define OCTAVE_SPARSE_CONTROLS_SIZE 13 |
5164 | 39 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
40 namespace octave |
5164 | 41 { |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
42 class OCTAVE_API sparse_params |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
43 { |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
44 protected: |
5164 | 45 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
46 sparse_params (void) |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
47 : m_params (OCTAVE_SPARSE_CONTROLS_SIZE), |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
48 m_keys (OCTAVE_SPARSE_CONTROLS_SIZE) |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
49 { |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
50 init_keys (); |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
51 do_defaults (); |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
52 } |
5893 | 53 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
54 public: |
5893 | 55 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
56 sparse_params (const sparse_params&) = default; |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
57 |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
58 sparse_params& operator = (const sparse_params&) = default; |
6482 | 59 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
60 ~sparse_params (void) = default; |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
61 |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
62 static bool instance_ok (void); |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
63 |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
64 static void defaults (void); |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
65 |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
66 static void tight (void); |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
67 |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
68 static string_vector get_keys (void); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
69 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
70 static ColumnVector get_vals (void); |
6482 | 71 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
72 static bool set_vals (const Array<double>& vals); |
6482 | 73 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
74 static bool set_key (const std::string& key, const double& val); |
5893 | 75 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
76 static double get_key (const std::string& key); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
77 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
78 static double get_bandden (void); |
5164 | 79 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
80 static void print_info (std::ostream& os, const std::string& prefix); |
5164 | 81 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
82 private: |
5164 | 83 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
84 ColumnVector m_params; |
5164 | 85 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
86 string_vector m_keys; |
5164 | 87 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
88 static sparse_params *s_instance; |
6460 | 89 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
90 static void cleanup_instance (void) |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
91 { |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
92 delete s_instance; |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
93 s_instance = nullptr; |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
94 } |
5164 | 95 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
96 void do_defaults (void); |
5164 | 97 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
98 void do_tight (void); |
5893 | 99 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
100 string_vector do_get_keys (void) const { return m_keys; } |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
101 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
102 ColumnVector do_get_vals (void) const { return m_params; } |
5893 | 103 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
104 bool do_set_vals (const Array<double>& vals); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
105 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
106 bool do_set_key (const std::string& key, const double& val); |
5893 | 107 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
108 double do_get_key (const std::string& key); |
5164 | 109 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
110 double do_get_bandden (void); |
5893 | 111 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
112 void do_print_info (std::ostream& os, const std::string& prefix) const; |
5893 | 113 |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
114 void init_keys (void); |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
115 }; |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
116 } |
6460 | 117 |
29954
4c88a452519c
rename OCTAVE_USE_DEPRECATED_FUNCTIONS macro and attempt to make it work
John W. Eaton <jwe@octave.org>
parents:
29872
diff
changeset
|
118 #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) |
29872
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
119 OCTAVE_DEPRECATED (7, "use 'octave::sparse_params' instead") |
df2cdf42a909
update coding style for octave_sparse_params class
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
120 typedef octave::sparse_params octave_sparse_params; |
29954
4c88a452519c
rename OCTAVE_USE_DEPRECATED_FUNCTIONS macro and attempt to make it work
John W. Eaton <jwe@octave.org>
parents:
29872
diff
changeset
|
121 #endif |
5164 | 122 |
123 #endif |