Python中的SymPy Partition.next_lex()
Partition.next_lex() : next_lex()是一个sympy Python库函数,它返回下一个整数分区,n为lexicographical顺序。如果分区是[1,…,1],这个排序就会环绕[n]。
**语法 : ** sympy.combinatorics.partitions.Partition.next_lex()
返回 :下一个整数分区,n为lexicographical顺序
代码 #1 : next_lex() 示例
Python3 1=1
输出 :
p : [312, 121, 14, 5] Next Integer : [312, 121, 15, 1, 1, 1, 1]
代码#2:next_lex()示例
Python3 1=1
输出 :
p : [312, 121, 56, 34, 32, 14, 1] Next Integer : [312, 121, 56, 34, 32, 15]