Mercurial > hg > octave-lyh
annotate liboctave/numeric/ODES.h @ 17191:ca5103ab0b21
check_gzip_magic before get_file_format (wrong type detection, bug #39652)
* load-save.cc (get_file_format): call check_gzip_magic before get_file_format
to avoid random LS_MAT_ASCII detections in gzipped files.
* ls-mat-ascii.cc (looks_like_mat_ascii_file): New arg, IS which could also
be a gzipped file, is now opened in the calling function.
* ls-mat-ascii.h (looks_like_mat_ascii_file): New arg, IS.
author | Andreas Weber <andy.weber.aw@gmail.com> |
---|---|
date | Fri, 02 Aug 2013 19:48:34 +0200 |
parents | 648dabbb4c6b |
children |
rev | line source |
---|---|
3984 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
3 Copyright (C) 2002-2012 John W. Eaton |
3984 | 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 the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
3984 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
3984 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_ODES_h) | |
24 #define octave_ODES_h 1 | |
25 | |
26 #include "ODESFunc.h" | |
27 #include "base-de.h" | |
28 | |
29 class | |
30 ODES : public base_diff_eqn, public ODESFunc | |
31 { | |
32 public: | |
33 | |
34 ODES (void) | |
11502
4638800cd660
delete data pointer members from liboctave ODE/DAE classes; make destuctors virtual in ODE/DAE base classes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
35 : base_diff_eqn (), ODESFunc (), xdot (), theta () { } |
3984 | 36 |
4587 | 37 ODES (const ColumnVector& s, double tm, ODESFunc& f) |
38 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), theta () { } | |
3984 | 39 |
4587 | 40 ODES (const ColumnVector& s, const ColumnVector& xtheta, double tm, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
41 ODESFunc& f) |
4587 | 42 : base_diff_eqn (s, tm), ODESFunc (f), xdot (s.length (), 0.0), |
3984 | 43 theta (xtheta) { } |
44 | |
45 ODES (const ODES& a) | |
11502
4638800cd660
delete data pointer members from liboctave ODE/DAE classes; make destuctors virtual in ODE/DAE base classes
John W. Eaton <jwe@octave.org>
parents:
10312
diff
changeset
|
46 : base_diff_eqn (a), ODESFunc (a), xdot (a.xdot), theta (a.theta) { } |
3984 | 47 |
48 ODES& operator = (const ODES& a) | |
49 { | |
50 if (this != &a) | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
51 { |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
52 base_diff_eqn::operator = (a); |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
53 ODESFunc::operator = (a); |
3984 | 54 |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
55 xdot = a.xdot; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
56 theta = a.theta; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
57 } |
3984 | 58 return *this; |
59 } | |
60 | |
61 ~ODES (void) { } | |
62 | |
63 ColumnVector parameter_vector (void) { return theta; } | |
64 | |
65 void initialize (const ColumnVector& x, double t); | |
66 | |
67 void initialize (const ColumnVector& x, double t, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
68 const ColumnVector& theta); |
3984 | 69 |
70 protected: | |
71 | |
72 // State vector time derivatives. | |
73 ColumnVector xdot; | |
74 | |
75 // Parameter vector. | |
76 ColumnVector theta; | |
77 }; | |
78 | |
79 #endif |