GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ODES.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2002-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_ODES_h)
27 #define octave_ODES_h 1
28 
29 #include "octave-config.h"
30 
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)
40  : base_diff_eqn (), ODESFunc (), xdot (), theta () { }
41 
42  ODES (const ColumnVector& s, double tm, ODESFunc& f)
43  : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.numel (), 0.0), theta () { }
44 
45  ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm,
46  ODESFunc& f)
47  : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.numel (), 0.0),
48  theta (xtheta) { }
49 
50  ODES (const ODES& a)
51  : base_diff_eqn (a), ODESFunc (a), xdot (a.xdot), theta (a.theta) { }
52 
53  ODES& operator = (const ODES& a)
54  {
55  if (this != &a)
56  {
59 
60  xdot = a.xdot;
61  theta = a.theta;
62  }
63  return *this;
64  }
65 
66  ~ODES (void) = default;
67 
68  ColumnVector parameter_vector (void) { return theta; }
69 
70  void initialize (const ColumnVector& x, double t);
71 
72  void initialize (const ColumnVector& x, double t,
73  const ColumnVector& theta);
74 
75 protected:
76 
77  // State vector time derivatives.
79 
80  // Parameter vector.
82 };
83 
84 #endif
ODESFunc & operator=(const ODESFunc &a)
Definition: ODESFunc.h:70
Definition: ODES.h:36
ColumnVector xdot
Definition: ODES.h:78
ODES(const ColumnVector &s, double tm, ODESFunc &f)
Definition: ODES.h:42
~ODES(void)=default
ODES(void)
Definition: ODES.h:39
ColumnVector parameter_vector(void)
Definition: ODES.h:68
ODES(const ColumnVector &s, const ColumnVector &xtheta, double tm, ODESFunc &f)
Definition: ODES.h:45
ColumnVector theta
Definition: ODES.h:81
ODES(const ODES &a)
Definition: ODES.h:50
base_diff_eqn & operator=(const base_diff_eqn &a)
Definition: base-de.h:54
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
static void initialize(void)
T::size_type numel(const T &str)
Definition: oct-string.cc:71