GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
DASRT.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2002-2025 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
38{
39public:
40
42 : m_x (), m_xdot (), m_t () { }
43
44 DASRT_result (const Matrix& x, const Matrix& xdot, const ColumnVector& t)
45 : m_x (x), m_xdot (xdot), m_t (t) { }
46
48 : m_x (r.m_x), m_xdot (r.m_xdot), m_t (r.m_t) { }
49
51 {
52 if (this != &r)
53 {
54 m_x = r.m_x;
55 m_xdot = r.m_xdot;
56 m_t = r.m_t;
57 }
58 return *this;
59 }
60
61 ~DASRT_result () = default;
62
63 Matrix state () const { return m_x; }
64 Matrix deriv () const { return m_xdot; }
65 ColumnVector times () const { return m_t; }
66
67private:
68
69 Matrix m_x;
70 Matrix m_xdot;
71 ColumnVector m_t;
72};
73
74class OCTAVE_API DASRT : public DAERT, public DASRT_options
75{
76public:
77
79 : DAERT (), DASRT_options (), m_initialized (false),
80 m_liw (0), m_lrw (0), m_ng (0), m_info (), m_iwork (), m_jroot (),
81 m_rwork (), m_abs_tol (), m_rel_tol ()
82 { }
83
84 DASRT (const ColumnVector& s, double tm, DAERTFunc& f)
85 : DAERT (s, tm, f), DASRT_options (), m_initialized (false),
86 m_liw (0), m_lrw (0), m_ng (0), m_info (), m_iwork (), m_jroot (),
87 m_rwork (), m_abs_tol (), m_rel_tol ()
88 { }
89
90 DASRT (const ColumnVector& s, const ColumnVector& deriv,
91 double tm, DAERTFunc& f)
92 : DAERT (s, deriv, tm, f), DASRT_options (), m_initialized (false),
93 m_liw (0), m_lrw (0), m_ng (0), m_info (), m_iwork (), m_jroot (),
94 m_rwork (), m_abs_tol (), m_rel_tol ()
95 { }
96
97 OCTAVE_DEFAULT_COPY_MOVE_DELETE (DASRT)
98
99 DASRT_result integrate (const ColumnVector& tout);
100
101 DASRT_result integrate (const ColumnVector& tout,
102 const ColumnVector& tcrit);
103
104 std::string error_message () const;
105
106private:
107
108 bool m_initialized;
109
110 octave_f77_int_type m_liw;
111 octave_f77_int_type m_lrw;
112
113 octave_f77_int_type m_ng;
114
118
119 Array<double> m_rwork;
120
121 Array<double> m_abs_tol;
122 Array<double> m_rel_tol;
123
124 void integrate (double t);
125};
126
127#endif
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
Definition DAERT.h:36
DASRT_result()
Definition DASRT.h:41
DASRT_result & operator=(const DASRT_result &r)
Definition DASRT.h:50
Matrix deriv() const
Definition DASRT.h:64
DASRT_result(const Matrix &x, const Matrix &xdot, const ColumnVector &t)
Definition DASRT.h:44
Matrix state() const
Definition DASRT.h:63
ColumnVector times() const
Definition DASRT.h:65
DASRT_result(const DASRT_result &r)
Definition DASRT.h:47
~DASRT_result()=default
Definition DASRT.h:75
DASRT(const ColumnVector &s, double tm, DAERTFunc &f)
Definition DASRT.h:84
DASRT()
Definition DASRT.h:78
DASRT(const ColumnVector &s, const ColumnVector &deriv, double tm, DAERTFunc &f)
Definition DASRT.h:90
virtual std::string error_message() const =0
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