@@ -614,6 +614,23 @@ module stdlib_linalg
614614 !> [optional] state return flag. On error if not requested, the code will stop
615615 type(linalg_state_type), optional, intent(out) :: err
616616 end subroutine stdlib_linalg_${ri}$_qr
617+
618+ pure module subroutine stdlib_linalg_${ri}$_pivoting_qr(a, q, r, pivots, overwrite_a, storage, err)
619+ !> Input matrix a[m, n]
620+ ${rt}$, intent(inout), target :: a(:, :)
621+ !> Orthogonal matrix Q ([m, m] or [m, k] if reduced)
622+ ${rt}$, intent(out), contiguous, target :: q(:, :)
623+ !> Upper triangular matrix R ([m, n] or [k, n] if reduced)
624+ ${rt}$, intent(out), contiguous, target :: r(:, :)
625+ !> Pivots.
626+ integer(ilp), intent(out) :: pivots(:)
627+ !> [optional] Can A data be overwritten and destroyed?
628+ logical(lk), optional, intent(in) :: overwrite_a
629+ !> [optional] Provide pre-allocated workspace, size to be checked with pivoting_qr_space.
630+ ${rt}$, intent(out), optional, target :: storage(:)
631+ !> [optional] state return flag. On error if not requested, the code will stop.
632+ type(linalg_state_type), optional, intent(out) :: err
633+ end subroutine stdlib_linalg_${ri}$_pivoting_qr
617634 #:endfor
618635 end interface qr
619636
0 commit comments