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

编程入门 行业动态 更新时间:2024-10-11 13:25:25
本文介绍了如何将dlib中的矩阵转换为std :: vector的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在dlib中定义了colume矢量。如何将其转换为std :: vector?

I have a colume vector defined in dlib. How can I convert it to std::vector?

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

谢谢

推荐答案

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

There are many ways. You could copy it via a for loop. Or use the std::vector constructor that takes iterators: std::vector<double> x(starting_point.begin(), starting_point.end()).

更多推荐

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

本文发布于:2023-11-05 18:19:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1561532.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:矩阵   转换为   如何将   vector   dlib

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!