pass arguments to sub2ind by reference when they're simd vectors