Click or drag to resize

Pointwise Operations

Hereinafter the following convention is used:

  • VSmall Greek – small Greek letters are used to denote scalars;

  • VSmall Latin – small Latin letters are used to denote vectors;

  • VCapital Latin – capital Latin letters are used to denote matrices.

This topic contains the following sections:

Addition

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:

MAddition Scalar

In place:

methodPointwiseAddInPlace(Double)

Returning result:

methodPointwiseAdd(Double)

Out of place:

methodPointwiseAdd(Double, Matrix)

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:

MTwo Matrices

then:

MTwo Matrices Sum

In place:

methodPointwiseAddInPlace(Matrix)

Returning result:

methodPointwiseAdd(Matrix)

Out of place:

methodPointwiseAdd(Matrix, Matrix)

Subtraction

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:

MSubtraction Scalar

In place:

methodPointwiseSubtractInPlace(Double)

Returning result:

methodPointwiseSubtract(Double)

Out of place:

methodPointwiseSubtract(Double, Matrix)

Subtracts each element of the vector from the given scalar:

MSubtraction From Scalar

In place:

methodPointwiseLeftSubtractInPlace(Double)

Returning result:

methodPointwiseLeftSubtract(Double)

Out of place:

methodPointwiseLeftSubtract(Double, Matrix)

matrix-matrix pointwise subtraction

Subtracts each element of the other matrix from the corresponding element of the given matrix:

MTwo Matrices

then:

MSubtract

In place:

methodPointwiseSubtractInPlace(Matrix)

Returning result:

methodPointwiseSubtract(Matrix)

Out of place:

methodPointwiseSubtract(Matrix, Matrix)

Subtracts each element of the matrix from the corresponding element of another matrix:

MLeft Subtract

In place:

methodPointwiseLeftSubtractInPlace(Matrix)

Returning result:

methodPointwiseLeftSubtract(Matrix)

Out of place:

methodPointwiseLeftSubtract(Matrix, Matrix)

Multiplication

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:

MMultiplication Scalar

In place:

methodPointwiseMultiplyInPlace(Double)

Returning result:

methodPointwiseMultiply(Double)

Out of place:

methodPointwiseMultiply(Double, Matrix)

matrix-matrix pointwise multiplication

Multiplies each element of the given matrix by the corresponding element of another given matrix:

Given two matrices:

MTwo Matrices

the result will be:

MMultiplyPW

In place:

methodPointwiseMultiplyInPlace(Matrix)

Returning result:

methodPointwiseMultiply(Matrix)

Out of place:

methodPointwiseMultiply(Matrix, Matrix)

Division

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:

MDivision

In place:

methodPointwiseDivideInPlace(Double)

Returning result:

methodPointwiseDivide(Double)

Out of place:

methodPointwiseDivide(Double, Matrix)

Divides a given scalar by each element of this matrix:

MDivide ScalarPW

In place:

methodPointwiseLeftDivideInPlace(Double)

Returning result:

methodPointwiseLeftDivide(Double)

Out of place:

methodPointwiseLeftDivide(Double, Matrix)

matrix-matrix pointwise division

Divides each element of this matrix by the corresponding element of the other matrix:

Given two matrices:

MTwo Matrices

the result will be:

MDivide MatrixPW

In place:

methodPointwiseDivideInPlace(Matrix)

Returning result:

methodPointwiseDivide(Matrix)

Out of place:

methodPointwiseDivide(Matrix, Matrix)

Divides each element of the second matrix by the corresponding element of this matrix:

MDivide LeftPW

In place:

methodPointwiseLeftDivideInPlace(Matrix)

Returning result:

methodPointwiseLeftDivide(Matrix)

Out of place:

methodPointwiseLeftDivide(Matrix, Matrix)

See Also