Package cc.redberry.rings.poly.multivar
Class MonomialSet<Term extends AMonomial<Term>>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.TreeMap<DegreeVector,Term>
-
- cc.redberry.rings.poly.multivar.MonomialSet<Term>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Term>
,Map<DegreeVector,Term>
,NavigableMap<DegreeVector,Term>
,SortedMap<DegreeVector,Term>
public final class MonomialSet<Term extends AMonomial<Term>> extends TreeMap<DegreeVector,Term> implements Iterable<Term>, Cloneable
Sorted set of monomials -- basic underlying data structure of multivariate polynomials.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description MonomialSet(Comparator<? super DegreeVector> comparator)
MonomialSet(SortedMap<DegreeVector,? extends Term> m)
Constructs a new monomial set containing the same mappings and using the same ordering as the specified sorted map.
-
Method Summary
Modifier and Type Method Description Term
add(Term term)
Add monomial to this setIterator<Term>
ascendingIterator()
MonomialSet<Term>
clone()
Collection<Term>
collection()
int[]
degrees()
default int
degreeSum()
Returns the sum ofdegrees()
Iterator<Term>
descendingIterator()
Term
first()
First monomial in this setint
hashCode()
Iterator<Term>
iterator()
Term
last()
Last monomial in this setdefault Term
lt()
int
size()
int
skeletonHashCode()
-
Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clear, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
-
Methods inherited from class java.util.AbstractMap
equals, isEmpty, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, isEmpty, merge, putIfAbsent, remove
-
-
-
-
Constructor Detail
-
MonomialSet
public MonomialSet(Comparator<? super DegreeVector> comparator)
-
MonomialSet
public MonomialSet(SortedMap<DegreeVector,? extends Term> m)
Constructs a new monomial set containing the same mappings and using the same ordering as the specified sorted map. This method runs in linear time.- Parameters:
m
- the sorted map whose mappings are to be placed in this monomial set, and whose comparator is to be used to sort this map
-
-
Method Detail
-
first
public Term first()
First monomial in this set
-
last
public Term last()
Last monomial in this set
-
collection
public Collection<Term> collection()
-
degrees
public int[] degrees()
-
clone
public MonomialSet<Term> clone()
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceMap<DegreeVector,Term extends AMonomial<Term>>
- Overrides:
hashCode
in classAbstractMap<DegreeVector,Term extends AMonomial<Term>>
-
skeletonHashCode
public int skeletonHashCode()
-
lt
public default Term lt()
-
size
public abstract int size()
-
degreeSum
public default int degreeSum()
Returns the sum ofdegrees()
- Returns:
- sum of
degrees()
-
-