Mercurial > octave
annotate liboctave/numeric/DAEFunc.h @ 33657:6f2baadfdb3d bytecode-interpreter tip
maint: Merge default to bytecode-interpreter.
author | Nicholas R. Jankowski <jankowski.nicholas@gmail.com> |
---|---|
date | Tue, 04 Jun 2024 20:06:05 -0400 |
parents | 4b601ca024d5 |
children |
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 // |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31771
diff
changeset
|
3 // Copyright (C) 1993-2024 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 //////////////////////////////////////////////////////////////////////// |
3 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #if ! defined (octave_DAEFunc_h) |
382 | 27 #define octave_DAEFunc_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 |
30508
6f07492c9c20
Provide header file with forward declarations of matrix types (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents:
30046
diff
changeset
|
31 #include "mx-fwd.h" |
3 | 32 |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
33 class DAEFunc |
3 | 34 { |
35 public: | |
36 | |
1528 | 37 typedef ColumnVector (*DAERHSFunc) (const ColumnVector& x, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
38 const ColumnVector& xdot, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
39 double t, octave_idx_type& ires); |
1528 | 40 |
3991 | 41 // This is really the form used by DASSL: |
42 // | |
43 // PD = DG/DY + CJ * DG/DYPRIME | |
44 | |
45 typedef Matrix (*DAEJacFunc) (const ColumnVector& x, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
46 const ColumnVector& xdot, |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
47 double t, double cj); |
1528 | 48 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
49 DAEFunc () |
30898
51a3d3a69193
maint: Use "fcn" as preferred abbreviation for "function" in liboctave/.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
50 : m_fcn (nullptr), m_jac (nullptr), m_reset (true) { } |
532 | 51 |
1528 | 52 DAEFunc (DAERHSFunc f) |
30898
51a3d3a69193
maint: Use "fcn" as preferred abbreviation for "function" in liboctave/.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
53 : m_fcn (f), m_jac (nullptr), m_reset (true) { } |
532 | 54 |
1528 | 55 DAEFunc (DAERHSFunc f, DAEJacFunc j) |
30898
51a3d3a69193
maint: Use "fcn" as preferred abbreviation for "function" in liboctave/.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
56 : m_fcn (f), m_jac (j), m_reset (true) { } |
3 | 57 |
1528 | 58 DAEFunc (const DAEFunc& a) |
30898
51a3d3a69193
maint: Use "fcn" as preferred abbreviation for "function" in liboctave/.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
59 : m_fcn (a.m_fcn), m_jac (a.m_jac), m_reset (a.m_reset) { } |
3 | 60 |
1528 | 61 DAEFunc& operator = (const DAEFunc& a) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
62 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
63 if (this != &a) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
64 { |
30898
51a3d3a69193
maint: Use "fcn" as preferred abbreviation for "function" in liboctave/.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
65 m_fcn = a.m_fcn; |
30046
b3717fd85e49
maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
66 m_jac = a.m_jac; |
b3717fd85e49
maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
67 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
|
68 } |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
69 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
70 } |
3 | 71 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
72 virtual ~DAEFunc () = default; |
1868 | 73 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
74 DAERHSFunc function () const { return m_fcn; } |
1528 | 75 |
76 DAEFunc& set_function (DAERHSFunc f) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
77 { |
30898
51a3d3a69193
maint: Use "fcn" as preferred abbreviation for "function" in liboctave/.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
78 m_fcn = f; |
30046
b3717fd85e49
maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
79 m_reset = true; |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
80 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
81 } |
3 | 82 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
83 DAEJacFunc jacobian_function () const { return m_jac; } |
3 | 84 |
1528 | 85 DAEFunc& set_jacobian_function (DAEJacFunc j) |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
86 { |
30046
b3717fd85e49
maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
87 m_jac = j; |
b3717fd85e49
maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
88 m_reset = true; |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
89 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 } |
3 | 91 |
92 protected: | |
93 | |
30898
51a3d3a69193
maint: Use "fcn" as preferred abbreviation for "function" in liboctave/.
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
94 DAERHSFunc m_fcn; |
30046
b3717fd85e49
maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
95 DAEJacFunc m_jac; |
4049 | 96 |
97 // This variable is TRUE when this object is constructed, and also | |
98 // after any internal data has changed. Derived classes may use | |
99 // this information (and change it) to know when to (re)initialize | |
100 // their own internal data related to this object. | |
101 | |
30046
b3717fd85e49
maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
102 bool m_reset; |
3 | 103 }; |
104 | |
105 #endif |