55 #define MARRAY_DAS_OP(OP, FN) \ 56 template <typename T> \ 58 operator OP (const MDiagArray2<T>& a, const T& s) \ 60 return MDiagArray2<T> (do_ms_binary_op<T, T, T> (a, s, FN), a.d1, a.d2); \ 78 #define MARRAY_DADA_OP(FCN, OP, FN) \ 79 template <typename T> \ 81 FCN (const MDiagArray2<T>& a, const MDiagArray2<T>& b) \ 83 if (a.d1 != b.d1 || a.d2 != b.d2) \ 84 octave::err_nonconformant (#FCN, a.d1, a.d2, b.d1, b.d2); \ 86 return MDiagArray2<T> (do_mm_binary_op<T, T, T> (a, b, FN, FN, FN, #FCN), a.d1, a.d2); \ 102 template <
typename T>
identity matrix If supplied two scalar respectively For allows like xample val
bool is_multiple_of_identity(T val) const
#define MARRAY_DADA_OP(FCN, OP, FN)
void mx_inline_mul(size_t n, R *r, const X *x, const Y *y)
Template for two dimensional diagonal array with math operators.
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
MDiagArray2< T > operator-(const MDiagArray2< T > &a, const MDiagArray2< T > &b)
void mx_inline_sub(size_t n, R *r, const X *x, const Y *y)
void mx_inline_uminus(size_t n, R *r, const X *x)
octave_idx_type cols(void) const
#define MARRAY_DAS_OP(OP, FN)
void mx_inline_add(size_t n, R *r, const X *x, const Y *y)
void mx_inline_div(size_t n, R *r, const X *x, const Y *y)
MDiagArray2< T > product(const MDiagArray2< T > &a, const MDiagArray2< T > &b)
octave_idx_type rows(void) const