GNU Octave  6.2.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 dependency graph for ops.h:

Go to the source code of this file.

Namespaces

 octave
 

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)
 

Functions

void install_ops (octave::type_info &)
 

Macro Definition Documentation

◆ CONCAT2

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

Definition at line 40 of file ops.h.

◆ CONCAT2X

#define CONCAT2X (   x,
 
)    x ## y

Definition at line 39 of file ops.h.

◆ CONCAT3

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

Definition at line 43 of file ops.h.

◆ CONCAT3X

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

Definition at line 42 of file ops.h.

◆ CONVDECL

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

Definition at line 168 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) \
{ \
CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (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:40

Definition at line 156 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 81 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, \
{ \
CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
\
v1.f (idx, v2.CONCAT2 (t1, _value) ()); \
return octave_value (); \
}
const octave_char_matrix & v2

Definition at line 87 of file ops.h.

◆ DEFBINOP

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

Definition at line 230 of file ops.h.

◆ DEFBINOP_FN

#define DEFBINOP_FN (   name,
  t1,
  t2,
  f 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (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 290 of file ops.h.

◆ DEFBINOP_OP

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

Definition at line 235 of file ops.h.

◆ DEFBINOPX

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

Definition at line 225 of file ops.h.

◆ DEFCATOP

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

Definition at line 328 of file ops.h.

◆ DEFCATOP_FN

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

Definition at line 336 of file ops.h.

◆ DEFCATOPX

#define DEFCATOPX (   name,
  t1,
  t2 
)
Value:

Definition at line 323 of file ops.h.

◆ DEFCMPLXCMPOP_OP

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

Definition at line 247 of file ops.h.

◆ DEFCONV

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

Definition at line 172 of file ops.h.

◆ DEFNCUNOP_METHOD

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

Definition at line 217 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, \
{ \
CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
\
v1.f (idx, v2.CONCAT2 (e, _value) ()); \
return octave_value (); \
}

Definition at line 112 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, \
{ \
CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
\
assert (idx.empty ()); \
fnop (v1.matrix_ref (), v2.CONCAT2 (f, _value) ()); \
\
return octave_value (); \
}

Definition at line 141 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, \
{ \
CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
\
assert (idx.empty ()); \
v1.matrix_ref () op v2.CONCAT2 (f, _value) (); \
\
return octave_value (); \
}

Definition at line 126 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, \
{ \
const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
\
return octave_value (f (v1.CONCAT2 (e1, _value) (), v2.CONCAT2 (e2, _value) ())); \
}

Definition at line 301 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, \
{ \
const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
\
return octave_value \
(v1.CONCAT2 (e1, _value) () op v2.CONCAT2 (e2, _value) ()); \
}

Definition at line 276 of file ops.h.

◆ DEFNDCATOP_FN

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

Definition at line 348 of file ops.h.

◆ DEFNDCATOP_FN2

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

Definition at line 377 of file ops.h.

◆ DEFNDCHARCATOP_FN

#define DEFNDCHARCATOP_FN (   name,
  t1,
  t2,
  f 
)
Value:
CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
{ \
CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (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(void) const
Definition: ov-base.h:385
charNDArray char_array_value(bool=false) const
Definition: ov-ch-mat.h:145

Definition at line 360 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, \
{ \
const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
\
return octave_value (f (v1.CONCAT2 (e1, _value) (), v2.CONCAT2 (e2, _value) ())); \
}

Definition at line 312 of file ops.h.

◆ DEFNDUNOP_FN

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

Definition at line 209 of file ops.h.

◆ DEFNDUNOP_OP

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

Definition at line 191 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, \
{ \
CONCAT2 (octave_, t)& v = dynamic_cast<CONCAT2 (octave_, t)&> (a); \
\
v.f (idx); \
return octave_value (); \
}

Definition at line 100 of file ops.h.

◆ DEFSCALARBOOLOP_OP

#define DEFSCALARBOOLOP_OP (   name,
  t1,
  t2,
  op 
)
Value:
CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
{ \
const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (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) ()); \
}
bool isnan(bool)
Definition: lo-mappers.h:178
void err_nan_to_logical_conversion(void)

Definition at line 261 of file ops.h.

◆ DEFUNOP

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

Definition at line 179 of file ops.h.

◆ DEFUNOP_FN

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

Definition at line 201 of file ops.h.

◆ DEFUNOP_OP

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

Definition at line 183 of file ops.h.

◆ DEFUNOPX

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

Definition at line 175 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 69 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 73 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 64 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 55 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 60 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 51 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 47 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 77 of file ops.h.

Function Documentation

◆ install_ops()

void install_ops ( octave::type_info )