| 3588 | |
| 3589 | template<typename typ> |
| 3590 | static void |
| 3591 | qr_complete(char **args, npy_intp const *dimensions, npy_intp const *steps, |
| 3592 | void *NPY_UNUSED(func)) |
| 3593 | { |
| 3594 | using ftyp = fortran_type_t<typ>; |
| 3595 | GQR_PARAMS_t<ftyp> params; |
| 3596 | int error_occurred = get_fp_invalid_and_clear(); |
| 3597 | fortran_int n, m; |
| 3598 | |
| 3599 | INIT_OUTER_LOOP_3 |
| 3600 | |
| 3601 | m = (fortran_int)dimensions[0]; |
| 3602 | n = (fortran_int)dimensions[1]; |
| 3603 | |
| 3604 | |
| 3605 | if (init_gqr_complete(¶ms, m, n)) { |
| 3606 | LINEARIZE_DATA_t a_in, tau_in, q_out; |
| 3607 | |
| 3608 | init_linearize_data(&a_in, n, m, steps[1], steps[0]); |
| 3609 | init_linearize_data(&tau_in, 1, fortran_int_min(m, n), 1, steps[2]); |
| 3610 | init_linearize_data(&q_out, m, m, steps[4], steps[3]); |
| 3611 | |
| 3612 | BEGIN_OUTER_LOOP_3 |
| 3613 | int not_ok; |
| 3614 | linearize_matrix((typ*)params.A, (typ*)args[0], &a_in); |
| 3615 | linearize_matrix((typ*)params.Q, (typ*)args[0], &a_in); |
| 3616 | linearize_matrix((typ*)params.TAU, (typ*)args[1], &tau_in); |
| 3617 | not_ok = call_gqr(¶ms); |
| 3618 | if (!not_ok) { |
| 3619 | delinearize_matrix((typ*)args[2], (typ*)params.Q, &q_out); |
| 3620 | } else { |
| 3621 | error_occurred = 1; |
| 3622 | nan_matrix((typ*)args[2], &q_out); |
| 3623 | } |
| 3624 | END_OUTER_LOOP |
| 3625 | |
| 3626 | release_gqr(¶ms); |
| 3627 | } |
| 3628 | |
| 3629 | set_fp_invalid_or_clear(error_occurred); |
| 3630 | } |
| 3631 | |
| 3632 | /* -------------------------------------------------------------------------- */ |
| 3633 | /* least squares */ |
nothing calls this directly
no test coverage detected