Class LexicographicalVectorComparator

java.lang.Object
org.uma.jmetal.util.comparator.LexicographicalVectorComparator
All Implemented Interfaces:
Comparator<double[]>

public class LexicographicalVectorComparator extends Object implements Comparator<double[]>
This class implements the Comparator interface for comparing two vectors. The order used is lexicographical numerical order.
Author:
Antonio J. Nebro <antonio@lcc.uma.es>
  • Constructor Details

    • LexicographicalVectorComparator

      public LexicographicalVectorComparator()
  • Method Details

    • compare

      public int compare(double[] x, double[] y)
      The compare method compare the objects o1 and o2.
      Specified by:
      compare in interface Comparator<double[]>
      Parameters:
      x - Vector (array) of double values
      y - Vector (array) of double values
      Returns:
      The following value: -1 if x < y, 1 if x > y or 0 otherwise.