Class PopulationChangeVector

All Implemented Interfaces:
Serializable, Cloneable, Comparable<EnhancedVector>, Iterable<Integer>, Collection<Integer>, List<Integer>, RandomAccess, SequencedCollection<Integer>

public class PopulationChangeVector extends EnhancedVector
This class implements the PopulationChangeVector object, which are used in in the definition of the CoMoM basis. It extends an EnhancedVector object.
Author:
Jack Bradshaw, 2012
See Also:
  • Constructor Details

    • PopulationChangeVector

      public PopulationChangeVector()
      Creates an empty PopulationChangeVector object.
    • PopulationChangeVector

      public PopulationChangeVector(Integer[] P)
      Creates an PopulationChangeVector with content equal to the given matrix.
      Parameters:
      P - The matrix containing the vector elements
    • PopulationChangeVector

      public PopulationChangeVector(int k, int length)
      Creates a new PopulationChangeVector of specific length, where all elements are equal to a specific value.
      Parameters:
      k - The value of all elements
      length - The length of the PopulationChangeVector
  • Method Details

    • copy

      public PopulationChangeVector copy()
      This method returns a copy of the current PopulationChangeVector object. Position and delta stacks are disregarded.
      Overrides:
      copy in class EnhancedVector
      Returns:
      Copy of the initial PopulationChangeVector object.
    • sum

      public int sum(int from, int to)
    • sumTail

      public int sumTail(int index)
    • sumHead

      public int sumHead(int index)
    • RightMostNonZero

      public int RightMostNonZero()
      returns index of the right-most non-zero element indices start from 0