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

1.4.5 vsip_dmput_p - Set Matrix Element

void vsip_mput_f(const vsip_mview_f *v, vsip_index i, vsip_index j, vsip_scalar_f vv); 
void vsip_cmput_f(const vsip_cmview_f *v, vsip_index i, vsip_index j, vsip_cscalar_f vv);
Description

This function sets the value of a specific element in a matrix view. The element is identified by its row and column indices (0-based).

Parameters
Example

vsip_mview_f *matrix; 
vsip_index i, j; 
 
// Create a matrix 
matrix = vsip_mcreate_f(5, 5, VSIP_ROW, VSIP_MEM_NONE); 
 
// Set specific elements 
vsip_mput_f(matrix, 0, 0, 1.0f);  // Top-left corner 
vsip_mput_f(matrix, 2, 2, 5.0f);  // Center element 
vsip_mput_f(matrix, 4, 4, 9.0f);  // Bottom-right corner
Notes