5164
|
1 /* |
|
2 |
|
3 Copyright (C) 2004 David Bateman |
|
4 Copyright (C) 1998-2004 Andy Adler |
|
5 |
|
6 Octave is free software; you can redistribute it and/or modify it |
|
7 under the terms of the GNU General Public License as published by the |
|
8 Free Software Foundation; either version 2, or (at your option) any |
|
9 later version. |
|
10 |
|
11 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 for more details. |
|
15 |
|
16 You should have received a copy of the GNU General Public License |
5307
|
17 along with this program; see the file COPYING. If not, write to the |
|
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
19 Boston, MA 02110-1301, USA. |
5164
|
20 |
|
21 */ |
|
22 |
|
23 #ifdef HAVE_CONFIG_H |
|
24 #include <config.h> |
|
25 #endif |
|
26 |
|
27 #include <iostream> |
|
28 |
|
29 #include "mach-info.h" |
|
30 #include "error.h" |
|
31 #include "oct-obj.h" |
|
32 #include "oct-stream.h" |
|
33 #include "ops.h" |
|
34 #include "ov.h" |
|
35 #include "ov-file.h" |
|
36 #include "ov-typeinfo.h" |
|
37 |
|
38 #include "ov-re-sparse.h" |
|
39 |
|
40 // file by sparse matrix ops. |
|
41 |
|
42 DEFBINOP (lshift, file, sparse_matrix) |
|
43 { |
|
44 CAST_BINOP_ARGS (const octave_file&, const octave_sparse_matrix&); |
|
45 |
|
46 octave_stream oct_stream = v1.stream_value (); |
|
47 |
|
48 if (oct_stream) |
|
49 { |
|
50 std::ostream *osp = oct_stream.output_stream (); |
|
51 |
|
52 if (osp) |
|
53 { |
|
54 std::ostream& os = *osp; |
|
55 |
|
56 v2.print_raw (os); |
|
57 } |
|
58 else |
|
59 error ("invalid file specified for binary operator `<<'"); |
|
60 } |
|
61 |
|
62 return octave_value (oct_stream, v1.stream_number ()); |
|
63 } |
|
64 |
|
65 void |
|
66 install_fil_sm_ops (void) |
|
67 { |
|
68 INSTALL_BINOP (op_lshift, octave_file, octave_sparse_matrix, lshift); |
|
69 } |
|
70 |
|
71 /* |
|
72 ;;; Local Variables: *** |
|
73 ;;; mode: C++ *** |
|
74 ;;; End: *** |
|
75 */ |