MtxExpr.DivideElem Method

Overload List

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

Overload 1: Matrix DivideElem(TCplx X, TMtx Y, TMtxVec Z)

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

#NameTypeDescription
1XTCplxscalar
2YTMtxsource TMtx
3ZTMtxVecsource TVec or TMtx

Returns: Matrix

Overload 2: Vector DivideElem(TCplx X, TVec Y, TMtxVec Z)

Compute xScalar / (Y*Z)

#NameTypeDescription
1XTCplxscalar
2YTVecsource TVec
3ZTMtxVecsource TVec or TMtx

Returns: Vector

Overload 3: Matrix DivideElem(TMtx X, TMtxVec Y, TMtxVec Z)

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

#NameTypeDescription
1XTMtxsource TMtx
2YTMtxVecsource TVec or TMtx
3ZTMtxVecsource TVec or TMtx

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 4: Vector DivideElem(TVec X, TMtxVec Y, TMtxVec Z)

Compute X / (Y*Z)

#NameTypeDescription
1XTVecsource TVec
2YTMtxVecsource TVec or TMtx
3ZTMtxVecsource TVec or TMtx

Returns: Vector

Remarks:

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

Examples
using Dew.Math;
using Dew.Math.Units;

namespace Dew.Examples
{
    void Example()
    {
        Vector X = (Vector) new double[] { 6, 8, 10, 12 };
        Vector Y = (Vector) new double[] { 1, 2, 3, 4 };
        Vector Z = (Vector) new double[] { 2, 2, 2, 2 };
        Vector A1 = X / (Y * Z);
        Vector A2 = DivideElem(X, Y, Z);
        Vector A3 = new Vector();
        A3.Divide(X, Y, Z);
        if (!A2.IsEqual(A1)) Math387.ERaise("Problem");
        if (!A3.IsEqual(A1)) Math387.ERaise("Problem");
    }
}

Overload 5: Matrix DivideElem(Double X, TMtx Y, TMtxVec Z)

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

#NameTypeDescription
1XDoublescalar
2YTMtxsource TMtx
3ZTMtxVecsource TVec or TMtx

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 6: Vector DivideElem(Double X, TVec Y, TMtxVec Z)

Compute xScalar / (Y*Z)

#NameTypeDescription
1XDoublescalar
2YTVecsource TVec
3ZTMtxVecsource TVec or TMtx

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
using Dew.Math;
using Dew.Math.Units;

namespace Dew.Examples
{
    void Example()
    {
        double xScalar = 100;
        Vector Y = (Vector) new double[] { 2, 4, 5, 10 };
        Vector Z = (Vector) new double[] { 1, 2, 2, 2 };
        Vector A1 = xScalar / (Y * Z);
        Vector A2 = DivideElem(xScalar, Y, Z);
        Vector A3 = new Vector();
        A3.Divide(xScalar, Y, Z);
        if (!A2.IsEqual(A1)) Math387.ERaise("Problem");
        if (!A3.IsEqual(A1)) Math387.ERaise("Problem");
    }
}