Автор | Сообщение |
|

Отправлено: 04.06.14 16:02. Заголовок: vectors grouping
i have a 2d array and i accses data row by row and split into two types of vectors i like to group them base one its types and how to add groups of vectors together what is the beast way to do it
|
 |

|
Новых ответов нет
[см. все]
|
|
|

Отправлено: 04.06.14 19:42. Заголовок: I have not understoo..
I have not understood what you are trying to do and what groups of vectors are.
|
 |

|
|

Отправлено: 08.06.14 07:24. Заголовок: 2d or 3d vectors a ..
2d or 3d vectors a groups of vector inside a vector i am trying to group a set of pixel from a image by accessing row by row and i did sum calculation on it to get a set of vector of a row than loop again to get second row vectors and i compare first row vectors and second row vectors based on near pixel color value matching (take first row first vector and second row first vector than first row second vector and second row second vector ans so on ) than matching vector add into a group (sum ID giving to vector for identification of a group || adding to 2d or 3d vector ) how this Done in c++ .
|
 |

|
|

Отправлено: 08.06.14 20:06. Заголовок: I am sorry but I hav..
I am sorry but I have understood nothing. I do not understand for example what is the "first row first vector and second row ffirst vector".
|
 |

|
|

Отправлено: 09.06.14 17:03. Заголовок: for example if i sp..
for example if i splitting row array when there are adjacent equal elements using below code . the first output vector of this code is the first vector second output split is second vector and so no........ int a[] = { 2, 5, 6, 7, 5, 4, 2, 1, 3, 3, 6, 10, 9, 6, 2, 1 }; int *p = std::begin( a ); std::vector<std::vector<int>> v; while ( p != std::end( a ) ) { int *q = std::adjacent_find( p, std::end( a ), std::greater<int>() ); q = std::adjacent_find( q, std::end( a ), std::less<int>() ); if ( q != std::end( a ) ) ++q; v.push_back( std::vector<int>() ); v.back().reserve( std::distance( p, q ) ); std::copy( p, q, std::back_inserter( v.back() ) ); p = q; } for ( const std::vector<int> &v1 : v ) { std::copy( v1.begin(), v1.end(), std::ostream_iterator<int>( std::cout, " " ) ); std::cout << std::endl; }
|
 |

|
|

Отправлено: 10.06.14 13:31. Заголовок: You want to say that..
You want to say that you have something as std::vector<std::vector<int>> and you split each std::vector<int> of this vector as it was showed above. Is it correct? And what is the problem?
|
 |

|
|