public ExecutionOutput(TimeSpan time, MemorySpan memory, string result, int exitCode) { this.Time = time; this.Memory = memory; this.Result = result; this.ExitCode = exitCode; }
/// <summary> /// /// </summary> public static List <float> Decompress(byte[] values) { var memory = new MemorySpan(values); var type = memory.ReadByte(); List <float> re = new List <float>(300); var dval = (float)Math.Pow(10, type); if (type == byte.MaxValue) { while (memory.Position < memory.Length) { re.Add(memory.ReadFloat()); } } else { var val = memory.ReadFloat(); re.Add(val); using (ProtoMemory vmemory = new ProtoMemory(values.AsSpan().Slice(9).ToArray())) { while (vmemory.ReadPosition < vmemory.DataBuffer.Length) { val += (vmemory.ReadSInt32() / dval); re.Add(val); } } } return(re); }
public Sampler(MklRng src, S distspec, int?bufferLen = null) { this.Source = src; this.BufferLength = bufferLen ?? Pow2.T14; this.Buffer = MemorySpan.Alloc <T>(this.BufferLength); this.Remaining = 0; this.DistSpec = distspec; }
public void BinaryStreamTests_MemorySpanTest() { MemorySpan span = new MemorySpan(new byte[0]); span.WriteBytes(ArrayUtils.CreateArray <byte>(1000, 0)); span.Offset = 0; byte[][] buffers = Binary.SplitBytes(span, 90); for (int i = 0; i < buffers.Length; ++i) { Console.WriteLine(buffers[i].Length); } }
public ExecutingOptions(TimeSpan timeLimit, MemorySpan memoryLimit) { this.TimeLimit = timeLimit; this.MemoryLimit = memoryLimit; }