Package io.github.skenvy
Class Collatz.TreeGraph
- java.lang.Object
-
- io.github.skenvy.Collatz.TreeGraph
-
-
Constructor Summary
Constructors Constructor Description TreeGraph(Collatz.TreeGraphNode root)Create a new TreeGraph by directly passing it the root node.TreeGraph(BigInteger nodeValue, int maxOrbitDistance, BigInteger p, BigInteger a, BigInteger b)Create a new TreeGraph with the root node defined by the inputs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)The equality betweenTreeGraph's is determined by the equality check on subtrees.inthashCode()The hashCode of a TreeGraph is determined by the hash of the root node.
-
-
-
Constructor Detail
-
TreeGraph
public TreeGraph(BigInteger nodeValue, int maxOrbitDistance, BigInteger p, BigInteger a, BigInteger b) throws Collatz.FailedSaneParameterCheck
Create a new TreeGraph with the root node defined by the inputs.- Parameters:
nodeValue- The value for which to find the tree graph node reversal.maxOrbitDistance- The maximum distance/orbit/branch length to travel.p- Modulus used to devide n, iff n is equivalent to (0 mod P).a- Factor by which to multiply n.b- Value to add to the scaled value of n.- Throws:
Collatz.FailedSaneParameterCheck- if P or a are 0.
-
TreeGraph
public TreeGraph(Collatz.TreeGraphNode root)
Create a new TreeGraph by directly passing it the root node. Intended to be used in testing by manually creating trees.- Parameters:
root- The root node of the tree.
-
-