Lines Matching refs:valarray
1 // The template and inlines for the -*- C++ -*- valarray class.
25 /** @file include/valarray
89 template<class _Tp> class valarray; // An array of type _Tp
118 * A valarray is an array that provides constraints intended to allow for
127 class valarray
138 // _lib.valarray.cons_ construct/destroy:
140 valarray();
143 explicit valarray(size_t);
146 valarray(const _Tp&, size_t);
149 valarray(const _Tp* __restrict__, size_t);
152 valarray(const valarray&);
156 valarray(valarray&&) noexcept;
160 valarray(const slice_array<_Tp>&);
163 valarray(const gslice_array<_Tp>&);
166 valarray(const mask_array<_Tp>&);
169 valarray(const indirect_array<_Tp>&);
173 valarray(initializer_list<_Tp>);
177 valarray(const _Expr<_Dom, _Tp>& __e);
179 ~valarray() _GLIBCXX_NOEXCEPT;
181 // _lib.valarray.assign_ assignment:
189 valarray<_Tp>& operator=(const valarray<_Tp>& __v);
199 valarray<_Tp>& operator=(valarray<_Tp>&& __v) noexcept;
209 valarray<_Tp>& operator=(const _Tp& __t);
219 valarray<_Tp>& operator=(const slice_array<_Tp>& __sa);
229 valarray<_Tp>& operator=(const gslice_array<_Tp>& __ga);
239 valarray<_Tp>& operator=(const mask_array<_Tp>& __ma);
249 valarray<_Tp>& operator=(const indirect_array<_Tp>& __ia);
260 valarray& operator=(initializer_list<_Tp> __l);
263 template<class _Dom> valarray<_Tp>&
266 // _lib.valarray.access_ element access:
276 // 389. Const overload of valarray::operator[] returns by value.
279 // _lib.valarray.sub_ subset operations:
283 * Returns a new valarray containing the elements of the array
284 * indicated by the slice argument. The new valarray has the same size
288 * @return New valarray containing elements in @a __s.
295 * Returns a new valarray containing the elements of the array
296 * indicated by the slice argument. The new valarray has the same size
300 * @return New valarray containing elements in @a __s.
318 * Returns a new valarray containing the elements of the array
319 * indicated by the gslice argument. The new valarray has
323 * @return New valarray containing elements in @a __s.
330 * Returns a new valarray containing the elements of the array
331 * indicated by the argument. The input is a valarray of bool which
333 * the new valarray. Each element of the array is added to the return
334 * valarray if the corresponding element of the argument is true.
336 * @param __m The valarray bitmask.
337 * @return New valarray containing elements indicated by @a __m.
339 valarray<_Tp> operator[](const valarray<bool>& __m) const;
345 * indicated by the argument. The input is a valarray of bool which
350 * @param __m The valarray bitmask.
351 * @return New valarray containing elements indicated by @a __m.
353 mask_array<_Tp> operator[](const valarray<bool>& __m);
358 * Returns a new valarray containing the elements of the array
360 * interpreted as the indices of elements of this valarray to copy to
361 * the return valarray.
363 * @param __i The valarray element index list.
364 * @return New valarray containing elements in @a __s.
367 operator[](const valarray<size_t>& __i) const;
374 * interpreted as the indices of elements of this valarray to include
378 * @param __i The valarray element index list.
381 indirect_array<_Tp> operator[](const valarray<size_t>& __i);
383 // _lib.valarray.unary_ unary operators:
384 /// Return a new valarray by applying unary + to each element.
387 /// Return a new valarray by applying unary - to each element.
390 /// Return a new valarray by applying unary ~ to each element.
393 /// Return a new valarray by applying unary ! to each element.
396 // _lib.valarray.cassign_ computed assignment:
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 _Tp&);
422 valarray<_Tp>& operator<<=(const _Tp&);
425 valarray<_Tp>& operator>>=(const _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 valarray<_Tp>&);
452 valarray<_Tp>& operator<<=(const valarray<_Tp>&);
455 valarray<_Tp>& operator>>=(const valarray<_Tp>&);
458 valarray<_Tp>& operator*=(const _Expr<_Dom, _Tp>&);
460 valarray<_Tp>& operator/=(const _Expr<_Dom, _Tp>&);
462 valarray<_Tp>& operator%=(const _Expr<_Dom, _Tp>&);
464 valarray<_Tp>& operator+=(const _Expr<_Dom, _Tp>&);
466 valarray<_Tp>& operator-=(const _Expr<_Dom, _Tp>&);
468 valarray<_Tp>& operator^=(const _Expr<_Dom, _Tp>&);
470 valarray<_Tp>& operator|=(const _Expr<_Dom, _Tp>&);
472 valarray<_Tp>& operator&=(const _Expr<_Dom, _Tp>&);
474 valarray<_Tp>& operator<<=(const _Expr<_Dom, _Tp>&);
476 valarray<_Tp>& operator>>=(const _Expr<_Dom, _Tp>&);
478 // _lib.valarray.members_ member functions:
481 void swap(valarray<_Tp>& __v) noexcept;
504 * A new valarray is constructed as a copy of this array with elements
506 * is i - n. The new valarray has the same size as the current one.
514 * @return New valarray with elements in shifted positions.
516 valarray<_Tp> shift (int __n) const;
521 * A new valarray is constructed as a copy of this array with elements
523 * is (i - n) % size(). The new valarray has the same size as the
531 * @return New valarray with elements in shifted positions.
533 valarray<_Tp> cshift(int __n) const;
538 * Returns a new valarray with elements assigned to the result of
543 * @return New valarray with transformed elements.
550 * Returns a new valarray with elements assigned to the result of
555 * @return New valarray with transformed elements.
579 valarray(const _Tp(&)[_Nm], size_t) -> valarray<_Tp>;
584 valarray<_Tp>::operator[](size_t __i) const
592 valarray<_Tp>::operator[](size_t __i)
621 valarray<_Tp>::valarray() : _M_size(0), _M_data(0) {}
625 valarray<_Tp>::valarray(size_t __n)
631 valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
637 valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
646 valarray<_Tp>::valarray(const valarray<_Tp>& __v)
654 valarray<_Tp>::valarray(valarray<_Tp>&& __v) noexcept
664 valarray<_Tp>::valarray(const slice_array<_Tp>& __sa)
673 valarray<_Tp>::valarray(const gslice_array<_Tp>& __ga)
684 valarray<_Tp>::valarray(const mask_array<_Tp>& __ma)
693 valarray<_Tp>::valarray(const indirect_array<_Tp>& __ia)
703 valarray<_Tp>::valarray(initializer_list<_Tp> __l)
710 valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e)
716 valarray<_Tp>::~valarray() _GLIBCXX_NOEXCEPT
723 inline valarray<_Tp>&
724 valarray<_Tp>::operator=(const valarray<_Tp>& __v)
727 // 630. arrays of valarray.
747 inline valarray<_Tp>&
748 valarray<_Tp>::operator=(valarray<_Tp>&& __v) noexcept
763 inline valarray<_Tp>&
764 valarray<_Tp>::operator=(initializer_list<_Tp> __l)
767 // 630. arrays of valarray.
787 inline valarray<_Tp>&
788 valarray<_Tp>::operator=(const _Tp& __t)
795 inline valarray<_Tp>&
796 valarray<_Tp>::operator=(const slice_array<_Tp>& __sa)
805 inline valarray<_Tp>&
806 valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga)
815 inline valarray<_Tp>&
816 valarray<_Tp>::operator=(const mask_array<_Tp>& __ma)
825 inline valarray<_Tp>&
826 valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia)
835 inline valarray<_Tp>&
836 valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
839 // 630. arrays of valarray.
858 valarray<_Tp>::operator[](slice __s) const
866 valarray<_Tp>::operator[](slice __s)
871 valarray<_Tp>::operator[](const gslice& __gs) const
880 valarray<_Tp>::operator[](const gslice& __gs)
887 inline valarray<_Tp>
888 valarray<_Tp>::operator[](const valarray<bool>& __m) const
894 return valarray<_Tp>(mask_array<_Tp>(_Array<_Tp>(_M_data), __s,
900 valarray<_Tp>::operator[](const valarray<bool>& __m)
911 valarray<_Tp>::operator[](const valarray<size_t>& __i) const
919 valarray<_Tp>::operator[](const valarray<size_t>& __i)
928 valarray<_Tp>::swap(valarray<_Tp>& __v) noexcept
937 valarray<_Tp>::size() const
942 valarray<_Tp>::sum() const
949 inline valarray<_Tp>
950 valarray<_Tp>::shift(int __n) const
952 valarray<_Tp> __ret;
990 inline valarray<_Tp>
991 valarray<_Tp>::cshift(int __n) const
993 valarray<_Tp> __ret;
1032 valarray<_Tp>::resize(size_t __n, _Tp __c)
1034 // This complication is so to make valarray<valarray<T> > work
1036 // be saying valarray<valarray<T> > anyway. See the specs.
1049 valarray<_Tp>::min() const
1057 valarray<_Tp>::max() const
1065 valarray<_Tp>::apply(_Tp func(_Tp)) const
1073 valarray<_Tp>::apply(_Tp func(const _Tp &)) const
1082 inline typename valarray<_Tp>::template _UnaryOp<_Name>::_Rt \
1083 valarray<_Tp>::operator _Op() const \
1099 inline valarray<_Tp>& \
1100 valarray<_Tp>::operator _Op##=(const _Tp &__t) \
1107 inline valarray<_Tp>& \
1108 valarray<_Tp>::operator _Op##=(const valarray<_Tp> &__v) \
1131 inline valarray<_Tp>& \
1132 valarray<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) \
1156 operator _Op(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
1167 operator _Op(const valarray<_Tp>& __v, \
1168 const typename valarray<_Tp>::value_type& __t) \
1178 operator _Op(const typename valarray<_Tp>::value_type& __t, \
1179 const valarray<_Tp>& __v) \
1211 * the valarray.
1212 * @param __va valarray.
1216 begin(valarray<_Tp>& __va) noexcept
1221 * the const valarray.
1222 * @param __va valarray.
1226 begin(const valarray<_Tp>& __va) noexcept
1231 * the valarray.
1232 * @param __va valarray.
1236 end(valarray<_Tp>& __va) noexcept
1246 * the const valarray.
1247 * @param __va valarray.
1251 end(const valarray<_Tp>& __va) noexcept