TMtxInt.AddScaledSqr Method

Overload List

#SignatureDescription
1TMtxVecInt AddScaledSqr(TMtxVecInt X, TMtxVecInt Y, Int32 yScale)self = sqr(X + Y*yScale)
└ indexed: TMtxVecInt AddScaledSqr(TMtxVecInt X, Int32 XIndex, TMtxVecInt Y, Int32 YIndex, Int32 yScale, Int32 Index, Int32 Len)
2TMtxVecInt AddScaledSqr(TMtxVecInt X, Int32 xScale, TMtxVecInt Y, Int32 yScale)self = sqr(X*xScale + Y*yScale)
3TMtxVecInt AddScaledSqr(TMtxVecInt X, Int32 XIndex, Int32 xScale, TMtxVecInt Y, Int32 YIndex, Int32 yScale, Int32 Index, Int32 Len)self = sqr(X*xScale + Y*yScale) on sub arrays

Overload 1: TMtxVecInt AddScaledSqr(TMtxVecInt X, TMtxVecInt Y, Int32 yScale)

Compute sqr(X + Y*yScale)

#NameTypeDescription
1XTMtxVecIntsource TVecInt or TMtxInt
2YTMtxVecIntsource TVecInt or TMtxInt
3yScaleInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

By making use of yScale, it is also possible to compute the following (at the same or higher speed):

(X - Y)^2 = X^2 - 2XY +Y^2

Indexed: TMtxVecInt AddScaledSqr(TMtxVecInt X, Int32 XIndex, TMtxVecInt Y, Int32 YIndex, Int32 yScale, Int32 Index, Int32 Len)

Compute sqr(X + Y*yScale) on sub arrays

#NameTypeDescription
1XTMtxVecIntsource TVecInt or TMtxInt
2XIndexInt32X start index
3YTMtxVecIntsource TVecInt or TMtxInt
4YIndexInt32Y start index
5yScaleInt32
6IndexInt32start index
7LenInt32element count

Result: stored in self (calling object), returns self for chaining

Overload 2: TMtxVecInt AddScaledSqr(TMtxVecInt X, Int32 xScale, TMtxVecInt Y, Int32 yScale)

Compute sqr(X*xScale + Y*yScale)

#NameTypeDescription
1XTMtxVecIntsource TVecInt or TMtxInt
2xScaleInt32
3YTMtxVecIntsource TVecInt or TMtxInt
4yScaleInt32

Result: stored in self (calling object), returns self for chaining

Overload 3: TMtxVecInt AddScaledSqr(TMtxVecInt X, Int32 XIndex, Int32 xScale, TMtxVecInt Y, Int32 YIndex, Int32 yScale, Int32 Index, Int32 Len)

Compute sqr(X*xScale + Y*yScale) on sub arrays

#NameTypeDescription
1XTMtxVecIntsource TVecInt or TMtxInt
2XIndexInt32X start index
3xScaleInt32
4YTMtxVecIntsource TVecInt or TMtxInt
5YIndexInt32Y start index
6yScaleInt32
7IndexInt32start index
8LenInt32element count

Result: stored in self (calling object), returns self for chaining