Compute KMS index array