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 |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
4939
|
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 |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
4939
|
20 |
|
21 */ |
|
22 |
|
23 #ifdef HAVE_CONFIG_H |
|
24 #include <config.h> |
|
25 #endif |
|
26 |
|
27 #include "gripes.h" |
|
28 #include "oct-obj.h" |
|
29 #include "ov.h" |
|
30 #include "ov-struct.h" |
|
31 #include "ov-typeinfo.h" |
|
32 #include "ops.h" |
|
33 |
|
34 // struct ops. |
|
35 |
5571
|
36 DEFUNOP (transpose, cell) |
|
37 { |
|
38 CAST_UNOP_ARG (const octave_struct&); |
|
39 |
|
40 if (v.ndims () > 2) |
|
41 { |
|
42 error ("transpose not defined for N-d objects"); |
|
43 return octave_value (); |
|
44 } |
|
45 else |
|
46 return octave_value (v.map_value().transpose ()); |
|
47 } |
|
48 |
4939
|
49 DEFNDCATOP_FN (struct_struct, struct, struct, map, map, concat) |
|
50 |
|
51 void |
|
52 install_struct_ops (void) |
|
53 { |
5571
|
54 INSTALL_UNOP (op_transpose, octave_struct, transpose); |
|
55 INSTALL_UNOP (op_hermitian, octave_struct, transpose); |
|
56 |
4939
|
57 INSTALL_CATOP (octave_struct, octave_struct, struct_struct); |
|
58 } |
|
59 |
|
60 /* |
|
61 ;;; Local Variables: *** |
|
62 ;;; mode: C++ *** |
|
63 ;;; End: *** |
|
64 */ |