| 1808 | |
| 1809 | template<typename typ> |
| 1810 | static void |
| 1811 | inv(char **args, npy_intp const *dimensions, npy_intp const *steps, |
| 1812 | void *NPY_UNUSED(func)) |
| 1813 | { |
| 1814 | using 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(¶ms, 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(¶ms); |
| 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(¶ms); |
| 1840 | } |
| 1841 | |
| 1842 | set_fp_invalid_or_clear(error_occurred); |
| 1843 | } |
| 1844 | |
| 1845 | |
| 1846 | /* -------------------------------------------------------------------------- */ |
nothing calls this directly
no test coverage detected