> Eigen matrices have a range of methods that reduce them to a single number. Suppose A is an Eigen::MatrixXd object, then a few useful methods are:
*`A.size()`: the number of entries in A,
*`A.sum()`: the sum of all entries in A,
*`A.prod()`: the product of all entries in A,
*`A.minCoeff()`: the minimum value amongst the entries of A,
*`A.maxCoeff()`: the maximum value amongst the entries of A, and
*`A.norm()`: The (Frobenius) norm of the matrix A.
> The [Eigen::Array class](https://eigen.tuxfamily.org/dox/group__TutorialArrayClass.html) is also featured in this exercise to perform coefficient-wise comparison.
> Open "MatrixReduce.hpp" and fill in the missing code in between the delimiters `// START` and `// END` according to the instructions preceded by `// TO DO:`.
> Read each function of the program carefully. The code will not compile until after the first two tasks are finished, which is to include headers, set the namespace, and write the average() function.
> There are four functions in MatrixReduction.hpp and main.cpp has one test for each function.
***
> `average( MatrixXd A )`: This function should calculate the average of the entries in A.
The test prints `average(Matrix3d::Identity())`, and the correct result is:
```
0.333333
```
***
> `percent_zero( MatrixXd A )`: This function calculates the percentage of entries in A that are exactly equal to zero.
The test prints `percent_zero(Matrix3d::Identity())`, and the correct result is:
```
66.6667
```
***
> `has_zero_column( MatrixXd A )`: This function checks if any one of the columns in A is equal to zero.
The test prints
`has_zero_column(B)` followed by `has_zero_column(B.transpose())` where `B=MatrixXd::Identity(4,5)`, and the correct result is:
```
1 0
```
***
> `columns_sum_to_zero( MatrixXd A )`: This functions returns a copy of A, except that the diagonal entries have been changed in a way such that the columns of the new matrix sum to zero.
The test prints `columns_sum_to_zero(C)` where `C=Matrix3d::Random()+Matrix3d::Constant(1)` (the random seed is fixed), and the correct result is: