Skip to main content

matrix_from_flat

Function matrix_from_flat 

Source
pub fn matrix_from_flat<E>(
    rows: usize,
    cols: usize,
    elements: impl IntoIterator<Item = E>,
) -> Result<Expr, ExprShapeError>
where E: Into<Expr>, Expr: From<E>,
Expand description

Constructs a row-major matrix from a flat sequence.

ยงErrors

Returns ExprShapeError when either dimension is zero, the dimension product overflows, the element count differs from rows * cols, or an element is not scalar-valued.