Skip to content

Commit

Permalink
WIP: rewrite transpose
Browse files Browse the repository at this point in the history
  • Loading branch information
termoshtt committed Sep 1, 2022
1 parent bf56398 commit c1aca43
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lax/src/least_squares.rs
Expand Up @@ -68,8 +68,9 @@ macro_rules! impl_least_squares {
let mut a_t = None;
let a_layout = match a_layout {
MatrixLayout::C { .. } => {
a_t = Some(unsafe { vec_uninit( a.len()) });
transpose(a_layout, a, a_t.as_mut().unwrap())
let (layout, t) = transpose(a_layout, a);
a_t = Some(t);
layout
}
MatrixLayout::F { .. } => a_layout,
};
Expand All @@ -78,8 +79,9 @@ macro_rules! impl_least_squares {
let mut b_t = None;
let b_layout = match b_layout {
MatrixLayout::C { .. } => {
b_t = Some(unsafe { vec_uninit( b.len()) });
transpose(b_layout, b, b_t.as_mut().unwrap())
let (layout, t) = transpose(b_layout, b);
b_t = Some(t);
layout
}
MatrixLayout::F { .. } => b_layout,
};
Expand Down

0 comments on commit c1aca43

Please sign in to comment.