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

Function complex_gevm

src/complex/matrix.rs:2634–2666  ·  view source on GitHub ↗

General Vector-Matrix multiplication

(alpha: C64, a: &[C64], b: &ComplexMatrix, beta: C64, c: &mut [C64])

Source from the content-addressed store, hash-verified

2632
2633/// General Vector-Matrix multiplication
2634pub fn complex_gevm(alpha: C64, a: &[C64], b: &ComplexMatrix, beta: C64, c: &mut [C64]) {
2635 let m = 1usize;
2636 let k = a.len();
2637 let n = b.col;
2638 let (rsa, csa) = (1isize, 1isize);
2639 let (rsb, csb) = match b.shape {
2640 Shape::Row => (b.col as isize, 1isize),
2641 Shape::Col => (1isize, b.row as isize),
2642 };
2643 let (rsc, csc) = (1isize, 1isize);
2644
2645 unsafe {
2646 matrixmultiply::zgemm(
2647 // Requires crate feature "cgemm"
2648 CGemmOption::Standard,
2649 CGemmOption::Standard,
2650 m,
2651 k,
2652 n,
2653 [alpha.re, alpha.im],
2654 a.as_ptr() as *const _,
2655 rsa,
2656 csa,
2657 b.ptr() as *const _,
2658 rsb,
2659 csb,
2660 [beta.re, beta.im],
2661 c.as_mut_ptr() as *mut _,
2662 rsc,
2663 csc,
2664 )
2665 }
2666}
2667
2668/// LU via Gaussian Elimination with Partial Pivoting
2669#[allow(dead_code)]

Callers 1

mulMethod · 0.85

Calls 2

lenMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected