Mercurial > octave
annotate liboctave/numeric/ODES.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:
30067
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 //////////////////////////////////////////////////////////////////////// |
3984 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
26 #if ! defined (octave_ODES_h) |
3984 | 27 #define octave_ODES_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 |
3984 | 31 #include "ODESFunc.h" |
32 #include "base-de.h" | |
33 | |
34 class | |
35 ODES : public base_diff_eqn, public ODESFunc | |
36 { | |
37 public: | |
38 | |
39 ODES (void) | |
30067
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
40 : base_diff_eqn (), ODESFunc (), m_xdot (), m_theta () { } |
3984 | 41 |
4587 | 42 ODES (const ColumnVector& s, double tm, ODESFunc& f) |
30067
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
43 : base_diff_eqn (s, tm), ODESFunc (f), m_xdot (s.numel (), 0.0), m_theta () |
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
44 { } |
3984 | 45 |
4587 | 46 ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
47 ODESFunc& f) |
30067
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
48 : base_diff_eqn (s, tm), ODESFunc (f), m_xdot (s.numel (), 0.0), |
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
49 m_theta (xtheta) { } |
3984 | 50 |
51 ODES (const ODES& a) | |
30067
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
52 : base_diff_eqn (a), ODESFunc (a), m_xdot (a.m_xdot), m_theta (a.m_theta) |
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
53 { } |
3984 | 54 |
55 ODES& operator = (const ODES& a) | |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
56 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
57 if (this != &a) |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
58 { |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
59 base_diff_eqn::operator = (a); |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
60 ODESFunc::operator = (a); |
3984 | 61 |
30067
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
62 m_xdot = a.m_xdot; |
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
63 m_theta = a.m_theta; |
17769
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
64 } |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
65 return *this; |
49a5a4be04a1
maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
66 } |
3984 | 67 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
68 ~ODES (void) = default; |
3984 | 69 |
30067
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
70 ColumnVector parameter_vector (void) { return m_theta; } |
3984 | 71 |
29228
5c14f81e0937
Set API tags in files in liboctave/numeric (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
27923
diff
changeset
|
72 OCTAVE_API void initialize (const ColumnVector& x, double t); |
3984 | 73 |
29228
5c14f81e0937
Set API tags in files in liboctave/numeric (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
27923
diff
changeset
|
74 OCTAVE_API void |
5c14f81e0937
Set API tags in files in liboctave/numeric (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
27923
diff
changeset
|
75 initialize (const ColumnVector& x, double t, const ColumnVector& theta); |
3984 | 76 |
77 protected: | |
78 | |
79 // State vector time derivatives. | |
30067
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
80 ColumnVector m_xdot; |
3984 | 81 |
82 // Parameter vector. | |
30067
fc509c3c445a
maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
83 ColumnVector m_theta; |
3984 | 84 }; |
85 | |
86 #endif |