Pointwise Operations |
Hereinafter the following convention is used:
– small Greek letters are used to denote scalars;
– small Latin letters are used to denote vectors;
– capital Latin letters are used to denote matrices.
This topic contains the following sections:
Pointwise addition operation is identical to simple addition, as it allows summing each element of the given matrix with a scalar or with the corresponding element of the other matrix.
Operation | Description | Performance |
---|---|---|
matrix-scalar pointwise addition | Adds the given scalar to each element of the matrix: In place:Returning result:Out of place: | |
matrix-matrix pointwise addition | Adds each element of the given matrix to the corresponding element of the defined matrix. This operation is identical to simple matrix-matrix addition. given: then: In place:Returning result:Out of place: |
Pointwise subtraction allows calculating the difference between each element of the given matrix and a scalar or between each element of the given matrix and the corresponding element of the other defined matrix.
Operation | Description | Performance |
---|---|---|
matrix-scalar pointwise subtraction | Subtracts the given scalar from each element of the matrix: In place:PointwiseSubtractInPlace(Double) Returning result:Out of place:PointwiseSubtract(Double, Matrix) Subtracts each element of the vector from the given scalar: In place:PointwiseLeftSubtractInPlace(Double) Returning result:Out of place: | |
matrix-matrix pointwise subtraction | Subtracts each element of the other matrix from the corresponding element of the given matrix: then: In place:PointwiseSubtractInPlace(Matrix) Returning result:Out of place:PointwiseSubtract(Matrix, Matrix) Subtracts each element of the matrix from the corresponding element of another matrix: In place:PointwiseLeftSubtractInPlace(Matrix) Returning result:Out of place: |
Pointwise multiplication provides multiplying each element of the given matrix by a scalar or by the corresponding element of another given matrix.
Operation | Description | Performance |
---|---|---|
matrix-scalar pointwise multiplication | Multiplies each element of the matrix by the given scalar: In place:PointwiseMultiplyInPlace(Double) Returning result:Out of place: | |
matrix-matrix pointwise multiplication | Multiplies each element of the given matrix by the corresponding element of another given matrix: Given two matrices: the result will be: In place:PointwiseMultiplyInPlace(Matrix) Returning result:Out of place: |
Division of each element of the matrix by a scalar or by the corresponding element of the second matrix.
Operation | Description | Performance |
---|---|---|
matrix-scalar pointwise division | Divides each element of this matrix by the given scalar: In place:PointwiseDivideInPlace(Double) Returning result:Out of place:PointwiseDivide(Double, Matrix) Divides a given scalar by each element of this matrix: In place:PointwiseLeftDivideInPlace(Double) Returning result:Out of place: | |
matrix-matrix pointwise division | Divides each element of this matrix by the corresponding element of the other matrix: Given two matrices: the result will be: In place:PointwiseDivideInPlace(Matrix) Returning result:Out of place:PointwiseDivide(Matrix, Matrix) Divides each element of the second matrix by the corresponding element of this matrix: In place:PointwiseLeftDivideInPlace(Matrix) Returning result:Out of place: |