annotate liboctave/numeric/base-de.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
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 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30067
diff changeset
3 // Copyright (C) 1996-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 ////////////////////////////////////////////////////////////////////////
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 20229
diff changeset
26 #if ! defined (octave_base_de_h)
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
27 #define octave_base_de_h 1
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
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
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
31 #include <string>
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
32
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
33 #include "dColVector.h"
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
34
1879
1b43d3c06c04 [project @ 1996-02-05 16:24:56 by jwe]
jwe
parents: 1843
diff changeset
35 class
1b43d3c06c04 [project @ 1996-02-05 16:24:56 by jwe]
jwe
parents: 1843
diff changeset
36 base_diff_eqn
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
37 {
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
38 public:
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
39
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
40 base_diff_eqn (void)
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
41 : m_x (), m_t (0.0), m_stop_time (0.0), m_stop_time_set (false),
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
42 m_restart (true), m_integration_error (false), m_istate (0) { }
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
43
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
44 base_diff_eqn (const ColumnVector& xx, double tt)
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
45 : m_x (xx), m_t (tt), m_stop_time (0.0), m_stop_time_set (false),
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
46 m_restart (true), m_integration_error (false), m_istate (0) { }
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
47
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
48 base_diff_eqn (const base_diff_eqn& a)
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
49 : m_x (a.m_x), m_t (a.m_t), m_stop_time (0.0), m_stop_time_set (false),
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
50 m_restart (true), m_integration_error (false), m_istate (0) { }
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
51
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
52 virtual ~base_diff_eqn (void) = default;
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
53
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
54 base_diff_eqn& operator = (const base_diff_eqn& a)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
55 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
56 if (this != &a)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
57 {
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
58 m_x = a.m_x;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
59 m_t = a.m_t;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
60 m_stop_time = a.m_stop_time;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
61 m_stop_time_set = a.m_stop_time_set;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
62 m_restart = a.m_restart;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
63 m_integration_error = a.m_integration_error;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
64 m_istate = a.m_istate;
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
65 }
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
66
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
67 return *this;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
68 }
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
69
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents: 3511
diff changeset
70 void initialize (const ColumnVector& x0, double t0)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
71 {
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
72 m_x = x0;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
73 m_t = t0;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
74 m_integration_error = false;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
75 m_istate = 0;
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
76 force_restart ();
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
77 }
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
78
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
79 octave_idx_type size (void) const { return m_x.numel (); }
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
80
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
81 ColumnVector state (void) const { return m_x; }
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
82
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
83 double time (void) const { return m_t; }
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
84
4277
5ab4ac522fec [project @ 2003-01-03 23:45:06 by jwe]
jwe
parents: 4049
diff changeset
85 void set_stop_time (double tt)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
86 {
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
87 m_stop_time_set = true;
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
88 m_stop_time = tt;
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
89 force_restart ();
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
90 }
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
91
4049
a35a3c5d4740 [project @ 2002-08-16 08:54:31 by jwe]
jwe
parents: 3997
diff changeset
92 void clear_stop_time (void)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
93 {
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
94 m_stop_time_set = false;
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
95 force_restart ();
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
96 }
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
97
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
98 virtual void force_restart (void) { m_restart = true; }
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
99
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
100 bool integration_ok (void) const { return ! m_integration_error; }
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
101
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
102 octave_idx_type integration_state (void) const { return m_istate; }
3997
d4091aff6468 [project @ 2002-07-17 18:00:06 by jwe]
jwe
parents: 3995
diff changeset
103
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
104 virtual std::string error_message (void) const = 0;
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
105
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
106 protected:
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
107
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
108 ColumnVector m_x;
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
109
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
110 double m_t;
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
111
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
112 double m_stop_time;
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
113
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
114 bool m_stop_time_set;
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
115
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
116 bool m_restart;
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3984
diff changeset
117
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
118 bool m_integration_error;
3997
d4091aff6468 [project @ 2002-07-17 18:00:06 by jwe]
jwe
parents: 3995
diff changeset
119
30067
fc509c3c445a maint: use "m_" prefix for member variables in base-de.h and base-dae.h
Rik <rik@octave.org>
parents: 29358
diff changeset
120 octave_idx_type m_istate;
1843
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
121 };
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
122
88c5728ae7ae [project @ 1996-02-03 11:44:20 by jwe]
jwe
parents:
diff changeset
123 #endif