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

Method solve

src/complex/matrix.rs:2137–2153  ·  view source on GitHub ↗

Solve with Vector # Solve options LU: Gaussian elimination with Complete pivoting LU (GECP) WAZ: Solve with WAZ decomposition

(&self, b: &[C64], sk: SolveKind)

Source from the content-addressed store, hash-verified

2135 /// * LU: Gaussian elimination with Complete pivoting LU (GECP)
2136 /// * WAZ: Solve with WAZ decomposition
2137 fn solve(&self, b: &[C64], sk: SolveKind) -> Vec<C64> {
2138 match sk {
2139 SolveKind::LU => {
2140 let lu = self.lu();
2141 let (p, q, l, u) = lu.extract();
2142 let mut v = b.to_vec();
2143 v.swap_with_perm(&p.into_iter().enumerate().collect::<Vec<_>>());
2144 let z = l.forward_subs(&v);
2145 let mut y = u.back_subs(&z);
2146 y.swap_with_perm(&q.into_iter().enumerate().rev().collect::<Vec<_>>());
2147 y
2148 }
2149 SolveKind::WAZ => {
2150 unimplemented!()
2151 }
2152 }
2153 }
2154
2155 fn solve_mat(&self, m: &ComplexMatrix, sk: SolveKind) -> ComplexMatrix {
2156 match sk {

Callers

nothing calls this directly

Calls 7

into_iterMethod · 0.80
luMethod · 0.45
extractMethod · 0.45
to_vecMethod · 0.45
swap_with_permMethod · 0.45
forward_subsMethod · 0.45
back_subsMethod · 0.45

Tested by

no test coverage detected