Add free-function swap.
This allows all dense and sparse matrices and blocks to be used in
c++ algorithms that rely on swapping.
Fixes #2853 (closed).
This allows all dense and sparse matrices and blocks to be used in
c++ algorithms that rely on swapping.
Fixes #2853 (closed).