Navigation

Operators and Keywords

Function List:

C++ API

op-str-str.cc File Reference

#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"

Include dependency graph for op-str-str.cc:


Defines

#define DEFCHARNDBINOP_FN(name, op, t1, t2, e1, e2, f)

Define Documentation

#define DEFCHARNDBINOP_FN ( name,
op,
t1,
t2,
e1,
e2,
 ) 

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 ())); \
      } \
  }