Generated by DocFX

Class ElementComparer

Element-at-position comparer.

Inheritance
System.Object
ElementComparer<System.Double>
ElementComparer
Implements
IEqualityComparer<System.Double[]>
Inherited Members
ElementComparer<Double>.Index
ElementComparer<Double>.Compare(Double[], Double[])
ElementComparer<Double>.Equals(Double[], Double[])
ElementComparer<Double>.GetHashCode(Double[])
Namespace: ISynergy.Framework.Mathematics.Comparers
Assembly: ISynergy.Framework.Mathematics.dll
Syntax
public class ElementComparer : ElementComparer<double>
Remarks

This class compares arrays by checking the value of a particular element at a given array index.

Examples
// We sort the arrays according to the 
// elements at their second column.

double[][] values =
{   //                 v
  new double[] {  0, 3, 0 },
  new double[] {  0, 4, 1 },
  new double[] { -1, 1, 1 },
  new double[] { -1, 5, 4 },
  new double[] { -2, 2, 6 },
};

// Sort the array considering only the second column
Array.Sort(values, new ElementComparer() { Index = 1 });

// The result will be
double[][] result =
{
  new double[] { -1, 1, 1 },
  new double[] { -2, 2, 6 },
  new double[] {  0, 3, 0 },
  new double[] {  0, 4, 1 },
  new double[] { -1, 5, 4 },
};

Implements

IEqualityComparer<>

Extension Methods

Matrix.Replace<T>(T, Object, Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
EntityBaseExtensions.HasProperty(Object, String)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.To<T>(Object)
ObjectExtensions.To(Object, Type)
ObjectExtensions.HasMethod(Object, String)
ObjectExtensions.AddressOf<T>(T)
ReflectionExtensions.GetIdentityValue<T>(T)
ReflectionExtensions.GetIdentityValue<T, TResult>(T)
ReflectionExtensions.GetIdentityProperty<T>(T)
ReflectionExtensions.HasIdentityProperty<T>(T)
ReflectionExtensions.GetPropertyValue<T, TResult>(T, String, TResult)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)
ReflectionExtensions.GetTitleValue<T>(T)
ReflectionExtensions.HasParentIdentityProperty<T>(T)
ReflectionExtensions.GetParentIdentityProperty<T>(T)
ReflectionExtensions.IsFreeApplication<T>(T)

See Also

ElementComparer<T>
ArrayComparer<T>
GeneralComparer
CustomComparer<T>