GNU Octave  6.2.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-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_ODESFunc_h)
27 #define octave_ODESFunc_h 1
28 
29 #include "octave-config.h"
30 
31 #include "dMatrix.h"
32 
33 class ColumnVector;
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 
55  ODESFunc (void)
56  : fsub (nullptr), bsub (nullptr), jsub (nullptr) { }
57 
58  ODESFunc (ODES_fsub f)
59  : fsub (f), bsub (nullptr), jsub (nullptr) { }
60 
61  ODESFunc (ODES_fsub f, ODES_bsub b)
62  : fsub (f), bsub (b), jsub (nullptr) { }
63 
64  ODESFunc (ODES_fsub f, ODES_bsub b, ODES_jsub j)
65  : fsub (f), bsub (b), jsub (j) { }
66 
67  ODESFunc (const ODESFunc& a)
68  : fsub (a.fsub), bsub (a.bsub), jsub (a.jsub) { }
69 
70  ODESFunc& operator = (const ODESFunc& a)
71  {
72  if (this != &a)
73  {
74  fsub = a.fsub;
75  bsub = a.bsub;
76  jsub = a.jsub;
77  }
78  return *this;
79  }
80 
81  virtual ~ODESFunc (void) = default;
82 
83  ODES_fsub fsub_function (void) const { return fsub; }
84 
86  {
87  fsub = f;
88  return *this;
89  }
90 
91  ODES_bsub bsub_function (void) const { return bsub; }
92 
93  ODESFunc& set_bsub_function (ODES_bsub b)
94  {
95  bsub = b;
96  return *this;
97  }
98 
99  ODES_jsub jsub_function (void) const { return jsub; }
100 
102  {
103  jsub = j;
104  return *this;
105  }
106 
107 protected:
108 
109  ODES_fsub fsub;
110  ODES_bsub bsub;
111  ODES_jsub jsub;
112 };
113 
114 #endif
Definition: dMatrix.h:42
ODES_bsub bsub
Definition: ODESFunc.h:110
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
ODES_fsub fsub_function(void) const
Definition: ODESFunc.h:83
ODESFunc & set_jsub_function(ODES_jsub j)
Definition: ODESFunc.h:101
ODESFunc(void)
Definition: ODESFunc.h:55
virtual ~ODESFunc(void)=default
ODES_jsub jsub
Definition: ODESFunc.h:111
ODES_jsub jsub_function(void) const
Definition: ODESFunc.h:99
ODES_fsub fsub
Definition: ODESFunc.h:109
ODES_bsub bsub_function(void) const
Definition: ODESFunc.h:91
ODESFunc & set_fsub_function(ODES_fsub f)
Definition: ODESFunc.h:85
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