public void AlignRightTest() { var data = ReadPoints(); var lttb = new LTTBSampling { AlignMode = AlignModes.Right }; var sampled = lttb.Down(data, 500); Assert.NotNull(sampled); Assert.Equal(500, sampled.Length); WritePoints(sampled, lttb.AlignMode); }
public void Normal500() { var data = ReadPoints(); var lttb = new LTTBSampling(); var sampled = lttb.Down(data, 500); Assert.NotNull(sampled); Assert.Equal(500, sampled.Length); //var k = 0; //using var csv2 = new CsvFile("Algorithms/sampled.csv"); //while (true) //{ // var line = csv2.ReadLine(); // if (line == null) break; // Assert.Equal(line[0].ToInt(), sampled[k].Time); // Assert.True(Math.Abs(line[1].ToDouble() - sampled[k].Value) < 0.0001); // k++; //} WritePoints(sampled, lttb.AlignMode); }