Octopus
face_splitting_oct_m Module Reference

Functions/Subroutines

subroutine, public column_wise_khatri_rao_product (y, x, z)
 Column-wise Kronecker product. More...
 

Function/Subroutine Documentation

◆ column_wise_khatri_rao_product()

subroutine, public face_splitting_oct_m::column_wise_khatri_rao_product ( real(real64), dimension(:, :), intent(in), contiguous  y,
real(real64), dimension(:, :), intent(in), contiguous  x,
real(real64), dimension(:, :), intent(out), contiguous  z 
)

Column-wise Kronecker product.

\[ \mathbf{C} = \left[\begin{array}{l|l|l} \mathbf{C}_1 & \mathbf{C}_2 & \mathbf{C}_3 \end{array}\right] = \left[\begin{array}{l|l|l} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \end{array}\right], \quad \mathbf{D} = \left[\begin{array}{l} \mathbf{D}_1 \left| \mathbf{D}_2 \right| \mathbf{D}_3 \end{array}\right] = \left[\begin{array}{l|l|l} 1 & 4 & 7 \ 2 & 5 & 8 \ 3 & 6 & 9 \end{array}\right], \]

so that:

\[ \mathbf{C} * \mathbf{D} = \left[\mathbf{C}_1 \otimes \mathbf{D}_1 \left| \mathbf{C}_2 \otimes \mathbf{D}_2 \right| \mathbf{C}_3 \otimes \mathbf{D}_3 \right] = \left[\begin{array}{c|c|c} 1 & 8 & 21 \ 2 & 10 & 24 \ 3 & 12 & 27 \ 4 & 20 & 42 \ 8 & 25 & 48 \ 12 & 30 & 54 \ 7 & 32 & 63 \ 14 & 40 & 72 \ 21 & 48 & 81 \end{array}\right] \]

See the [wiki](https:

The resulting composite row index \((ij)\) is comprised of indices \(i\) (x) and \(j\) (y), with \(j\) varying faster than \(i\):

ij = 0
do i = 1, nrows_x
do j = 1, nrows_y
ij = ij + 1

To reverse this and have \(i\) vary faster, swap the x and y arguments.

Definition at line 180 of file face_splitting.F90.