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

Method det

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

Source from the content-addressed store, hash-verified

1821 }
1822
1823 pub fn det(&self) -> C64 {
1824 // sgn of perms
1825 let mut sgn_p = 1f64;
1826 let mut sgn_q = 1f64;
1827 for (i, &j) in self.p.iter().enumerate() {
1828 if i != j {
1829 sgn_p *= -1f64;
1830 }
1831 }
1832 for (i, &j) in self.q.iter().enumerate() {
1833 if i != j {
1834 sgn_q *= -1f64;
1835 }
1836 }
1837
1838 self.u.diag().reduce(Complex::one(), |x, y| x * y) * sgn_p * sgn_q
1839 }
1840
1841 pub fn inv(&self) -> ComplexMatrix {
1842 let (p, q, l, u) = self.extract();

Callers 5

optimizeMethod · 0.45
test_detFunction · 0.45
test_det2Function · 0.45
test_detFunction · 0.45
mainFunction · 0.45

Calls 4

iterMethod · 0.80
reduceMethod · 0.45
diagMethod · 0.45
luMethod · 0.45

Tested by 3

test_detFunction · 0.36
test_det2Function · 0.36
test_detFunction · 0.36