function partition input Real A[:]; input Integer p; input Integer r; input Integer I[:]; output Integer n; output Real B[size(A, 1)]; output Integer J[size(A, 1)]; end partition;