SWAP[x,y]
swaps contents of the vectors x and y.
SWAP
SWAP[x,y]
swaps contents of the vectors x and y.
更多信息和选项
- To use SWAP, you first need to load the BLAS Package using Needs["LinearAlgebra`BLAS`"].
- The following arguments must be given:
-
x input/output symbol vector; the symbol value is modified in place y input/output symbol vector; the symbol value is modified in place - SWAP[x,y] is equivalent to {x,y}={y,x}.
- The vector arguments must be of the same length.
范例
打开所有单元 关闭所有单元基本范例 (1)
Scope (4)
x = {1.2, -3.1, 0.4};
y = {-2.9, 1.6, 2.2};
SWAP[x, y];
{x, y}x = {2.I, -3. + 1.2I, 3.};
y = {0.4 + 7.3I, 2.2, 2.1I};
SWAP[x, y];
{x, y}x = {1`20, 2, 3};
y = {-1`20, 0, 1};
SWAP[x, y];
{x, y}x = {v1, v2, v3};
y = {w1, w2, w3};
SWAP[x, y];
{x, y}Generalizations & Extensions (2)
Properties & Relations (1)
文本
Wolfram Research (2017),SWAP,Wolfram 语言函数,https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/SWAP.html.
CMS
Wolfram 语言. 2017. "SWAP." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/SWAP.html.
APA
Wolfram 语言. (2017). SWAP. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/SWAP.html 年
BibTeX
@misc{reference.wolfram_2026_swap, author="Wolfram Research", title="{SWAP}", year="2017", howpublished="\url{https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/SWAP.html}", note=[Accessed: 26-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_swap, organization={Wolfram Research}, title={SWAP}, year={2017}, url={https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/SWAP.html}, note=[Accessed: 26-June-2026]}