vsip_mview_f* vsip_mcloneview_f(const vsip_mview_f* matrix); vsip_cmview_f* vsip_cmcloneview_f(const vsip_cmview_f* matrix);
This function creates a new matrix view that shares the same data block as the input matrix view but has its own independent view parameters. The cloned view references the same underlying data but maintains its own metadata (dimensions, strides, offset).
This is useful when you need multiple independent views of the same data, or when you want to create a view with different parameters (like different submatrix boundaries) while sharing the same data storage.
const vsip_dmview_p* matrix: Pointer to the source matrix view to be cloned.
On success, returns a pointer to the newly created matrix view that shares data with the input view.
On error, returns NULL.
vsip_mview_f *original_matrix; vsip_mview_f *cloned_matrix; // Clone the matrix view cloned_matrix = vsip_mcloneview_f(original_matrix); if (cloned_matrix == NULL) { // Handle error }
The cloned view shares the same underlying data block as the original view.
Changes to the data through one view will be visible through all other views that share the same data block.
The cloned view has the same dimensions, strides, and offset as the original view.
This function is useful for creating multiple independent views of the same data without copying the actual data.
To create a completely independent copy (including the data), use vsip_dmcopy_p_p to copy to a new matrix.