public override void AssertEquality(Bitmap64 _other) { DiffSetRL2_64 other = _other as DiffSetRL2_64; if (this.N != other.N) { throw new ArgumentException ("DiffSetRL2_64 N difference"); } if (this.M != other.M) { throw new ArgumentException ("DiffSetRL2_64 M difference"); } if (this.B != other.B) { throw new ArgumentException ("DiffSetRL2_64 B difference"); } Assertions.AssertIList<long> (this.Samples, other.Samples, "DiffSetRL2_64 Samples difference"); Assertions.AssertIList<long> (this.Offsets, other.Offsets, "DiffSetRL2_64 Offsets difference"); this.Stream.AssertEquality (other.Stream); }
public abstract void AssertEquality(Bitmap64 other);
public void Build(IList<int> seq, int sigma, int t = 16, BitmapFromList64 bitmap_builder = null) { this.sigma = sigma; long n = seq.Count; var L = new long[n]; var counters = new int[sigma + 1]; // counters.Add (0, sigma); <- if ListIFS for (int i = 0; i < n; ++i) { var sym = seq [i]; try { counters [sym + 1] += 1; } catch (Exception e) { Console.WriteLine ("===== sigma: {0}, sym: {1}, i: {2}, n: {3}", sigma, sym, i, n); throw e; } } for (int i = 1; i <= sigma; ++i) { counters [i] += counters [i - 1]; } for (int i = 0; i < n; ++i) { var sym = seq [i]; long long_sym = n * ((long)sym) + i; L [counters [sym]] = long_sym; counters [sym] += 1; } counters = null; /**** slow construction ****/ /***** for (int i = 0; i < n; ++i) { long s = seq [i]; L [i] = n * s + i; //L.Add (n * s + i); } Array.Sort (L); *****/ if (bitmap_builder == null) { bitmap_builder = BitmapBuilders.GetSArray64 (); } this.xl_bitmap = bitmap_builder (L, n * sigma); // now building the permutation for access var p = new ListGen_MRRR (); p.Build (this.GetNotIdxPERM (), t, null); this.perm = p; }
public override void AssertEquality(Bitmap64 obj) { var other = obj as SArray64; if (this.N != other.N) { throw new ArgumentException (String.Format ("SArray.N inequality. this.N {0}, other.N: {1}", this.N, other.N)); } this.H.AssertEquality (other.H); Assertions.AssertIList<int> (this.L, other.L, "SArray.L"); }
public void Load(BinaryReader Input) { this.sigma = Input.ReadInt32 (); this.xl_bitmap = GenericIO<Bitmap64>.Load (Input); var p = new ListGen_MRRR (); p.Load (Input); p.SetPERM (this.GetNotIdxPERM ()); this.perm = p; }