GNU Octave  4.4.1
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-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_DAERTFunc_h)
24 #define octave_DAERTFunc_h 1
25 
26 #include "octave-config.h"
27 
28 #include "DAEFunc.h"
29 
30 class
31 DAERTFunc : public DAEFunc
32 {
33 public:
34 
35  typedef ColumnVector (*DAERTConstrFunc) (const ColumnVector& x, double t);
36 
37  DAERTFunc (void)
38  : DAEFunc (), constr (nullptr), reset (true) { }
39 
40  DAERTFunc (DAERHSFunc f)
41  : DAEFunc (f), constr (nullptr), reset (true) { }
42 
43  DAERTFunc (DAERHSFunc f, DAEJacFunc j)
44  : DAEFunc (f, j), constr (nullptr), reset (true) { }
45 
46  DAERTFunc (DAERHSFunc f, DAERTConstrFunc cf)
47  : DAEFunc (f), constr (cf), reset (true) { }
48 
49  DAERTFunc (DAERHSFunc f, DAERTConstrFunc cf, DAEJacFunc j)
50  : DAEFunc (f, j), constr (cf), reset (true) { }
51 
53  : DAEFunc (a), constr (a.constr), reset (a.reset) { }
54 
56  {
57  if (this != &a)
58  {
60  constr = a.constr;
61  reset = a.reset;
62  }
63  return *this;
64  }
65 
66  virtual ~DAERTFunc (void) = default;
67 
68  DAERTConstrFunc constraint_function (void) const { return constr; }
69 
70  DAERTFunc& set_constraint_function (DAERTConstrFunc cf)
71  {
72  constr = cf;
73  reset = true;
74  return *this;
75  }
76 
77 protected:
78 
79  DAERTConstrFunc constr;
80 
81  // This variable is TRUE when this object is constructed, and also
82  // after any internal data has changed. Derived classes may use
83  // this information (and change it) to know when to (re)initialize
84  // their own internal data related to this object.
85 
86  bool reset;
87 };
88 
89 #endif
DAERTConstrFunc constr
Definition: DAERTFunc.h:79
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
DAERTFunc & set_constraint_function(DAERTConstrFunc cf)
Definition: DAERTFunc.h:70
DAERTFunc(DAERHSFunc f)
Definition: DAERTFunc.h:40
DAERTFunc(const DAERTFunc &a)
Definition: DAERTFunc.h:52
DAERTFunc(DAERHSFunc f, DAERTConstrFunc cf, DAEJacFunc j)
Definition: DAERTFunc.h:49
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
Definition: ov-usr-fcn.cc:997
DAERTConstrFunc constraint_function(void) const
Definition: DAERTFunc.h:68
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
ColumnVector & operator=(const ColumnVector &a)
Definition: dColVector.h:54
DAERTFunc(DAERHSFunc f, DAERTConstrFunc cf)
Definition: DAERTFunc.h:46
DAERTFunc(DAERHSFunc f, DAEJacFunc j)
Definition: DAERTFunc.h:43
DAEFunc & operator=(const DAEFunc &a)
Definition: DAEFunc.h:60
ColumnVector(void)
Definition: dColVector.h:38
DAERTFunc(void)
Definition: DAERTFunc.h:37
bool reset
Definition: DAERTFunc.h:86
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