def indexes_to_fix_for_low_rank(rank, size):
<EOL>n = np.arange(size)<EOL>triangulars = (n**<NUM_LIT:2> + n) / <NUM_LIT:2><EOL>keep = []<EOL>for i in range(rank):<EOL><INDENT>keep.append(triangulars[i:] + i)<EOL><DEDENT>keep.append(triangulars[<NUM_LIT:1>:]-<NUM_LIT:1>)<EOL>keep.append((size**<NUM_LIT:2> + size)/<NUM_LIT:2> -<NUM_LIT:1>)<EOL>keep = np.hstack(keep)<EOL>return np.setdiff1d(np.arange((size**<NUM_LIT:2>+size)/<NUM_LIT:2>), keep)<EOL>
Work out which indexes of the flatteneed array should be fixed if we want
the cholesky to represent a low rank matrix