comparison src/OPERATORS/op-fil-scm.cc @ 5164:57077d0ddc8e

[project @ 2005-02-25 19:55:24 by jwe]
author jwe
date Fri, 25 Feb 2005 19:55:28 +0000
parents
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
5163:9f3299378193 5164:57077d0ddc8e
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
17 along with this program; see the file COPYING. If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 */
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <iostream>
27
28 #include "mach-info.h"
29 #include "error.h"
30 #include "oct-obj.h"
31 #include "oct-stream.h"
32 #include "ops.h"
33 #include "ov.h"
34 #include "ov-file.h"
35 #include "ov-typeinfo.h"
36
37 #include "ov-cx-sparse.h"
38
39 // file by sparse complex matrix ops.
40
41 DEFBINOP (lshift, file, sparse_complex_matrix)
42 {
43 CAST_BINOP_ARGS (const octave_file&, const octave_sparse_complex_matrix&);
44
45 octave_stream oct_stream = v1.stream_value ();
46
47 if (oct_stream)
48 {
49 std::ostream *osp = oct_stream.output_stream ();
50
51 if (osp)
52 {
53 std::ostream& os = *osp;
54
55 v2.print_raw (os);
56 }
57 else
58 error ("invalid file specified for binary operator `<<'");
59 }
60
61 return octave_value (oct_stream, v1.stream_number ());
62 }
63
64 void
65 install_fil_scm_ops (void)
66 {
67 INSTALL_BINOP (op_lshift, octave_file, octave_sparse_complex_matrix,
68 lshift);
69 }
70
71 /*
72 ;;; Local Variables: ***
73 ;;; mode: C++ ***
74 ;;; End: ***
75 */