MCPcopy Create free account
hub / github.com/Axect/Peroxide / inv

Method inv

src/complex/matrix.rs:1841–1857  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1839 }
1840
1841 pub fn inv(&self) -> ComplexMatrix {
1842 let (p, q, l, u) = self.extract();
1843 let mut m = complex_inv_u(u) * complex_inv_l(l);
1844 // Q = Q1 Q2 Q3 ..
1845 for (idx1, idx2) in q.into_iter().enumerate().rev() {
1846 unsafe {
1847 m.swap(idx1, idx2, Shape::Row);
1848 }
1849 }
1850 // P = Pn-1 .. P3 P2 P1
1851 for (idx1, idx2) in p.into_iter().enumerate().rev() {
1852 unsafe {
1853 m.swap(idx1, idx2, Shape::Col);
1854 }
1855 }
1856 m
1857 }
1858}
1859
1860/// MATLAB like eye - Identity matrix

Callers 7

mainFunction · 0.45
mainFunction · 0.45
mut_updateMethod · 0.45
one_step_rok4aFunction · 0.45
optimizeMethod · 0.45
cubic_splineMethod · 0.45
test_inverseFunction · 0.45

Calls 6

complex_inv_uFunction · 0.85
complex_inv_lFunction · 0.85
into_iterMethod · 0.80
extractMethod · 0.45
swapMethod · 0.45
luMethod · 0.45

Tested by 1

test_inverseFunction · 0.36