({{, COPY[x,y] 
copies the contents of the vector x to the vector y.}})

OpenersNotesSection(Spacer1)Details

To use COPY, you first need to load the BLAS Package using (RefLink[Needs, paclet:ref/Needs])["LinearAlgebra`BLAS`"].

The following arguments must be given:

COPY[x,y] is equivalent to y=x.

OpenersPrimaryExamplesSection(Spacer1)Examples  (8)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Load the BLAS package:

Needs["LinearAlgebra`BLAS`"]

Assign a vector to y:

COPY[{1,2,3},y];
y

OpenersExampleSection1(Spacer1)Scope  (4)

A real vector :

COPY[{1.2,-2.3,4.5},y];
y

A complex vector:

COPY[{1.2+2.3 I, 3.1 I},z];
z

An arbitrary-precision vector:

COPY[{1`20,2,3},y];
y

A symbolic vector:

COPY[{a,b,c},s];
s

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

COPY[x,w] is equivalent to w=x:

x=RandomReal[1,{5}];
COPY[x,w];
w==x

OpenersExampleSection4(Spacer1)Possible Issues  (2)

If the second argument is not a symbol, an error message is issued:

COPY[x,{2,3,4}]

If the output symbol has been initialized to a vector, the input and output must have the same length:

COPY[{1,2},y];
y

To avoid this error, clear the existing output symbol.

Clear[y]
COPY[{1,2,3},y]

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Basic Linear Algebra Subroutines, paclet:LowLevelLinearAlgebra/guide/BLASGuide])}})}})