📜  Python| SymPy Permutation.full_cyclic_form() 方法

📅  最后修改于: 2022-05-13 01:54:31.060000             🧑  作者: Mango

Python| SymPy Permutation.full_cyclic_form() 方法

Permutation.full_cyclic_form() :full_cyclic_form()是一个 sympy Python库函数,它通过包含单例返回循环形式的排列。

代码 #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)

输出 :

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

# 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)

输出 :