public void TestTwoDimensionalSparse() { List <int> sparse = new List <int> { 1, 6, 8, 63 }; Sdr sut = new Sdr(new int[] { 8, 8 }); sut.SetSparse(sparse); List <int> result = sut.GetSparse(); Assert.AreEqual(sparse, result); }
public void TestTwoDimensionalDenseFromSparse() { List <byte> expected = new List <byte> { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 }; List <int> sparse = new List <int> { 0, 1, 14, 15 }; Sdr sut = new Sdr(new int[] { 8, 2 }); sut.SetSparse(sparse); List <byte> result = sut.GetDense(); Assert.AreEqual(expected, result); }