MtxExpr.Add Method

Overload List

#SignatureDescription
1Matrix Add(TMtx X, TMtxVec Y, TCplx Z)Result = X + Y + zScalar, where X is a Matrix
2Matrix Add(TMtx X, TMtxVec Y, TMtxVec Z)Result = X + Y + Z, where X is a Matrix
3Matrix Add(TMtx X, TMtxVec Y, Double Z)Result = X + Y + zScalar, where X is a Matrix
4Vector Add(TVec X, TMtxVec Y, TCplx Z)Result = X + Y + zScalar
5Vector Add(TVec X, TMtxVec Y, TMtxVec Z)Result = X + Y + Z
6Vector Add(TVec X, TMtxVec Y, Double Z)Result = X + Y + zScalar

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

Compute X + Y + zScalar, where X is a Matrix.

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

Returns: Matrix

Overload 2: Matrix Add(TMtx X, TMtxVec Y, TMtxVec Z)

Compute X + Y + Z, where X is a Matrix.

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

Returns: Matrix

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

Compute X + Y + zScalar, where X is a Matrix.

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

Returns: Matrix

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

Compute X + Y + zScalar

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

Returns: Vector

Overload 5: Vector Add(TVec X, TMtxVec Y, TMtxVec Z)

Compute X + Y + Z

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

Returns: Vector

Remarks:

Computes the sum of three vector-based operands, X, Y, and Z, without creating temporary objects.

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

namespace Dew.Examples
{
    void Example()
    {
        Vector X = (Vector) new double[] { 1, 2, 3, 4 };
        Vector Y = (Vector) new double[] { 2, 3, 4, 5 };
        Vector Z = (Vector) new double[] { 3, 4, 5, 6 };
        Vector A1 = X + Y + Z;
        Vector A2 = Add(X, Y, Z);
        Vector A3 = new Vector();
        A3.Add(X, Y, Z);
        if (!A2.IsEqual(A1)) Math387.ERaise("Problem");
        if (!A3.IsEqual(A1)) Math387.ERaise("Problem");
    }
}

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

Compute X + Y + zScalar

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

Returns: Vector

Remarks:

Computes the sum of X and Y with an added scalar zScalar without temporary objects.

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

namespace Dew.Examples
{
    void Example()
    {
        double zScalar = 3.0;
        Vector X = (Vector) new double[] { 1, 2, 3, 4 };
        Vector Y = (Vector) new double[] { 2, 3, 4, 5 };
        Vector A1 = X + Y + zScalar;
        Vector A2 = Add(X, Y, zScalar);
        Vector A3 = new Vector();
        A3.Add(X, Y, zScalar);
        if (!A2.IsEqual(A1)) Math387.ERaise("Problem");
        if (!A3.IsEqual(A1)) Math387.ERaise("Problem");
    }
}