Class CanonicalMultiplicitiesVectorCalculator

java.lang.Object
solvers.utilities.CanonicalMultiplicitiesVectorCalculator

public class CanonicalMultiplicitiesVectorCalculator extends Object
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 Details

    • CanonicalMultiplicitiesVectorCalculator

      public CanonicalMultiplicitiesVectorCalculator(QNModel qnm)
      Creates and initialises a CanonicalMultiplicitiesVectorCalculator object.
      Parameters:
      qnm - The QNModel we are working on
  • Method Details

    • findMulVectorsSummingExactlyTo

      public List<MultiplicitiesVector> findMulVectorsSummingExactlyTo(int level)
      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

      public List<MultiplicitiesVector> 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).
      Parameters:
      level - The level is equal to the sum of the elements of each MultiplicitiesVector
      Returns:
      The set of the corresponding vectors
    • inttovec

      public MultiplicitiesVector inttovec(int index) throws InternalErrorException
      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

      public int vectoint(MultiplicitiesVector v)
      Returns the index of a vector in the canonical ordering.
      Parameters:
      v - The vector
      Returns:
      The corresponding canonical index