void vsip_cmprodh_f(const vsip_cmview_f *a, const vsip_cmview_f *b, const vsip_cmview_f *r);
This function computes the product of a complex matrix
with the Hermitian transpose of a complex matrix
, storing the
result in complex matrix
. The operation performed is:

for all
and
, where
is an
complex matrix,
is a
complex matrix, and
is the resulting
complex
matrix.
denotes the complex conjugate of
.
const vsip_cmview_p* a: First input matrix of size
(complex).
const vsip_cmview_p* b: Second input matrix of size
(complex), which will be Hermitian transposed in
the operation.
const vsip_cmview_p* r: Output matrix of size
(complex) that will store the result.
vsip_cmview_f *A, *B, *R; vsip_length m = 2, n = 3, p = 2; // Create complex matrices A = vsip_cmcreate_f(m, n, VSIP_ROW, VSIP_MEM_NONE); B = vsip_cmcreate_f(p, n, VSIP_ROW, VSIP_MEM_NONE); R = vsip_cmcreate_f(m, p, VSIP_ROW, VSIP_MEM_NONE); // Initialize matrices A and B with complex values for (vsip_index i = 0; i < m; i++) { for (vsip_index j = 0; j < n; j++) { vsip_cscalar_f val = VSIP_CMPLX_F(i*n + j + 1, -(i*n + j + 1)); vsip_cmput_f(A, i, j, val); } } for (vsip_index i = 0; i < p; i++) { for (vsip_index j = 0; j < n; j++) { vsip_cscalar_f val = VSIP_CMPLX_F(i*n + j + 1, i*n + j + 2); vsip_cmput_f(B, i, j, val); } } // Compute matrix product with Hermitian transpose: R = A * B^H vsip_cmprodh_f(A, B, R); // Print the result printf("Result matrix R = A * B^H (%lux%lu):\n", m, p); for (vsip_index i = 0; i < m; i++) { for (vsip_index j = 0; j < p; j++) { vsip_cscalar_f val = vsip_cmget_f(R, i, j); printf("(%.2f%+.2fi) ", val.r, val.i); } printf("\n"); } // Clean up vsip_cmalldestroy_f(A); vsip_cmalldestroy_f(B); vsip_cmalldestroy_f(R);
The input matrices must have compatible dimensions: Both matrices
and
must have the same number of
columns (
).
The output matrix
must have dimensions
, where
is the number of rows in
and
is the number of
rows in
.
If you need more flexibility in choosing which matrix to transpose, consider using vsip_cgemp_p instead.