You are here: Symbol Reference > clMtxExpr Namespace > Classes > clMatrix Record > public > MulElem Method > clMatrix.MulElem Method (TOpenCLMatrix)
MtxVec VCL
ContentsIndex
PreviousUpNext
clMatrix.MulElem Method (TOpenCLMatrix)

Matrix array multiplication.

Pascal
function MulElem(Mtx: TOpenCLMatrix): TOpenCLMatrix; overload;

Multiplies elements in Mtx matrix with the elements in the calling matrix (array multiplication) and stores the results in calling matrix. The TOpenCLMatrix.Rows, Cols and TOpenCLBase.ComplexComplexproperties of both matrices must match, otherwise an exception is raised.

var A,B,C: clMatrix; begin A.CopyFromArray(2,2,TSingleArray.Create(1,2, 2,4)); B.CopyFromArray(2,2,TSingleArray.Create(1,2, 2,4)); C.MulElem(A,B); // C becomes: // [1, 4, // 4,16] end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!