You are here: Symbol Reference > Sparse Namespace > Classes > TSparseMtx Class > public > TSparseMtx.Mul Method
MtxVec VCL
ContentsIndex
PreviousUpNext
TSparseMtx.Mul Method

Multiply two sparse matrices (matrix multiplication).

Pascal
procedure Mul(const C: TSparseMtx; const B: TSparseMtx; MaxNonZeroCount: integer = 10000000); overload;

Multiply sparse matrices A and B and place the result in the calling matrix. Because the resulting matrix can be much less sparse, the memory requirements can increase beyond the available system memory. This method will raise an exception, if the requested memory size will exceed the value of MaxNonZeroCount.

Multiply SparseA and SparseB where maximum number of non-zero elements is estimated at 100.

SparseC.Mul(SparseA,SparseB, 100);
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!