29 Numerics library [numerics]

29.9 Basic linear algebra algorithms [linalg]

29.9.14 BLAS 2 algorithms [linalg.algs.blas2]

29.9.14.7 Symmetric or Hermitian Rank-1 (outer product) update of a matrix [linalg.algs.blas2.symherrank1]

[Note 1: 
These functions correspond to the BLAS functions xSYR, xSPR, xHER, and xHPR[bib].
They have overloads taking a scaling factor alpha, because it would be impossible to express the update in noncomplex arithmetic otherwise.
— end note]
The following elements apply to all functions in [linalg.algs.blas2.symherrank1].
For any function F in this subclause with a parameter named t, an InMat template parameter, and a function parameter InMat E, t applies to accesses done through the parameter E.
F only accesses the triangle of E specified by t.
For accesses of diagonal elements E[i, i], F only uses the value real-if-needed(E[i, i]) if the name of F starts with hermitian.
For accesses E[i, j] outside the triangle specified by t, F only uses the value
  • conj-if-needed(E[j, i]) if the name of F starts with hermitian, or
  • E[j, i] if the name of F starts with symmetric.
Mandates:
  • If OutMat has layout_blas_packed layout, then the layout's Triangle template argument has the same type as the function's Triangle template argument;
  • compatible-static-extents<decltype(A), decltype(A)>(0, 1) is true;
  • compatible-static-extents<decltype(A), decltype(x)>(0, 0) is true; and
  • possibly-addable<decltype(A), decltype(E), decltype(A)>() is true for those overloads with an E parameter.
Preconditions:
  • A.extent(0) equals A.extent(1),
  • A.extent(0) equals x.extent(0), and
  • addable(A, E, A) is true for those overloads with an E parameter.
Complexity: .
template<scalar Scalar, in-vector InVec, possibly-packed-out-matrix OutMat, class Triangle> void symmetric_matrix_rank_1_update(Scalar alpha, InVec x, OutMat A, Triangle t); template<class ExecutionPolicy, scalar Scalar, in-vector InVec, possibly-packed-out-matrix OutMat, class Triangle> void symmetric_matrix_rank_1_update(ExecutionPolicy&& exec, Scalar alpha, InVec x, OutMat A, Triangle t);
These functions perform an overwriting symmetric rank-1 update of the symmetric matrix A, taking into account the Triangle parameter that applies to A ([linalg.general]).
Effects: Computes a matrix , where the scalar α is alpha.
template<scalar Scalar, in-vector InVec, in-matrix InMat, possibly-packed-out-matrix OutMat, class Triangle> void symmetric_matrix_rank_1_update(Scalar alpha, InVec x, InMat E, OutMat A, Triangle t); template<class ExecutionPolicy, scalar Scalar, in-vector InVec, in-matrix InMat, possibly-packed-out-matrix OutMat, class Triangle> void symmetric_matrix_rank_1_update(ExecutionPolicy&& exec, Scalar alpha, InVec x, InMat E, OutMat A, Triangle t);
These functions perform an updating symmetric rank-1 update of the symmetric matrix A using the symmetric matrix E, taking into account the Triangle parameter that applies to A and E ([linalg.general]).
Effects: Computes , where the scalar α is alpha.
Remarks: A may alias E.
template<scalar Scalar, in-vector InVec, possibly-packed-out-matrix OutMat, class Triangle> void hermitian_matrix_rank_1_update(Scalar alpha, InVec x, OutMat A, Triangle t); template<class ExecutionPolicy, scalar Scalar, in-vector InVec, possibly-packed-out-matrix OutMat, class Triangle> void hermitian_matrix_rank_1_update(ExecutionPolicy&& exec, Scalar alpha, InVec x, OutMat A, Triangle t);
These functions perform an overwriting Hermitian rank-1 update of the Hermitian matrix A, taking into account the Triangle parameter that applies to A ([linalg.general]).
Effects: Computes , where the scalar α is real-if-needed(alpha).
template<scalar Scalar, possibly-packed-out-matrix OutMat, class Triangle> void hermitian_matrix_rank_1_update(InVec x, OutMat A, Triangle t); template<class ExecutionPolicy, scalar Scalar, possibly-packed-out-matrix OutMat, class Triangle> void hermitian_matrix_rank_1_update(ExecutionPolicy&& exec, InVec x, OutMat A, Triangle t);
These functions perform an updating Hermitian rank-1 update of the Hermitian matrix A using the Hermitian matrix E, taking into account the Triangle parameter that applies to A and E ([linalg.general]).
Effects: Computes , where the scalar α is real-if-needed(alpha).
Remarks: A may alias E.