map linear index to logical array