Class CanonicalMultiplicitiesVectorCalculator
java.lang.Object
solvers.utilities.CanonicalMultiplicitiesVectorCalculator
This class implements a calculator of the canonical order of
MultiplicitiesVector objects. By the canonical ordering, vectors are first
compared by the sum of their elements (greater sum means greater vector);
if the sums are equal, the vector with the greater leftmost element is greater.
- Author:
- Michail Makaronidis, 2010
-
Constructor Summary
ConstructorsConstructorDescriptionCreates and initialises a CanonicalMultiplicitiesVectorCalculator object. -
Method Summary
Modifier and TypeMethodDescriptionfindMulVectorsSummingExactlyTo(int level) This returns an ordered set containing the MultiplicitiesVectors the elements of which have sum equal to a specific number (level).findMulVectorsSummingUpTo(int level) This returns an ordered set containing the MultiplicitiesVectors the elements of which have sum less than or equal to a specific number (level).inttovec(int index) Returns the index'th vector of the canonical ordering.intReturns the index of a vector in the canonical ordering.
-
Constructor Details
-
CanonicalMultiplicitiesVectorCalculator
Creates and initialises a CanonicalMultiplicitiesVectorCalculator object.- Parameters:
qnm- The QNModel we are working on
-
-
Method Details
-
findMulVectorsSummingExactlyTo
This returns an ordered set containing the MultiplicitiesVectors the elements of which have sum equal to a specific number (level).- Parameters:
level- The level is equal to the sum of the elements of each MultiplicitiesVector- Returns:
- The set of the corresponding vectors
-
findMulVectorsSummingUpTo
This returns an ordered set containing the MultiplicitiesVectors the elements of which have sum less than or equal to a specific number (level).- Parameters:
level- The level is equal to the sum of the elements of each MultiplicitiesVector- Returns:
- The set of the corresponding vectors
-
inttovec
Returns the index'th vector of the canonical ordering.- Parameters:
index- The canonical position of the vector- Returns:
- The corresponding vector
- Throws:
InternalErrorException- Thrown when the index given does not correspond to vectors with sum greater than QNModel.R
-
vectoint
Returns the index of a vector in the canonical ordering.- Parameters:
v- The vector- Returns:
- The corresponding canonical index
-