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 adding each element of the given vector to a scalar or to the corresponding element of the other vector.

Operation

Description

Performance

vector-scalar pointwise addition

Calculates the sum of a scalar and each element of the vector, which is identical to simple vector-scalar addition:

VAddition Scalar

In place:

methodPointwiseAddInPlace(Double)

Returning result:

methodPointwiseAdd(Double)

Out of place:

methodPointwiseAdd(Double, Vector)

vector-vector pointwise addition

Adds each element of the given vector to the corresponding element of the defined vector. This operation is identical to simple vector-vector addition.

given:

VTwo Vector

then:

VTwo Vector Sum

In place:

methodPointwiseAddInPlace(Vector)

Returning result:

methodPointwiseAdd(Vector)

Out of place:

methodPointwiseAdd(Vector, Vector)

Subtraction

Pointwise subtraction allows calculating the difference between each element of the given vector and a scalar or between each element of the given vector and the corresponding element of the other defined vector.

Operation

Description

Performance

vector-scalar pointwise subtraction

Subtracts the given scalar from each element of the vector:

VSubtraction Scalar

In place:

methodPointwiseSubtractInPlace(Double)

Returning result:

methodPointwiseSubtract(Double)

Out of place:

methodPointwiseSubtract(Double, Vector)

Subtracts each element of the vector from the given scalar:

VSubtraction From Scalar

In place:

methodPointwiseLeftSubtractInPlace(Double)

Returning result:

methodPointwiseLeftSubtract(Double)

Out of place:

methodPointwiseLeftSubtract(Double, Vector)

vector-vector pointwise subtraction

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

VTwo Vector

then:

VSubtract

In place:

methodPointwiseSubtractInPlace(Vector)

Returning result:

methodPointwiseSubtract(Vector)

Out of place:

methodPointwiseSubtract(Vector, Vector)

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

VLeft Subtract

In place:

methodPointwiseLeftSubtractInPlace(Vector)

Returning result:

methodPointwiseLeftSubtract(Vector)

Out of place:

methodPointwiseLeftSubtract(Vector, Vector)

Multiplication

Pointwise multiplication provides multiplying each element of the given vector by a scalar or by the corresponding element of the other given vector.

Operation

Description

Performance

vector-scalar pointwise multiplication

Multiplies each element of the vector by the given scalar:

VMultiplication

In place:

methodPointwiseMultiplyInPlace(Double)

Returning result:

methodPointwiseMultiply(Double)

Out of place:

methodPointwiseMultiply(Double, Vector)

vector-vector pointwise multiplication

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

VMultiplyPW

In place:

methodPointwiseMultiplyInPlace(Vector)

Returning result:

methodPointwiseMultiply(Vector)

Out of place:

methodPointwiseMultiply(Vector, Vector)

Division

Division of each element of the vector by a scalar or be the corresponding element of the second vector.

Operation

Description

Performance

vector-scalar pointwise division

Divides each element of this vector by the given scalar:

VDivision

In place:

methodPointwiseDivideInPlace(Double)

Returning result:

methodPointwiseDivide(Double)

Out of place:

methodPointwiseDivide(Double, Vector)

Divides a given scalar by each element of this vector:

VDivide ScalarPW

In place:

methodPointwiseLeftDivideInPlace(Double)

Returning result:

methodPointwiseLeftDivide(Double)

Out of place:

methodPointwiseLeftDivide(Double, Vector)

vector-vector pointwise division

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

VDivide VectorPW

In place:

methodPointwiseDivideInPlace(Vector)

Returning result:

methodPointwiseDivide(Vector)

Out of place:

methodPointwiseDivide(Vector, Vector)

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

VDivide LeftPW

In place:

methodPointwiseLeftDivideInPlace(Vector)

Returning result:

methodPointwiseLeftDivide(Vector)

Out of place:

methodPointwiseLeftDivide(Vector, Vector)

See Also