From Jason Turner

[linalg.algs.blas1.swap]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp91u3_s7d/{from.md → to.md} +26 -0
tmp/tmp91u3_s7d/{from.md → to.md} RENAMED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Swap matrix or vector elements <a id="linalg.algs.blas1.swap">[[linalg.algs.blas1.swap]]</a>
2
+
3
+ ``` cpp
4
+ template<inout-object InOutObj1, inout-object InOutObj2>
5
+ void swap_elements(InOutObj1 x, InOutObj2 y);
6
+ template<class ExecutionPolicy, inout-object InOutObj1, inout-object InOutObj2>
7
+ void swap_elements(ExecutionPolicy&& exec, InOutObj1 x, InOutObj2 y);
8
+ ```
9
+
10
+ [*Note 1*: These functions correspond to the BLAS function
11
+ `xSWAP`. — *end note*]
12
+
13
+ *Constraints:* `x.rank()` equals `y.rank()`.
14
+
15
+ *Mandates:* For all `r` in the range [0, `x.rank()`),
16
+
17
+ ``` cpp
18
+ compatible-static-extents<InOutObj1, InOutObj2>(r, r)
19
+ ```
20
+
21
+ is `true`.
22
+
23
+ *Preconditions:* `x.extents()` equals `y.extents()`.
24
+
25
+ *Effects:* Swaps all corresponding elements of `x` and `y`.
26
+