MCPcopy Create free account
hub / github.com/numpy/numpy / inv

Function inv

numpy/linalg/umath_linalg.cpp:1810–1843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1808
1809template<typename typ>
1810static void
1811inv(char **args, npy_intp const *dimensions, npy_intp const *steps,
1812 void *NPY_UNUSED(func))
1813{
1814using ftyp = fortran_type_t<typ>;
1815 GESV_PARAMS_t<ftyp> params;
1816 fortran_int n;
1817 int error_occurred = get_fp_invalid_and_clear();
1818 INIT_OUTER_LOOP_2
1819
1820 n = (fortran_int)dimensions[0];
1821 if (init_gesv(&params, n, n)) {
1822 LINEARIZE_DATA_t a_in, r_out;
1823 init_linearize_data(&a_in, n, n, steps[1], steps[0]);
1824 init_linearize_data(&r_out, n, n, steps[3], steps[2]);
1825
1826 BEGIN_OUTER_LOOP_2
1827 int not_ok;
1828 linearize_matrix((typ*)params.A, (typ*)args[0], &a_in);
1829 identity_matrix((typ*)params.B, n);
1830 not_ok = call_gesv(&params);
1831 if (!not_ok) {
1832 delinearize_matrix((typ*)args[1], (typ*)params.B, &r_out);
1833 } else {
1834 error_occurred = 1;
1835 nan_matrix((typ*)args[1], &r_out);
1836 }
1837 END_OUTER_LOOP
1838
1839 release_gesv(&params);
1840 }
1841
1842 set_fp_invalid_or_clear(error_occurred);
1843}
1844
1845
1846/* -------------------------------------------------------------------------- */

Callers

nothing calls this directly

Calls 9

get_fp_invalid_and_clearFunction · 0.85
init_gesvFunction · 0.85
init_linearize_dataFunction · 0.85
linearize_matrixFunction · 0.85
identity_matrixFunction · 0.85
call_gesvFunction · 0.85
delinearize_matrixFunction · 0.85
nan_matrixFunction · 0.85
set_fp_invalid_or_clearFunction · 0.85

Tested by

no test coverage detected