Esempio n. 1
0
        public void TestNeighbors0Radius()
        {
            CoordinateEncoder ce = new CoordinateEncoder();

            int[]        coordinate = new[] { 100, 200, 300 };
            int          radius     = 0;
            List <int[]> neighbors  = ce.Neighbors(coordinate, radius);

            Assert.AreEqual(1, neighbors.Count);
            Assert.IsTrue(ArrayUtils.Contains(new[] { 100, 200, 300 }, neighbors));
        }
Esempio n. 2
0
        public void TestNeighbors1D()
        {
            CoordinateEncoder ce = new CoordinateEncoder();

            int[]        coordinate = { 100 };
            int          radius     = 5;
            List <int[]> neighbors  = ce.Neighbors(coordinate, radius);

            Assert.AreEqual(11, neighbors.Count);
            Assert.IsTrue(Arrays.AreEqual(new[] { 95 }, neighbors[0]));
            Assert.IsTrue(Arrays.AreEqual(new[] { 100 }, neighbors[5]));
            Assert.IsTrue(Arrays.AreEqual(new[] { 105 }, neighbors[10]));
        }