TVec.Divide Method

Overload List

#SignatureDescription
1TMtxVec Divide(TCplx X, TMtxVec Y, TMtxVec Z)self = xScalar / (Y*Z)
└ indexed: TMtxVec Divide(TCplx X, TMtxVec Y, Int32 YIndex, TMtxVec Z, Int32 zIndex, Int32 Index, Int32 Len)
2TMtxVec Divide(TMtxVec Vec)Divide each of calling vector elements with corresponding elements in the Vec object.
└ indexed: TMtxVec Divide(TMtxVec Vec, Int32 VecIndex, Int32 Index, Int32 Len)
3TMtxVec Divide(TMtxVec Num, TMtxVec Den)Divide each of Num elements with corresponding elements in Den.
4TMtxVec Divide(TMtxVec X, TMtxVec Y, TMtxVec Z)self = X / (Y*Z)
└ indexed: TMtxVec Divide(TMtxVec X, Int32 XIndex, TMtxVec Y, Int32 YIndex, TMtxVec Z, Int32 zIndex, Int32 Index, Int32 Len)
5TMtxVec Divide(TMtxVec Vec1, TMtxVec Vec2, Double Threshold)Divide each of Vec1 elements with corresponding elements in the Vec2 object.
└ indexed: TMtxVec Divide(TMtxVec Vec1, TMtxVec Vec2, Double Threshold, Int32 Vec1Index, Int32 Vec2Index, Int32 Index, Int32 Len)
6TMtxVec Divide(TMtxVec Vec, Double Threshold)Vector division.
└ indexed: TMtxVec Divide(TMtxVec Vec, Double Threshold, Int32 VecIndex, Int32 Index, Int32 Len)
7TMtxVec Divide(Double X, TMtxVec Y, TMtxVec Z)self = xScalar / (Y*Z)
└ indexed: TMtxVec Divide(Double X, TMtxVec Y, Int32 YIndex, TMtxVec Z, Int32 zIndex, Int32 Index, Int32 Len)
8TMtxVec Divide(TMtxVec Num, TMtxVec Den, Int32 NumIndex, Int32 DenIndex, Int32 Index, Int32 Len)Divide [NumIndex]..[NumIndex+Len-1] Num elements with [DenIndex]..[DenIndex+Len-1] elements in Den.

Overload 1: TMtxVec Divide(TCplx X, TMtxVec Y, TMtxVec Z)

Compute xScalar / (Y*Z)

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

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

Indexed: TMtxVec Divide(TCplx X, TMtxVec Y, Int32 YIndex, TMtxVec Z, Int32 zIndex, Int32 Index, Int32 Len)

Compute xScalar / (Y*Z) on sub array

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

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

Overload 2: TMtxVec Divide(TMtxVec Vec)

Divide each of calling vector elements with corresponding elements in the Vec object.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx

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

Remarks:

Size and Dew.Math.TMtxVec.Complex property of the calling object are set automatically. The result is stored in the calling object.

The result of division by zero will be the INF constant. Division of zero by zero will result in NAN.

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.Divide(b);
Vector expected = new Vector();
expected.SetIt(new double[] { 0.2, 0.333333333333333, 0.428571428571429, 0.5 });
if (!a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute))
    throw new Exception("Vector.Divide: mismatch");

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

Divide calling vector elements [Index]...[Index+Len-1] with corresponding elements [VecIndex]...[VecIndex+Len-1] from the Vec object.

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

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

Remarks:

Store the result in the claling vector. The Dew.Math.TMtxVecBase.Length of the calling vector is not changed. An exception is raised if Dew.Math.TMtxVecBase.ConditionCheck is True and array borders are overrun or underrun.

The result of division by zero will be the INF constant. Division of zero by zero will result in NAN.

Overload 3: TMtxVec Divide(TMtxVec Num, TMtxVec Den)

Divide each of Num elements with corresponding elements in Den.

#NameTypeDescription
1NumTMtxVecsource TVec or TMtx
2DenTMtxVecsource TVec or TMtx

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

Remarks:

Size and Dew.Math.TMtxVec.Complex property of the calling object are set automatically. The result is stored in the calling object.

The result of division by zero will be the INF constant. Division of zero by zero will result in NAN.

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.Divide(x, y);
Vector expected = new Vector();
expected.SetIt(new double[] { 0.2, 0.333333333333333, 0.428571428571429, 0.5 });
if (!a.IsEqual(expected, 1e-10, TCompare.cmpAbsolute))
    throw new Exception("Vector.Divide: mismatch");

Overload 4: TMtxVec Divide(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

Remarks:

The following expression would also run at the same or higher speed, when passing Y also for the Z parameter:

X / (Y^2)

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

Compute X/( Y*Z ) on sub array

#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 5: TMtxVec Divide(TMtxVec Vec1, TMtxVec Vec2, Double Threshold)

Divide each of Vec1 elements with corresponding elements in the Vec2 object.

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

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

Remarks:

Store the result in the calling vector.

Indexed: TMtxVec Divide(TMtxVec Vec1, TMtxVec Vec2, Double Threshold, Int32 Vec1Index, Int32 Vec2Index, Int32 Index, Int32 Len)

Divide Vec1 elements [Vec1Index]...[Vec1Index+Len-1] with corresponding elements [Vec2Index]...[Vec2Index+Len-1] from the Vec object.

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

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

Remarks:

Store the result in the calling vector [Index]...[Index+Len-1].

Overload 6: TMtxVec Divide(TMtxVec Vec, Double Threshold)

Vector division.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ThresholdDoublescalar

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

Remarks:

Divide each of Vec elements with corresponding elements in the calling object. Size and Dew.Math.TMtxVec.Complex property of the calling object are set automatically. The result is stored in the calling object.

The threshold parameter is used to prevent against division by zero and numerical instabilities in the follow on processing. All values of Vec smaller than Threshold will be replaced with Threshold.

Indexed: TMtxVec Divide(TMtxVec Vec, Double Threshold, Int32 VecIndex, Int32 Index, Int32 Len)

Divide each of Vec elements with corresponding elements in the calling object.

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

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

Remarks:

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

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

Compute xScalar / (Y*Z)

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

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

Indexed: TMtxVec Divide(Double X, TMtxVec Y, Int32 YIndex, TMtxVec Z, Int32 zIndex, Int32 Index, Int32 Len)

Compute xScalar / (Y*Z) on sub array

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

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

Overload 8: TMtxVec Divide(TMtxVec Num, TMtxVec Den, Int32 NumIndex, Int32 DenIndex, Int32 Index, Int32 Len)

Divide [NumIndex]..[NumIndex+Len-1] Num elements with [DenIndex]..[DenIndex+Len-1] elements in Den.

#NameTypeDescription
1NumTMtxVecsource TVec or TMtx
2DenTMtxVecsource TVec or TMtx
3NumIndexInt32
4DenIndexInt32
5IndexInt32start index
6LenInt32element count

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

Remarks:

and store result in the calling vector at positions [Index]..[Index+Len-1] Dew.Math.TMtxVec.Size and Dew.Math.TMtxVec.Complex property of the calling object are not changed. An exception is raised if Dew.Math.TMtxVecBase.ConditionCheck is True and array borders are overrun or underrun.

The result of division by zero will be the INF constant. Division of zero by zero will result in NAN.