#include "gripes.h"
#include "oct-obj.h"
#include "ov.h"
#include "ov-str-mat.h"
#include "ov-typeinfo.h"
#include "ov-null-mat.h"
#include "ops.h"
Defines | |
#define | DEFCHARNDBINOP_FN(name, op, t1, t2, e1, e2, f) |
Value:
BINOPDECL (name, a1, a2) \ { \ dim_vector a1_dims = a1.dims (); \ dim_vector a2_dims = a2.dims (); \ \ bool a1_is_scalar = a1_dims.all_ones (); \ bool a2_is_scalar = a2_dims.all_ones (); \ \ CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \ \ if (a1_is_scalar) \ { \ if (a2_is_scalar) \ return octave_value ((v1.e1 ## _value ())(0) op (v2.e2 ## _value ())(0)); \ else \ return octave_value (f ((v1.e1 ## _value ())(0), v2.e2 ## _value ())); \ } \ else \ { \ if (a2_is_scalar) \ return octave_value (f (v1.e1 ## _value (), (v2.e2 ## _value ())(0))); \ else \ return octave_value (f (v1.e1 ## _value (), v2.e2 ## _value ())); \ } \ }