Package jline.lib.mom.util
Object MomUtils
-
- All Implemented Interfaces:
public class MomUtilsMOM-specific utility functions for combinatorial operations Complements the existing jline.util.Maths class
-
-
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 IntegercountNonZeros(IntArray array)Count non-zero elements in an array final IntegerhashPop(IntArray population, IntArray maxPop)Hash a population vector to a unique index This is used for efficient lookup of population states -
-
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
-
-
-
-