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.permute.Permute Class Reference

## Public Member Functions

def __init__ (self, value, key=None, flag=False)

def __getitem__ (self, other)

def __mul__ (self, other)

def __rmul__ (self, other)

def __div__ (self, other)

def __rdiv__ (self, other)

def __pow__ (self, other)

def __call__ (self, other)

def setKey (self, key=None)

def getValue (self)

def inverse (self)

def getGroup (self)

def numbering (self)

def order (self)

def ToTranspose (self)

def ToCyclic (self)

def sgn (self)

def types (self)

def ToMatrix (self)

def permute (self, lists)

def __eq__ (self, other)

def __ne__ (self, other)

def __repr__ (self)

def __str__ (self)

data

key

## Static Private Attributes

def __truediv__ = __div__

## Detailed Description

```This is a class for 'normal' type element in the permutation group.
Example, [2,3,1,5,4]
This means [1 2 3 4 5]
[2 3 1 5 4]
(It is 1:1 onto mapping, 1->2, 2->3, 3->1, 4->5, 5->4)
```

Definition at line 7 of file permute.py.

## ◆ __init__()

 def nzmath.permute.Permute.__init__ ( self, value, key = `None`, flag = `False` )
```You can initialize with various one-to-one onto mapping.
Example,
Permute([2,3,4,5,1]) -> normal type
Permute(['b','c','d','e','a'], 1) -> [2,3,4,5,1]-normal type(identity is ascending order)
Permute(['b','c','d','e','a'], -1) -> [4,3,2,1,5]-normal type(identity is descending order)
Permute(['b','c','d','e','a'], ['b','a', 'c','d','e']) -> [1,3,4,5,2]-normal type(identity=key)
Permute({'a':'b','b':'c','c':'d','d':'e','e':'a'}) -> [2,3,4,5,1]-normal type
```

Definition at line 17 of file permute.py.

## ◆ __call__()

 def nzmath.permute.Permute.__call__ ( self, other )

Definition at line 120 of file permute.py.

References nzmath.permute.Permute.permute().

## ◆ __div__()

 def nzmath.permute.Permute.__div__ ( self, other )

Definition at line 99 of file permute.py.

## ◆ __eq__()

 def nzmath.permute.Permute.__eq__ ( self, other )

## ◆ __getitem__()

 def nzmath.permute.Permute.__getitem__ ( self, other )

Definition at line 76 of file permute.py.

References nzmath.permute.Permute.data, and nzmath.permute.Permute.key.

## ◆ __mul__()

 def nzmath.permute.Permute.__mul__ ( self, other )
```Compute the multiplication, that is, the composite of two maps self \circ other.
The map is the application of `self` to the result of `other`.
```

Definition at line 83 of file permute.py.

## ◆ __ne__()

 def nzmath.permute.Permute.__ne__ ( self, other )

Definition at line 295 of file permute.py.

## ◆ __pow__()

 def nzmath.permute.Permute.__pow__ ( self, other )

## ◆ __rdiv__()

 def nzmath.permute.Permute.__rdiv__ ( self, other )

## ◆ __repr__()

 def nzmath.permute.Permute.__repr__ ( self )

Definition at line 298 of file permute.py.

References nzmath.permute.Permute.getValue(), and nzmath.permute.Permute.key.

## ◆ __rmul__()

 def nzmath.permute.Permute.__rmul__ ( self, other )

Definition at line 96 of file permute.py.

## ◆ __str__()

 def nzmath.permute.Permute.__str__ ( self )

Definition at line 301 of file permute.py.

References nzmath.permute.Permute.getValue(), and nzmath.permute.Permute.key.

## ◆ getGroup()

 def nzmath.permute.Permute.getGroup ( self )

Definition at line 162 of file permute.py.

References nzmath.permute.Permute.key.

## ◆ getValue()

 def nzmath.permute.Permute.getValue ( self )
```Return value of self.
```

Definition at line 149 of file permute.py.

## ◆ inverse()

 def nzmath.permute.Permute.inverse ( self )

Definition at line 155 of file permute.py.

## ◆ numbering()

 def nzmath.permute.Permute.numbering ( self )
```Return the number of self by the following numbering.

This is the inductive definition on the dimension.
It is symmetrical arranging.

Example,
2-dimension [1,2], [2,1]
3-dimension [1,2,3], [2,1,3], [1,3,2], [2,3,1], [3,1,2], [3,2,1]
4-dimension [1,2,3,4], [2,1,3,4], [1,3,2,4], [2,3,1,4], [3,1,2,4],
[3,2,1,4], ..., [4,3,2,1]
```

Definition at line 165 of file permute.py.

References nzmath.permute.Permute.data, and nzmath.bigrange.range().

## ◆ permute()

 def nzmath.permute.Permute.permute ( self, lists )
```permute list following with self permutation.

Warning: The method do not check the compatibility of `lists` and self.key (except dict type).
```

Definition at line 265 of file permute.py.

Referenced by nzmath.permute.Permute.__call__(), and nzmath.permute.ExPermute.__call__().

## ◆ setKey()

 def nzmath.permute.Permute.setKey ( self, key = `None` )
```Set other key.
The function may be used if you want to permute a different sequence with
the same permutation.
```

Definition at line 123 of file permute.py.

## ◆ sgn()

 def nzmath.permute.Permute.sgn ( self )
```This method returns sign.

If self is even permutation, that is, self can be written as a composition
of an even number of transpositions, it returns 1. Otherwise,that is, for odd
permutation, it returns -1.
```

Definition at line 236 of file permute.py.

References nzmath.permute.Permute.ToCyclic().

## ◆ ToCyclic()

 def nzmath.permute.Permute.ToCyclic ( self )
```This method returns cyclic type element of permutation group.
```

Definition at line 216 of file permute.py.

## ◆ ToMatrix()

 def nzmath.permute.Permute.ToMatrix ( self )
```This method returns the permutation matrix.
```

Definition at line 255 of file permute.py.

References nzmath.permute.Permute.data, and nzmath.bigrange.range().

## ◆ ToTranspose()

 def nzmath.permute.Permute.ToTranspose ( self )
```This method returns
2-dimensional cyclic type element of permutation group.

The method uses recursion.
```

Definition at line 197 of file permute.py.

References nzmath.permute.Permute.data, and nzmath.permute.Permute.key.

## ◆ types()

 def nzmath.permute.Permute.types ( self )
```This method returns 'type' defined by each cyclic element length.
```

Definition at line 246 of file permute.py.

References nzmath.bigrange.range(), and nzmath.permute.Permute.ToCyclic().

## ◆ __truediv__

 def nzmath.permute.Permute.__truediv__ = __div__
staticprivate

Definition at line 102 of file permute.py.

## ◆ key

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