ImmutableRelation( ImmutableRelation <TupleType> other, byte dim, byte level, object liquidToken) { _bucket0 = other._bucket0; _bucket1 = other._bucket1; _bucket2 = other._bucket2; _bucket3 = other._bucket3; _bucket4 = other._bucket4; _bucket5 = other._bucket5; _bucket6 = other._bucket6; _bucket7 = other._bucket7; _proj = other._proj; _count = other._count; _dim = dim; _level = level; _liquidToken = liquidToken; }
/// <summary> /// Removes the specified element. /// </summary> /// <typeparam name="T">Type of elements stored in the relation</typeparam> /// <param name="rel">Unary relation</param> /// <param name="x">Element to remove</param> /// <returns>Updated relation</returns> public static ImmutableRelation <T> Remove <T>(this ImmutableRelation <T> rel, T?x) where T : struct { return(rel.Remove(x == null ? ItemMatcher <T> .Any : new ItemMatcher <T>(x.Value))); }
/// <summary> /// Removes the specified element. /// </summary> /// <typeparam name="T">Type of elements stored in the relation</typeparam> /// <param name="rel">Unary relation</param> /// <param name="x">Element to remove</param> /// <returns>Updated relation</returns> public static ImmutableRelation <T> Remove <T>(this ImmutableRelation <T> rel, T x) where T : class { return(rel.Remove(x == null ? ItemMatcher <T> .Any : new ItemMatcher <T>(x))); }
/// <summary> /// Searches for the specified element. /// </summary> /// <typeparam name="T">Type of elements stored in the relation</typeparam> /// <param name="rel">Unary relation</param> /// <param name="x">Element to look for</param> /// <returns>Sequence of occurences (either empty or containing exactly one element)</returns> public static IEnumerable <T> Find <T>(this ImmutableRelation <T> rel, T?x) where T : struct { return(rel.Find(x == null ? ItemMatcher <T> .Any : new ItemMatcher <T>(x.Value))); }
/// <summary> /// Searches for the specified element. /// </summary> /// <typeparam name="T">Type of elements stored in the relation</typeparam> /// <param name="rel">Unary relation</param> /// <param name="x">Element to look for</param> /// <returns>Sequence of occurences (either empty or containing exactly one element)</returns> public static IEnumerable <T> Find <T>(this ImmutableRelation <T> rel, T x) where T : class { return(rel.Find(x == null ? ItemMatcher <T> .Any : new ItemMatcher <T>(x))); }
/// <summary> /// Creates an empty unary relation, using the supplied <see cref="IEqualityComparer{T}"/>. /// This is a degenerated case, since it's principally the same as on ordinary hash set. /// </summary> /// <typeparam name="T">Type of elements to be stored in the relation</typeparam> public static ImmutableRelation <T> Create <T>(IEqualityComparer <T> ec) { return(ImmutableRelation <T> .Create(new TupleProjector <T>(ec))); }
/// <summary> /// Creates an empty unary relation, using the default <see cref="EqualityComparer{T}"/>. /// This is a degenerated case, since it's principally the same as on ordinary hash set. /// </summary> /// <typeparam name="T">Type of elements to be stored in the relation</typeparam> public static ImmutableRelation <T> Create <T>() { return(ImmutableRelation <T> .Create(new TupleProjector <T>(null))); }
public Bucket(TupleType item, ImmutableRelation <TupleType> subrel) { Item = item; Subrel = subrel; ItemValid = true; }
public Bucket(ImmutableRelation <TupleType> subrel) { Item = default; Subrel = subrel; ItemValid = false; }
public Bucket(TupleType item) { Item = item; Subrel = null; ItemValid = true; }