batched inv with precomputation/indexing