vsip_mview_f* vsip_mputcolstride_f(const vsip_mview_f *v, vsip_stride stride); vsip_cmview_f* vsip_cmputcolstride_f(const vsip_cmview_f *v, vsip_stride stride);
This function modifies the column stride of an existing matrix view. The column stride determines how elements are laid out in memory along the columns of the matrix (how many elements to skip when moving from one column to the next within a row).
const vsip_dmview_p* v: Pointer to the matrix view to be modified.
vsip_stride stride: The new column stride value.
Returns a pointer to the modified matrix view.
vsip_mview_f *matrix; vsip_stride original_stride, new_stride; // Create a matrix matrix = vsip_mcreate_f(100, 100, VSIP_ROW, VSIP_MEM_NONE); original_stride = vsip_mgetcolstride_f(matrix); printf("Original column stride: %ld\n", original_stride); // Typically 1 // Change to stride of 2 (every other element in rows) if (vsip_mputcolstride_f(matrix, 2) == NULL) { // Handle error } printf("New column stride: %ld\n", vsip_mgetcolstride_f(matrix)); // Output: 2
The new stride must be compatible with the matrix dimensions and block size:
(column length - 1) * new stride + offset must be
block size
Changing the column stride affects how elements are accessed when moving along rows.