3937
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
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 |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
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 |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
3937
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
|
28 #include "gripes.h" |
4055
|
29 #include "oct-obj.h" |
3937
|
30 #include "ov.h" |
|
31 #include "ov-cell.h" |
|
32 #include "ov-scalar.h" |
|
33 #include "ov-re-mat.h" |
|
34 #include "ov-typeinfo.h" |
|
35 #include "ops.h" |
|
36 |
|
37 // cell ops. |
|
38 |
4673
|
39 DEFUNOP (transpose, cell) |
|
40 { |
|
41 CAST_UNOP_ARG (const octave_cell&); |
|
42 |
|
43 if (v.ndims () > 2) |
|
44 { |
|
45 error ("transpose not defined for N-d objects"); |
|
46 return octave_value (); |
|
47 } |
|
48 else |
|
49 return octave_value (Cell (v.cell_value().transpose ())); |
|
50 } |
|
51 |
4915
|
52 DEFCATOP_FN (c_c, cell, cell, concat) |
|
53 |
3937
|
54 DEFASSIGNANYOP_FN (assign, cell, assign); |
|
55 |
|
56 void |
|
57 install_cell_ops (void) |
|
58 { |
4673
|
59 INSTALL_UNOP (op_transpose, octave_cell, transpose); |
|
60 INSTALL_UNOP (op_hermitian, octave_cell, transpose); |
|
61 |
4915
|
62 INSTALL_CATOP (octave_cell, octave_cell, c_c); |
|
63 |
3937
|
64 INSTALL_ASSIGNANYOP (op_asn_eq, octave_cell, assign); |
|
65 } |
|
66 |
|
67 /* |
|
68 ;;; Local Variables: *** |
|
69 ;;; mode: C++ *** |
|
70 ;;; End: *** |
|
71 */ |