rows

This page contains details of the function templates for finding the rows of a matrix in the namespace matrix_helper.

For dynamic matrices

template<typename T, typename = std::enable_if_t<IsDynamicMatrix<T>>>
std::vector<typename T::RowView> rows(T const &x)

Returns a vector of row views into all of the rows of the dynamic matrix x.

Parameters

x – the matrix.

Returns

A vector of T::RowView of size x.number_of_rows().

Exceptions

Throws if T::rows throws, or std::bad_alloc is thrown.

Complexity

\(O(m)\) where \(m\) is the number of rows in the matrix x.

For static matrices

template<typename T, typename = std::enable_if_t<IsStaticMatrix<T>>>
detail::StaticVector1<typename T::RowView, T::number_of_rows> rows(T const &x)

Returns a static vector of row views into all of the rows of the static matrix x. Static vectors have the same interface as std::vector but their capacity is defined at compile time.

Parameters

x – the matrix

Returns

A static vector of T::RowView of size x.number_of_rows().

Exceptions

Throws if T::rows throws, or std::bad_alloc is thrown.

Complexity

\(O(m)\) where \(m\) is the number of rows in the matrix x.