Replace the non-zero entries of x with ones. This creates a sparse matrix with the same structure as x.