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