annotate liboctave/numeric/ODES.h @ 20595:c1a6c31ac29a

eliminate more simple uses of error_state * ov-classdef.cc: Eliminate simple uses of error_state.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Oct 2015 00:20:02 -0400
parents a9574e3c6e9e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
1 /*
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17769
diff changeset
3 Copyright (C) 2002-2015 John W. Eaton
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
4
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
6
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
10 option) any later version.
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
11
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
15 for more details.
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
16
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
17 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: 5307
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
19 <http://www.gnu.org/licenses/>.
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
20
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
21 */
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
22
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
23 #if !defined (octave_ODES_h)
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
24 #define octave_ODES_h 1
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
25
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
26 #include "ODESFunc.h"
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
27 #include "base-de.h"
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
28
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
29 class
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
30 ODES : public base_diff_eqn, public ODESFunc
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
31 {
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
32 public:
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
33
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
34 ODES (void)
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
35 : base_diff_eqn (), ODESFunc (), xdot (), theta () { }
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
36
4587
7b957b442818 [project @ 2003-11-10 15:50:39 by jwe]
jwe
parents: 4192
diff changeset
37 ODES (const ColumnVector& s, double tm, ODESFunc& f)
20267
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 19731
diff changeset
38 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.numel (), 0.0), theta () { }
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
39
4587
7b957b442818 [project @ 2003-11-10 15:50:39 by jwe]
jwe
parents: 4192
diff changeset
40 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
41 ODESFunc& f)
20267
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 19731
diff changeset
42 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.numel (), 0.0),
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
43 theta (xtheta) { }
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
44
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
45 ODES (const ODES& a)
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
46 : base_diff_eqn (a), ODESFunc (a), xdot (a.xdot), theta (a.theta) { }
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
47
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
48 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
49 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
50 if (this != &a)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
51 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
52 base_diff_eqn::operator = (a);
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
53 ODESFunc::operator = (a);
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
54
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
55 xdot = a.xdot;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
56 theta = a.theta;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
57 }
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
58 return *this;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
59 }
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
60
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
61 ~ODES (void) { }
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
62
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
63 ColumnVector parameter_vector (void) { return theta; }
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
64
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
65 void initialize (const ColumnVector& x, double t);
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
66
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
67 void initialize (const ColumnVector& x, double t,
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
68 const ColumnVector& theta);
3984
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
69
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
70 protected:
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
71
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
72 // State vector time derivatives.
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
73 ColumnVector xdot;
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
74
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
75 // Parameter vector.
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
76 ColumnVector theta;
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
77 };
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
78
addebffd4961 [project @ 2002-07-11 03:39:33 by jwe]
jwe
parents:
diff changeset
79 #endif