コード例 #1
0
        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;
        }
コード例 #2
0
 /// <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)));
 }
コード例 #3
0
 /// <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)));
 }
コード例 #4
0
 /// <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)));
 }
コード例 #5
0
 /// <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)));
 }
コード例 #6
0
 /// <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)));
 }
コード例 #7
0
 /// <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)));
 }
コード例 #8
0
 public Bucket(TupleType item, ImmutableRelation <TupleType> subrel)
 {
     Item      = item;
     Subrel    = subrel;
     ItemValid = true;
 }
コード例 #9
0
 public Bucket(ImmutableRelation <TupleType> subrel)
 {
     Item      = default;
     Subrel    = subrel;
     ItemValid = false;
 }
コード例 #10
0
 public Bucket(TupleType item)
 {
     Item      = item;
     Subrel    = null;
     ItemValid = true;
 }