34 out.
set_size(A_rows*B_rows, A_cols*B_cols);
36 for(
uword i = 0; i < A_rows; i++)
38 for(
uword j = 0; j < A_cols; j++)
40 out.
submat(i*B_rows, j*B_cols, (i+1)*B_rows-1, (j+1)*B_cols-1) = A(i,j) * B;
57 typedef typename std::complex<T> eT;
59 const uword A_rows = A.n_rows;
60 const uword A_cols = A.n_cols;
64 out.set_size(A_rows*B_rows, A_cols*B_cols);
68 for(
uword i = 0; i < A_rows; i++)
70 for(
uword j = 0; j < A_cols; j++)
72 out.submat(i*B_rows, j*B_cols, (i+1)*B_rows-1, (j+1)*B_cols-1) = A(i,j) * tmp_B;
91 const uword B_rows = B.n_rows;
92 const uword B_cols = B.n_cols;
94 out.set_size(A_rows*B_rows, A_cols*B_cols);
96 for(
uword i = 0; i < A_rows; i++)
98 for(
uword j = 0; j < A_cols; j++)
100 out.submat(i*B_rows, j*B_cols, (i+1)*B_rows-1, (j+1)*B_cols-1) = A(i,j) * B;
109 template<
typename T1,
typename T2>
116 typedef typename T1::elem_type eT;
void set_size(const uword in_elem)
change the matrix to have user specified dimensions (data is not preserved)
arma_inline subview< eT > submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2)
creation of subview (submatrix)
const uword n_cols
number of columns in the matrix (read-only)
const uword n_rows
number of rows in the matrix (read-only)
static void direct_kron(Mat< eT > &out, const Mat< eT > &A, const Mat< eT > &B)
both input matrices have the same element type
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_kron > &X)
apply Kronecker product for two objects with same element type