title: Matlab Spdiags equivalent in EIGEN C++
body: <p>I'm searching for an equivalent of A=Spdiags(B,d,N,N)in C++. This function extracts the diagonals element of the matrix B by taking the columns of B and placing them along the diagonals specified by the vector d. N N are the size of the output matrix A. </p>
  
  <p>I've searched in Eigen, but it seems that it does not exist. </p>
  
  <p>any ideas?</p>