optimizations for selecting a row or col from a matrix exp