Class MultiplicitiesVector
java.lang.Object
java.util.AbstractCollection<Integer>
java.util.AbstractList<Integer>
java.util.ArrayList<Integer>
solvers.dataStructures.EnhancedVector
solvers.dataStructures.MultiplicitiesVector
- All Implemented Interfaces:
Serializable, Cloneable, Comparable<EnhancedVector>, Iterable<Integer>, Collection<Integer>, List<Integer>, RandomAccess, SequencedCollection<Integer>
This class implements the MultiplicitiesVector object, which is used to
store a multiplicities vector. It extends an EnhancedVector object.
- Author:
- Michail Makaronidis, 2010
- See Also:
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty MultiplicitiesVector object.MultiplicitiesVector(int k, int length) Creates a new MultiplicitiesVector of specific lenth, where all elements are equal to a specific value.Creates an MultiplicitiesVector with content equal to the given matrix. -
Method Summary
Modifier and TypeMethodDescriptionAdds two vectors.copy()This method returns a copy of the current MultiplicitiesVector object.intAdded by Haixiao SuintAdded by Jack Bradshaw.Methods inherited from class EnhancedVector
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
-
MultiplicitiesVector
public MultiplicitiesVector()Creates an empty MultiplicitiesVector object. -
MultiplicitiesVector
Creates an MultiplicitiesVector with content equal to the given matrix.- Parameters:
M- The matrix containing the vector elements
-
MultiplicitiesVector
public MultiplicitiesVector(int k, int length) Creates a new MultiplicitiesVector of specific lenth, where all elements are equal to a specific value.- Parameters:
k- The value of all elementslength- The length of the MultiplicitiesVector
-
-
Method Details
-
copy
This method returns a copy of the current MultiplicitiesVector object. Position and delta stacks are disregarded.- Overrides:
copyin classEnhancedVector- Returns:
- Copy of the initial MultiplicitiesVector object.
-
addVec
Description copied from class:EnhancedVectorAdds two vectors. The vectors must be of the same size.- Overrides:
addVecin classEnhancedVector- Parameters:
b- Vector to add- Returns:
- The result of the addition
-
whichSingleQueueAdded
Added by Jack Bradshaw.- Returns:
- The position of the entry that contains at 1
- Throws:
InternalErrorException- if more or less than one queue added.
-
isNearlyAllOneElements
public int isNearlyAllOneElements()Added by Haixiao Su- Returns:
- The position of the element that is not 1 if that's the only element that is not 1, otherwise return -1.
-