29 Numerics library [numerics]

29.9 Basic linear algebra algorithms [linalg]

29.9.14 BLAS 2 algorithms [linalg.algs.blas2]

29.9.14.8 Symmetric and Hermitian rank-2 matrix updates [linalg.algs.blas2.rank2]

[Note 1: 
These functions correspond to the BLAS functions xSYR2,xSPR2, xHER2 and xHPR2[bib].
— end note]
The following elements apply to all functions in [linalg.algs.blas2.rank2].
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;
  • If the function has an InMat template parameter and InMat 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;
  • possibly-multipliable<decltype(A), decltype(x), decltype(y)>() 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),
  • multipliable(A, x, y) is true, and
  • addable(A, E, A) is true for those overloads with an E parameter.
Complexity: .
template<in-vector InVec1, in-vector InVec2, possibly-packed-out-matrix OutMat, class Triangle> void symmetric_matrix_rank_2_update(InVec1 x, InVec2 y, OutMat A, Triangle t); template<class ExecutionPolicy, in-vector InVec1, in-vector InVec2, possibly-packed-out-matrix OutMat, class Triangle> void symmetric_matrix_rank_2_update(ExecutionPolicy&& exec, InVec1 x, InVec2 y, OutMat A, Triangle t);
These functions perform an overwriting symmetric rank-2 update of the symmetric matrix A, taking into account the Triangle parameter that applies to A ([linalg.general]).
Effects: Computes .
template<in-vector InVec1, in-vector InVec2, in-matrix InMat, possibly-packed-out-matrix OutMat, class Triangle> void symmetric_matrix_rank_2_update(InVec1 x, InVec2 y, InMat E, OutMat A, Triangle t); template<class ExecutionPolicy, in-vector InVec1, in-vector InVec2, in-matrix InMat, possibly-packed-out-matrix OutMat, class Triangle> void symmetric_matrix_rank_2_update(ExecutionPolicy&& exec, InVec1 x, InVec2 y, InMat E, OutMat A, Triangle t);
These functions perform an updating symmetric rank-2 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 .
Remarks: A may alias E.
template<in-vector InVec1, in-vector InVec2, possibly-packed-out-matrix OutMat, class Triangle> void hermitian_matrix_rank_2_update(InVec1 x, InVec2 y, OutMat A, Triangle t); template<class ExecutionPolicy, in-vector InVec1, in-vector InVec2, possibly-packed-out-matrix OutMat, class Triangle> void hermitian_matrix_rank_2_update(ExecutionPolicy&& exec, InVec1 x, InVec2 y, OutMat A, Triangle t);
These functions perform an overwriting Hermitian rank-2 update of the Hermitian matrix A, taking into account the Triangle parameter that applies to A ([linalg.general]).
Effects: Computes .
template<in-vector InVec1, in-vector InVec2, in-matrix InMat, possibly-packed-out-matrix OutMat, class Triangle> void hermitian_matrix_rank_2_update(InVec1 x, InVec2 y, InMat E, OutMat A, Triangle t); template<class ExecutionPolicy, in-vector InVec1, in-vector InVec2, in-matrix InMat, possibly-packed-out-matrix OutMat, class Triangle> void hermitian_matrix_rank_2_update(ExecutionPolicy&& exec, InVec1 x, InVec2 y, InMat E, OutMat A, Triangle t);
These functions perform an updating Hermitian rank-2 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 .
Remarks: A may alias E.