mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-04-29 06:48:41 +00:00
example
This commit is contained in:
@@ -3,29 +3,26 @@ using Esiur.Data.Gvwie;
|
||||
using Esiur.Tests.Gvwie;
|
||||
using MessagePack;
|
||||
|
||||
var e = GroupInt32Codec.Encode(new int[] {-12000, 15000, -1, 32760 });
|
||||
//var e = GroupInt32Codec.Encode(new int[] {-12000, 15000, -1, 32760 });
|
||||
|
||||
var s = new int[] { 1, -1, 2, 300, 301, 200,1, 302 };
|
||||
|
||||
var e = GroupInt32Codec.Encode(s);
|
||||
|
||||
var d = GroupInt32Codec.Decode(e);
|
||||
|
||||
if (d.SequenceEqual(s))
|
||||
Console.WriteLine("Example passed.");
|
||||
|
||||
var test = IntArrayGenerator.GenerateInt32(5000, GeneratorPattern.Uniform);
|
||||
|
||||
var aligned = GroupInt32Codec.Encode(test, true);
|
||||
var nonAligned = GroupInt32Codec.Encode(test, false);
|
||||
|
||||
var result1 = GroupInt32Codec.Decode(aligned);
|
||||
var result2 = GroupInt32Codec.Decode(nonAligned);
|
||||
|
||||
if (result1.SequenceEqual(result2))
|
||||
Console.WriteLine($"Passed {aligned.Length}");
|
||||
|
||||
if (result1.SequenceEqual(test))
|
||||
Console.WriteLine($"Passed {nonAligned.Length}");
|
||||
|
||||
MessagePack.MessagePackSerializer.DefaultOptions = MessagePackSerializerOptions.Standard
|
||||
.WithCompression(MessagePackCompression.None); // optional; remove if you want raw size
|
||||
|
||||
|
||||
var ints = new IntArrayRunner();
|
||||
//IntArrayGenerator.InitRng();
|
||||
//ints.Run();
|
||||
IntArrayGenerator.InitRng();
|
||||
ints.Run();
|
||||
IntArrayGenerator.InitRng();
|
||||
ints.RunChart();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user