Template Function mrpt::math::extractColumnFromVectorOfVectors

Function Documentation

template<class VECTOR_OF_VECTORS, class VECTORLIKE>
void mrpt::math::extractColumnFromVectorOfVectors(const size_t colIndex, const VECTOR_OF_VECTORS &data, VECTORLIKE &out_column)

Extract a column from a vector of vectors, and store it in another vector.

  • Input data can be: std::vector<mrpt::math::CVectorDouble>, std::deque<std::list<double> >, std::list<CVectorFixedDouble<5> >, etc. etc.

  • Output is the sequence: data[0][idx],data[1][idx],data[2][idx], etc..

For the sake of generality, this function does NOT check the limits in the number of column, unless it’s implemented in the [] operator of each of the “rows”.