#include <algorithm>
#include <iostream>
#include "dim-vector.h"
#include "oct-locbuf.h"
#include "lo-error.h"
#include "mx-inlines.cc"
Go to the source code of this file.
Defines | |
#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) |
Functions | |
template<class R , class X , class Y > | |
Array< R > | do_bsxfun_op (const Array< X > &x, const Array< Y > &y, void(*op_vv)(size_t, R *, const X *, const Y *), void(*op_sv)(size_t, R *, X, const Y *), void(*op_vs)(size_t, R *, const X *, Y)) |
template<class R , class X > | |
void | do_inplace_bsxfun_op (Array< R > &r, const Array< X > &x, void(*op_vv)(size_t, R *, const X *), void(*op_vs)(size_t, R *, X)) |
#define BSXFUN_OP2_DEF | ( | OP, | ||
ARRAY, | ||||
ARRAY1, | ||||
ARRAY2 | ||||
) | ARRAY bsxfun_ ## OP (const ARRAY1& x, const ARRAY2& y) |
Definition at line 210 of file bsxfun-defs.cc.
#define BSXFUN_OP2_DEF_MXLOOP | ( | OP, | ||
ARRAY, | ||||
ARRAY1, | ||||
ARRAY2, | ||||
LOOP | ||||
) |
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); }
Definition at line 221 of file bsxfun-defs.cc.
#define BSXFUN_OP_DEF | ( | OP, | ||
ARRAY | ||||
) | ARRAY bsxfun_ ## OP (const ARRAY& x, const ARRAY& y) |
Definition at line 207 of file bsxfun-defs.cc.
#define BSXFUN_OP_DEF_MXLOOP | ( | OP, | ||
ARRAY, | ||||
LOOP | ||||
) |
BSXFUN_OP_DEF(OP, ARRAY) \ { return do_bsxfun_op<ARRAY::element_type, ARRAY::element_type, ARRAY::element_type> \ (x, y, LOOP, LOOP, LOOP); }
Definition at line 216 of file bsxfun-defs.cc.
#define BSXFUN_POW_MIXED_MXLOOP | ( | INT_TYPE | ) |
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)
Definition at line 248 of file bsxfun-defs.cc.
#define BSXFUN_REL_DEF | ( | OP, | ||
ARRAY | ||||
) | boolNDArray bsxfun_ ## OP (const ARRAY& x, const ARRAY& y) |
Definition at line 213 of file bsxfun-defs.cc.
#define BSXFUN_REL_DEF_MXLOOP | ( | OP, | ||
ARRAY, | ||||
LOOP | ||||
) |
BSXFUN_REL_DEF(OP, ARRAY) \ { return do_bsxfun_op<bool, ARRAY::element_type, ARRAY::element_type> \ (x, y, LOOP, LOOP, LOOP); }
Definition at line 226 of file bsxfun-defs.cc.
#define BSXFUN_STDOP_DEFS_MXLOOP | ( | ARRAY | ) |
BSXFUN_OP_DEF_MXLOOP (add, ARRAY, mx_inline_add) \ 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) \
Definition at line 231 of file bsxfun-defs.cc.
#define BSXFUN_STDREL_DEFS_MXLOOP | ( | ARRAY | ) |
BSXFUN_REL_DEF_MXLOOP (eq, ARRAY, mx_inline_eq) \ 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)
Definition at line 239 of file bsxfun-defs.cc.
Array<R> do_bsxfun_op | ( | const Array< X > & | x, | |
const Array< Y > & | y, | |||
void(*)(size_t, R *, const X *, const Y *) | op_vv, | |||
void(*)(size_t, R *, X, const Y *) | op_sv, | |||
void(*)(size_t, R *, const X *, Y) | op_vs | |||
) |
Definition at line 38 of file bsxfun-defs.cc.
References dim_vector::compute_index(), dim_vector::cum_compute_index(), Array< T >::dims(), Array< T >::fortran_vec(), dim_vector::increment_index(), Array< T >::is_empty(), max(), Array< T >::ndims(), dim_vector::numel(), Array< T >::numel(), OCTAVE_LOCAL_BUFFER_INIT, dim_vector::redim(), dim_vector::resize(), Sparse< double >::ridx(), and dim_vector::str().
Referenced by binmap(), and do_mm_binary_op().
void do_inplace_bsxfun_op | ( | Array< R > & | r, | |
const Array< X > & | x, | |||
void(*)(size_t, R *, const X *) | op_vv, | |||
void(*)(size_t, R *, X) | op_vs | |||
) |
Definition at line 138 of file bsxfun-defs.cc.
References dim_vector::compute_index(), dim_vector::cum_compute_index(), Array< T >::dims(), Array< T >::fortran_vec(), dim_vector::increment_index(), Array< T >::is_empty(), max(), Array< T >::ndims(), dim_vector::numel(), Array< T >::numel(), OCTAVE_LOCAL_BUFFER_INIT, and Sparse< double >::ridx().
Referenced by do_mm_inplace_op().