Compute optimal matrix-chain multiplication order | Apple