20 template<
typename T1,
typename T2>
27 typedef typename T1::elem_type eT;
34 arma_debug_check( ((A.get_n_elem() != 3) || (B.get_n_elem() != 3)),
"cross(): input vectors must have 3 elements" );
36 out.
set_size(A.get_n_rows(), A.get_n_cols());
38 eT* out_mem = out.
memptr();
39 ea_type1 PA = A.get_ea();
40 ea_type2 PB = B.get_ea();
50 out_mem[0] = ay*bz - az*by;
51 out_mem[1] = az*bx - ax*bz;
52 out_mem[2] = ax*by - ay*bx;
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the matrix
void set_size(const uword in_elem)
change the matrix to have user specified dimensions (data is not preserved)
const T1 & A
first operand
const T2 & B
second operand
#define arma_extra_debug_sigprint
static void apply(Mat< typename T1::elem_type > &out, const Glue< T1, T2, glue_cross > &X)