allow minimum and maximum over a subvector