GNU Octave 7.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-2022 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
37class
39{
40public:
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 (void) = default;
63
64 Matrix state (void) const { return m_x; }
65 Matrix deriv (void) const { return m_xdot; }
66 ColumnVector times (void) const { return m_t; }
67
68private:
69
73};
74
75class
77DASRT : public DAERT, public DASRT_options
78{
79public:
80
81 DASRT (void)
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 ~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
109private:
110
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
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 m_x
Definition: DASRT.h:70
Matrix m_xdot
Definition: DASRT.h:71
DASRT_result(const Matrix &x, const Matrix &xdot, const ColumnVector &t)
Definition: DASRT.h:45
ColumnVector m_t
Definition: DASRT.h:72
Matrix deriv(void) const
Definition: DASRT.h:65
~DASRT_result(void)=default
DASRT_result(const DASRT_result &r)
Definition: DASRT.h:48
Definition: DASRT.h:78
DASRT(void)
Definition: DASRT.h:81
Array< double > m_abs_tol
Definition: DASRT.h:124
DASRT(const ColumnVector &s, double tm, DAERTFunc &f)
Definition: DASRT.h:87
octave_f77_int_type m_lrw
Definition: DASRT.h:114
~DASRT(void)=default
Array< octave_f77_int_type > m_iwork
Definition: DASRT.h:119
octave_f77_int_type m_liw
Definition: DASRT.h:113
Array< double > m_rwork
Definition: DASRT.h:122
octave_f77_int_type m_ng
Definition: DASRT.h:116
Array< octave_f77_int_type > m_jroot
Definition: DASRT.h:120
bool m_initialized
Definition: DASRT.h:111
Array< double > m_rel_tol
Definition: DASRT.h:125
Array< octave_f77_int_type > m_info
Definition: DASRT.h:118
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.in.cc:55