Object MomUtils

  • All Implemented Interfaces:

    
    public class MomUtils
    
                        

    MOM-specific utility functions for combinatorial operations Complements the existing jline.util.Maths class

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static MomUtils INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Array<IntArray> sortByNnzPos(Array<IntArray> combinations) Sort combinations by number of non-zeros and their positions This is used to optimize the order of processing in the solver
      final Integer countNonZeros(IntArray array) Count non-zero elements in an array
      final Integer hashPop(IntArray population, IntArray maxPop) Hash a population vector to a unique index This is used for efficient lookup of population states
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • sortByNnzPos

         final Array<IntArray> sortByNnzPos(Array<IntArray> combinations)

        Sort combinations by number of non-zeros and their positions This is used to optimize the order of processing in the solver

        Parameters:
        combinations - Array of combinations to sort
        Returns:

        Sorted array of combinations

      • countNonZeros

         final Integer countNonZeros(IntArray array)

        Count non-zero elements in an array

        Parameters:
        array - The array to count non-zeros in
        Returns:

        Number of non-zero elements

      • hashPop

         final Integer hashPop(IntArray population, IntArray maxPop)

        Hash a population vector to a unique index This is used for efficient lookup of population states

        Parameters:
        population - The population vector
        maxPop - Maximum population per class (for hash calculation)
        Returns:

        Hash index