lima.mathematical.factorisation
Class Factorisation

java.lang.Object
  |
  +--lima.mathematical.factorisation.Factorisation

public final class Factorisation
extends java.lang.Object

An object of this class represents the current state of a factorisation, consisting of a set of prime factors and a single composite factor. The composite factor can be targeted for further factorisation with a factorisation algorithm. When a factorisation algorithm discovers a new prime factor it may submit that prime factor to the factorisation object through the "expand" method, to further expand the factorisation. This method takes the single composite factor and repeatedly divides it with the prime factor specified, until the composite factor can be divided no further. After each successful division attempt a copy of the specified prime factor is automatically added to the set of prime factors. Numbers placed into the prime factor set are almost certainly prime, with certainty that is configurable. The single composite factor is guaranteed to be composite with absolute certainty.


Constructor Summary
Factorisation(java.math.BigInteger n)
          Construct a new factorisation object from the specified big integer.
 
Method Summary
 void expand(java.math.BigInteger primeFactor)
          Expand a factorisation object, with the specified prime factor.
 void expand(lima.mathematical.factorisation.Factorisation f)
          Expand a factorisation object, by specifying another factorisation object.
 java.math.BigInteger getCompositeFactor()
          Obtain the single composite factor.
 lima.mathematical.factorisation.Factor[] getPrimeFactors()
          Obtain the set of prime factors.
 java.math.BigInteger getTarget()
          Obtain the target integer.
 boolean isMaximal()
          Determine whether or not a factorisation object represents the maximal factorisation of its target integer.
static void main(java.lang.String[] args)
           
 java.lang.String toString()
          Generate a string representation of a factorisation object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Factorisation

public Factorisation(java.math.BigInteger n)
Construct a new factorisation object from the specified big integer. The specified big integer will become the target of the factorisation object.

Parameters:
n - - the big integer to be factorised.
Method Detail

getCompositeFactor

public java.math.BigInteger getCompositeFactor()
Obtain the single composite factor.


getPrimeFactors

public lima.mathematical.factorisation.Factor[] getPrimeFactors()
Obtain the set of prime factors.


getTarget

public java.math.BigInteger getTarget()
Obtain the target integer.


toString

public java.lang.String toString()
Generate a string representation of a factorisation object.

Overrides:
toString in class java.lang.Object
Returns:
String.

isMaximal

public boolean isMaximal()
Determine whether or not a factorisation object represents the maximal factorisation of its target integer. A factorisation is considered to be maximal when its single composite factor is equal to one and can be factorised no further.


expand

public void expand(java.math.BigInteger primeFactor)
Expand a factorisation object, with the specified prime factor. This method examines the single composite factor and repeatedly divides it with the prime factor specified, until the composite factor can be divided no further. After each successful division attempt a copy of the specified prime factor is automatically added to the set of prime factors.

Parameters:
primeFactor - - the prime factor with which to expand the factorisation.

expand

public void expand(lima.mathematical.factorisation.Factorisation f)
Expand a factorisation object, by specifying another factorisation object. This method attempts to expand the existing factorisation object with each of the prime factors contained in the specified factorisation object. This provides a convenient way of taking the prime factors in one factorisation object and using them to automatically expand another factorisation object.

Parameters:
f - - the factorisation object containing prime factors to expand with.

main

public static void main(java.lang.String[] args)