I need to create a diagonal MatrixXd in C++ using Eigen library in which the elements on the diagonal are N replication of a shorter VectorXd.
VectorXd R; // a vector of size n
VectorXd V; // a vector of size n*N corresponding to N concatenated replicate of R, i don't khow how to create
MatrixXd D=MatrixXd(V.asDiagonal()); //my diagonal matrix on size nN x nN
thanks.