GNU Octave 7.1.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-2022 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
34class
35ODES : public base_diff_eqn, public ODESFunc
36{
37public:
38
39 ODES (void)
40 : base_diff_eqn (), ODESFunc (), m_xdot (), m_theta () { }
41
42 ODES (const ColumnVector& s, double tm, ODESFunc& f)
43 : base_diff_eqn (s, tm), ODESFunc (f), m_xdot (s.numel (), 0.0), m_theta ()
44 { }
45
46 ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm,
47 ODESFunc& f)
48 : base_diff_eqn (s, tm), ODESFunc (f), m_xdot (s.numel (), 0.0),
49 m_theta (xtheta) { }
50
51 ODES (const ODES& a)
52 : base_diff_eqn (a), ODESFunc (a), m_xdot (a.m_xdot), m_theta (a.m_theta)
53 { }
54
55 ODES& operator = (const ODES& a)
56 {
57 if (this != &a)
58 {
61
62 m_xdot = a.m_xdot;
63 m_theta = a.m_theta;
64 }
65 return *this;
66 }
67
68 ~ODES (void) = default;
69
70 ColumnVector parameter_vector (void) { return m_theta; }
71
72 OCTAVE_API void initialize (const ColumnVector& x, double t);
73
74 OCTAVE_API void
75 initialize (const ColumnVector& x, double t, const ColumnVector& theta);
76
77protected:
78
79 // State vector time derivatives.
81
82 // Parameter vector.
84};
85
86#endif
ODESFunc & operator=(const ODESFunc &a)
Definition: ODESFunc.h:70
Definition: ODES.h:36
ColumnVector m_xdot
Definition: ODES.h:80
ColumnVector m_theta
Definition: ODES.h:83
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:70
ODES(const ColumnVector &s, const ColumnVector &xtheta, double tm, ODESFunc &f)
Definition: ODES.h:46
ODES(const ODES &a)
Definition: ODES.h:51
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
#define OCTAVE_API
Definition: main.in.cc:55
T::size_type numel(const T &str)
Definition: oct-string.cc:71
static void initialize(void)