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 "ov-perm.h"
00028 #include MINCLUDE
00029 #include "ops.h"
00030 #ifdef DEFINENULLASSIGNCONV
00031 #include "ov-null-mat.h"
00032 #endif
00033
00034 #ifndef LDMATRIX
00035 #define LDMATRIX LMATRIX
00036 #endif
00037
00038 #define OCTAVE_LMATRIX CONCAT2(octave_, LMATRIX)
00039 #define OCTAVE_LDMATRIX CONCAT2(octave_, LDMATRIX)
00040 #define OCTAVE_RMATRIX CONCAT2(octave_, RMATRIX)
00041 #ifdef LEFT
00042 #define LMATRIX_VALUE perm_matrix_value
00043 #define RMATRIX_VALUE CONCAT2(RMATRIX, _value)
00044 #else
00045 #define LMATRIX_VALUE CONCAT2(LMATRIX, _value)
00046 #define RMATRIX_VALUE perm_matrix_value
00047 #endif
00048
00049 DEFBINOP (mul, LMATRIX, RMATRIX)
00050 {
00051 CAST_BINOP_ARGS (const OCTAVE_LMATRIX&, const OCTAVE_RMATRIX&);
00052
00053 return v1.LMATRIX_VALUE () * v2.RMATRIX_VALUE ();
00054 }
00055
00056 #ifdef LEFT
00057 DEFBINOP (ldiv, LMATRIX, RMATRIX)
00058 {
00059 CAST_BINOP_ARGS (const OCTAVE_LMATRIX&, const OCTAVE_RMATRIX&);
00060
00061 return v1.perm_matrix_value ().inverse () * v2.RMATRIX_VALUE ();
00062 }
00063 #else
00064 DEFBINOP (div, LMATRIX, RMATRIX)
00065 {
00066 CAST_BINOP_ARGS (const OCTAVE_LMATRIX&, const OCTAVE_RMATRIX&);
00067
00068 return v1.LMATRIX_VALUE () * v2.perm_matrix_value ().inverse ();
00069 }
00070 #endif
00071
00072
00073 #define SHORT_NAME CONCAT3(LSHORT, _, RSHORT)
00074 #define INST_NAME CONCAT3(install_, SHORT_NAME, _ops)
00075
00076 void
00077 INST_NAME (void)
00078 {
00079 INSTALL_BINOP (op_mul, OCTAVE_LMATRIX, OCTAVE_RMATRIX, mul);
00080 #ifdef LEFT
00081 INSTALL_BINOP (op_ldiv, OCTAVE_LMATRIX, OCTAVE_RMATRIX, ldiv);
00082 #else
00083 INSTALL_BINOP (op_div, OCTAVE_LMATRIX, OCTAVE_RMATRIX, div);
00084 #endif
00085 #ifdef DEFINENULLASSIGNCONV
00086 INSTALL_ASSIGNCONV (OCTAVE_LMATRIX, octave_null_matrix, OCTAVE_LDMATRIX);
00087 INSTALL_ASSIGNCONV (OCTAVE_LMATRIX, octave_null_str, OCTAVE_LDMATRIX);
00088 INSTALL_ASSIGNCONV (OCTAVE_LMATRIX, octave_null_sq_str, OCTAVE_LDMATRIX);
00089 #endif
00090 }