GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ODEFunc.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1993-2025 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_ODEFunc_h)
27#define octave_ODEFunc_h 1
28
29#include "octave-config.h"
30
31#include "mx-fwd.h"
32
34{
35public:
36
38 typedef Matrix (*ODEJacFunc) (const ColumnVector&, double);
39
41 : m_fcn (nullptr), m_jac (nullptr), m_reset (true) { }
42
44 : m_fcn (f), m_jac (nullptr), m_reset (true) { }
45
47 : m_fcn (f), m_jac (j), m_reset (true) { }
48
49 ODEFunc (const ODEFunc& a)
50 : m_fcn (a.m_fcn), m_jac (a.m_jac), m_reset (true) { }
51
53 {
54 if (this != &a)
55 {
56 m_fcn = a.m_fcn;
57 m_jac = a.m_jac;
58 m_reset = a.m_reset;
59 }
60 return *this;
61 }
62
63 virtual ~ODEFunc () = default;
64
65 ODERHSFunc function () const { return m_fcn; }
66
68 {
69 m_fcn = f;
70 m_reset = true;
71 return *this;
72 }
73
74 ODEJacFunc jacobian_function () const { return m_jac; }
75
77 {
78 m_jac = j;
79 m_reset = true;
80 return *this;
81 }
82
83protected:
84
87
88 // This variable is TRUE when this object is constructed, and also
89 // after any internal data has changed. Derived classes may use
90 // this information (and change it) to know when to (re)initialize
91 // their own internal data related to this object.
92
93 bool m_reset;
94};
95
96#endif
ODEJacFunc m_jac
Definition ODEFunc.h:86
ODEFunc(ODERHSFunc f)
Definition ODEFunc.h:43
ODEFunc(const ODEFunc &a)
Definition ODEFunc.h:49
ODERHSFunc m_fcn
Definition ODEFunc.h:85
ColumnVector(* ODERHSFunc)(const ColumnVector &, double)
Definition ODEFunc.h:37
Matrix(* ODEJacFunc)(const ColumnVector &, double)
Definition ODEFunc.h:38
ODEFunc(ODERHSFunc f, ODEJacFunc j)
Definition ODEFunc.h:46
ODEFunc & set_function(ODERHSFunc f)
Definition ODEFunc.h:67
ODEFunc & operator=(const ODEFunc &a)
Definition ODEFunc.h:52
virtual ~ODEFunc()=default
ODEFunc()
Definition ODEFunc.h:40
bool m_reset
Definition ODEFunc.h:93
ODERHSFunc function() const
Definition ODEFunc.h:65
ODEFunc & set_jacobian_function(ODEJacFunc j)
Definition ODEFunc.h:76
ODEJacFunc jacobian_function() const
Definition ODEFunc.h:74
F77_RET_T const F77_DBLE const F77_DBLE * f