Cat::CombinatorialClassWith2DBoxedRepresentation – the category of combinatorial classes with a 2D boxed-style representation

Cat::CombinatorialClassWith2DBoxedRepresentation represents the category of combinatorial classes with a 2D boxed-style representation.

→ Examples

Categories

Cat::CombinatorialClass

See Also:

combinat::integerMatrices, combinat::partitions, combinat::ribbons, combinat::ribbonsTableaux, combinat::skewPartitions, combinat::skewTableaux, combinat::tableaux

Details:

Entries

"printPrettyOptions"

A list of options to be passed to output::asciiArt::fromArray for pretty printing. Typical values are Compact, or Packed. For consistency in the output, most domains should not override this without good reason. On the other hand, a user may typically use this to customize the output for his particular problem by issuing something like myclass::printPrettyOptions := [ Packed ]

toArray – 2D content of an object

Cat::CombinatorialClassWith2DBoxedRepresentation::toArray(dom x)

Returns an array representing the 2D content of the object x.

If the array contains an element at position (row, col), then a box is to be drawn at this position with the element inside. Strings are drawn unquoted; in particular, the empty string "" gives empty boxes.

Uninitialized entries in the array are ignored. Hence, it is not a problem if the array is larger than strictly required. In particular, an empty object can safely be represented by an 1x1 array to work around the fact that 0x0 arrays are not allowed in MuPAD.

toArraySeparator – cell separators

Cat::CombinatorialClassWith2DBoxedRepresentation::toArraySeparator(dom x)

Returns an array representing which separators needs to be drawn around each cell. See output::asciiArt::fromArray for the exact syntax.

The default implementation is to draw boxes around each non empty cell.

toArrayVerticalAlignment – vertical alignment

Cat::CombinatorialClassWith2DBoxedRepresentation::toArrayVerticalAlignment(dom x)

Returns the position of the base line. This can be a row number (1 is the top row, -1 is the bottom row), Top, Center, or Bottom.

The default is to center vertically.

Example 1:

Many of the combinatorial classes in the combinat library have a 2D-boxed style representation. Here are some examples. Integer partitions:

combinat::partitions::printPretty([5, 3, 1])

+---+

|   |

+---+---+---+

|   |   |   |

+---+---+---+---+---+

|   |   |   |   |   |

+---+---+---+---+---+

 

Young tableaux:

combinat::tableaux([[6], [2, 4], [1, 2, 5]])

+---+

| 6 |

+---+---+

| 2 | 4 |

+---+---+---+

| 1 | 2 | 5 |

+---+---+---+

 

Ribbons tableaux:

combinat::ribbonsTableaux([[], [[3], [0, 0], [2, 0, 0, 2],

[1, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0]]])

+---+

|   |

+   +---+

| 3     |

+---+---+---+---+

|         2 |   |

+---+---+---+   +---+

|   | 1     |     2 |

+   +---+   +---+---+---+

| 1     |   | 1         |

+---+---+---+---+---+---+

 

Integer matrices:

combinat::integerMatrices::printPretty([[1, 2, 3],

[0, 1, 1], [2, 1, 0]])

+---+---+---+

| 1 | 2 | 3 |

+---+---+---+

| 0 | 1 | 1 |

+---+---+---+

| 2 | 1 | 0 |

+---+---+---+

 

Other objects in this category can be polyominoes, mazes, and so on.

Changes in MuPAD 3.1

New Function.