#176 Refactored *matrix_tools.i