[linalg.algs.blas1.copy]

# 29 Numerics library [[numerics]](./#numerics)

## 29.9 Basic linear algebra algorithms [[linalg]](linalg#algs.blas1.copy)

### 29.9.13 BLAS 1 algorithms [[linalg.algs.blas1]](linalg.algs.blas1#copy)

#### 29.9.13.5 Copy elements of one matrix or vector into another [linalg.algs.blas1.copy]

[ð](#lib:copy)

`template<[in-object](linalg.helpers.concepts#concept:in-object "29.9.7.5 Argument concepts [linalg.helpers.concepts]") InObj, [out-object](linalg.helpers.concepts#concept:out-object "29.9.7.5 Argument concepts [linalg.helpers.concepts]") OutObj>
  void copy(InObj x, OutObj y);
template<class ExecutionPolicy, [in-object](linalg.helpers.concepts#concept:in-object "29.9.7.5 Argument concepts [linalg.helpers.concepts]") InObj, [out-object](linalg.helpers.concepts#concept:out-object "29.9.7.5 Argument concepts [linalg.helpers.concepts]") OutObj>
  void copy(ExecutionPolicy&& exec, InObj x, OutObj y);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L13521)

[*Note [1](#note-1)*:

These functions correspond to the BLAS function xCOPY[[bib]](bibliography#bib:blas1 "Bibliography")[.](#1.sentence-1)

â *end note*]

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L13526)

*Constraints*: x.rank() equals y.rank()[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L13530)

*Mandates*: For all r in the range [0,x.rank()),*compatible-static-extents*<InObj, OutObj>(r, r) is true[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L13538)

*Preconditions*: x.extents() equals y.extents()[.](#4.sentence-1)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L13542)

*Effects*: Assigns each element of x to the corresponding element of y[.](#5.sentence-1)
