line 517 in matt.hpp is part of the at method. So the problem is with dft_output_vector.at

Code:
all_vector.push_back (dft_output_vector.at <double>(i,j));
You'll need to debug the code to find the reason.