NZMATH  1.2.0 About: NZMATH is a Python based number theory oriented calculation system.   Fossies Dox: NZMATH-1.2.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)
nzmath.factor.util.FactoringInteger Class Reference
Inheritance diagram for nzmath.factor.util.FactoringInteger:
[legend]
Collaboration diagram for nzmath.factor.util.FactoringInteger:
[legend]

## Public Member Functions

def __init__ (self, number)

def register (self, divisor, isprime=Unknown)

def replace (self, number, factors)

def getMatchingFactor (self, number)

def getCompositeFactor (self)

def getNextTarget (self, cond=None)

def getResult (self)

def setPrimality (self, number, isprime)

def sortFactors (self)

number

factors

primality

## Detailed Description

```A class for keeping track of factorization.
```

Definition at line 141 of file util.py.

## ◆ __init__()

 def nzmath.factor.util.FactoringInteger.__init__ ( self, number )
```The given number must be a composite.
```

Definition at line 145 of file util.py.

## ◆ getCompositeFactor()

 def nzmath.factor.util.FactoringInteger.getCompositeFactor ( self )
```Return a composite (or unknown primality) factor from factors
in a form (base, index), whose base's primality is non-True.

If there is no such factor, LookupError will be raised.
```

Definition at line 218 of file util.py.

## ◆ getMatchingFactor()

 def nzmath.factor.util.FactoringInteger.getMatchingFactor ( self, number )
```Find a factor matching to number.
```

Definition at line 208 of file util.py.

Referenced by nzmath.factor.util.FactoringInteger.replace().

## ◆ getNextTarget()

 def nzmath.factor.util.FactoringInteger.getNextTarget ( self, cond = `None` )
```Return the next target which meets 'cond'.  if 'cond' is not
specified, then the next target is a composite (or unknown
primality) factor of self.number.  'cond' can be a binary
(arguments are base and index) predicate.

If there is no such factor, LookupError will be raised.
```

Definition at line 231 of file util.py.

## ◆ getResult()

 def nzmath.factor.util.FactoringInteger.getResult ( self )
```Return the factors in the form of [(base, index), ...].
```

Definition at line 248 of file util.py.

## ◆ register()

 def nzmath.factor.util.FactoringInteger.register ( self, divisor, isprime = `Unknown` )
```Register a divisor of the number, if the divisor is a true
divisor of the number.  The number is divided by the divisor
as many times as possible.
```

Definition at line 153 of file util.py.

Referenced by nzmath.factor.util.FactoringInteger.register().

## ◆ replace()

 def nzmath.factor.util.FactoringInteger.replace ( self, number, factors )
```Replace a number with factors.
The number is a one of known factors of tracked number.
factors is a list of (base, index) pairs.
It is assumed that number = product of factors.
```

Definition at line 185 of file util.py.

Referenced by nzmath.factor.util.FactoringInteger.register().

## ◆ setPrimality()

 def nzmath.factor.util.FactoringInteger.setPrimality ( self, number, isprime )
```Set primality for number to isprime.
```

Definition at line 254 of file util.py.

## ◆ sortFactors()

 def nzmath.factor.util.FactoringInteger.sortFactors ( self )
```Sort factors list. Return nothing.
```

Definition at line 260 of file util.py.

## ◆ number

 nzmath.factor.util.FactoringInteger.number

Definition at line 149 of file util.py.

## ◆ primality

 nzmath.factor.util.FactoringInteger.primality

The documentation for this class was generated from the following file: