0
- 我想複製矩陣行向量向量我怎麼能 應用它?
- 是否有可能將提升矩陣轉換爲向量向量?
源代碼:複製boost :: numeric :: ublas ::矩陣行向量的向量
#include <iostream.h>
#include <boost/numeric/ublas/matrix.hpp>
#include <vector>
int main()
{
//declare vector and matrix
std::vector<std::vector<float>> document;
boost::numeric::ublas::matrix<float> data(10,10);
// fill matrix (any numbers)
for (size_t i = 0; i < data.size1(); i++)
{
for (size_t j = 0; j < data.size2(); j++)
{
data(i,j) = i + j ;
}
}
//The problem is here. I want to copy data(j) to document i.e document.push_back(data(j)). How can I copy matrix rows to a vector?
//I know that it's wrong: document.push_back(data(j)) but that's almost what i am trying to do
//matrix_row<matrix<double> > mr (m, i); allows me to access a row right?
return 0;
}