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