TSmallMatrixMultiply.Mul Method

Overload List

#SignatureDescription
1void MulPerforms matrix multiplication optimized for small matrices
2void Mul(TMtx A, TMtx B, TMtx C)Performs matrix multiplication optimized for small matrices

Overload 1: void Mul

Performs matrix multiplication optimized for small matrices

Result: stored in self (calling object)

Remarks:

Computes: C = alpha*opA(A)*opB(B) + beta*C

The operation must first be initialized with a call to the Init method. The method will use the memory locations of parameters A,B and C passed to the Init routine. This means, that A,B and C may not be resized after calling Init even if they restore the size and layout before calling this routine. There is no other dependence and all objects can be free independently.

Calling TMtx.Size multiple times will not trigger a resize or memory allocation unless the size has changed.

This routine performs no error checking! Any error checking is performed during the call to the Init routine.

The method is about 2x faster than the jit.Mul(a,b,c) overload; It is about 1.3% slower than calling jit.MulKernelDouble(jit.jitter, a,b,c); function It is 3x faster than the Delphi's unrolled-loop matrix multiply.

Overload 2: void Mul(TMtx A, TMtx B, TMtx C)

Performs matrix multiplication optimized for small matrices

#NameTypeDescription
1ATMtxsource TMtx
2BTMtxsource TMtx
3CTMtxsource TMtx

Result: stored in self (calling object)

Remarks:

Computes: C = alpha*opA(A)*opB(B) + beta*C

The operation must first be initialized with a call to the Init method. This means, that A,B and C may not be have a different size than when calling Init. Their size however can change in between the calls.

This routine performs no error checking! Any error checking is performed during the call to the Init routine.

The method is about 3x slower than the jit.Mul; overload; It is about 4x slower than calling jit.MulKernelDouble(jit.jitter, a,b,c); function It is equally fast as the Delphi unrolled loop matrix multiply.