예제 #1
0
        public void Normal500()
        {
            var data = ReadPoints();

            var ltob    = new LTOBSampling();
            var sampled = ltob.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, ltob.AlignMode);
        }
예제 #2
0
        public void AlignRightTest()
        {
            var data = ReadPoints();
            var ltob = new LTOBSampling {
                AlignMode = AlignModes.Right
            };
            var sampled = ltob.Down(data, 500);

            Assert.NotNull(sampled);
            Assert.Equal(500, sampled.Length);

            WritePoints(sampled, ltob.AlignMode);
        }