GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
DASRT.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_DASRT_h)
27 #define octave_DASRT_h 1
28 
29 #include "octave-config.h"
30 
31 #include <string>
32 
33 #include "Array.h"
34 #include "DASRT-opts.h"
35 #include "dMatrix.h"
36 
37 class
39 {
40 public:
41 
42  DASRT_result (void)
43  : x (), xdot (), t () { }
44 
45  DASRT_result (const Matrix& xx, const Matrix& xxdot, const ColumnVector& tt)
46  : x (xx), xdot (xxdot), t (tt) { }
47 
49  : x (r.x), xdot (r.xdot), t (r.t) { }
50 
51  DASRT_result& operator = (const DASRT_result& r)
52  {
53  if (this != &r)
54  {
55  x = r.x;
56  xdot = r.xdot;
57  t = r.t;
58  }
59  return *this;
60  }
61 
62  ~DASRT_result (void) = default;
63 
64  Matrix state (void) const { return x; }
65  Matrix deriv (void) const { return xdot; }
66  ColumnVector times (void) const { return t; }
67 
68 private:
69 
73 };
74 
75 class
76 OCTAVE_API
77 DASRT : public DAERT, public DASRT_options
78 {
79 public:
80 
81  DASRT (void)
82  : DAERT (), DASRT_options (), initialized (false),
83  liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
84  abs_tol (), rel_tol ()
85  { }
86 
87  DASRT (const ColumnVector& s, double tm, DAERTFunc& f)
88  : DAERT (s, tm, f), DASRT_options (), initialized (false),
89  liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
90  abs_tol (), rel_tol ()
91  { }
92 
93  DASRT (const ColumnVector& s, const ColumnVector& deriv,
94  double tm, DAERTFunc& f)
95  : DAERT (s, deriv, tm, f), DASRT_options (), initialized (false),
96  liw (0), lrw (0), ng (0), info (), iwork (), jroot (), rwork (),
97  abs_tol (), rel_tol ()
98  { }
99 
100  ~DASRT (void) = default;
101 
102  DASRT_result integrate (const ColumnVector& tout);
103 
104  DASRT_result integrate (const ColumnVector& tout,
105  const ColumnVector& tcrit);
106 
107  std::string error_message (void) const;
108 
109 private:
110 
112 
113  octave_f77_int_type liw;
114  octave_f77_int_type lrw;
115 
116  octave_f77_int_type ng;
117 
121 
123 
126 
127  void integrate (double t);
128 };
129 
130 #endif
Definition: DAERT.h:37
ColumnVector times(void) const
Definition: DASRT.h:66
Matrix state(void) const
Definition: DASRT.h:64
DASRT_result(void)
Definition: DASRT.h:42
Matrix xdot
Definition: DASRT.h:71
DASRT_result(const Matrix &xx, const Matrix &xxdot, const ColumnVector &tt)
Definition: DASRT.h:45
Matrix deriv(void) const
Definition: DASRT.h:65
Matrix x
Definition: DASRT.h:70
~DASRT_result(void)=default
ColumnVector t
Definition: DASRT.h:72
DASRT_result(const DASRT_result &r)
Definition: DASRT.h:48
Definition: DASRT.h:78
DASRT(void)
Definition: DASRT.h:81
DASRT(const ColumnVector &s, double tm, DAERTFunc &f)
Definition: DASRT.h:87
~DASRT(void)=default
Array< double > abs_tol
Definition: DASRT.h:124
Array< octave_f77_int_type > iwork
Definition: DASRT.h:119
Array< octave_f77_int_type > jroot
Definition: DASRT.h:120
Array< double > rwork
Definition: DASRT.h:122
Array< octave_f77_int_type > info
Definition: DASRT.h:118
octave_f77_int_type lrw
Definition: DASRT.h:114
octave_f77_int_type liw
Definition: DASRT.h:113
Array< double > rel_tol
Definition: DASRT.h:125
octave_f77_int_type ng
Definition: DASRT.h:116
bool initialized
Definition: DASRT.h:111
DASRT(const ColumnVector &s, const ColumnVector &deriv, double tm, DAERTFunc &f)
Definition: DASRT.h:93
Definition: dMatrix.h:42
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
T * r
Definition: mx-inlines.cc:773