From Jason Turner

[linalg.algs.blas1.matfrobnorm]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_ygvnfiy/{from.md → to.md} +49 -0
tmp/tmp_ygvnfiy/{from.md → to.md} RENAMED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Frobenius norm of a matrix <a id="linalg.algs.blas1.matfrobnorm">[[linalg.algs.blas1.matfrobnorm]]</a>
2
+
3
+ [*Note 1*: These functions exist in the BLAS standard but are not part
4
+ of the reference implementation. — *end note*]
5
+
6
+ ``` cpp
7
+ template<in-matrix InMat, class Scalar>
8
+ Scalar matrix_frob_norm(InMat A, Scalar init);
9
+ template<class ExecutionPolicy, in-matrix InMat, class Scalar>
10
+ Scalar matrix_frob_norm(ExecutionPolicy&& exec, InMat A, Scalar init);
11
+ ```
12
+
13
+ *Mandates:* Let `a` be
14
+ *`abs-if-needed`*`(declval<typename InMat::value_type>())`. Then,
15
+ `decltype(init + a * a)` is convertible to `Scalar`.
16
+
17
+ *Returns:* The square root of the sum of squares of `init` and the
18
+ absolute values of the elements of `A`.
19
+
20
+ [*Note 1*: For `init` equal to zero, this is the Frobenius norm of the
21
+ matrix `A`. — *end note*]
22
+
23
+ *Remarks:* If `InMat::value_type` and `Scalar` are all floating-point
24
+ types or specializations of `complex`, and if `Scalar` has higher
25
+ precision than `InMat::value_type`, then intermediate terms in the sum
26
+ use `Scalar`’s precision or greater.
27
+
28
+ ``` cpp
29
+ template<in-matrix InMat>
30
+ auto matrix_frob_norm(InMat A);
31
+ template<class ExecutionPolicy, in-matrix InMat>
32
+ auto matrix_frob_norm(ExecutionPolicy&& exec, InMat A);
33
+ ```
34
+
35
+ *Effects:* Let `a` be
36
+ *`abs-if-needed`*`(declval<typename InMat::value_type>())`. Let `T` be
37
+ `decltype(a * a)`. Then,
38
+
39
+ - the one-parameter overload is equivalent to:
40
+ ``` cpp
41
+ return matrix_frob_norm(A, T{});
42
+ ```
43
+
44
+ and
45
+ - the two-parameter overload is equivalent to:
46
+ ``` cpp
47
+ return matrix_frob_norm(std::forward<ExecutionPolicy>(exec), A, T{});
48
+ ```
49
+