GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ops.h File Reference
#include "octave-config.h"
#include "Array-util.h"
#include "error.h"

Go to the source code of this file.

Macros

#define CONCAT2(x, y)   CONCAT2X (x, y)
 
#define CONCAT2X(x, y)   x ## y
 
#define CONCAT3(x, y, z)   CONCAT3X (x, y, z)
 
#define CONCAT3X(x, y, z)   x ## y ## z
 
#define CONVDECL(name)
 
#define DEFASSIGNANYOP_FN(name, t1, f)
 
#define DEFASSIGNOP(name, t1, t2)
 
#define DEFASSIGNOP_FN(name, t1, t2, f)
 
#define DEFBINOP(name, t1, t2)
 
#define DEFBINOP_FN(name, t1, t2, f)
 
#define DEFBINOP_OP(name, t1, t2, op)
 
#define DEFBINOPX(name, t1, t2)
 
#define DEFCATOP(name, t1, t2)
 
#define DEFCATOP_FN(name, t1, t2, f)
 
#define DEFCATOPX(name, t1, t2)
 
#define DEFCMPLXCMPOP_OP(name, t1, t2, op)
 
#define DEFCONV(name, a_dummy, b_dummy)    CONVDECL (name)
 
#define DEFNCUNOP_METHOD(name, t, method)
 
#define DEFNDASSIGNOP_FN(name, t1, t2, e, f)
 
#define DEFNDASSIGNOP_FNOP(name, t1, t2, f, fnop)
 
#define DEFNDASSIGNOP_OP(name, t1, t2, f, op)
 
#define DEFNDBINOP_FN(name, t1, t2, e1, e2, f)
 
#define DEFNDBINOP_OP(name, t1, t2, e1, e2, op)
 
#define DEFNDCATOP_FN(name, t1, t2, e1, e2, f)
 
#define DEFNDCATOP_FN2(name, t1, t2, tc1, tc2, e1, e2, f)
 
#define DEFNDCHARCATOP_FN(name, t1, t2, f)
 
#define DEFNDCMPLXCMPOP_FN(name, t1, t2, e1, e2, f)
 
#define DEFNDUNOP_FN(name, t, e, f)
 
#define DEFNDUNOP_OP(name, t, e, op)
 
#define DEFNULLASSIGNOP_FN(name, t, f)
 
#define DEFSCALARBOOLOP_OP(name, t1, t2, op)
 
#define DEFUNOP(name, t)
 
#define DEFUNOP_FN(name, t, f)
 
#define DEFUNOP_OP(name, t, op)
 
#define DEFUNOPX(name, t)
 
#define INSTALL_ASSIGNANYOP_TI(ti, op, t1, f)
 
#define INSTALL_ASSIGNCONV_TI(ti, t1, t2, tr)
 
#define INSTALL_ASSIGNOP_TI(ti, op, t1, t2, f)
 
#define INSTALL_BINOP_TI(ti, op, t1, t2, f)
 
#define INSTALL_CATOP_TI(ti, t1, t2, f)
 
#define INSTALL_NCUNOP_TI(ti, op, t, f)
 
#define INSTALL_UNOP_TI(ti, op, t, f)
 
#define INSTALL_WIDENOP_TI(ti, t1, t2, f)
 
#define OCTAVE_CAST_BASE_VALUE(T, T_VAL, BASE_VAL)    T T_VAL = OCTAVE_DYNAMIC_CAST<T> (BASE_VAL)
 
#define OCTAVE_DYNAMIC_CAST   static_cast
 

Macro Definition Documentation

◆ CONCAT2

#define CONCAT2 (   x,
 
)    CONCAT2X (x, y)

Definition at line 57 of file ops.h.

◆ CONCAT2X

#define CONCAT2X (   x,
 
)    x ## y

Definition at line 56 of file ops.h.

◆ CONCAT3

#define CONCAT3 (   x,
  y,
 
)    CONCAT3X (x, y, z)

Definition at line 60 of file ops.h.

◆ CONCAT3X

#define CONCAT3X (   x,
  y,
 
)    x ## y ## z

Definition at line 59 of file ops.h.

◆ CONVDECL

#define CONVDECL (   name)
Value:
static octave_base_value * \
CONCAT2 (oct_conv_, name) (const octave_base_value& a)

Definition at line 183 of file ops.h.

◆ DEFASSIGNANYOP_FN

#define DEFASSIGNANYOP_FN (   name,
  t1,
  f 
)
Value:
CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
const octave_value_list& idx, \
const octave_value& a2) \
{ \
OCTAVE_CAST_BASE_VALUE (CONCAT2 (octave_, t1)&, v1, a1); \
\
v1.f (idx, a2); \
return octave_value (); \
}
const octave_base_value & a2
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
#define CONCAT2(x, y)
Definition: ops.h:57

Definition at line 171 of file ops.h.

◆ DEFASSIGNOP

#define DEFASSIGNOP (   name,
  t1,
  t2 
)
Value:
CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
const octave_value_list& idx, \

Definition at line 96 of file ops.h.

◆ DEFASSIGNOP_FN

#define DEFASSIGNOP_FN (   name,
  t1,
  t2,
  f 
)
Value:
CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
const octave_value_list& idx, \
{ \
OCTAVE_CAST_BASE_VALUE (CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
v1.f (idx, v2.CONCAT2 (t1, _value) ()); \
return octave_value (); \
}
const octave_char_matrix & v2

Definition at line 102 of file ops.h.

◆ DEFBINOP

#define DEFBINOP (   name,
  t1,
  t2 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \

Definition at line 245 of file ops.h.

◆ DEFBINOP_FN

#define DEFBINOP_FN (   name,
  t1,
  t2,
  f 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value (f (v1.CONCAT2 (t1, _value) (), v2.CONCAT2 (t2, _value) ())); \
}
F77_RET_T const F77_DBLE const F77_DBLE * f

Definition at line 305 of file ops.h.

◆ DEFBINOP_OP

#define DEFBINOP_OP (   name,
  t1,
  t2,
  op 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value \
(v1.CONCAT2 (t1, _value) () op v2.CONCAT2 (t2, _value) ()); \
}

Definition at line 250 of file ops.h.

◆ DEFBINOPX

#define DEFBINOPX (   name,
  t1,
  t2 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value&, \

Definition at line 240 of file ops.h.

◆ DEFCATOP

#define DEFCATOP (   name,
  t1,
  t2 
)
Value:
CONCAT2 (oct_catop_, name) (const octave_base_value& a1, \
const octave_base_value const Array< octave_idx_type > & ra_idx

Definition at line 344 of file ops.h.

◆ DEFCATOP_FN

#define DEFCATOP_FN (   name,
  t1,
  t2,
  f 
)
Value:
CONCAT2 (oct_catop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value (v1.CONCAT2 (t1, _value) () . f (v2.CONCAT2 (t2, _value) (), ra_idx)); \
}

Definition at line 352 of file ops.h.

◆ DEFCATOPX

#define DEFCATOPX (   name,
  t1,
  t2 
)
Value:
CONCAT2 (oct_catop_, name) (const octave_base_value&, \

Definition at line 338 of file ops.h.

◆ DEFCMPLXCMPOP_OP

#define DEFCMPLXCMPOP_OP (   name,
  t1,
  t2,
  op 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value \
(v1.CONCAT2 (t1, _value) () op v2.CONCAT2 (t2, _value) ()); \
}
void warn_complex_cmp()
Definition: errwarn.cc:303

Definition at line 262 of file ops.h.

◆ DEFCONV

#define DEFCONV (   name,
  a_dummy,
  b_dummy 
)     CONVDECL (name)

Definition at line 187 of file ops.h.

◆ DEFNCUNOP_METHOD

#define DEFNCUNOP_METHOD (   name,
  t,
  method 
)
Value:
static void \
CONCAT2 (oct_unop_, name) (octave_base_value& a) \
{ \
OCTAVE_CAST_BASE_VALUE (CONCAT2 (octave_, t)&, v, a); \
v.method (); \
}

Definition at line 232 of file ops.h.

◆ DEFNDASSIGNOP_FN

#define DEFNDASSIGNOP_FN (   name,
  t1,
  t2,
  e,
  f 
)
Value:
CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
const octave_value_list& idx, \
{ \
OCTAVE_CAST_BASE_VALUE (CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
v1.f (idx, v2.CONCAT2 (e, _value) ()); \
return octave_value (); \
}

Definition at line 127 of file ops.h.

◆ DEFNDASSIGNOP_FNOP

#define DEFNDASSIGNOP_FNOP (   name,
  t1,
  t2,
  f,
  fnop 
)
Value:
CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
const octave_value_list& idx, \
{ \
OCTAVE_CAST_BASE_VALUE (CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
error_unless (idx.empty ()); \
fnop (v1.matrix_ref (), v2.CONCAT2 (f, _value) ()); \
\
return octave_value (); \
}
#define error_unless(cond)
Definition: error.h:530

Definition at line 156 of file ops.h.

◆ DEFNDASSIGNOP_OP

#define DEFNDASSIGNOP_OP (   name,
  t1,
  t2,
  f,
  op 
)
Value:
CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
const octave_value_list& idx, \
{ \
OCTAVE_CAST_BASE_VALUE (CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
error_unless (idx.empty ()); \
v1.matrix_ref () op v2.CONCAT2 (f, _value) (); \
\
return octave_value (); \
}

Definition at line 141 of file ops.h.

◆ DEFNDBINOP_FN

#define DEFNDBINOP_FN (   name,
  t1,
  t2,
  e1,
  e2,
  f 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value (f (v1.CONCAT2 (e1, _value) (), v2.CONCAT2 (e2, _value) ())); \
}

Definition at line 316 of file ops.h.

◆ DEFNDBINOP_OP

#define DEFNDBINOP_OP (   name,
  t1,
  t2,
  e1,
  e2,
  op 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value \
(v1.CONCAT2 (e1, _value) () op v2.CONCAT2 (e2, _value) ()); \
}

Definition at line 291 of file ops.h.

◆ DEFNDCATOP_FN

#define DEFNDCATOP_FN (   name,
  t1,
  t2,
  e1,
  e2,
  f 
)
Value:
CONCAT2 (oct_catop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value (v1.CONCAT2 (e1, _value) () . f (v2.CONCAT2 (e2, _value) (), ra_idx)); \
}

Definition at line 364 of file ops.h.

◆ DEFNDCATOP_FN2

#define DEFNDCATOP_FN2 (   name,
  t1,
  t2,
  tc1,
  tc2,
  e1,
  e2,
  f 
)
Value:
CONCAT2 (oct_catop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value (tc1 (v1.CONCAT2 (e1, _value) ()) . f (tc2 (v2.CONCAT2 (e2, _value) ()), ra_idx)); \
}

Definition at line 393 of file ops.h.

◆ DEFNDCHARCATOP_FN

#define DEFNDCHARCATOP_FN (   name,
  t1,
  t2,
  f 
)
Value:
CONCAT2 (oct_catop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value (v1.char_array_value () . f (v2.char_array_value (), ra_idx), \
((a1.is_sq_string () || a2.is_sq_string ()) \
? '\'' : '"')); \
}
virtual bool is_sq_string() const
Definition: ov-base.h:445
charNDArray char_array_value(bool=false) const
Definition: ov-ch-mat.h:145

Definition at line 376 of file ops.h.

◆ DEFNDCMPLXCMPOP_FN

#define DEFNDCMPLXCMPOP_FN (   name,
  t1,
  t2,
  e1,
  e2,
  f 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
return octave_value (f (v1.CONCAT2 (e1, _value) (), v2.CONCAT2 (e2, _value) ())); \
}

Definition at line 327 of file ops.h.

◆ DEFNDUNOP_FN

#define DEFNDUNOP_FN (   name,
  t,
  e,
  f 
)
Value:
CONCAT2 (oct_unop_, name) (const octave_base_value& a) \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t)&, v, a); \
return octave_value (f (v.CONCAT2 (e, _value) ())); \
}

Definition at line 224 of file ops.h.

◆ DEFNDUNOP_OP

#define DEFNDUNOP_OP (   name,
  t,
  e,
  op 
)
Value:
CONCAT2 (oct_unop_, name) (const octave_base_value& a) \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t)&, v, a); \
return octave_value (op v.CONCAT2 (e, _value) ()); \
}

Definition at line 206 of file ops.h.

◆ DEFNULLASSIGNOP_FN

#define DEFNULLASSIGNOP_FN (   name,
  t,
  f 
)
Value:
CONCAT2 (oct_assignop_, name) (octave_base_value& a, \
const octave_value_list& idx, \
{ \
OCTAVE_CAST_BASE_VALUE (CONCAT2 (octave_, t)&, v, a); \
\
v.f (idx); \
return octave_value (); \
}

Definition at line 115 of file ops.h.

◆ DEFSCALARBOOLOP_OP

#define DEFSCALARBOOLOP_OP (   name,
  t1,
  t2,
  op 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t1)&, v1, a1); \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t2)&, v2, a2); \
\
if (octave::math::isnan (v1.CONCAT2 (t1, _value) ()) || octave::math::isnan (v2.CONCAT2 (t2, _value) ())) \
\
return octave_value \
(v1.CONCAT2 (t1, _value) () op v2.CONCAT2 (t2, _value) ()); \
}
void err_nan_to_logical_conversion()
bool isnan(bool)
Definition: lo-mappers.h:178

Definition at line 276 of file ops.h.

◆ DEFUNOP

#define DEFUNOP (   name,
 
)
Value:
CONCAT2 (oct_unop_, name) (const octave_base_value& a)

Definition at line 194 of file ops.h.

◆ DEFUNOP_FN

#define DEFUNOP_FN (   name,
  t,
  f 
)
Value:
CONCAT2 (oct_unop_, name) (const octave_base_value& a) \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t)&, v, a); \
return octave_value (f (v.CONCAT2 (t, _value) ())); \
}

Definition at line 216 of file ops.h.

◆ DEFUNOP_OP

#define DEFUNOP_OP (   name,
  t,
  op 
)
Value:
CONCAT2 (oct_unop_, name) (const octave_base_value& a) \
{ \
OCTAVE_CAST_BASE_VALUE (const CONCAT2 (octave_, t)&, v, a); \
return octave_value (op v.CONCAT2 (t, _value) ()); \
}

Definition at line 198 of file ops.h.

◆ DEFUNOPX

#define DEFUNOPX (   name,
 
)
Value:
CONCAT2 (oct_unop_, name) (const octave_base_value&)

Definition at line 190 of file ops.h.

◆ INSTALL_ASSIGNANYOP_TI

#define INSTALL_ASSIGNANYOP_TI (   ti,
  op,
  t1,
  f 
)
Value:
ti.install_assignany_op \
(octave_value::op, t1::static_type_id (), CONCAT2 (oct_assignop_, f));

Definition at line 84 of file ops.h.

◆ INSTALL_ASSIGNCONV_TI

#define INSTALL_ASSIGNCONV_TI (   ti,
  t1,
  t2,
  tr 
)
Value:
ti.install_pref_assign_conv \
(t1::static_type_id (), t2::static_type_id (), tr::static_type_id ());

Definition at line 88 of file ops.h.

◆ INSTALL_ASSIGNOP_TI

#define INSTALL_ASSIGNOP_TI (   ti,
  op,
  t1,
  t2,
  f 
)
Value:
ti.install_assign_op \
(octave_value::op, t1::static_type_id (), t2::static_type_id (), \
CONCAT2 (oct_assignop_, f));

Definition at line 79 of file ops.h.

◆ INSTALL_BINOP_TI

#define INSTALL_BINOP_TI (   ti,
  op,
  t1,
  t2,
  f 
)
Value:
ti.install_binary_op \
(octave_value::op, t1::static_type_id (), t2::static_type_id (), \
CONCAT2 (oct_binop_, f));

Definition at line 70 of file ops.h.

◆ INSTALL_CATOP_TI

#define INSTALL_CATOP_TI (   ti,
  t1,
  t2,
  f 
)
Value:
ti.install_cat_op \
(t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_catop_, f));

Definition at line 75 of file ops.h.

◆ INSTALL_NCUNOP_TI

#define INSTALL_NCUNOP_TI (   ti,
  op,
  t,
  f 
)
Value:
ti.install_non_const_unary_op \
(octave_value::op, t::static_type_id (), CONCAT2 (oct_unop_, f));

Definition at line 66 of file ops.h.

◆ INSTALL_UNOP_TI

#define INSTALL_UNOP_TI (   ti,
  op,
  t,
  f 
)
Value:
ti.install_unary_op \
(octave_value::op, t::static_type_id (), CONCAT2 (oct_unop_, f));

Definition at line 62 of file ops.h.

◆ INSTALL_WIDENOP_TI

#define INSTALL_WIDENOP_TI (   ti,
  t1,
  t2,
  f 
)
Value:
ti.install_widening_op \
(t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_conv_, f));

Definition at line 92 of file ops.h.

◆ OCTAVE_CAST_BASE_VALUE

#define OCTAVE_CAST_BASE_VALUE (   T,
  T_VAL,
  BASE_VAL 
)     T T_VAL = OCTAVE_DYNAMIC_CAST<T> (BASE_VAL)

Definition at line 52 of file ops.h.

◆ OCTAVE_DYNAMIC_CAST

#define OCTAVE_DYNAMIC_CAST   static_cast

Definition at line 49 of file ops.h.