Testing and sorting
In order to test whether we have a PARTITION of rectangle shape
the following routine helps:
Sometimes it is useful to sort an INTEGER vector, so that the
result is a PARTITIONobject. This is done in the routine:
- NAME: rectanglep
- SYNOPSIS: INT rectanglep(OP part)
- DESCRIPTION: returns TRUE if of rectangle shape FALSE in the
else case. Works for VECTOR type and EXPONENT type.
- NAME: m_v_pa means make_vector_partition
INT m_v_pa(OP vec, result)
- DESCRIPTION: The vec must be a VECTORobject with
nonnegative INTEGERobjects. This vector will be sorted and it
self part of the result which becomes a PARTITIONobject.
As the name make_ .. says the vec will be copied. So you
can still use the unsorted INTEGER vector vec. In the case
b_v_pa the sorted vector becomes part of the PARTITION
in the case of m_v_pa vec and result may be equal.
ERROR if negative entries,
ERROR if not INTEGER entries, else
last changed: November 19, 2001