added indexOf to DenseMat
added indexOf to DenseMat