You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/03/10 04:36:38 UTC

[GitHub] [commons-math] chentao106 opened a new pull request #124: MATH-1522 Remove generic parameter in ClusterEvaluator and ClusterRan…

chentao106 opened a new pull request #124: MATH-1522 Remove generic parameter in ClusterEvaluator and ClusterRan…
URL: https://github.com/apache/commons-math/pull/124
 
 
   MATH-1522 Remove generic parameter in ClusterEvaluator and ClusterRanking, then the object declarations can be easier, and can be reused.
   
   Before remove the generic parameter:
   ```java
   ClusterRanking<DoublePoint> evaluator = new SumOfClusterVariances<>();
   List<Cluster<DoublePoint>> clusters1 = ...
   evaluator.compute(clusters1); // It is OK.
   ...
   // The evaluator could be reused, but trigger a compile error
   List<Cluster<MyClusterable>> clusters2 = ...
   evaluator.compute(clusters2); // Compile error
   ```
   
   After remove the generic parameter:
   ```java
   // The variable define is simple now.
   ClusterRanking evaluator = new SumOfClusterVariances();
   ...
   List<Cluster<DoublePoint>> clusters1 = ...
   double score1 = evaluator.compute(clusters1); // OK.
   ...
   // It can be reused now.
   List<Cluster<MyClusterable>> clusters2 = ...
   double score2 = evaluator.compute(clusters2); // OK.
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [commons-math] asfgit closed pull request #124: MATH-1522 Remove generic parameter in ClusterEvaluator and ClusterRan…

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #124: MATH-1522 Remove generic parameter in ClusterEvaluator and ClusterRan…
URL: https://github.com/apache/commons-math/pull/124
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services