Class SortVectorByhThenRmnz

java.lang.Object
solvers.basis.comparators.SortVectorByhThenRmnz
All Implemented Interfaces:
Comparator<EnhancedVector>

public class SortVectorByhThenRmnz extends Object implements Comparator<EnhancedVector>
A comparator to sort an array of Enhanced Vectors, to be used by Basis objects.
Author:
Jack Bradshaw
  • Constructor Details

    • SortVectorByhThenRmnz

      public SortVectorByhThenRmnz()
  • Method Details

    • compare

      public int compare(EnhancedVector v1, EnhancedVector v2)
      Compares two PopulationChangeVector objects.* for the fine grain Block Triangular Form. First vectors are compared at the number of non zero elements (h) Then the position of those elements based on right most nonzero Then the value at those positions, left to right leftmost non-zero is the smaller.
      Specified by:
      compare in interface Comparator<EnhancedVector>
      Parameters:
      v1 - the first vector to compare
      v2 - the second vector to compare
      Returns:
      -1 if this < o, 0 if this = o, 1 if this > o