const correctness for RMatrix and iterators