annotate liboctave/numeric/DASRT.h @ 27918:b442ec6dda5c

use centralized file for copyright info for individual contributors * COPYRIGHT.md: New file. * In most other files, use "Copyright (C) YYYY-YYYY The Octave Project Developers" instead of tracking individual names in separate source files. The motivation is to reduce the effort required to update the notices each year. Until now, the Octave source files contained copyright notices that list individual contributors. I adopted these file-scope copyright notices because that is what everyone was doing 30 years ago in the days before distributed version control systems. But now, with many contributors and modern version control systems, having these file-scope copyright notices causes trouble when we update copyright years or refactor code. Over time, the file-scope copyright notices may become outdated as new contributions are made or code is moved from one file to another. Sometimes people contribute significant patches but do not add a line claiming copyright. Other times, people add a copyright notice for their contribution but then a later refactoring moves part or all of their contribution to another file and the notice is not moved with the code. As a practical matter, moving such notices is difficult -- determining what parts are due to a particular contributor requires a time-consuming search through the project history. Even managing the yearly update of copyright years is problematic. We have some contributors who are no longer living. Should we update the copyright dates for their contributions when we release new versions? Probably not, but we do still want to claim copyright for the project as a whole. To minimize the difficulty of maintaining the copyright notices, I would like to change Octave's sources to use what is described here: https://softwarefreedom.org/resources/2012/ManagingCopyrightInformation.html in the section "Maintaining centralized copyright notices": The centralized notice approach consolidates all copyright notices in a single location, usually a top-level file. This file should contain all of the copyright notices provided project contributors, unless the contribution was clearly insignificant. It may also credit -- without a copyright notice -- anyone who helped with the project but did not contribute code or other copyrighted material. This approach captures less information about contributions within individual files, recognizing that the DVCS is better equipped to record those details. As we mentioned before, it does have one disadvantage as compared to the file-scope approach: if a single file is separated from the distribution, the recipient won't see the contributors' copyright notices. But this can be easily remedied by including a single copyright notice in each file's header, pointing to the top-level file: Copyright YYYY-YYYY The Octave Project Developers See the COPYRIGHT file at the top-level directory of this distribution or at https://octave.org/COPYRIGHT.html. followed by the usual GPL copyright statement. For more background, see the discussion here: https://lists.gnu.org/archive/html/octave-maintainers/2020-01/msg00009.html Most files in the following directories have been skipped intentinally in this changeset: doc libgui/qterminal liboctave/external m4
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 15:38:17 -0500
parents 00f796120a6d
children 1891570abac8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
1 /*
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
2
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
3 Copyright (C) 2002-2019 The Octave Project Developers
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
5 See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
6 or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
7
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
8
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
9 This file is part of Octave.
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
10
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23475
diff changeset
11 Octave is free software: you can redistribute it and/or modify it
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
12 under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23475
diff changeset
13 the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
14 (at your option) any later version.
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
15
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
16 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
17 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
19 GNU General Public License for more details.
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
20
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
21 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6108
diff changeset
22 along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23475
diff changeset
23 <https://www.gnu.org/licenses/>.
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
24
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
25 */
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
26
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
27 #if ! defined (octave_DASRT_h)
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
28 #define octave_DASRT_h 1
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
29
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21218
diff changeset
30 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21218
diff changeset
31
23443
3f1bf237908b maint: Eliminate <cfloat.h> header from liboctave files.
Rik <rik@octave.org>
parents: 23220
diff changeset
32 #include <string>
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
33
23475
d691ed308237 maint: Clean up #includes in liboctave/numeric directory.
Rik <rik@octave.org>
parents: 23443
diff changeset
34 #include "Array.h"
3998
f6df65db67f9 [project @ 2002-07-24 18:10:39 by jwe]
jwe
parents: 3997
diff changeset
35 #include "DASRT-opts.h"
23475
d691ed308237 maint: Clean up #includes in liboctave/numeric directory.
Rik <rik@octave.org>
parents: 23443
diff changeset
36 #include "dMatrix.h"
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
37
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
38 class
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
39 DASRT_result
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
40 {
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
41 public:
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
42
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: 10312
diff changeset
43 DASRT_result (void)
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: 10312
diff changeset
44 : x (), xdot (), t () { }
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
45
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
46 DASRT_result (const Matrix& xx, const Matrix& xxdot, const ColumnVector& tt)
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
47 : x (xx), xdot (xxdot), t (tt) { }
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
48
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
49 DASRT_result (const DASRT_result& r)
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
50 : x (r.x), xdot (r.xdot), t (r.t) { }
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
51
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
52 DASRT_result& operator = (const DASRT_result& r)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
53 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
54 if (this != &r)
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 x = r.x;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
57 xdot = r.xdot;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
58 t = r.t;
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 return *this;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
61 }
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
62
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
63 ~DASRT_result (void) = default;
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
64
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
65 Matrix state (void) const { return x; }
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
66 Matrix deriv (void) const { return xdot; }
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
67 ColumnVector times (void) const { return t; }
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
68
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
69 private:
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
70
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
71 Matrix x;
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
72 Matrix xdot;
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
73 ColumnVector t;
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
74 };
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
75
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
76 class
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5307
diff changeset
77 OCTAVE_API
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
78 DASRT : public DAERT, public DASRT_options
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
79 {
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
80 public:
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
81
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: 10312
diff changeset
82 DASRT (void)
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: 10312
diff changeset
83 : DAERT (), DASRT_options (), initialized (false),
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: 10312
diff changeset
84 liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
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: 10312
diff changeset
85 abs_tol (), rel_tol ()
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
86 { }
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
87
4587
7b957b442818 [project @ 2003-11-10 15:50:39 by jwe]
jwe
parents: 4192
diff changeset
88 DASRT (const ColumnVector& s, double tm, DAERTFunc& f)
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: 10312
diff changeset
89 : DAERT (s, tm, f), DASRT_options (), initialized (false),
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: 10312
diff changeset
90 liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
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: 10312
diff changeset
91 abs_tol (), rel_tol ()
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
92 { }
3994
a41827ec5677 [project @ 2002-07-16 23:57:09 by jwe]
jwe
parents: 3992
diff changeset
93
4587
7b957b442818 [project @ 2003-11-10 15:50:39 by jwe]
jwe
parents: 4192
diff changeset
94 DASRT (const ColumnVector& s, const ColumnVector& deriv,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
95 double tm, DAERTFunc& f)
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: 10312
diff changeset
96 : DAERT (s, deriv, tm, f), DASRT_options (), initialized (false),
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: 10312
diff changeset
97 liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
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: 10312
diff changeset
98 abs_tol (), rel_tol ()
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
99 { }
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
100
22868
87e3163f6c87 use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents: 22755
diff changeset
101 ~DASRT (void) = default;
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
102
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
103 DASRT_result integrate (const ColumnVector& tout);
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
104
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
105 DASRT_result integrate (const ColumnVector& tout,
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
106 const ColumnVector& tcrit);
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
107
3995
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3994
diff changeset
108 std::string error_message (void) const;
ee0304212be0 [project @ 2002-07-17 04:32:42 by jwe]
jwe
parents: 3994
diff changeset
109
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
110 private:
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
111
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
112 bool initialized;
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
113
22960
0d1422cb7e93 use F77_INT instead of octave_idx_type for liboctave ODE and DAE classes
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
114 octave_f77_int_type liw;
0d1422cb7e93 use F77_INT instead of octave_idx_type for liboctave ODE and DAE classes
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
115 octave_f77_int_type lrw;
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
116
22960
0d1422cb7e93 use F77_INT instead of octave_idx_type for liboctave ODE and DAE classes
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
117 octave_f77_int_type ng;
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
118
22960
0d1422cb7e93 use F77_INT instead of octave_idx_type for liboctave ODE and DAE classes
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
119 Array<octave_f77_int_type> info;
0d1422cb7e93 use F77_INT instead of octave_idx_type for liboctave ODE and DAE classes
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
120 Array<octave_f77_int_type> iwork;
0d1422cb7e93 use F77_INT instead of octave_idx_type for liboctave ODE and DAE classes
John W. Eaton <jwe@octave.org>
parents: 22868
diff changeset
121 Array<octave_f77_int_type> jroot;
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
122
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
123 Array<double> rwork;
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
124
3998
f6df65db67f9 [project @ 2002-07-24 18:10:39 by jwe]
jwe
parents: 3997
diff changeset
125 Array<double> abs_tol;
f6df65db67f9 [project @ 2002-07-24 18:10:39 by jwe]
jwe
parents: 3997
diff changeset
126 Array<double> rel_tol;
3990
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
127
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
128 void integrate (double t);
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
129 };
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
130
46388d6a4e44 [project @ 2002-07-16 06:20:39 by jwe]
jwe
parents:
diff changeset
131 #endif