Adelsbach/VSIPL
Core Programming Reference Guide
DD-00016-015
Core

This manual is preliminary and incomplete.
While our Core implementation implements all functions given in the standard we are still working on completing this documentation.

Please refer to the VSIPL standard for a complete function reference of the Core profile until we have completed work on this documentation.

1.4.11 vsip_mrealview_p - Create a Real Part Matrix View

vsip_mview_f* vsip_mrealview_f(const vsip_cmview_f* cmatrix);
Description

This function creates a real matrix view that represents the real parts of a complex matrix. The resulting matrix view shares the same underlying data block as the complex matrix but provides access to only the real components of each complex element.

For a complex matrix A with elements aij= xij+ iyij, the real view matrix B will have elements bij= xij.

Parameters
Return Value
Example

vsip_cmview_f *complex_matrix; 
vsip_mview_f *real_matrix; 
vsip_length i, j; 
 
// Create a 3x3 complex matrix 
complex_matrix = vsip_cmcreate_f(3, 3, VSIP_ROW, VSIP_MEM_NONE); 
 
// Fill with complex values 
for (i = 0; i < 3; i++) { 
    for (j = 0; j < 3; j++) { 
        vsip_cmput_f(complex_matrix, i, j, 
                    VSIP_CMPLX_F(i*3+j+1, (i*3+j+1)*0.1f)); 
    } 
} 
 
// Create a real view of the complex matrix 
real_matrix = vsip_mrealview_f(complex_matrix); 
 
if (real_matrix == NULL) { 
    // Handle error 
}
Notes