27 template <
typename EIGEN_VECTOR_ARRAY_TYPE_IN,
typename SCALAR =
double>
31 if (array.front().cols() != 1)
33 throw std::runtime_error(
34 "ct::core::transposeArray() called with invalid type. Eigen types in array must be vectors (no matrices " 38 size_t rows_in = array.front().rows();
39 size_t cols_in = array.size();
43 for (
size_t j = 0; j < rows_in; j++)
45 Eigen::Matrix<SCALAR, -1, -1> newVec(cols_in, 1);
47 for (
size_t i = 0;
i < cols_in;
i++)
49 newVec(
i, 0) = array[
i](j);
51 result.push_back(newVec);
An discrete array (vector) of a particular data type.
Definition: DiscreteArray.h:22
CppAD::AD< CppAD::cg::CG< double > > SCALAR
DiscreteArray< Eigen::Matrix< SCALAR, -1, -1 > > transposeArray(const EIGEN_VECTOR_ARRAY_TYPE_IN &array)
this method transposes/flips an array of vectors into another array containing the scalar trajectorie...
Definition: ArrayHelpers.h:28