GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions
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:

Go to the source code of this file.

Macros

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

Functions

void install_str_str_ops (void)
 
static octave_value oct_assignop_assign (octave_base_value &a1, const octave_value_list &idx, const octave_base_value &a2)
 
static octave_value oct_assignop_null_assign (octave_base_value &a, const octave_value_list &idx, const octave_base_value &)
 
static octave_value oct_binop_eq (const octave_base_value &a1, const octave_base_value &a2)
 
static octave_value oct_binop_ge (const octave_base_value &a1, const octave_base_value &a2)
 
static octave_value oct_binop_gt (const octave_base_value &a1, const octave_base_value &a2)
 
static octave_value oct_binop_le (const octave_base_value &a1, const octave_base_value &a2)
 
static octave_value oct_binop_lt (const octave_base_value &a1, const octave_base_value &a2)
 
static octave_value oct_binop_ne (const octave_base_value &a1, const octave_base_value &a2)
 
static octave_value oct_catop_str_str (octave_base_value &a1, const octave_base_value &a2, const Array< octave_idx_type > &ra_idx)
 
static octave_value oct_unop_transpose (const octave_base_value &a)
 

Macro Definition Documentation

#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 ())); \
} \
}
virtual dim_vector dims(void) const
Definition: ov-base.h:292
int bool
Definition: mex.h:56
#define BINOPDECL(name, a1, a2)
Definition: ops.h:272
const octave_base_value const Array< octave_idx_type > &ra_idx octave_int16_scalar & v1
#define CAST_BINOP_ARGS(t1, t2)
Definition: ops.h:79
const octave_base_value & a2
F77_RET_T const double const double * f
const octave_char_matrix & v2
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))

Definition at line 53 of file op-str-str.cc.

Function Documentation

void install_str_str_ops ( void  )
static octave_value oct_assignop_assign ( octave_base_value a1,
const octave_value_list idx,
const octave_base_value a2 
)
static
static octave_value oct_assignop_null_assign ( octave_base_value a,
const octave_value_list idx,
const octave_base_value  
)
static

Definition at line 101 of file op-str-str.cc.

static octave_value oct_binop_eq ( const octave_base_value a1,
const octave_base_value a2 
)
static

Definition at line 85 of file op-str-str.cc.

static octave_value oct_binop_ge ( const octave_base_value a1,
const octave_base_value a2 
)
static

Definition at line 87 of file op-str-str.cc.

static octave_value oct_binop_gt ( const octave_base_value a1,
const octave_base_value a2 
)
static

Definition at line 89 of file op-str-str.cc.

static octave_value oct_binop_le ( const octave_base_value a1,
const octave_base_value a2 
)
static

Definition at line 83 of file op-str-str.cc.

static octave_value oct_binop_lt ( const octave_base_value a1,
const octave_base_value a2 
)
static

Definition at line 81 of file op-str-str.cc.

static octave_value oct_binop_ne ( const octave_base_value a1,
const octave_base_value a2 
)
static

Definition at line 91 of file op-str-str.cc.

static octave_value oct_catop_str_str ( octave_base_value a1,
const octave_base_value a2,
const Array< octave_idx_type > &  ra_idx 
)
static

Definition at line 103 of file op-str-str.cc.

static octave_value oct_unop_transpose ( const octave_base_value a)
static

Definition at line 37 of file op-str-str.cc.

References CAST_UNOP_ARG, error(), and octave_value().