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

Method solve_mat

src/complex/matrix.rs:2155–2187  ·  view source on GitHub ↗
(&self, m: &ComplexMatrix, sk: SolveKind)

Source from the content-addressed store, hash-verified

2153 }
2154
2155 fn solve_mat(&self, m: &ComplexMatrix, sk: SolveKind) -> ComplexMatrix {
2156 match sk {
2157 SolveKind::LU => {
2158 let lu = self.lu();
2159 let (p, q, l, u) = lu.extract();
2160 let mut x = cmatrix(
2161 vec![Complex::zero(); self.col * m.col],
2162 self.col,
2163 m.col,
2164 Shape::Col,
2165 );
2166 for i in 0..m.col {
2167 let mut v = m.col(i).clone();
2168 for (r, &s) in p.iter().enumerate() {
2169 v.swap(r, s);
2170 }
2171 let z = l.forward_subs(&v);
2172 let mut y = u.back_subs(&z);
2173 for (r, &s) in q.iter().enumerate() {
2174 y.swap(r, s);
2175 }
2176 unsafe {
2177 let mut c = x.col_mut(i);
2178 copy_vec_ptr(&mut c, &y);
2179 }
2180 }
2181 x
2182 }
2183 SolveKind::WAZ => {
2184 unimplemented!()
2185 }
2186 }
2187 }
2188
2189 fn is_symmetric(&self) -> bool {
2190 if self.row != self.col {

Callers 2

solveFunction · 0.45
csolveFunction · 0.45

Calls 10

cmatrixFunction · 0.85
copy_vec_ptrFunction · 0.85
iterMethod · 0.80
luMethod · 0.45
extractMethod · 0.45
colMethod · 0.45
swapMethod · 0.45
forward_subsMethod · 0.45
back_subsMethod · 0.45
col_mutMethod · 0.45

Tested by

no test coverage detected