Matrix.BlockInit Method

Overload List

#SignatureDescription
1void BlockInitInitializes block processing.
2void BlockInit(TMtxVecBase Src)Initializes block processing.
3void BlockInit(TMtxVecBase Src, Int32 ABlockSize)Initializes block processing.
4void BlockInit(Int32 ABlockSize)

Overload 1: void BlockInit

Initializes block processing.

Result: stored in self (calling object)

Remarks:

Initializes block processing. Because the size of the CPU cache is limited, significant performance gains can be obtained by splitting long vectors in to a series of short ones, which can all fit in the CPU cache entirely. The BlockInit method is to be used together with Dew.Math.Matrix.BlockNext and methods to initialize a block processing while loop. BlockInit will call Dew.Math.Matrix.SetSubRange to obtain subrange of the data in TVec. The Dew.Math.Matrix.Length of the subranged Matrix is determined by the global Dew.Math.Units.Math387.MtxVecBlockSize variable declared in Dew.Math.Units.Math387 unit. Default value of MtxVecBlockSize is preset to 800 Matrix elements for double precision and 1600 elements for single precision. BlockInit supports nested calls and from witihin a blocked while loop you can call procedures and functions which are also blocked. If you use block processing, typical performance gains will range from 2 to a maximum of 6. Block processing can not be used, or it is difficult to apply, in cases where Matrix elements are not independent of each other. The block processing while loop must be written like this:

a.BlockInit;
while not A.BlockEnd do
begin
  // .... user defined function
a.BlockNext.
end;
See Also: Matrix.BlockNext, Matrix.BlockEnd

Overload 2: void BlockInit(TMtxVecBase Src)

Initializes block processing.

#NameTypeDescription
1SrcTMtxVecBasesource TVec, TMtx, TVecInt or TMtxInt

Result: stored in self (calling object)

Overload 3: void BlockInit(TMtxVecBase Src, Int32 ABlockSize)

Initializes block processing.

#NameTypeDescription
1SrcTMtxVecBasesource TVec, TMtx, TVecInt or TMtxInt
2ABlockSizeInt32

Result: stored in self (calling object)

Remarks:

Block processing can be applied on possibly already subranged Src object. Src may not be freed or go out of scope until block processing loop has finished. There would be no error raised other than AV.

Overload 4: void BlockInit(Int32 ABlockSize)

#NameTypeDescription
1ABlockSizeInt32

Result: stored in self (calling object)