Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize squareform's square matrix construction
Avoid breaking chunks into smaller pieces than necessary by taking advantage of symmetry. Namely note that pieces of rows also correspond to pieces of columns as well. Starting from the right corner where these pieces are simple singleton 1-D arrays, concatenate them together into larger pieces. Use a 2-D singleton zero array as a seed for this concatenation to grow from. By doing this, we avoid further subselection from the 1-D array beyond the necessary selection of pieces.
- Loading branch information