Template Function otyca::vector_to_colvec(const std::vector<std::vector<T>>&, arma::Col<T>&)

Function Documentation

template<typename T>
void otyca::vector_to_colvec(const std::vector<std::vector<T>> &vec_of_vec, arma::Col<T> &col)

Converts a 2D vector of ys into a column vector.

This function takes a 2D vector of values (ys) and flattens it into a single column vector (arma::Col<T>). Each value from the 2D vector is placed in the resulting column vector in a row-major order.

Template Parameters:

T – The type of the data (e.g., float, double).

Parameters:
  • vec_of_vec – A 2D vector containing the data to be flattened.

  • col – The output column vector that will hold the flattened data.