hybrid min_rank
forgot to return result
added dense_rank by making the algorithm used in min_rank more generic and controlled by a tmpl parameter