GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ODESFunc.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2002-2024 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_ODESFunc_h)
27 #define octave_ODESFunc_h 1
28 
29 #include "octave-config.h"
30 
31 #include "mx-fwd.h"
32 
33 #include "dMatrix.h"
34 
35 class
37 {
38 public:
39 
40  struct DAEJac
41  {
44  };
45 
46  typedef ColumnVector (*ODES_fsub) (const ColumnVector& x, double,
47  const ColumnVector& theta);
48 
49  typedef ColumnVector (*ODES_bsub) (const ColumnVector& x, double,
50  const ColumnVector& theta, int column);
51 
52  typedef Matrix (*ODES_jsub) (const ColumnVector& x, double,
53  const ColumnVector& theta);
54 
56  : m_fsub (nullptr), m_bsub (nullptr), m_jsub (nullptr) { }
57 
58  ODESFunc (ODES_fsub f)
59  : m_fsub (f), m_bsub (nullptr), m_jsub (nullptr) { }
60 
61  ODESFunc (ODES_fsub f, ODES_bsub b)
62  : m_fsub (f), m_bsub (b), m_jsub (nullptr) { }
63 
64  ODESFunc (ODES_fsub f, ODES_bsub b, ODES_jsub j)
65  : m_fsub (f), m_bsub (b), m_jsub (j) { }
66 
67  ODESFunc (const ODESFunc& a)
68  : m_fsub (a.m_fsub), m_bsub (a.m_bsub), m_jsub (a.m_jsub) { }
69 
70  ODESFunc& operator = (const ODESFunc& a)
71  {
72  if (this != &a)
73  {
74  m_fsub = a.m_fsub;
75  m_bsub = a.m_bsub;
76  m_jsub = a.m_jsub;
77  }
78  return *this;
79  }
80 
81  virtual ~ODESFunc () = default;
82 
83  ODES_fsub fsub_function () const { return m_fsub; }
84 
86  {
87  m_fsub = f;
88  return *this;
89  }
90 
91  ODES_bsub bsub_function () const { return m_bsub; }
92 
93  ODESFunc& set_bsub_function (ODES_bsub b)
94  {
95  m_bsub = b;
96  return *this;
97  }
98 
99  ODES_jsub jsub_function () const { return m_jsub; }
100 
102  {
103  m_jsub = j;
104  return *this;
105  }
106 
107 protected:
108 
109  ODES_fsub m_fsub;
110  ODES_bsub m_bsub;
111  ODES_jsub m_jsub;
112 };
113 
114 #endif
Definition: dMatrix.h:42
ODESFunc(ODES_fsub f)
Definition: ODESFunc.h:58
ODESFunc(ODES_fsub f, ODES_bsub b)
Definition: ODESFunc.h:61
ODESFunc(const ODESFunc &a)
Definition: ODESFunc.h:67
ODESFunc & set_bsub_function(ODES_bsub b)
Definition: ODESFunc.h:93
ODESFunc(ODES_fsub f, ODES_bsub b, ODES_jsub j)
Definition: ODESFunc.h:64
ODESFunc()
Definition: ODESFunc.h:55
ODES_jsub m_jsub
Definition: ODESFunc.h:111
ODESFunc & set_jsub_function(ODES_jsub j)
Definition: ODESFunc.h:101
ODES_jsub jsub_function() const
Definition: ODESFunc.h:99
virtual ~ODESFunc()=default
ODES_fsub fsub_function() const
Definition: ODESFunc.h:83
ODES_bsub bsub_function() const
Definition: ODESFunc.h:91
ODESFunc & set_fsub_function(ODES_fsub f)
Definition: ODESFunc.h:85
ODES_bsub m_bsub
Definition: ODESFunc.h:110
ODES_fsub m_fsub
Definition: ODESFunc.h:109
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
Matrix * dfdx
Definition: ODESFunc.h:43
Matrix * dfdxdot
Definition: ODESFunc.h:42