Python SymPy Permutation.full_cyclic_form()方法

Python SymPy Permutation.full_cyclic_form()方法

Permutation.full_cyclic_form() : full_cyclic_form()是一个Sympy Python库函数,通过包括单子,返回循环形式的包络。

语法 : sympy.combinatorics.permutations.Permutation.full_cyclic_form()

返回 :
循环形式的互换

代码 #1 : full_cyclic_form() 示例

# Python code explaining
# SymPy.Permutation.full_cyclic_form()
  
# importing SymPy libraries
from sympy.combinatorics.partitions import Partition
from sympy.combinatorics.permutations import Permutation
  
# Using from sympy.combinatorics.permutations.Permutation.full_cyclic_form() method 
  
# creating Permutation
a = Permutation([2, 0, 3, 1, 5, 4])
  
b = Permutation([3, 1, 2, 5, 4, 0])
  
  
print ("Permutation a - full_cyclic_form form : ", a.full_cyclic_form)
print ("Permutation b - full_cyclic_form form : ", b.full_cyclic_form)

输出 :

Permutation a – full_cyclic_form form : [[0, 2, 3, 1], [4, 5]]
Permutation b – full_cyclic_form form : [[0, 3, 5], [1], [2], [4]]

代码 #2 : full_cyclic_form() 示例 – 二维排列

# Python code explaining
# SymPy.Permutation.full_cyclic_form()
  
# importing SymPy libraries
from sympy.combinatorics.partitions import Partition
from sympy.combinatorics.permutations import Permutation
  
# Using from 
# sympy.combinatorics.permutations.Permutation.full_cyclic_form() method 
  
# creating Permutation
a = Permutation([[2, 4, 0], 
                 [3, 1, 2],
                 [1, 5, 6]])
      
print ("Permutation a - full_cyclic_form form : ", a.full_cyclic_form)

输出 :

Permutation a – full_cyclic_form form : [[0, 3, 5, 6, 1, 2, 4]]

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程