vsip_vview_f* vsip_vcloneview_f(const vsip_vview_f* v); vsip_vview_bl* vsip_vcloneview_bl(const vsip_vview_bl* v); vsip_vview_vi* vsip_vcloneview_vi(const vsip_vview_vi* v); vsip_vview_mi* vsip_vcloneview_mi(const vsip_vview_mi* v); vsip_cvview_f* vsip_cvcloneview_f(const vsip_cvview_f* v);
This function creates a new vector view that shares the same underlying data block as the input vector view but has its own independent view parameters. The cloned view references the same data as the original view but maintains its own metadata (length, stride, offset, and block).
const vsip_dvview_p* v: Pointer to the source complex vector view to be cloned.
On success, returns a pointer to the newly created complex vector view that shares data with the input view.
On error, returns NULL.
vsip_cvview_f *original_vector; vsip_cvview_f *cloned_vector; vsip_length i; // Create a complex vector original_vector = vsip_cvcreate_f(10, VSIP_MEM_NONE); // Clone the vector view cloned_vector = vsip_cvcloneview_f(original_vector); if (cloned_vector == NULL) { // Handle error }
The cloned view shares the same underlying data block as the source complex vector.
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 length, stride, and offset as the original view.