Beispiel #1
0
 /// <summary>
 /// Returns true iff <paramref name="x"/> is stricle greater than <paramref name="y"/> in the total order <paramref name="order"/>.
 /// </summary>
 /// <typeparam name="T">The type of the elements in the relation.</typeparam>
 /// <typeparam name="TOrder">The type of the order.</typeparam>
 /// <param name="order">The structure which has a total order.</param>
 /// <param name="x">The first element to compare.</param>
 /// <param name="y">The second element to compare.</param>
 public static bool Ge <T, TOrder>(this IContainsOrder <TOrder> order, T x, T y)
     where TOrder : ITotalOrder <T>
 => order.Order.Compare(x, y) > 0;
Beispiel #2
0
 /// <summary>
 /// Returns true iff <paramref name="x"/> is smaller than or equal to <paramref name="y"/> in the partial order <paramref name="order"/>.
 /// </summary>
 /// <typeparam name="T">The type of the elements in the relation.</typeparam>
 /// <typeparam name="TOrder">The type of the order.</typeparam>
 /// <param name="order">The structure which has a total order.</param>
 /// <param name="x">The first element to compare.</param>
 /// <param name="y">The second element to compare.</param>
 public static bool Leq <T, TOrder>(this IContainsOrder <TOrder> order, T x, T y)
     where TOrder : IPartialOrder <T>
 => order.Order.Contains(x, y);