4939
|
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. |
4939
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
|
28 #include "gripes.h" |
|
29 #include "oct-obj.h" |
|
30 #include "ov.h" |
|
31 #include "ov-struct.h" |
|
32 #include "ov-typeinfo.h" |
|
33 #include "ops.h" |
|
34 |
|
35 // struct ops. |
|
36 |
5571
|
37 DEFUNOP (transpose, cell) |
|
38 { |
|
39 CAST_UNOP_ARG (const octave_struct&); |
|
40 |
|
41 if (v.ndims () > 2) |
|
42 { |
|
43 error ("transpose not defined for N-d objects"); |
|
44 return octave_value (); |
|
45 } |
|
46 else |
|
47 return octave_value (v.map_value().transpose ()); |
|
48 } |
|
49 |
4939
|
50 DEFNDCATOP_FN (struct_struct, struct, struct, map, map, concat) |
|
51 |
|
52 void |
|
53 install_struct_ops (void) |
|
54 { |
5571
|
55 INSTALL_UNOP (op_transpose, octave_struct, transpose); |
|
56 INSTALL_UNOP (op_hermitian, octave_struct, transpose); |
|
57 |
4939
|
58 INSTALL_CATOP (octave_struct, octave_struct, struct_struct); |
|
59 } |
|
60 |
|
61 /* |
|
62 ;;; Local Variables: *** |
|
63 ;;; mode: C++ *** |
|
64 ;;; End: *** |
|
65 */ |