Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026
00027 #include "gripes.h"
00028 #include "oct-obj.h"
00029 #include "ov.h"
00030 #include "ov-perm.h"
00031 #include "ov-re-mat.h"
00032 #include "ov-scalar.h"
00033 #include "ov-typeinfo.h"
00034 #include "ops.h"
00035 #include "xpow.h"
00036
00037 DEFUNOP (transpose, perm_matrix)
00038 {
00039 CAST_UNOP_ARG (const octave_perm_matrix&);
00040 return octave_value (v.perm_matrix_value().transpose ());
00041 }
00042
00043 DEFBINOP_OP (mul, perm_matrix, perm_matrix, *)
00044
00045 DEFBINOP (div, perm_matrix, perm_matrix)
00046 {
00047 CAST_BINOP_ARGS (const octave_perm_matrix&, const octave_perm_matrix&);
00048
00049 return (v1.perm_matrix_value () * v2.perm_matrix_value ().inverse ());
00050 }
00051
00052 DEFBINOP (ldiv, perm_matrix, perm_matrix)
00053 {
00054 CAST_BINOP_ARGS (const octave_perm_matrix&, const octave_perm_matrix&);
00055
00056 return (v1.perm_matrix_value ().inverse () * v2.perm_matrix_value ());
00057 }
00058
00059 DEFBINOP (pow, perm_matrix, scalar)
00060 {
00061 CAST_BINOP_ARGS (const octave_perm_matrix&, const octave_scalar&);
00062
00063 return xpow (v1.perm_matrix_value (), v2.scalar_value ());
00064 }
00065
00066 CONVDECL (perm_matrix_to_matrix)
00067 {
00068 CAST_CONV_ARG (const octave_perm_matrix&);
00069
00070 return new octave_matrix (v.matrix_value ());
00071 }
00072
00073 void
00074 install_pm_pm_ops (void)
00075 {
00076 INSTALL_UNOP (op_transpose, octave_perm_matrix, transpose);
00077 INSTALL_UNOP (op_hermitian, octave_perm_matrix, transpose);
00078
00079 INSTALL_BINOP (op_mul, octave_perm_matrix, octave_perm_matrix, mul);
00080 INSTALL_BINOP (op_div, octave_perm_matrix, octave_perm_matrix, div);
00081 INSTALL_BINOP (op_ldiv, octave_perm_matrix, octave_perm_matrix, ldiv);
00082 INSTALL_BINOP (op_pow, octave_perm_matrix, octave_scalar, pow);
00083
00084 INSTALL_CONVOP (octave_perm_matrix, octave_matrix, perm_matrix_to_matrix);
00085 INSTALL_ASSIGNCONV (octave_perm_matrix, octave_matrix, octave_matrix);
00086 INSTALL_WIDENOP (octave_perm_matrix, octave_matrix, perm_matrix_to_matrix);
00087 }