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

Function solve

numpy/linalg/umath_linalg.cpp:1733–1769  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1731
1732template<typename typ>
1733static void
1734solve(char **args, npy_intp const *dimensions, npy_intp const *steps,
1735 void *NPY_UNUSED(func))
1736{
1737using ftyp = fortran_type_t<typ>;
1738 GESV_PARAMS_t<ftyp> params;
1739 fortran_int n, nrhs;
1740 int error_occurred = get_fp_invalid_and_clear();
1741 INIT_OUTER_LOOP_3
1742
1743 n = (fortran_int)dimensions[0];
1744 nrhs = (fortran_int)dimensions[1];
1745 if (init_gesv(&params, n, nrhs)) {
1746 LINEARIZE_DATA_t a_in, b_in, r_out;
1747
1748 init_linearize_data(&a_in, n, n, steps[1], steps[0]);
1749 init_linearize_data(&b_in, nrhs, n, steps[3], steps[2]);
1750 init_linearize_data(&r_out, nrhs, n, steps[5], steps[4]);
1751
1752 BEGIN_OUTER_LOOP_3
1753 int not_ok;
1754 linearize_matrix((typ*)params.A, (typ*)args[0], &a_in);
1755 linearize_matrix((typ*)params.B, (typ*)args[1], &b_in);
1756 not_ok =call_gesv(&params);
1757 if (!not_ok) {
1758 delinearize_matrix((typ*)args[2], (typ*)params.B, &r_out);
1759 } else {
1760 error_occurred = 1;
1761 nan_matrix((typ*)args[2], &r_out);
1762 }
1763 END_OUTER_LOOP
1764
1765 release_gesv(&params);
1766 }
1767
1768 set_fp_invalid_or_clear(error_occurred);
1769}
1770
1771
1772template<typename typ>

Callers

nothing calls this directly

Calls 8

get_fp_invalid_and_clearFunction · 0.85
init_gesvFunction · 0.85
init_linearize_dataFunction · 0.85
linearize_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