This is the basic C++ program of C++ armadillo library which shows how to get the diagonal of the given matrix of some particular size. It can be carried out by the help of inbuilt function "diagvec" in armadillo library. "diagvec" function takes just one parameter i.e the input matrix name. This function is used to store the diagonal of input matrix.
Comments