Lines Matching refs:valarray

1 // The template and inlines for the -*- C++ -*- valarray class.
27 /** @file include/valarray
80 template<class _Tp> class valarray; // An array of type _Tp
109 * A valarray is an array that provides constraints intended to allow for
118 class valarray
129 // _lib.valarray.cons_ construct/destroy:
131 valarray();
134 explicit valarray(size_t);
137 valarray(const _Tp&, size_t);
140 valarray(const _Tp* __restrict__, size_t);
143 valarray(const valarray&);
147 valarray(valarray&&) noexcept;
151 valarray(const slice_array<_Tp>&);
154 valarray(const gslice_array<_Tp>&);
157 valarray(const mask_array<_Tp>&);
160 valarray(const indirect_array<_Tp>&);
164 valarray(initializer_list<_Tp>);
168 valarray(const _Expr<_Dom, _Tp>& __e);
170 ~valarray() _GLIBCXX_NOEXCEPT;
172 // _lib.valarray.assign_ assignment:
180 valarray<_Tp>& operator=(const valarray<_Tp>& __v);
190 valarray<_Tp>& operator=(valarray<_Tp>&& __v) noexcept;
200 valarray<_Tp>& operator=(const _Tp& __t);
210 valarray<_Tp>& operator=(const slice_array<_Tp>& __sa);
220 valarray<_Tp>& operator=(const gslice_array<_Tp>& __ga);
230 valarray<_Tp>& operator=(const mask_array<_Tp>& __ma);
240 valarray<_Tp>& operator=(const indirect_array<_Tp>& __ia);
251 valarray& operator=(initializer_list<_Tp> __l);
254 template<class _Dom> valarray<_Tp>&
257 // _lib.valarray.access_ element access:
267 // 389. Const overload of valarray::operator[] returns by value.
270 // _lib.valarray.sub_ subset operations:
274 * Returns a new valarray containing the elements of the array
275 * indicated by the slice argument. The new valarray has the same size
279 * @return New valarray containing elements in @a __s.
286 * Returns a new valarray containing the elements of the array
287 * indicated by the slice argument. The new valarray has the same size
291 * @return New valarray containing elements in @a __s.
309 * Returns a new valarray containing the elements of the array
310 * indicated by the gslice argument. The new valarray has
314 * @return New valarray containing elements in @a __s.
321 * Returns a new valarray containing the elements of the array
322 * indicated by the argument. The input is a valarray of bool which
324 * the new valarray. Each element of the array is added to the return
325 * valarray if the corresponding element of the argument is true.
327 * @param __m The valarray bitmask.
328 * @return New valarray containing elements indicated by @a __m.
330 valarray<_Tp> operator[](const valarray<bool>& __m) const;
336 * indicated by the argument. The input is a valarray of bool which
341 * @param __m The valarray bitmask.
342 * @return New valarray containing elements indicated by @a __m.
344 mask_array<_Tp> operator[](const valarray<bool>& __m);
349 * Returns a new valarray containing the elements of the array
351 * interpreted as the indices of elements of this valarray to copy to
352 * the return valarray.
354 * @param __i The valarray element index list.
355 * @return New valarray containing elements in @a __s.
358 operator[](const valarray<size_t>& __i) const;
365 * interpreted as the indices of elements of this valarray to include
369 * @param __i The valarray element index list.
372 indirect_array<_Tp> operator[](const valarray<size_t>& __i);
374 // _lib.valarray.unary_ unary operators:
375 /// Return a new valarray by applying unary + to each element.
378 /// Return a new valarray by applying unary - to each element.
381 /// Return a new valarray by applying unary ~ to each element.
384 /// Return a new valarray by applying unary ! to each element.
387 // _lib.valarray.cassign_ computed assignment:
389 valarray<_Tp>& operator*=(const _Tp&);
392 valarray<_Tp>& operator/=(const _Tp&);
395 valarray<_Tp>& operator%=(const _Tp&);
398 valarray<_Tp>& operator+=(const _Tp&);
401 valarray<_Tp>& operator-=(const _Tp&);
404 valarray<_Tp>& operator^=(const _Tp&);
407 valarray<_Tp>& operator&=(const _Tp&);
410 valarray<_Tp>& operator|=(const _Tp&);
413 valarray<_Tp>& operator<<=(const _Tp&);
416 valarray<_Tp>& operator>>=(const _Tp&);
419 valarray<_Tp>& operator*=(const valarray<_Tp>&);
422 valarray<_Tp>& operator/=(const valarray<_Tp>&);
425 valarray<_Tp>& operator%=(const valarray<_Tp>&);
428 valarray<_Tp>& operator+=(const valarray<_Tp>&);
431 valarray<_Tp>& operator-=(const valarray<_Tp>&);
434 valarray<_Tp>& operator^=(const valarray<_Tp>&);
437 valarray<_Tp>& operator|=(const valarray<_Tp>&);
440 valarray<_Tp>& operator&=(const valarray<_Tp>&);
443 valarray<_Tp>& operator<<=(const valarray<_Tp>&);
446 valarray<_Tp>& operator>>=(const valarray<_Tp>&);
449 valarray<_Tp>& operator*=(const _Expr<_Dom, _Tp>&);
451 valarray<_Tp>& operator/=(const _Expr<_Dom, _Tp>&);
453 valarray<_Tp>& operator%=(const _Expr<_Dom, _Tp>&);
455 valarray<_Tp>& operator+=(const _Expr<_Dom, _Tp>&);
457 valarray<_Tp>& operator-=(const _Expr<_Dom, _Tp>&);
459 valarray<_Tp>& operator^=(const _Expr<_Dom, _Tp>&);
461 valarray<_Tp>& operator|=(const _Expr<_Dom, _Tp>&);
463 valarray<_Tp>& operator&=(const _Expr<_Dom, _Tp>&);
465 valarray<_Tp>& operator<<=(const _Expr<_Dom, _Tp>&);
467 valarray<_Tp>& operator>>=(const _Expr<_Dom, _Tp>&);
469 // _lib.valarray.members_ member functions:
472 void swap(valarray<_Tp>& __v) noexcept;
495 * A new valarray is constructed as a copy of this array with elements
497 * is i - n. The new valarray has the same size as the current one.
505 * @return New valarray with elements in shifted positions.
507 valarray<_Tp> shift (int __n) const;
512 * A new valarray is constructed as a copy of this array with elements
514 * is (i - n) % size(). The new valarray has the same size as the
522 * @return New valarray with elements in shifted positions.
524 valarray<_Tp> cshift(int __n) const;
529 * Returns a new valarray with elements assigned to the result of
534 * @return New valarray with transformed elements.
541 * Returns a new valarray with elements assigned to the result of
546 * @return New valarray with transformed elements.
570 valarray<_Tp>::operator[](size_t __i) const
578 valarray<_Tp>::operator[](size_t __i)
607 valarray<_Tp>::valarray() : _M_size(0), _M_data(0) {}
611 valarray<_Tp>::valarray(size_t __n)
617 valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
623 valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
632 valarray<_Tp>::valarray(const valarray<_Tp>& __v)
640 valarray<_Tp>::valarray(valarray<_Tp>&& __v) noexcept
650 valarray<_Tp>::valarray(const slice_array<_Tp>& __sa)
659 valarray<_Tp>::valarray(const gslice_array<_Tp>& __ga)
670 valarray<_Tp>::valarray(const mask_array<_Tp>& __ma)
679 valarray<_Tp>::valarray(const indirect_array<_Tp>& __ia)
689 valarray<_Tp>::valarray(initializer_list<_Tp> __l)
696 valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e)
702 valarray<_Tp>::~valarray() _GLIBCXX_NOEXCEPT
709 inline valarray<_Tp>&
710 valarray<_Tp>::operator=(const valarray<_Tp>& __v)
713 // 630. arrays of valarray.
733 inline valarray<_Tp>&
734 valarray<_Tp>::operator=(valarray<_Tp>&& __v) noexcept
749 inline valarray<_Tp>&
750 valarray<_Tp>::operator=(initializer_list<_Tp> __l)
753 // 630. arrays of valarray.
773 inline valarray<_Tp>&
774 valarray<_Tp>::operator=(const _Tp& __t)
781 inline valarray<_Tp>&
782 valarray<_Tp>::operator=(const slice_array<_Tp>& __sa)
791 inline valarray<_Tp>&
792 valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga)
801 inline valarray<_Tp>&
802 valarray<_Tp>::operator=(const mask_array<_Tp>& __ma)
811 inline valarray<_Tp>&
812 valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia)
821 inline valarray<_Tp>&
822 valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
831 valarray<_Tp>::operator[](slice __s) const
839 valarray<_Tp>::operator[](slice __s)
844 valarray<_Tp>::operator[](const gslice& __gs) const
853 valarray<_Tp>::operator[](const gslice& __gs)
860 inline valarray<_Tp>
861 valarray<_Tp>::operator[](const valarray<bool>& __m) const
867 return valarray<_Tp>(mask_array<_Tp>(_Array<_Tp>(_M_data), __s,
873 valarray<_Tp>::operator[](const valarray<bool>& __m)
884 valarray<_Tp>::operator[](const valarray<size_t>& __i) const
892 valarray<_Tp>::operator[](const valarray<size_t>& __i)
901 valarray<_Tp>::swap(valarray<_Tp>& __v) noexcept
910 valarray<_Tp>::size() const
915 valarray<_Tp>::sum() const
922 inline valarray<_Tp>
923 valarray<_Tp>::shift(int __n) const
925 valarray<_Tp> __ret;
963 inline valarray<_Tp>
964 valarray<_Tp>::cshift(int __n) const
966 valarray<_Tp> __ret;
1005 valarray<_Tp>::resize(size_t __n, _Tp __c)
1007 // This complication is so to make valarray<valarray<T> > work
1009 // be saying valarray<valarray<T> > anyway. See the specs.
1022 valarray<_Tp>::min() const
1030 valarray<_Tp>::max() const
1038 valarray<_Tp>::apply(_Tp func(_Tp)) const
1046 valarray<_Tp>::apply(_Tp func(const _Tp &)) const
1054 inline typename valarray<_Tp>::template _UnaryOp<_Name>::_Rt \
1055 valarray<_Tp>::operator _Op() const \
1071 inline valarray<_Tp>& \
1072 valarray<_Tp>::operator _Op##=(const _Tp &__t) \
1079 inline valarray<_Tp>& \
1080 valarray<_Tp>::operator _Op##=(const valarray<_Tp> &__v) \
1103 inline valarray<_Tp>& \
1104 valarray<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) \
1128 operator _Op(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
1139 operator _Op(const valarray<_Tp>& __v, const _Tp& __t) \
1149 operator _Op(const _Tp& __t, const valarray<_Tp>& __v) \
1180 * the valarray.
1181 * @param __va valarray.
1185 begin(valarray<_Tp>& __va)
1190 * the const valarray.
1191 * @param __va valarray.
1195 begin(const valarray<_Tp>& __va)
1200 * the valarray.
1201 * @param __va valarray.
1205 end(valarray<_Tp>& __va)
1210 * the const valarray.
1211 * @param __va valarray.
1215 end(const valarray<_Tp>& __va)