Files
cppdraft_translate/cppdraft/linalg/algs/blas1/matfrobnorm.md
2025-10-25 03:02:53 +03:00

3.0 KiB
Raw Blame History

[linalg.algs.blas1.matfrobnorm]

29 Numerics library [numerics]

29.9 Basic linear algebra algorithms [linalg]

29.9.13 BLAS 1 algorithms [linalg.algs.blas1]

29.9.13.12 Frobenius norm of a matrix [linalg.algs.blas1.matfrobnorm]

1

#

[Note 1:

These functions exist in the BLAS standard[bib] but are not part of the reference implementation.

— end note]

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Scalar> Scalar matrix_frob_norm(InMat A, Scalar init); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat, class Scalar> Scalar matrix_frob_norm(ExecutionPolicy&& exec, InMat A, Scalar init);

2

#

Mandates: Let a beabs-if-needed(declval<typename InMat::value_type>()).

Then, decltype(init + a * a) is convertible to Scalar.

3

#

Returns: The square root of the sum of squares of init and the absolute values of the elements of A.

[Note 2:

For init equal to zero, this is the Frobenius norm of the matrix A.

— end note]

4

#

Remarks: If InMat::value_type and Scalar are all floating-point types or specializations of complex, and if Scalar has higher precision than InMat::value_type, then intermediate terms in the sum use Scalar's precision or greater.

🔗

template<[in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat> auto matrix_frob_norm(InMat A); template<class ExecutionPolicy, [in-matrix](linalg.helpers.concepts#concept:in-matrix "29.9.7.5Argument concepts[linalg.helpers.concepts]") InMat> auto matrix_frob_norm(ExecutionPolicy&& exec, InMat A);

5

#

Effects: Let a beabs-if-needed(declval<typename InMat::value_type>()).

Let T bedecltype(a * a).

Then,

the one-parameter overload is equivalent to:return matrix_frob_norm(A, T{}); and

the two-parameter overload is equivalent to:return matrix_frob_norm(std::forward(exec), A, T{});