public override float[] PredictStrength(BaseVector x)
 {
     double[] projectedTest = MatrixUtils.VectorTimesMatrix(x, projection);
     float[] distances = new float[ngroups];
     IDistance distance = new EuclideanDistance();
     for (int j = 0; j < ngroups; j++){
         distances[j] = -(float) distance.Get(projectedTest, projectedGroupMeans[j]);
     }
     return distances;
 }
        public void TestGeneralDistanceMatrix()
        {
            var distance = new EuclideanDistance();
            var distanceMatrix = new GenericDistanceMatrix(new FloatMatrixIndexer(new float[,] { {0,0}, {1,0}, {3,0} }), distance);
            Assert.AreEqual(0, distanceMatrix[0,0]);
            Assert.AreEqual(0, distanceMatrix[2,2]);
            Assert.AreEqual(distanceMatrix[1,2], distanceMatrix[2,1]);
            Assert.AreEqual(1, distanceMatrix[1,0]);
            Assert.AreEqual(2, distanceMatrix[1,2]);

            distanceMatrix[0, 1] = -1;
            Assert.AreEqual(-1, distanceMatrix[0, 1]);
        }