TVec.Add Method

Overload List

#SignatureDescription
1TMtxVec Add(TCplx Value)Adds complex Value to all calling object complex elements.
└ indexed: TMtxVec Add(TCplx Value, Int32 Index, Int32 Len)
2TMtxVec Add(TMtxVec Vec)Array addition.
└ indexed: TMtxVec Add(TMtxVec Vec, Int32 VecIndex, Int32 Index, Int32 Len)
3TMtxVec Add(TMtxVec Vec, TCplx Value)Adds complex Value to each element of the Vec object.
└ indexed: TMtxVec Add(TMtxVec Vec, TCplx Value, Int32 VecIndex, Int32 Index, Int32 Len)
4TMtxVec Add(TMtxVec Vec1, TMtxVec Vec2)Add each of Vec2 elements to corresponding elements in Vec1.
└ indexed: TMtxVec Add(TMtxVec Vec1, TMtxVec Vec2, Int32 Vec1Index, Int32 Vec2Index, Int32 Index, Int32 Len)
5TMtxVec Add(TMtxVec X, TMtxVec Y, TCplx Z)self = X + Y + zScalar
└ indexed: TMtxVec Add(TMtxVec X, Int32 XIndex, TMtxVec Y, Int32 YIndex, TCplx Z, Int32 Index, Int32 Len)
6TMtxVec Add(TMtxVec X, TMtxVec Y, TMtxVec Z)self = X + Y + Z
└ indexed: TMtxVec Add(TMtxVec X, Int32 XIndex, TMtxVec Y, Int32 YIndex, TMtxVec Z, Int32 zIndex, Int32 Index, Int32 Len)
7TMtxVec Add(TMtxVec X, TMtxVec Y, Double Z)self = X + Y + zScalar
└ indexed: TMtxVec Add(TMtxVec X, Int32 XIndex, TMtxVec Y, Int32 YIndex, Double Z, Int32 Index, Int32 Len)
8TMtxVec Add(TMtxVec Vec, Double Value)Adds Value to the each element of the Vec object.
└ indexed: TMtxVec Add(TMtxVec Vec, Double Value, Int32 VecIndex, Int32 Index, Int32 Len)
9TMtxVec Add(Double Value)Adds Value to object elements.
└ indexed: TMtxVec Add(Double Value, Int32 Index, Int32 Len)

Overload 1: TMtxVec Add(TCplx Value)

Adds complex Value to all calling object complex elements.

#NameTypeDescription
1ValueTCplxscalar

Result: stored in self (calling object), returns self for chaining

Indexed: TMtxVec Add(TCplx Value, Int32 Index, Int32 Len)

Adds complex Value to calling object complex elements [Index]..[Index+Len-1].

#NameTypeDescription
1ValueTCplxscalar
2IndexInt32start index
3LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

An exception is raised if array borders are overrun.

Overload 2: TMtxVec Add(TMtxVec Vec)

Array addition.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx

Result: stored in self (calling object), returns self for chaining

Remarks:

Add each of Vec elements to corresponding elements in the calling object.

Examples
Vector a = new Vector();
a.SetIt(new double[] { 1.0, 2.0, 3.0, 4.0 });
Vector b = new Vector();
b.SetIt(new double[] { 5.0, 6.0, 7.0, 8.0 });
a.Add(b);
Vector expected = new Vector();
expected.SetIt(new double[] { 6.0, 8.0, 10.0, 12.0 });
if (!a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute))
    throw new Exception("Vector.Add: mismatch");

Indexed: TMtxVec Add(TMtxVec Vec, Int32 VecIndex, Int32 Index, Int32 Len)

Add Vec elements [VecIndex]..[VecIndex+Len-1] to calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2VecIndexInt32
3IndexInt32start index
4LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

An exception is raised if Dew.Math.TMtxVecBase.ConditionCheck is true and array borders are overrun.

Overload 3: TMtxVec Add(TMtxVec Vec, TCplx Value)

Adds complex Value to each element of the Vec object.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ValueTCplxscalar

Result: stored in self (calling object), returns self for chaining

Remarks:

Store the result to the calling object. Size property of the calling object is set automatically. Dew.Math.TMtxVec.Complex property of the calling object is set to True.

Indexed: TMtxVec Add(TMtxVec Vec, TCplx Value, Int32 VecIndex, Int32 Index, Int32 Len)

Adds complex Value to each elements of the Vec object in range [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ValueTCplxscalar
3VecIndexInt32
4IndexInt32start index
5LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Stores the result to elements [Index]..[Index+Len-1] of the calling object. Size of the calling object is not changed. An exception is raised if array borders are overrun. Dew.Math.TMtxVec.Complex property of the calling object is set to True.

Overload 4: TMtxVec Add(TMtxVec Vec1, TMtxVec Vec2)

Add each of Vec2 elements to corresponding elements in Vec1.

#NameTypeDescription
1Vec1TMtxVecsource TVec or TMtx
2Vec2TMtxVecsource TVec or TMtx

Result: stored in self (calling object), returns self for chaining

Remarks:

The results are stored in the calling object. Size and Dew.Math.TMtxVec.Complex properties of the calling object are set implicitly to match Vec1 and Vec2 vectors.

Examples
Vector a = new Vector();
Vector x = new Vector();
x.SetIt(new double[] { 1.0, 2.0, 3.0, 4.0 });
Vector y = new Vector();
y.SetIt(new double[] { 5.0, 6.0, 7.0, 8.0 });
a.Add(x, y);
Vector expected = new Vector();
expected.SetIt(new double[] { 6.0, 8.0, 10.0, 12.0 });
if (!a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute))
    throw new Exception("Vector.Add: mismatch");

Indexed: TMtxVec Add(TMtxVec Vec1, TMtxVec Vec2, Int32 Vec1Index, Int32 Vec2Index, Int32 Index, Int32 Len)

Add Vec1 elements [Vec1Index]..[Vec1Index+Len-1] to Vec2 elements [Vec2Index]..[Vec2Index+Len-1].

#NameTypeDescription
1Vec1TMtxVecsource TVec or TMtx
2Vec2TMtxVecsource TVec or TMtx
3Vec1IndexInt32
4Vec2IndexInt32
5IndexInt32start index
6LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Store the results in calling object elements [Index]..[Index+Len-1]. An exception is raised if Dew.Math.TMtxVecBase.ConditionCheck is true and array borders are overrun.

Overload 5: TMtxVec Add(TMtxVec X, TMtxVec Y, TCplx Z)

Compute X + Y + zScalar

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

Result: stored in self (calling object), returns self for chaining

Indexed: TMtxVec Add(TMtxVec X, Int32 XIndex, TMtxVec Y, Int32 YIndex, TCplx Z, Int32 Index, Int32 Len)

Compute X + Y + zScalar on sub arrays

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2XIndexInt32X start index
3YTMtxVecsource TVec or TMtx
4YIndexInt32Y start index
5ZTCplxscalar
6IndexInt32start index
7LenInt32element count

Result: stored in self (calling object), returns self for chaining

Overload 6: TMtxVec Add(TMtxVec X, TMtxVec Y, TMtxVec Z)

Compute X + Y + Z

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

Result: stored in self (calling object), returns self for chaining

Indexed: TMtxVec Add(TMtxVec X, Int32 XIndex, TMtxVec Y, Int32 YIndex, TMtxVec Z, Int32 zIndex, Int32 Index, Int32 Len)

Compute X + Y + Z on sub arrays

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2XIndexInt32X start index
3YTMtxVecsource TVec or TMtx
4YIndexInt32Y start index
5ZTMtxVecsource TVec or TMtx
6zIndexInt32
7IndexInt32start index
8LenInt32element count

Result: stored in self (calling object), returns self for chaining

Overload 7: TMtxVec Add(TMtxVec X, TMtxVec Y, Double Z)

Compute X + Y + zScalar

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

Result: stored in self (calling object), returns self for chaining

Indexed: TMtxVec Add(TMtxVec X, Int32 XIndex, TMtxVec Y, Int32 YIndex, Double Z, Int32 Index, Int32 Len)

Compute X + Y + zScalar on sub arrays

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2XIndexInt32X start index
3YTMtxVecsource TVec or TMtx
4YIndexInt32Y start index
5ZDoublescalar
6IndexInt32start index
7LenInt32element count

Result: stored in self (calling object), returns self for chaining

Overload 8: TMtxVec Add(TMtxVec Vec, Double Value)

Adds Value to the each element of the Vec object.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ValueDoublescalar

Result: stored in self (calling object), returns self for chaining

Remarks:

Stores the result in the calling object. Size and Dew.Math.TMtxVec.Complex properties of the calling object are set automatically.

Indexed: TMtxVec Add(TMtxVec Vec, Double Value, Int32 VecIndex, Int32 Index, Int32 Len)

Adds Value to each element of Vec object in range [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ValueDoublescalar
3VecIndexInt32
4IndexInt32start index
5LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Stores result to elements [Index]..[Index+Len-1] of the calling object. Size of the calling object is not changed. An exception is raised if array borders are overrun. Dew.Math.TMtxVec.Complex property of the calling object is set implicitly.

Overload 9: TMtxVec Add(Double Value)

Adds Value to object elements.

#NameTypeDescription
1ValueDoublescalar

Result: stored in self (calling object), returns self for chaining

Indexed: TMtxVec Add(Double Value, Int32 Index, Int32 Len)

Adds Value to calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1ValueDoublescalar
2IndexInt32start index
3LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

An exception is raised if array borders are overrun.