You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The definition of all standard arithmetic operators have been overloaded to be applicable for the matrix types defined by `stdlib_sparse`. The operators have been overloaded to support the following tuple combinations of the left-hand-side of the operation: same type and kind matrix-matrix, matrix-scalar and scalar-matrix.
376
+
377
+
### Syntax
378
+
379
+
- Matrix-matrix operators :
380
+
381
+
`C = A + B`
382
+
383
+
`C = A - B`
384
+
385
+
`C = A * B`
386
+
387
+
`C = A / B`
388
+
389
+
- Matrix scalar operators :
390
+
391
+
`B = A + alpha` or `B = alpha + A`
392
+
393
+
`B = A - alpha` or `B = alpha - A`
394
+
395
+
`B = A * alpha` or `B = alpha * A`
396
+
397
+
`B = A / alpha` or `B = alpha / A`
398
+
399
+
*Note*: scalar addition and subtraction operators perform element-wise operations only on the stored (non-zero) values, not on the full mathematical matrix. Meaning, the sparsity pattern is preserved.
0 commit comments