Write code for the function additiveInverse. It should take the 2D matrix given and change it into its additive inverse by multiplying each value in the matrix by -1.
Write the function vector<vector<int>> create(int rows, int cols);. It should return a 2D vector of integers that is the correct dimensions. All the values should be 0
Complete the function diagonalAdder that adds up the numbers on the diagonal (from upper left to lower right) of a 2D vector. You can assume the vector is βsquareβ - it has the same number of rows as columns. For example, in this matrix:
Complete the function revDiagonalAdder that adds up and returns the numbers on the reverse diagonal (from upper right lower left) of a 2D vector of integers. You can assume the vector is βsquareβ - it has the same number of rows as columns. For example, in this matrix:
There is a relationship between the row and column number. As the row number increases, the column number decreases. Row 0 uses the last column. Row 1 uses the column before that. Row 2 uses the column before that. The last row uses column 0.