Init
This commit is contained in:
92
cppdraft/template/slice/array.md
Normal file
92
cppdraft/template/slice/array.md
Normal file
@@ -0,0 +1,92 @@
|
||||
[template.slice.array]
|
||||
|
||||
# 29 Numerics library [[numerics]](./#numerics)
|
||||
|
||||
## 29.6 Numeric arrays [[numarray]](numarray#template.slice.array)
|
||||
|
||||
### 29.6.5 Class template slice_array [template.slice.array]
|
||||
|
||||
#### [29.6.5.1](#overview) Overview [[template.slice.array.overview]](template.slice.array.overview)
|
||||
|
||||
[ð](#lib:slice_array)
|
||||
|
||||
namespace std {template<class T> class slice_array {public:using value_type = T; void operator= (const valarray<T>&) const; void operator*= (const valarray<T>&) const; void operator/= (const valarray<T>&) const; void operator%= (const valarray<T>&) const; void operator+= (const valarray<T>&) const; void operator-= (const valarray<T>&) const; void operator^= (const valarray<T>&) const; void operator&= (const valarray<T>&) const; void operator|= (const valarray<T>&) const; void operator<<=(const valarray<T>&) const; void operator>>=(const valarray<T>&) const;
|
||||
|
||||
slice_array(const slice_array&); ~slice_array(); const slice_array& operator=(const slice_array&) const; void operator=(const T&) const;
|
||||
|
||||
slice_array() = delete; // as implied by declaring copy constructor above};}
|
||||
|
||||
[1](#overview-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8504)
|
||||
|
||||
This template is a helper template used by theslice subscript operatorslice_array<T> valarray<T>::operator[](slice);
|
||||
|
||||
[2](#overview-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8511)
|
||||
|
||||
It has reference semantics to a subset of an array specified by aslice object[.](#overview-2.sentence-1)
|
||||
|
||||
[*Example [1](#overview-example-1)*:
|
||||
|
||||
The expressiona[slice(1, 5, 3)] = b; has the effect of assigning the elements ofb to a slice of the elements ina[.](#overview-2.sentence-2)
|
||||
|
||||
For the slice shown, the elements
|
||||
selected froma are 1,4,â¦,13[.](#overview-2.sentence-3)
|
||||
|
||||
â *end example*]
|
||||
|
||||
#### [29.6.5.2](#slice.arr.assign) Assignment [[slice.arr.assign]](slice.arr.assign)
|
||||
|
||||
[ð](#lib:operator=,slice_array)
|
||||
|
||||
`void operator=(const valarray<T>&) const;
|
||||
const slice_array& operator=(const slice_array&) const;
|
||||
`
|
||||
|
||||
[1](#slice.arr.assign-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8537)
|
||||
|
||||
These assignment operators have reference semantics,
|
||||
assigning the values of the argument array elements to selected
|
||||
elements of thevalarray<T> object to which theslice_array object refers[.](#slice.arr.assign-1.sentence-1)
|
||||
|
||||
#### [29.6.5.3](#slice.arr.comp.assign) Compound assignment [[slice.arr.comp.assign]](slice.arr.comp.assign)
|
||||
|
||||
[ð](#lib:operator*=,slice_array)
|
||||
|
||||
`void operator*= (const valarray<T>&) const;
|
||||
void operator/= (const valarray<T>&) const;
|
||||
void operator%= (const valarray<T>&) const;
|
||||
void operator+= (const valarray<T>&) const;
|
||||
void operator-= (const valarray<T>&) const;
|
||||
void operator^= (const valarray<T>&) const;
|
||||
void operator&= (const valarray<T>&) const;
|
||||
void operator|= (const valarray<T>&) const;
|
||||
void operator<<=(const valarray<T>&) const;
|
||||
void operator>>=(const valarray<T>&) const;
|
||||
`
|
||||
|
||||
[1](#slice.arr.comp.assign-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8573)
|
||||
|
||||
These compound assignments have reference semantics, applying the
|
||||
indicated operation to the elements of the argument array
|
||||
and selected elements of thevalarray<T> object to which theslice_array object refers[.](#slice.arr.comp.assign-1.sentence-1)
|
||||
|
||||
#### [29.6.5.4](#slice.arr.fill) Fill function [[slice.arr.fill]](slice.arr.fill)
|
||||
|
||||
[ð](#lib:operator=,slice_array_)
|
||||
|
||||
`void operator=(const T&) const;
|
||||
`
|
||||
|
||||
[1](#slice.arr.fill-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8591)
|
||||
|
||||
This function has reference semantics, assigning the value of its argument
|
||||
to the elements of thevalarray<T> object to which theslice_array object refers[.](#slice.arr.fill-1.sentence-1)
|
||||
38
cppdraft/template/slice/array/overview.md
Normal file
38
cppdraft/template/slice/array/overview.md
Normal file
@@ -0,0 +1,38 @@
|
||||
[template.slice.array.overview]
|
||||
|
||||
# 29 Numerics library [[numerics]](./#numerics)
|
||||
|
||||
## 29.6 Numeric arrays [[numarray]](numarray#template.slice.array.overview)
|
||||
|
||||
### 29.6.5 Class template slice_array [[template.slice.array]](template.slice.array#overview)
|
||||
|
||||
#### 29.6.5.1 Overview [template.slice.array.overview]
|
||||
|
||||
[ð](#lib:slice_array)
|
||||
|
||||
namespace std {template<class T> class slice_array {public:using value_type = T; void operator= (const valarray<T>&) const; void operator*= (const valarray<T>&) const; void operator/= (const valarray<T>&) const; void operator%= (const valarray<T>&) const; void operator+= (const valarray<T>&) const; void operator-= (const valarray<T>&) const; void operator^= (const valarray<T>&) const; void operator&= (const valarray<T>&) const; void operator|= (const valarray<T>&) const; void operator<<=(const valarray<T>&) const; void operator>>=(const valarray<T>&) const;
|
||||
|
||||
slice_array(const slice_array&); ~slice_array(); const slice_array& operator=(const slice_array&) const; void operator=(const T&) const;
|
||||
|
||||
slice_array() = delete; // as implied by declaring copy constructor above};}
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8504)
|
||||
|
||||
This template is a helper template used by theslice subscript operatorslice_array<T> valarray<T>::operator[](slice);
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8511)
|
||||
|
||||
It has reference semantics to a subset of an array specified by aslice object[.](#2.sentence-1)
|
||||
|
||||
[*Example [1](#example-1)*:
|
||||
|
||||
The expressiona[slice(1, 5, 3)] = b; has the effect of assigning the elements ofb to a slice of the elements ina[.](#2.sentence-2)
|
||||
|
||||
For the slice shown, the elements
|
||||
selected froma are 1,4,â¦,13[.](#2.sentence-3)
|
||||
|
||||
â *end example*]
|
||||
Reference in New Issue
Block a user