Mercurial > octave
annotate liboctave/numeric/DAERTFunc.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 | 597f3ee61a48 |
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:
30047
diff
changeset
|
3 // Copyright (C) 2002-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 //////////////////////////////////////////////////////////////////////// |
3990 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #if ! defined (octave_DAERTFunc_h) |
3990 | 27 #define octave_DAERTFunc_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 |
23442
53f5f8231c37
allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
31 #include "DAEFunc.h" |
3990 | 32 |
33 class | |
3993 | 34 DAERTFunc : public DAEFunc |
3990 | 35 { |
36 public: | |
37 | |
38 typedef ColumnVector (*DAERTConstrFunc) (const ColumnVector& x, double t); | |
39 | |
40 DAERTFunc (void) | |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
41 : DAEFunc (), m_constr (nullptr), m_reset (true) { } |
3990 | 42 |
43 DAERTFunc (DAERHSFunc f) | |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
44 : DAEFunc (f), m_constr (nullptr), m_reset (true) { } |
3990 | 45 |
46 DAERTFunc (DAERHSFunc f, DAEJacFunc j) | |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
47 : DAEFunc (f, j), m_constr (nullptr), m_reset (true) { } |
3990 | 48 |
49 DAERTFunc (DAERHSFunc f, DAERTConstrFunc cf) | |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
50 : DAEFunc (f), m_constr (cf), m_reset (true) { } |
3990 | 51 |
52 DAERTFunc (DAERHSFunc f, DAERTConstrFunc cf, DAEJacFunc j) | |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
53 : DAEFunc (f, j), m_constr (cf), m_reset (true) { } |
3990 | 54 |
55 DAERTFunc (const DAERTFunc& a) | |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
56 : DAEFunc (a), m_constr (a.m_constr), m_reset (a.m_reset) { } |
3990 | 57 |
58 DAERTFunc& operator = (const DAERTFunc& a) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
59 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
60 if (this != &a) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
61 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
62 DAEFunc::operator = (a); |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
63 m_constr = a.m_constr; |
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
64 m_reset = a.m_reset; |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
65 } |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
66 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
67 } |
3990 | 68 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
69 virtual ~DAERTFunc (void) = default; |
3990 | 70 |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
71 DAERTConstrFunc constraint_function (void) const { return m_constr; } |
3990 | 72 |
73 DAERTFunc& set_constraint_function (DAERTConstrFunc cf) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
74 { |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
75 m_constr = cf; |
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
76 m_reset = true; |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
77 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
78 } |
3990 | 79 |
80 protected: | |
81 | |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
82 DAERTConstrFunc m_constr; |
4049 | 83 |
84 // This variable is TRUE when this object is constructed, and also | |
85 // after any internal data has changed. Derived classes may use | |
86 // this information (and change it) to know when to (re)initialize | |
87 // their own internal data related to this object. | |
88 | |
30047
02e28f7e4d04
maint: use "m_" prefix for member variables DAERTFunc/ODEFunc classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
89 bool m_reset; |
3990 | 90 }; |
91 | |
92 #endif |