In this exercise I am using Visual Studio 2019 and a modified version of the std_lib_facilities header found here.
Chapter 24 // Exercise 11
Write a swap_columns() to match swap_rows() from section 24.5.3. Obviously, to do that you have to read and understand some of the existing Matrix library code. Don't worry too much about efficiency; it is not possible to get swap_columns() to run as fast as swap_rows().
I started off by modifying the swapRow function I did for vectors in exercise 7. Once that was working, I simply switched the subscripting round. Then copied that into a member function for 2d matrixes.
No comments:
Post a Comment