Try our new documentation site (beta).
Filter Content By
Version
Text Search
${sidebar_list_label} - Back
Filter by Language
MLinExpr.__setitem__()
__setitem__ ( )
Assign into this MLinExpr.
Example usage:
mle = 2 * model.addMVar((2,2)) v = model.addVar() w = model.addVar() mle[:] = v + 1 # Overwrite mle with four independent copies of 'v+1' mle[1, 1] = w # Overwrite the entry at position (1, 1) of mle with 'w'
Note that assignment into an existing MLinExpr always entails multiple data copies and is less efficient than building matrix expressions through operations with MVar objects.