XPRSchgcoef


Purpose
Used to change a single coefficient in the matrix. If the coefficient does not already exist, a new coefficient will be added to the matrix. If many coefficients are being added to a row of the matrix, it may be more efficient to delete the old row of the matrix and add a new row.
Synopsis
int XPRS_CC XPRSchgcoef(XPRSprob prob, int irow, int icol, double dval);
Arguments
prob 
The current problem.
irow 
Row index for the coefficient.
icol 
Column index for the coefficient.
dval 
New value for the coefficient. If dval is zero, any existing coefficient will be deleted.
Related Controls
Double
Zero tolerance on matrix elements.

Example
In the following, the element in row 2, column 1 of the matrix is changed to 0.33:
XPRSchgcoef(prob,2,1,0.33);
Further information
XPRSchgmcoef is more efficient than multiple calls to XPRSchgcoef and should be used in its place in such circumstances.
Related topics
XPRSaddcols, XPRSaddrows, XPRSchgmcoef, XPRSchgmqobj, XPRSchgobj, XPRSchgqobj, XPRSchgrhs, XPRSgetcols, XPRSgetrows.


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.