Lines Matching refs:valarray
1 // The template and inlines for the -*- C++ -*- valarray class.
25 /** @file include/valarray
78 template<class _Tp> class valarray; // An array of type _Tp
107 * A valarray is an array that provides constraints intended to allow for
116 class valarray
127 // _lib.valarray.cons_ construct/destroy:
129 valarray();
132 explicit valarray(size_t);
135 valarray(const _Tp&, size_t);
138 valarray(const _Tp* __restrict__, size_t);
141 valarray(const valarray&);
145 valarray(valarray&&) noexcept;
149 valarray(const slice_array<_Tp>&);
152 valarray(const gslice_array<_Tp>&);
155 valarray(const mask_array<_Tp>&);
158 valarray(const indirect_array<_Tp>&);
162 valarray(initializer_list<_Tp>);
166 valarray(const _Expr<_Dom, _Tp>& __e);
168 ~valarray() _GLIBCXX_NOEXCEPT;
170 // _lib.valarray.assign_ assignment:
178 valarray<_Tp>& operator=(const valarray<_Tp>& __v);
188 valarray<_Tp>& operator=(valarray<_Tp>&& __v) noexcept;
198 valarray<_Tp>& operator=(const _Tp& __t);
208 valarray<_Tp>& operator=(const slice_array<_Tp>& __sa);
218 valarray<_Tp>& operator=(const gslice_array<_Tp>& __ga);
228 valarray<_Tp>& operator=(const mask_array<_Tp>& __ma);
238 valarray<_Tp>& operator=(const indirect_array<_Tp>& __ia);
249 valarray& operator=(initializer_list<_Tp> __l);
252 template<class _Dom> valarray<_Tp>&
255 // _lib.valarray.access_ element access:
265 // 389. Const overload of valarray::operator[] returns by value.
268 // _lib.valarray.sub_ subset operations:
272 * Returns a new valarray containing the elements of the array
273 * indicated by the slice argument. The new valarray has the same size
277 * @return New valarray containing elements in @a __s.
284 * Returns a new valarray containing the elements of the array
285 * indicated by the slice argument. The new valarray has the same size
289 * @return New valarray containing elements in @a __s.
307 * Returns a new valarray containing the elements of the array
308 * indicated by the gslice argument. The new valarray has
312 * @return New valarray containing elements in @a __s.
319 * Returns a new valarray containing the elements of the array
320 * indicated by the argument. The input is a valarray of bool which
322 * the new valarray. Each element of the array is added to the return
323 * valarray if the corresponding element of the argument is true.
325 * @param __m The valarray bitmask.
326 * @return New valarray containing elements indicated by @a __m.
328 valarray<_Tp> operator[](const valarray<bool>& __m) const;
334 * indicated by the argument. The input is a valarray of bool which
339 * @param __m The valarray bitmask.
340 * @return New valarray containing elements indicated by @a __m.
342 mask_array<_Tp> operator[](const valarray<bool>& __m);
347 * Returns a new valarray containing the elements of the array
349 * interpreted as the indices of elements of this valarray to copy to
350 * the return valarray.
352 * @param __i The valarray element index list.
353 * @return New valarray containing elements in @a __s.
356 operator[](const valarray<size_t>& __i) const;
363 * interpreted as the indices of elements of this valarray to include
367 * @param __i The valarray element index list.
370 indirect_array<_Tp> operator[](const valarray<size_t>& __i);
372 // _lib.valarray.unary_ unary operators:
373 /// Return a new valarray by applying unary + to each element.
376 /// Return a new valarray by applying unary - to each element.
379 /// Return a new valarray by applying unary ~ to each element.
382 /// Return a new valarray by applying unary ! to each element.
385 // _lib.valarray.cassign_ computed assignment:
387 valarray<_Tp>& operator*=(const _Tp&);
390 valarray<_Tp>& operator/=(const _Tp&);
393 valarray<_Tp>& operator%=(const _Tp&);
396 valarray<_Tp>& operator+=(const _Tp&);
399 valarray<_Tp>& operator-=(const _Tp&);
402 valarray<_Tp>& operator^=(const _Tp&);
405 valarray<_Tp>& operator&=(const _Tp&);
408 valarray<_Tp>& operator|=(const _Tp&);
411 valarray<_Tp>& operator<<=(const _Tp&);
414 valarray<_Tp>& operator>>=(const _Tp&);
417 valarray<_Tp>& operator*=(const valarray<_Tp>&);
420 valarray<_Tp>& operator/=(const valarray<_Tp>&);
423 valarray<_Tp>& operator%=(const valarray<_Tp>&);
426 valarray<_Tp>& operator+=(const valarray<_Tp>&);
429 valarray<_Tp>& operator-=(const valarray<_Tp>&);
432 valarray<_Tp>& operator^=(const valarray<_Tp>&);
435 valarray<_Tp>& operator|=(const valarray<_Tp>&);
438 valarray<_Tp>& operator&=(const valarray<_Tp>&);
441 valarray<_Tp>& operator<<=(const valarray<_Tp>&);
444 valarray<_Tp>& operator>>=(const valarray<_Tp>&);
447 valarray<_Tp>& operator*=(const _Expr<_Dom, _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 // _lib.valarray.members_ member functions:
470 void swap(valarray<_Tp>& __v) noexcept;
493 * A new valarray is constructed as a copy of this array with elements
495 * is i - n. The new valarray has the same size as the current one.
503 * @return New valarray with elements in shifted positions.
505 valarray<_Tp> shift (int __n) const;
510 * A new valarray is constructed as a copy of this array with elements
512 * is (i - n) % size(). The new valarray has the same size as the
520 * @return New valarray with elements in shifted positions.
522 valarray<_Tp> cshift(int __n) const;
527 * Returns a new valarray with elements assigned to the result of
532 * @return New valarray with transformed elements.
539 * Returns a new valarray with elements assigned to the result of
544 * @return New valarray with transformed elements.
568 valarray(const _Tp(&)[_Nm], size_t) -> valarray<_Tp>;
573 valarray<_Tp>::operator[](size_t __i) const
581 valarray<_Tp>::operator[](size_t __i)
610 valarray<_Tp>::valarray() : _M_size(0), _M_data(0) {}
614 valarray<_Tp>::valarray(size_t __n)
620 valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
626 valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
635 valarray<_Tp>::valarray(const valarray<_Tp>& __v)
643 valarray<_Tp>::valarray(valarray<_Tp>&& __v) noexcept
653 valarray<_Tp>::valarray(const slice_array<_Tp>& __sa)
662 valarray<_Tp>::valarray(const gslice_array<_Tp>& __ga)
673 valarray<_Tp>::valarray(const mask_array<_Tp>& __ma)
682 valarray<_Tp>::valarray(const indirect_array<_Tp>& __ia)
692 valarray<_Tp>::valarray(initializer_list<_Tp> __l)
699 valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e)
705 valarray<_Tp>::~valarray() _GLIBCXX_NOEXCEPT
712 inline valarray<_Tp>&
713 valarray<_Tp>::operator=(const valarray<_Tp>& __v)
716 // 630. arrays of valarray.
736 inline valarray<_Tp>&
737 valarray<_Tp>::operator=(valarray<_Tp>&& __v) noexcept
752 inline valarray<_Tp>&
753 valarray<_Tp>::operator=(initializer_list<_Tp> __l)
756 // 630. arrays of valarray.
776 inline valarray<_Tp>&
777 valarray<_Tp>::operator=(const _Tp& __t)
784 inline valarray<_Tp>&
785 valarray<_Tp>::operator=(const slice_array<_Tp>& __sa)
794 inline valarray<_Tp>&
795 valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga)
804 inline valarray<_Tp>&
805 valarray<_Tp>::operator=(const mask_array<_Tp>& __ma)
814 inline valarray<_Tp>&
815 valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia)
824 inline valarray<_Tp>&
825 valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
828 // 630. arrays of valarray.
847 valarray<_Tp>::operator[](slice __s) const
855 valarray<_Tp>::operator[](slice __s)
860 valarray<_Tp>::operator[](const gslice& __gs) const
869 valarray<_Tp>::operator[](const gslice& __gs)
876 inline valarray<_Tp>
877 valarray<_Tp>::operator[](const valarray<bool>& __m) const
883 return valarray<_Tp>(mask_array<_Tp>(_Array<_Tp>(_M_data), __s,
889 valarray<_Tp>::operator[](const valarray<bool>& __m)
900 valarray<_Tp>::operator[](const valarray<size_t>& __i) const
908 valarray<_Tp>::operator[](const valarray<size_t>& __i)
917 valarray<_Tp>::swap(valarray<_Tp>& __v) noexcept
926 valarray<_Tp>::size() const
931 valarray<_Tp>::sum() const
938 inline valarray<_Tp>
939 valarray<_Tp>::shift(int __n) const
941 valarray<_Tp> __ret;
979 inline valarray<_Tp>
980 valarray<_Tp>::cshift(int __n) const
982 valarray<_Tp> __ret;
1021 valarray<_Tp>::resize(size_t __n, _Tp __c)
1023 // This complication is so to make valarray<valarray<T> > work
1025 // be saying valarray<valarray<T> > anyway. See the specs.
1038 valarray<_Tp>::min() const
1046 valarray<_Tp>::max() const
1054 valarray<_Tp>::apply(_Tp func(_Tp)) const
1062 valarray<_Tp>::apply(_Tp func(const _Tp &)) const
1070 inline typename valarray<_Tp>::template _UnaryOp<_Name>::_Rt \
1071 valarray<_Tp>::operator _Op() const \
1087 inline valarray<_Tp>& \
1088 valarray<_Tp>::operator _Op##=(const _Tp &__t) \
1095 inline valarray<_Tp>& \
1096 valarray<_Tp>::operator _Op##=(const valarray<_Tp> &__v) \
1119 inline valarray<_Tp>& \
1120 valarray<_Tp>::operator _Op##=(const _Expr<_Dom, _Tp>& __e) \
1144 operator _Op(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
1155 operator _Op(const valarray<_Tp>& __v, const _Tp& __t) \
1165 operator _Op(const _Tp& __t, const valarray<_Tp>& __v) \
1196 * the valarray.
1197 * @param __va valarray.
1201 begin(valarray<_Tp>& __va)
1206 * the const valarray.
1207 * @param __va valarray.
1211 begin(const valarray<_Tp>& __va)
1216 * the valarray.
1217 * @param __va valarray.
1221 end(valarray<_Tp>& __va)
1226 * the const valarray.
1227 * @param __va valarray.
1231 end(const valarray<_Tp>& __va)