+

# SymPy | Partition.RGS_generalized () in Python

Limited growth lines — a line where each character a i leads to the block (B i ) to which the corresponding element belongs.

Syntax : sympy.combinatorics.partitions.Partition.RGS_generalized ()

Return: generalized unrestricted growth strings as row of matrix.

Code # 1: Example RGS_generalized ()

 `] `   ` # Python code explaining ` ` # SymPy.RGS_generalized () `   ` # import SymPy libraries ` ` from ` ` sympy.combinatorics.partitions ` ` import ` ` Partition ` ` from ` < code class = "plain"> sympy.combinatorics.partitions ` import ` ` RGS_generalized `   ` # Using the sympy.combinatorics.partitions.Partition.RGS_generalized () method ` ` p ` ` = ` ` RGS_generalized (` ` 3 ` `) `   ` print ` ` (` ` "Row of Matrx:" ` `, p) `` `

Output:

Row of Matrx:
Matrix ([[1, 1, 1, 1], [1, 2, 3, 0], [2, 5, 0, 0], [5, 0, 0, 0]])

Code # 2: Example RGS_generalized ()

 `] `   ` # Python code, explaining ` ` # SymPy.RGS_generalized () `   ` # import SymPy libraries ` ` from ` ` sympy.combinatorics.partitions ` ` import ` ` Partition ` ` from ` ` sympy.combinatorics.partitions ` ` import ` ` RGS_generalized `   ` # Using the sympy.combinatorics.partitions.Partition.RGS_generalized () method ` ` p ` ` = ` ` RGS_generalized (` ` - ` ` 1 ` )   ` print ( "Row of Matrx:" , p) `

Output:

Row of Matrx:
Matrix (0, 0, [])