MtxExpr.DivideElem Method

Overload List

#SignatureDescription
1function DivideElem(const X: TCplx; const Y: TMtx; const Z: TMtxVec): Matrix;Result = xScalar / (Y*Z), where Y is a Matrix
2function DivideElem(const X: TCplx; const Y: TVec; const Z: TMtxVec): Vector;Result = xScalar / (Y*Z)
3function DivideElem(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec): Matrix;Result = X / (Y*Z), when X is a Matrix
4function DivideElem(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector;Result = X / (Y*Z)
5function DivideElem(const X: Double; const Y: TMtx; const Z: TMtxVec): Matrix;Result = xScalar / (Y*Z), when Y is a Matrix
6function DivideElem(const X: Double; const Y: TVec; const Z: TMtxVec): Vector;Result = xScalar / (Y*Z)

Overload 1: function DivideElem(const X: TCplx; const Y: TMtx; const Z: TMtxVec): Matrix;

Compute xScalar / (Y*Z), where Y is a Matrix

#NameTypeDescription
1XTCplx
2YTMtx
3ZTMtxVec

Returns: Matrix

Overload 2: function DivideElem(const X: TCplx; const Y: TVec; const Z: TMtxVec): Vector;

Compute xScalar / (Y*Z)

#NameTypeDescription
1XTCplx
2YTVec
3ZTMtxVec

Returns: Vector

Overload 3: function DivideElem(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec): Matrix;

Compute X / (Y*Z), when X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3ZTMtxVec

Returns: Matrix

Remarks:

The operation does only per-element math.

Examples
uses MtxVec, MtxExpr, Math387;

var
    Y, Z, A1, A2, A3: Vector;
    xScalar: Double;
begin
    xScalar := 100;
    Y := [2,4,5,10];
    Z := [1,2,2,2];
    A1 := xScalar / (Y * Z);
    A2 := DivideElem(xScalar, Y, Z);
    A3.Divide(xScalar, Y, Z);
    if not A2.IsEqual(A1) then ERaise('Problem');
    if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 4: function DivideElem(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector;

Compute X / (Y*Z)

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTMtxVec

Returns: Vector

Remarks:

Divides X by the product of Y and Z without temporary objects.

Examples
uses MtxVec, MtxExpr, Math387;

var
    X, Y, Z, A1, A2, A3: Vector;
begin
    X := [6,8,10,12];
    Y := [1,2,3,4];
    Z := [2,2,2,2];
    A1 := X * (Y * Z);
    A2 := DivideElem(X, Y, Z);
    A3.Divide(X, Y, Z);
    if not A2.IsEqual(A1) then ERaise('Problem');
    if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 5: function DivideElem(const X: Double; const Y: TMtx; const Z: TMtxVec): Matrix;

Compute xScalar / (Y*Z), when Y is a Matrix

#NameTypeDescription
1XDouble
2YTMtx
3ZTMtxVec

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 6: function DivideElem(const X: Double; const Y: TVec; const Z: TMtxVec): Vector;

Compute xScalar / (Y*Z)

#NameTypeDescription
1XDouble
2YTVec
3ZTMtxVec

Returns: Vector

Remarks:

Divides a scalar xScalar by the product of Y and Z without temporary objects. Since the first parameter is scalar, the overload is provided by splitting the second parameter into TVec and TMtx versions.

Examples
var
    xScalar: Double;
    Y, Z, A1, A2, A3: Vector;
begin
xScalar := 100;
Y := [2, 4, 5, 10];
Z := [1, 2, 2, 2];
A1 := xScalar / (Y * Z);
A2 := DivideElem(xScalar, Y, Z);
A3.Divide(xScalar, Y, Z);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;