Template Function parrot::matrix(std::initializer_list<std::initializer_list<T>>)#

Function Documentation#

template<typename T>
auto parrot::matrix(std::initializer_list<std::initializer_list<T>> nested_list)#

Create a 2D matrix from a nested initializer list.

Template Parameters:

T – The element type (automatically deduced from the nested list)

Parameters:

nested_list – A nested initializer list where each inner list represents a row

Throws:

std::invalid_argument – if nested_list is empty or inner lists have different lengths

Returns:

A fusion_array with shape {rows, cols} containing the matrix data