GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
bsxfun-defs.cc File Reference
#include <algorithm>
#include "dim-vector.h"
#include "lo-error.h"
#include "mx-inlines.cc"
#include "oct-locbuf.h"

Go to the source code of this file.

Macros

#define BSXFUN_OP2_DEF(OP, ARRAY, ARRAY1, ARRAY2)    ARRAY bsxfun_ ## OP (const ARRAY1& x, const ARRAY2& y)
 
#define BSXFUN_OP2_DEF_MXLOOP(OP, ARRAY, ARRAY1, ARRAY2, LOOP)
 
#define BSXFUN_OP_DEF(OP, ARRAY)    ARRAY bsxfun_ ## OP (const ARRAY& x, const ARRAY& y)
 
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
 
#define BSXFUN_POW_MIXED_MXLOOP(INT_TYPE)
 
#define BSXFUN_REL_DEF(OP, ARRAY)    boolNDArray bsxfun_ ## OP (const ARRAY& x, const ARRAY& y)
 
#define BSXFUN_REL_DEF_MXLOOP(OP, ARRAY, LOOP)
 
#define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY)
 
#define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY)
 
#define octave_bsxfun_defs_h   1
 

Functions

template<typename R , typename X , typename Y >
Array< R > do_bsxfun_op (const Array< X > &x, const Array< Y > &y, void(*op_vv)(std::size_t, R *, const X *, const Y *), void(*op_sv)(std::size_t, R *, X, const Y *), void(*op_vs)(std::size_t, R *, const X *, Y))
 
template<typename R , typename X >
void do_inplace_bsxfun_op (Array< R > &r, const Array< X > &x, void(*op_vv)(std::size_t, R *, const X *), void(*op_vs)(std::size_t, R *, X))
 

Macro Definition Documentation

◆ BSXFUN_OP2_DEF

#define BSXFUN_OP2_DEF (   OP,
  ARRAY,
  ARRAY1,
  ARRAY2 
)     ARRAY bsxfun_ ## OP (const ARRAY1& x, const ARRAY2& y)

Definition at line 215 of file bsxfun-defs.cc.

◆ BSXFUN_OP2_DEF_MXLOOP

#define BSXFUN_OP2_DEF_MXLOOP (   OP,
  ARRAY,
  ARRAY1,
  ARRAY2,
  LOOP 
)
Value:
BSXFUN_OP2_DEF(OP, ARRAY, ARRAY1, ARRAY2) \
{ return do_bsxfun_op<ARRAY::element_type, ARRAY1::element_type, ARRAY2::element_type> \
(x, y, LOOP, LOOP, LOOP); }
#define BSXFUN_OP2_DEF(OP, ARRAY, ARRAY1, ARRAY2)
Definition: bsxfun-defs.cc:215
F77_RET_T const F77_DBLE * x

Definition at line 226 of file bsxfun-defs.cc.

◆ BSXFUN_OP_DEF

#define BSXFUN_OP_DEF (   OP,
  ARRAY 
)     ARRAY bsxfun_ ## OP (const ARRAY& x, const ARRAY& y)

Definition at line 212 of file bsxfun-defs.cc.

◆ BSXFUN_OP_DEF_MXLOOP

#define BSXFUN_OP_DEF_MXLOOP (   OP,
  ARRAY,
  LOOP 
)
Value:
BSXFUN_OP_DEF(OP, ARRAY) \
{ return do_bsxfun_op<ARRAY::element_type, ARRAY::element_type, ARRAY::element_type> \
(x, y, LOOP, LOOP, LOOP); }
#define BSXFUN_OP_DEF(OP, ARRAY)
Definition: bsxfun-defs.cc:212

Definition at line 221 of file bsxfun-defs.cc.

◆ BSXFUN_POW_MIXED_MXLOOP

#define BSXFUN_POW_MIXED_MXLOOP (   INT_TYPE)
Value:
BSXFUN_OP2_DEF_MXLOOP (pow, INT_TYPE, INT_TYPE, NDArray, mx_inline_pow) \
BSXFUN_OP2_DEF_MXLOOP (pow, INT_TYPE, INT_TYPE, FloatNDArray, mx_inline_pow) \
BSXFUN_OP2_DEF_MXLOOP (pow, INT_TYPE, NDArray, INT_TYPE, mx_inline_pow) \
BSXFUN_OP2_DEF_MXLOOP (pow, INT_TYPE, FloatNDArray, INT_TYPE, mx_inline_pow)
#define BSXFUN_OP2_DEF_MXLOOP(OP, ARRAY, ARRAY1, ARRAY2, LOOP)
Definition: bsxfun-defs.cc:226
void mx_inline_pow(std::size_t n, R *r, const X *x, const Y *y)
Definition: mx-inlines.cc:419
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)

Definition at line 253 of file bsxfun-defs.cc.

◆ BSXFUN_REL_DEF

#define BSXFUN_REL_DEF (   OP,
  ARRAY 
)     boolNDArray bsxfun_ ## OP (const ARRAY& x, const ARRAY& y)

Definition at line 218 of file bsxfun-defs.cc.

◆ BSXFUN_REL_DEF_MXLOOP

#define BSXFUN_REL_DEF_MXLOOP (   OP,
  ARRAY,
  LOOP 
)
Value:
BSXFUN_REL_DEF(OP, ARRAY) \
{ return do_bsxfun_op<bool, ARRAY::element_type, ARRAY::element_type> \
(x, y, LOOP, LOOP, LOOP); }
#define BSXFUN_REL_DEF(OP, ARRAY)
Definition: bsxfun-defs.cc:218

Definition at line 231 of file bsxfun-defs.cc.

◆ BSXFUN_STDOP_DEFS_MXLOOP

#define BSXFUN_STDOP_DEFS_MXLOOP (   ARRAY)
Value:
BSXFUN_OP_DEF_MXLOOP (sub, ARRAY, mx_inline_sub) \
BSXFUN_OP_DEF_MXLOOP (mul, ARRAY, mx_inline_mul) \
BSXFUN_OP_DEF_MXLOOP (div, ARRAY, mx_inline_div) \
BSXFUN_OP_DEF_MXLOOP (min, ARRAY, mx_inline_xmin) \
BSXFUN_OP_DEF_MXLOOP (max, ARRAY, mx_inline_xmax)
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
Definition: bsxfun-defs.cc:221
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:230
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:207
void mx_inline_xmin(std::size_t n, T *r, const T *x, const T *y)
Definition: mx-inlines.cc:341
void mx_inline_sub(std::size_t n, R *r, const X *x, const Y *y)
Definition: mx-inlines.cc:109
void mx_inline_div(std::size_t n, R *r, const X *x, const Y *y)
Definition: mx-inlines.cc:111
void mx_inline_xmax(std::size_t n, T *r, const T *x, const T *y)
Definition: mx-inlines.cc:365
void mx_inline_add(std::size_t n, R *r, const X *x, const Y *y)
Definition: mx-inlines.cc:108
void mx_inline_mul(std::size_t n, R *r, const X *x, const Y *y)
Definition: mx-inlines.cc:110

Definition at line 236 of file bsxfun-defs.cc.

◆ BSXFUN_STDREL_DEFS_MXLOOP

#define BSXFUN_STDREL_DEFS_MXLOOP (   ARRAY)
Value:
BSXFUN_REL_DEF_MXLOOP (ne, ARRAY, mx_inline_ne) \
BSXFUN_REL_DEF_MXLOOP (lt, ARRAY, mx_inline_lt) \
BSXFUN_REL_DEF_MXLOOP (le, ARRAY, mx_inline_le) \
BSXFUN_REL_DEF_MXLOOP (gt, ARRAY, mx_inline_gt) \
BSXFUN_REL_DEF_MXLOOP (ge, ARRAY, mx_inline_ge)
#define BSXFUN_REL_DEF_MXLOOP(OP, ARRAY, LOOP)
Definition: bsxfun-defs.cc:231
void mx_inline_le(std::size_t n, bool *r, const X *x, const Y *y)
Definition: mx-inlines.cc:153
void mx_inline_eq(std::size_t n, bool *r, const X *x, const Y *y)
Definition: mx-inlines.cc:156
void mx_inline_ge(std::size_t n, bool *r, const X *x, const Y *y)
Definition: mx-inlines.cc:155
void mx_inline_gt(std::size_t n, bool *r, const X *x, const Y *y)
Definition: mx-inlines.cc:154
void mx_inline_lt(std::size_t n, bool *r, const X *x, const Y *y)
Definition: mx-inlines.cc:152
void mx_inline_ne(std::size_t n, bool *r, const X *x, const Y *y)
Definition: mx-inlines.cc:157

Definition at line 244 of file bsxfun-defs.cc.

◆ octave_bsxfun_defs_h

#define octave_bsxfun_defs_h   1

Definition at line 27 of file bsxfun-defs.cc.

Function Documentation

◆ do_bsxfun_op()

template<typename R , typename X , typename Y >
Array<R> do_bsxfun_op ( const Array< X > &  x,
const Array< Y > &  y,
void(*)(std::size_t, R *, const X *, const Y *)  op_vv,
void(*)(std::size_t, R *, X, const Y *)  op_sv,
void(*)(std::size_t, R *, const X *, Y)  op_vs 
)

◆ do_inplace_bsxfun_op()

template<typename R , typename X >
void do_inplace_bsxfun_op ( Array< R > &  r,
const Array< X > &  x,
void(*)(std::size_t, R *, const X *)  op_vv,
void(*)(std::size_t, R *, X)  op_vs 
)