annotate liboctave/numeric/LSODE.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: 30046
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 ////////////////////////////////////////////////////////////////////////
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
26 #if ! defined (octave_LSODE_h)
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
27 #define octave_LSODE_h 1
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21218
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21218
diff changeset
30
23443
3f1bf237908b maint: Eliminate <cfloat.h> header from liboctave files.
Rik <rik@octave.org>
parents: 23220
diff changeset
31 #include <string>
1867
52e7bca8ce33 [project @ 1996-02-04 11:19:32 by jwe]
jwe
parents: 1841
diff changeset
32
23475
d691ed308237 maint: Clean up #includes in liboctave/numeric directory.
Rik <rik@octave.org>
parents: 23443
diff changeset
33 #include "Array.h"
3998
f6df65db67f9 [project @ 2002-07-24 18:10:39 by jwe]
jwe
parents: 3997
diff changeset
34 #include "LSODE-opts.h"
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
35
1867
52e7bca8ce33 [project @ 1996-02-04 11:19:32 by jwe]
jwe
parents: 1841
diff changeset
36 class
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5307
diff changeset
37 OCTAVE_API
1867
52e7bca8ce33 [project @ 1996-02-04 11:19:32 by jwe]
jwe
parents: 1841
diff changeset
38 LSODE : public ODE, public LSODE_options
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
39 {
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
40 public:
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
41
11502
4638800cd660 delete data pointer members from liboctave ODE/DAE classes; make destuctors virtual in ODE/DAE base classes
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
42 LSODE (void)
30046
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
43 : ODE (), LSODE_options (), m_initialized (false), m_method_flag (0),
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
44 m_itask (0), m_iopt (0), m_itol (0), m_liw (0), m_lrw (0),
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
45 m_iwork (), m_rwork (), m_rel_tol (0.0), m_abs_tol () { }
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
46
4587
7b957b442818 [project @ 2003-11-10 15:50:39 by jwe]
jwe
parents: 4231
diff changeset
47 LSODE (const ColumnVector& s, double tm, const ODEFunc& f)
30046
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
48 : ODE (s, tm, f), LSODE_options (), m_initialized (false),
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
49 m_method_flag (0), m_itask (0), m_iopt (0), m_itol (0), m_liw (0),
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
50 m_lrw (0), m_iwork (), m_rwork (), m_rel_tol (0.0), m_abs_tol () { }
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 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 ~LSODE (void) = default;
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
53
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
54 ColumnVector do_integrate (double t);
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
55
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
56 Matrix do_integrate (const ColumnVector& tout);
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
57
3511
d92134062783 [project @ 2000-02-01 22:06:28 by jwe]
jwe
parents: 3504
diff changeset
58 Matrix do_integrate (const ColumnVector& tout, const ColumnVector& tcrit);
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
59
3959
5a848097fe4a [project @ 2002-05-24 17:58:16 by jwe]
jwe
parents: 3955
diff changeset
60 std::string error_message (void) const;
5a848097fe4a [project @ 2002-05-24 17:58:16 by jwe]
jwe
parents: 3955
diff changeset
61
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
62 private:
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
63
30046
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
64 bool m_initialized;
4049
a35a3c5d4740 [project @ 2002-08-16 08:54:31 by jwe]
jwe
parents: 4044
diff changeset
65
30046
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
66 octave_f77_int_type m_method_flag;
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
67 octave_f77_int_type m_itask;
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
68 octave_f77_int_type m_iopt;
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
69 octave_f77_int_type m_itol;
4049
a35a3c5d4740 [project @ 2002-08-16 08:54:31 by jwe]
jwe
parents: 4044
diff changeset
70
30046
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
71 octave_f77_int_type m_liw;
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
72 octave_f77_int_type m_lrw;
4049
a35a3c5d4740 [project @ 2002-08-16 08:54:31 by jwe]
jwe
parents: 4044
diff changeset
73
30046
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
74 Array<octave_f77_int_type> m_iwork;
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
75 Array<double> m_rwork;
4049
a35a3c5d4740 [project @ 2002-08-16 08:54:31 by jwe]
jwe
parents: 4044
diff changeset
76
30046
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
77 double m_rel_tol;
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
78
30046
b3717fd85e49 maint: use "m_" prefix for member variables ODE/DAE classes in liboctave/numeric.
Rik <rik@octave.org>
parents: 29358
diff changeset
79 Array<double> m_abs_tol;
1841
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
80 };
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
81
fc5667a20dd2 [project @ 1996-02-03 11:44:02 by jwe]
jwe
parents:
diff changeset
82 #endif