如何将dlib中的矩阵转换为std :: vector

col*_*die 3 c++ dlib

我有一个在dlib中定义的colume向量.我怎样才能将它转换为std :: vector?

typedef dlib::matrix<double,0,1> column_vector;
column_vector starting_point(4);
starting_point = 1,2,3,4;
std::vector x = ??
Run Code Online (Sandbox Code Playgroud)

谢谢

Dav*_*ing 11

有很多方法.你可以通过for循环复制它.或者使用带有迭代器的std :: vector构造函数:std::vector<double> x(starting_point.begin(), starting_point.end()).