Tp | Type of object in the array. |
Definition at line 109 of file valarray.
std::valarray< _Tp >::valarray | ( | ) | [inline] |
std::valarray< _Tp >::valarray | ( | size_t | __n | ) | [inline, explicit] |
std::valarray< _Tp >::valarray | ( | const _Tp & | __t, | |
size_t | __n | |||
) | [inline] |
std::valarray< _Tp >::valarray | ( | const _Tp * | __restrict__, | |
size_t | ||||
) |
Construct an array initialized to the first n elements of t.
std::valarray< _Tp >::valarray | ( | const valarray< _Tp > & | __v | ) | [inline] |
Copy constructor.
Definition at line 576 of file valarray.
References std::valarray< _Tp >::_M_data.
std::valarray< _Tp >::valarray | ( | const slice_array< _Tp > & | __sa | ) | [inline] |
Construct an array with the same size and values in sa.
Definition at line 583 of file valarray.
References std::slice_array< _Tp >::_M_array, std::slice_array< _Tp >::_M_stride, and std::slice_array< _Tp >::_M_sz.
std::valarray< _Tp >::valarray | ( | const gslice_array< _Tp > & | __ga | ) | [inline] |
Construct an array with the same size and values in ga.
Definition at line 592 of file valarray.
References std::gslice_array< _Tp >::_M_array, and std::gslice_array< _Tp >::_M_index.
std::valarray< _Tp >::valarray | ( | const mask_array< _Tp > & | __ma | ) | [inline] |
Construct an array with the same size and values in ma.
Definition at line 603 of file valarray.
References std::mask_array< _Tp >::_M_array, and std::mask_array< _Tp >::_M_mask.
std::valarray< _Tp >::valarray | ( | const indirect_array< _Tp > & | __ia | ) | [inline] |
Construct an array with the same size and values in ia.
Definition at line 612 of file valarray.
References std::indirect_array< _Tp >::_M_array, and std::indirect_array< _Tp >::_M_index.
_Expr< _RefFunClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::apply | ( | _Tp | funcconst _Tp & | ) | const [inline] |
Apply a function to the array.
Returns a new valarray with elements assigned to the result of applying func to the corresponding element of this array. The new array has the same size as this one.
func | Function of const Tp& returning Tp to apply. |
_Expr< _ValFunClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::apply | ( | _Tp | func_Tp | ) | const [inline] |
valarray< _Tp > std::valarray< _Tp >::cshift | ( | int | __n | ) | const [inline] |
Return a rotated array.
A new valarray is constructed as a copy of this array with elements in shifted positions. For an element with index i, the new position is (i - n) % size(). The new valarray has the same size as the current one. Elements that are shifted beyond the array bounds are shifted into the other end of the array. No elements are lost.
Positive arguments shift toward index 0, wrapping around the top. Negative arguments shift towards the top, wrapping around to 0.
n | Number of element positions to rotate. |
Definition at line 824 of file valarray.
References std::valarray< _Tp >::_M_data, and std::valarray< _Tp >::_M_size.
_Tp std::valarray< _Tp >::max | ( | ) | const [inline] |
Return the maximum element using operator<().
Definition at line 890 of file valarray.
References std::max_element().
_Tp std::valarray< _Tp >::min | ( | ) | const [inline] |
Return the minimum element using operator<().
Definition at line 882 of file valarray.
References std::min_element().
valarray< _Tp >::template _UnaryOp< __logical_not >::_Rt std::valarray< _Tp >::operator! | ( | ) | const [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator%= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator%= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator&= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator&= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator*= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator*= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp >::template _UnaryOp< __unary_plus >::_Rt std::valarray< _Tp >::operator+ | ( | ) | const [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator+= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator+= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp >::template _UnaryOp< __negate >::_Rt std::valarray< _Tp >::operator- | ( | ) | const [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator-= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator-= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator/= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator/= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator<<= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator<<= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator= | ( | const indirect_array< _Tp > & | __ia | ) | [inline] |
Assign elements to an array subset.
Assign elements of array to values in ia. Results are undefined if ia does not have the same size as this array.
ia | Array slice to get values from. |
Definition at line 682 of file valarray.
References std::indirect_array< _Tp >::_M_array, std::indirect_array< _Tp >::_M_index, and std::indirect_array< _Tp >::_M_sz.
valarray< _Tp > & std::valarray< _Tp >::operator= | ( | const mask_array< _Tp > & | __ma | ) | [inline] |
Assign elements to an array subset.
Assign elements of array to values in ma. Results are undefined if ma does not have the same size as this array.
ma | Array slice to get values from. |
Definition at line 672 of file valarray.
References std::mask_array< _Tp >::_M_array, std::mask_array< _Tp >::_M_mask, and std::mask_array< _Tp >::_M_sz.
valarray< _Tp > & std::valarray< _Tp >::operator= | ( | const gslice_array< _Tp > & | __ga | ) | [inline] |
Assign elements to an array subset.
Assign elements of array to values in ga. Results are undefined if ga does not have the same size as this array.
ga | Array slice to get values from. |
Definition at line 662 of file valarray.
References std::gslice_array< _Tp >::_M_array, std::gslice_array< _Tp >::_M_index, and std::valarray< _Tp >::size().
valarray< _Tp > & std::valarray< _Tp >::operator= | ( | const slice_array< _Tp > & | __sa | ) | [inline] |
Assign elements to an array subset.
Assign elements of array to values in sa. Results are undefined if sa does not have the same size as this array.
sa | Array slice to get values from. |
Definition at line 652 of file valarray.
References std::slice_array< _Tp >::_M_array, std::slice_array< _Tp >::_M_stride, and std::slice_array< _Tp >::_M_sz.
valarray< _Tp > & std::valarray< _Tp >::operator= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator= | ( | const valarray< _Tp > & | __v | ) | [inline] |
Assign elements to an array.
Assign elements of array to values in v. Results are undefined if v does not have the same size as this array.
v | Valarray to get values from. |
Definition at line 635 of file valarray.
References std::valarray< _Tp >::_M_data, and std::valarray< _Tp >::_M_size.
valarray< _Tp > & std::valarray< _Tp >::operator>>= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator>>= | ( | const _Tp & | __t | ) | [inline] |
indirect_array< _Tp > std::valarray< _Tp >::operator[] | ( | const valarray< size_t > & | __i | ) | [inline] |
Return a reference to an array subset.
Returns an indirect_array referencing the elements of the array indicated by the argument. The elements in the argument are interpreted as the indices of elements of this valarray to include in the subset. The returned indirect_array refers to these elements.
Definition at line 762 of file valarray.
References std::valarray< _Tp >::size().
_Expr< _IClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::operator[] | ( | const valarray< size_t > & | __i | ) | const [inline] |
mask_array< _Tp > std::valarray< _Tp >::operator[] | ( | const valarray< bool > & | __m | ) | [inline] |
Return a reference to an array subset.
Returns a new mask_array referencing the elements of the array indicated by the argument. The input is a valarray of bool which represents a bitmask indicating which elements are part of the subset. Elements of the array are part of the subset if the corresponding element of the argument is true.
m | The valarray bitmask. |
Definition at line 743 of file valarray.
References std::valarray< _Tp >::size().
valarray< _Tp > std::valarray< _Tp >::operator[] | ( | const valarray< bool > & | __m | ) | const [inline] |
Return an array subset.
Returns a new valarray containing the elements of the array indicated by the argument. The input is a valarray of bool which represents a bitmask indicating which elements should be copied into the new valarray. Each element of the array is added to the return valarray if the corresponding element of the argument is true.
m | The valarray bitmask. |
Definition at line 731 of file valarray.
References std::valarray< _Tp >::size().
gslice_array< _Tp > std::valarray< _Tp >::operator[] | ( | const gslice & | __gs | ) | [inline] |
Return a reference to an array subset.
Returns a new valarray containing the elements of the array indicated by the gslice argument. The new valarray has the same size as the input gslice.
s | The source gslice. |
Definition at line 723 of file valarray.
References std::gslice::_M_index.
_Expr< _GClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::operator[] | ( | const gslice & | __gs | ) | const [inline] |
Return an array subset.
Returns a slice_array referencing the elements of the array indicated by the slice argument.
s | The source slice. |
Definition at line 714 of file valarray.
References std::gslice::_M_index.
slice_array< _Tp > std::valarray< _Tp >::operator[] | ( | slice | __s | ) | [inline] |
_Expr< _SClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::operator[] | ( | slice | __s | ) | const [inline] |
_Tp & std::valarray< _Tp >::operator[] | ( | size_t | __i | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator^= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator^= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator|= | ( | const valarray< _Tp > & | __v | ) | [inline] |
valarray< _Tp > & std::valarray< _Tp >::operator|= | ( | const _Tp & | __t | ) | [inline] |
valarray< _Tp >::template _UnaryOp< __bitwise_not >::_Rt std::valarray< _Tp >::operator~ | ( | ) | const [inline] |
void std::valarray< _Tp >::resize | ( | size_t | __size, | |
_Tp | __c = _Tp() | |||
) | [inline] |
valarray< _Tp > std::valarray< _Tp >::shift | ( | int | __n | ) | const [inline] |
Return a shifted array.
A new valarray is constructed as a copy of this array with elements in shifted positions. For an element with index i, the new position is i - n. The new valarray has the same size as the current one. New elements without a value are set to 0. Elements whose new position is outside the bounds of the array are discarded.
Positive arguments shift toward index 0, discarding elements [0, n). Negative arguments discard elements from the top of the array.
n | Number of element positions to shift. |
Definition at line 783 of file valarray.
References std::valarray< _Tp >::_M_data, and std::valarray< _Tp >::_M_size.
size_t std::valarray< _Tp >::size | ( | ) | const [inline] |
Return the number of elements in array.
Definition at line 770 of file valarray.
Referenced by std::valarray< _Tp >::operator=(), std::gslice_array< _Tp >::operator=(), and std::valarray< _Tp >::operator[]().
_Tp std::valarray< _Tp >::sum | ( | ) | const [inline] |