Class PopulationChangeVector
java.lang.Object
java.util.AbstractCollection<Integer>
java.util.AbstractList<Integer>
java.util.ArrayList<Integer>
solvers.dataStructures.EnhancedVector
solvers.dataStructures.PopulationChangeVector
- All Implemented Interfaces:
Serializable, Cloneable, Comparable<EnhancedVector>, Iterable<Integer>, Collection<Integer>, List<Integer>, RandomAccess, SequencedCollection<Integer>
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:
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty PopulationChangeVector object.PopulationChangeVector(int k, int length) Creates a new PopulationChangeVector of specific length, where all elements are equal to a specific value.Creates an PopulationChangeVector with content equal to the given matrix. -
Method Summary
Methods inherited from class EnhancedVector
addVec, compareTo, containsMinusOne, copyTo, countNonZeroElements, countZeroElements, equalsIgnoreHistory, fillFromMyVector, findFirstNonZeroElement, getAsBigRational, isOneVector, isZeroVector, max, min, minusOne, plusOne, print, restore, subVec, sumMethods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Constructor Details
-
PopulationChangeVector
public PopulationChangeVector()Creates an empty PopulationChangeVector object. -
PopulationChangeVector
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 elementslength- The length of the PopulationChangeVector
-
-
Method Details
-
copy
This method returns a copy of the current PopulationChangeVector object. Position and delta stacks are disregarded.- Overrides:
copyin classEnhancedVector- 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
-