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.6 vsip_dmsubview_p - Create a Submatrix View

vsip_mview_f* vsip_msubview_f(const vsip_mview_f* matrix, 
                             vsip_index row_offset, vsip_index col_offset, 
                             vsip_length row_length, vsip_length col_length); 
vsip_cmview_f* vsip_cmsubview_f(const vsip_cmview_f* matrix, 
                               vsip_index row_offset, vsip_index col_offset, 
                               vsip_length row_length, vsip_length col_length);
Description

This function creates a new matrix view that represents a submatrix of an existing matrix view. The submatrix is defined by its offset from the parent matrix and its dimensions. The new view shares the same underlying data block as the parent matrix but provides access to only the specified subregion.

This operation is efficient as it doesn’t copy any data, but rather creates a new view that references a portion of the original matrix’s data.

Parameters
Return Value
Example

vsip_mview_f *parent_matrix; 
vsip_mview_f *submatrix; 
 
// Create a parent matrix 
parent_matrix = vsip_mcreate_f(100, 100, VSIP_ROW, VSIP_MEM_NONE); 
 
// Create a 50x50 submatrix starting at row 25, column 25 
submatrix = vsip_msubview_f(parent_matrix, 25, 25, 50, 50); 
 
if (submatrix == NULL) { 
    // Handle error (e.g., invalid submatrix dimensions) 
}
Notes