GNU Octave  9.1.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-2024 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 
43  : m_x (), m_xdot (), m_t () { }
44 
45  DASRT_result (const Matrix& x, const Matrix& xdot, const ColumnVector& t)
46  : m_x (x), m_xdot (xdot), m_t (t) { }
47 
49  : m_x (r.m_x), m_xdot (r.m_xdot), m_t (r.m_t) { }
50 
51  DASRT_result& operator = (const DASRT_result& r)
52  {
53  if (this != &r)
54  {
55  m_x = r.m_x;
56  m_xdot = r.m_xdot;
57  m_t = r.m_t;
58  }
59  return *this;
60  }
61 
62  ~DASRT_result () = default;
63 
64  Matrix state () const { return m_x; }
65  Matrix deriv () const { return m_xdot; }
66  ColumnVector times () const { return m_t; }
67 
68 private:
69 
70  Matrix m_x;
71  Matrix m_xdot;
72  ColumnVector m_t;
73 };
74 
75 class
77 DASRT : public DAERT, public DASRT_options
78 {
79 public:
80 
81  DASRT ()
82  : DAERT (), DASRT_options (), m_initialized (false),
83  m_liw (0), m_lrw (0), m_ng (0), m_info (), m_iwork (), m_jroot (),
84  m_rwork (), m_abs_tol (), m_rel_tol ()
85  { }
86 
87  DASRT (const ColumnVector& s, double tm, DAERTFunc& f)
88  : DAERT (s, tm, f), DASRT_options (), m_initialized (false),
89  m_liw (0), m_lrw (0), m_ng (0), m_info (), m_iwork (), m_jroot (),
90  m_rwork (), m_abs_tol (), m_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 (), m_initialized (false),
96  m_liw (0), m_lrw (0), m_ng (0), m_info (), m_iwork (), m_jroot (),
97  m_rwork (), m_abs_tol (), m_rel_tol ()
98  { }
99 
100  OCTAVE_DEFAULT_COPY_MOVE_DELETE (DASRT)
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 () const;
108 
109 private:
110 
111  bool m_initialized;
112 
113  octave_f77_int_type m_liw;
114  octave_f77_int_type m_lrw;
115 
116  octave_f77_int_type m_ng;
117 
121 
122  Array<double> m_rwork;
123 
124  Array<double> m_abs_tol;
125  Array<double> m_rel_tol;
126 
127  void integrate (double t);
128 };
129 
130 #endif
Definition: DAERT.h:37
DASRT_result()
Definition: DASRT.h:42
Matrix deriv() const
Definition: DASRT.h:65
DASRT_result(const Matrix &x, const Matrix &xdot, const ColumnVector &t)
Definition: DASRT.h:45
Matrix state() const
Definition: DASRT.h:64
ColumnVector times() const
Definition: DASRT.h:66
DASRT_result(const DASRT_result &r)
Definition: DASRT.h:48
~DASRT_result()=default
Definition: DASRT.h:78
DASRT(const ColumnVector &s, double tm, DAERTFunc &f)
Definition: DASRT.h:87
DASRT()
Definition: DASRT.h:81
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
#define OCTAVE_API
Definition: main.cc:55
T * r
Definition: mx-inlines.cc:781