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

Function inv

examples/linalg/src/lib.rs:8–17  ·  view source on GitHub ↗
(
        py: Python<'py>,
        x: PyReadonlyArray2<'py, f64>,
    )

Source from the content-addressed store, hash-verified

6
7 #[pyfunction]
8 fn inv<'py>(
9 py: Python<'py>,
10 x: PyReadonlyArray2<'py, f64>,
11 ) -> PyResult<Bound<'py, PyArray2<f64>>> {
12 let x = x.as_array();
13 let y = x
14 .inv()
15 .map_err(|e| PyRuntimeError::new_err(e.to_string()))?;
16 Ok(y.into_pyarray(py))
17 }
18}

Callers

nothing calls this directly

Calls 2

into_pyarrayMethod · 0.80
as_arrayMethod · 0.45

Tested by

no test coverage detected