How can I do FullPivHouseholderQR form Eigen with nalgebra in rust ?

I'm trying omething like this but nalgebra doesn't like dynamic matrix size...


let mat_a: Matrix3xX<f64> = ...;
let vec_b: DVector<f64> = ...;
let vec_x = mat_a
.transpose()
.qr()
.solve(&vec_b)
.ok_or("Can't solve qr decomposition")?;

it works with Martix3, but I need to do it with any number of rows...

And of course I'm not even sure I did the whole operation. Pretty sure I miss the FullPivHousehoder part.

(Yeah I know, I'm all over the place... )

#rustlang #cpp #nalgebra #eigen

Библиотека nalgebra в Rust

Линейная алгебра сейчас применяется практические везде. В связс с этим сегодня рассмотрим одну из библиотек для Rust — nalgebra . Основная цель nalgebra — предоставить инструмент для работы с линейной алгеброй.

https://habr.com/ru/companies/otus/articles/828316/

#rust #математика #программирование #nalgebra

Библиотека nalgebra в Rust

Привет, Хабр! Линейная алгебра сейчас применяется практические везде. В связс с этим сегодня рассмотрим одну из библиотек для Rust — nalgebra . Основная цель nalgebra — предоставить инструмент для...

Хабр

#RustLang I’m fighting with borrow-checker versus #nalgebra.

I’m trying to write toy Gaussian elimination function generic over matrix types.

And I want to do `matrix.row_iter().map(|r| &r[(1, i)])…` to iterate over ith elements of every row of the matrix.

But row_iter() returns a new Vector view of the orig. mat., and then indexing returns a reference to the element with the lifetime of the row, not the orig. matrix.

Is there any way around it? This *should* be fine, since

WOW, I did not expect such a beautiful terminal output from #nalgebra 🤯

#RustLang #Rust