implement toPtrArray for Array2DHashSet to allow iterating over elements easily