MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / axpy

Function axpy

examples/simple/src/lib.rs:25–27  ·  view source on GitHub ↗

example using immutable borrows producing a new array

(a: f64, x: ArrayViewD<'_, f64>, y: ArrayViewD<'_, f64>)

Source from the content-addressed store, hash-verified

23
24 // example using immutable borrows producing a new array
25 fn axpy(a: f64, x: ArrayViewD<'_, f64>, y: ArrayViewD<'_, f64>) -> ArrayD<f64> {
26 a * &x + &y
27 }
28
29 // example using a mutable borrow to modify an array in-place
30 fn mult(a: f64, mut x: ArrayViewMutD<'_, f64>) {

Callers 2

axpy_pyFunction · 0.85
test_axpyFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_axpyFunction · 0.68