transpose

Function transpose 

Source
pub fn transpose(mat: &Matrix) -> Matrix
Expand description

Transpose the input Matrix and returns the result as a new Matrix

ยงExample:

use puanrs::linalg::Matrix;
use puanrs::linalg::transpose;
let res = transpose(&Matrix{val: vec![1., 2., 3., 4., 5., 6.], ncols: 3, nrows: 2});
assert_eq!(format!("{res:#?}"),
"Matrix {
    val: [
        1.0,
        4.0,
        2.0,
        5.0,
        3.0,
        6.0,
    ],
    ncols: 2,
    nrows: 3,
}")