GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ODESFunc.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2002-2013 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 the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 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 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if !defined (octave_ODESFunc_h)
24 #define octave_ODESFunc_h 1
25 
26 #include "dMatrix.h"
27 
28 class
30 {
31 public:
32 
33  struct DAEJac
34  {
37  };
38 
39  typedef ColumnVector (*ODES_fsub) (const ColumnVector& x, double,
40  const ColumnVector& theta);
41 
42  typedef ColumnVector (*ODES_bsub) (const ColumnVector& x, double,
43  const ColumnVector& theta, int column);
44 
45  typedef Matrix (*ODES_jsub) (const ColumnVector& x, double,
46  const ColumnVector& theta);
47 
48  ODESFunc (void)
49  : fsub (0), bsub (0), jsub (0) { }
50 
51  ODESFunc (ODES_fsub f)
52  : fsub (f), bsub (0), jsub (0) { }
53 
54  ODESFunc (ODES_fsub f, ODES_bsub b)
55  : fsub (f), bsub (b), jsub (0) { }
56 
57  ODESFunc (ODES_fsub f, ODES_bsub b, ODES_jsub j)
58  : fsub (f), bsub (b), jsub (j) { }
59 
60  ODESFunc (const ODESFunc& a)
61  : fsub (a.fsub), bsub (a.bsub), jsub (a.jsub) { }
62 
63  ODESFunc& operator = (const ODESFunc& a)
64  {
65  if (this != &a)
66  {
67  fsub = a.fsub;
68  bsub = a.bsub;
69  jsub = a.jsub;
70  }
71  return *this;
72  }
73 
74  virtual ~ODESFunc (void) { }
75 
76  ODES_fsub fsub_function (void) const { return fsub; }
77 
78  ODESFunc& set_fsub_function (ODES_fsub f)
79  {
80  fsub = f;
81  return *this;
82  }
83 
84  ODES_bsub bsub_function (void) const { return bsub; }
85 
86  ODESFunc& set_bsub_function (ODES_bsub b)
87  {
88  bsub = b;
89  return *this;
90  }
91 
92  ODES_jsub jsub_function (void) const { return jsub; }
93 
94  ODESFunc& set_jsub_function (ODES_jsub j)
95  {
96  jsub = j;
97  return *this;
98  }
99 
100 protected:
101 
102  ODES_fsub fsub;
103  ODES_bsub bsub;
104  ODES_jsub jsub;
105 };
106 
107 #endif