Exemplo n.º 1
0
        public void SparseCoordinatesAreCorrect()
        {
            var coordinates   = new[] { 2, 3, 6, 7, 8 };
            var values        = new uint[] { 1, 2, 3, 4, 5 };
            var missingValues = new uint[] { 0, 6 };
            var point         = new HyperContrastedPoint(coordinates, values, 10, missingValues);

            for (var i = 0; i < coordinates.Length; i++)
            {
                Assert.AreEqual(values[i], point.Coordinates[coordinates[i]]);
            }
        }
Exemplo n.º 2
0
        public void MissingCoordinatesAreCorrect()
        {
            var coordinates   = new[] { 2, 3, 6, 7, 8 };
            var values        = new uint[] { 1, 2, 3, 4, 5 };
            var missingValues = new uint[] { 0, 6 };
            var point         = new HyperContrastedPoint(coordinates, values, 10, missingValues);

            for (var i = 0; i < point.Dimensions; i++)
            {
                if (coordinates.Contains(i))
                {
                    continue; // Not a missing value
                }
                Assert.IsTrue(missingValues.Contains(point.Coordinates[i]));
            }
        }