code: public double mahalanobisDistance(NumberVector vec) {
      // TODO: this allocates one array.
      return squareSum(chol.solveLInplace(minusEquals(vec.toArray(), mean)));
    }
docs: Compute the Mahalanobis distance from the centroid for a given vector.
  
  Note: used by P3C.
  
  @param vec Vector
  @return Mahalanobis distance