Function create_diagonal_matrix

Function Documentation

arma::mat create_diagonal_matrix(const std::vector<double> &diagonal)

transforms a vector into a diagonal matrix

This function takes a vector of n elements and in quaternions and transforms it in a diagonal matrix of size n x n

Parameters:

diagonal – A constant reference to a vector which needs to be transformed.

Returns:

A diagonal matrix of size n x n