DiffPatchis able to compute length matrix