Adding C wrappers for lapack-like/perm and removing an unused variable in SetDiagonal