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

Function qr_complete

numpy/linalg/umath_linalg.cpp:3590–3630  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3588
3589template<typename typ>
3590static void
3591qr_complete(char **args, npy_intp const *dimensions, npy_intp const *steps,
3592 void *NPY_UNUSED(func))
3593{
3594using 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(&params, 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(&params);
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(&params);
3627 }
3628
3629 set_fp_invalid_or_clear(error_occurred);
3630}
3631
3632/* -------------------------------------------------------------------------- */
3633 /* least squares */

Callers

nothing calls this directly

Calls 9

get_fp_invalid_and_clearFunction · 0.85
init_gqr_completeFunction · 0.85
init_linearize_dataFunction · 0.85
fortran_int_minFunction · 0.85
linearize_matrixFunction · 0.85
call_gqrFunction · 0.85
delinearize_matrixFunction · 0.85
nan_matrixFunction · 0.85
set_fp_invalid_or_clearFunction · 0.85

Tested by

no test coverage detected