Package de.tilman_neumann.jml.partitions
Class IntegerPartition
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.TreeMap<T,Integer>
-
- org.matheclipse.core.numbertheory.SortedMultiset_BottomUp<Integer>
-
- de.tilman_neumann.jml.partitions.IntegerPartition
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<SortedMultiset<Integer>>
,Map<Integer,Integer>
,NavigableMap<Integer,Integer>
,SortedMap<Integer,Integer>
,Multiset<Integer>
,SortedMultiset<Integer>
public class IntegerPartition extends SortedMultiset_BottomUp<Integer>
Integer partition, with nice String output.- Author:
- Tilman Neumann
- 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 IntegerPartition(int[] elements)
Constructor from flat element array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigInteger
getNumberOfRealizations()
int
sum()
String
toString()
Returns a sum-like representation of the additive multiset, with distinct keys separated by "+" and the multiplicity indicated by "*".-
Methods inherited from class org.matheclipse.core.numbertheory.SortedMultiset_BottomUp
add, add, addAll, addAll, addAll, compareTo, equals, getBiggestElement, getSmallestElement, getTopDownIterator, hashCode, intersect, remove, remove, removeAll, toList, toString, totalCount
-
Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clear, clone, 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, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
-
Methods inherited from class java.util.AbstractMap
isEmpty
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, get, getOrDefault, isEmpty, merge, put, putAll, putIfAbsent, remove, replace, replace, replaceAll, size
-
Methods inherited from interface org.matheclipse.core.numbertheory.SortedMultiset
entrySet
-
-
-
-
Method Detail
-
sum
public int sum()
- Returns:
- the sum over all entries, taking into account their frequencies.
-
getNumberOfRealizations
public BigInteger getNumberOfRealizations()
- Returns:
- The number of ways to realize this partition.
-
-