c++ convert int vector to real vector code example
Example 1: convert vector to set c++
set <int> convertToSet(vector<int> v)
{
set<int> s(v.begin(),v.end());
return s;
}
Example 2: transform a vector into a matrix
M = reshape(V, 3, 3).';
set <int> convertToSet(vector<int> v)
{
set<int> s(v.begin(),v.end());
return s;
}
M = reshape(V, 3, 3).';