GNU Octave  4.4.1
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-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_ODESFunc_h)
24 #define octave_ODESFunc_h 1
25 
26 #include "octave-config.h"
27 
28 #include "dMatrix.h"
29 
30 class ColumnVector;
31 
32 class
34 {
35 public:
36 
37  struct DAEJac
38  {
41  };
42 
43  typedef ColumnVector (*ODES_fsub) (const ColumnVector& x, double,
44  const ColumnVector& theta);
45 
46  typedef ColumnVector (*ODES_bsub) (const ColumnVector& x, double,
47  const ColumnVector& theta, int column);
48 
49  typedef Matrix (*ODES_jsub) (const ColumnVector& x, double,
50  const ColumnVector& theta);
51 
52  ODESFunc (void)
53  : fsub (nullptr), bsub (nullptr), jsub (nullptr) { }
54 
55  ODESFunc (ODES_fsub f)
56  : fsub (f), bsub (nullptr), jsub (nullptr) { }
57 
58  ODESFunc (ODES_fsub f, ODES_bsub b)
59  : fsub (f), bsub (b), jsub (nullptr) { }
60 
61  ODESFunc (ODES_fsub f, ODES_bsub b, ODES_jsub j)
62  : fsub (f), bsub (b), jsub (j) { }
63 
64  ODESFunc (const ODESFunc& a)
65  : fsub (a.fsub), bsub (a.bsub), jsub (a.jsub) { }
66 
67  ODESFunc& operator = (const ODESFunc& a)
68  {
69  if (this != &a)
70  {
71  fsub = a.fsub;
72  bsub = a.bsub;
73  jsub = a.jsub;
74  }
75  return *this;
76  }
77 
78  virtual ~ODESFunc (void) = default;
79 
80  ODES_fsub fsub_function (void) const { return fsub; }
81 
83  {
84  fsub = f;
85  return *this;
86  }
87 
88  ODES_bsub bsub_function (void) const { return bsub; }
89 
91  {
92  bsub = b;
93  return *this;
94  }
95 
96  ODES_jsub jsub_function (void) const { return jsub; }
97 
98  ODESFunc& set_jsub_function (ODES_jsub j)
99  {
100  jsub = j;
101  return *this;
102  }
103 
104 protected:
105 
106  ODES_fsub fsub;
107  ODES_bsub bsub;
108  ODES_jsub jsub;
109 };
110 
111 #endif
ODES_fsub fsub_function(void) const
Definition: ODESFunc.h:80
ODES_bsub bsub_function(void) const
Definition: ODESFunc.h:88
OCTAVE_EXPORT octave_value_list column
Definition: sparse.cc:123
ODESFunc(void)
Definition: ODESFunc.h:52
ODESFunc(const ODESFunc &a)
Definition: ODESFunc.h:64
Matrix * dfdx
Definition: ODESFunc.h:40
ODES_bsub bsub
Definition: ODESFunc.h:107
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
ODESFunc & set_fsub_function(ODES_fsub f)
Definition: ODESFunc.h:82
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:400
ODESFunc & set_bsub_function(ODES_bsub b)
Definition: ODESFunc.h:90
ODES_fsub fsub
Definition: ODESFunc.h:106
Matrix * dfdxdot
Definition: ODESFunc.h:39
ODES_jsub jsub
Definition: ODESFunc.h:108
OCTAVE_EXPORT octave_value_list angle of ex theta
Definition: mappers.cc:258
Definition: dMatrix.h:36
ODESFunc(ODES_fsub f, ODES_bsub b, ODES_jsub j)
Definition: ODESFunc.h:61
ODES_jsub jsub_function(void) const
Definition: ODESFunc.h:96
ODESFunc & set_jsub_function(ODES_jsub j)
Definition: ODESFunc.h:98
b
Definition: cellfun.cc:400
ODESFunc(ODES_fsub f, ODES_bsub b)
Definition: ODESFunc.h:58
ODESFunc(ODES_fsub f)
Definition: ODESFunc.h:55
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x