void Unique(TMtxVec Src, TVec Dst, TVecInt Counts)
Finds the unique elements in vector/matrix.
| # | Name | Description |
|---|---|---|
| 1 | Src | Defines data unique elements search. |
| 2 | Dst | Returns unique elements. Size and Dew.Math.TMtxVec.Complex properties of Dst are adjusted automatically. |
| 3 | Counts | If specifed, stores the count of each unique element in dataset. |
Result: stored in self (calling object)
Remarks:
Finds and sorts the unique elements in Src vector/matrix array. Sorted values are returned in Dst vector. An exception is raised if Src is Complex. Length and Complex properties of Dst vector are adjusted automatically.
Examples
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example()
{
Matrix m1 = new Matrix(0,0);
Vector uvec = new Vector(0);
m1.SetIt(4,3,false, new double[]
{ 1,2,3,
4,2,1,
3,2,3,
3,3,1});
Statistics.Unique(m1,uvec,null);
// uvec elements are [1,2,3,4]
}
}
See Also: Statistics.Ranks, Statistics.TiedRanks