Mercurial > octave
annotate libinterp/corefcn/oct-iostrm.cc @ 30913:a4ed2fed7dfa
Add tests for automatic broadcasting with inplace times operator ".*=" (bug #38466).
* libinterp/corefcn/bsxfun.cc: Add tests for automatic broadcasting with inplace
times operator ".*=" with rhs of different shapes.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Fri, 08 Apr 2022 17:50:00 +0200 |
parents | 796f54d4ddbf |
children | e88a07dec498 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29991
diff
changeset
|
3 // Copyright (C) 1996-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
2081 | 25 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21200
diff
changeset
|
27 # include "config.h" |
2081 | 28 #endif |
29 | |
25438
cb1606f78f6b
prefer <istream>, <ostream>, or <iosfwd> to <iostream> where possible
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
30 #include <istream> |
cb1606f78f6b
prefer <istream>, <ostream>, or <iosfwd> to <iostream> where possible
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
31 #include <ostream> |
23059
b98ebcd7f11c
move some octave stream classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
32 |
2081 | 33 #include "error.h" |
34 #include "oct-iostrm.h" | |
35 | |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
36 OCTAVE_NAMESPACE_BEGIN |
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
37 |
2081 | 38 // Position a stream at OFFSET relative to ORIGIN. |
39 | |
40 int | |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
41 base_iostream::seek (off_t, int) |
2081 | 42 { |
43 invalid_operation (); | |
44 return -1; | |
45 } | |
46 | |
47 // Return current stream position. | |
48 | |
16011
8122286c69a9
initial large file support for 32-bit systems
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
49 off_t |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
50 base_iostream::tell (void) |
2081 | 51 { |
52 invalid_operation (); | |
53 return -1; | |
54 } | |
55 | |
18812
9ac2357f19bc
doc: Replace "non-zero" with "nonzero" to match existing usage.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
56 // Return nonzero if EOF has been reached on this stream. |
2081 | 57 |
58 bool | |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
59 base_iostream::eof (void) const |
2081 | 60 { |
61 invalid_operation (); | |
62 return false; | |
63 } | |
64 | |
65 void | |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
66 base_iostream::invalid_operation (void) const |
2081 | 67 { |
20938
aac911d8847b
choose correct error function in stream classes
John W. Eaton <jwe@octave.org>
parents:
20931
diff
changeset
|
68 // Note: use ::error to get error from error.h which halts operation. |
2081 | 69 ::error ("%s: invalid operation", stream_type ()); |
70 } | |
71 | |
18812
9ac2357f19bc
doc: Replace "non-zero" with "nonzero" to match existing usage.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
72 // Return nonzero if EOF has been reached on this stream. |
3342 | 73 |
74 bool | |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
75 istream::eof (void) const |
3342 | 76 { |
27172 | 77 return m_istream && m_istream->eof (); |
3342 | 78 } |
79 | |
23059
b98ebcd7f11c
move some octave stream classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
80 octave::stream |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
81 istream::create (std::istream *arg, const std::string& n) |
3340 | 82 { |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
83 return octave::stream (new istream (arg, n)); |
3340 | 84 } |
85 | |
18812
9ac2357f19bc
doc: Replace "non-zero" with "nonzero" to match existing usage.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
86 // Return nonzero if EOF has been reached on this stream. |
3342 | 87 |
88 bool | |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
89 ostream::eof (void) const |
3342 | 90 { |
27172 | 91 return m_ostream && m_ostream->eof (); |
3342 | 92 } |
93 | |
23059
b98ebcd7f11c
move some octave stream classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
94 octave::stream |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
95 ostream::create (std::ostream *arg, const std::string& n) |
3340 | 96 { |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
97 return octave::stream (new ostream (arg, n)); |
3340 | 98 } |
29991
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
99 |
3988112c7116
move i/o stream classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
100 OCTAVE_NAMESPACE_END |