Manpages - std_valarray.3

Table of Contents

NAME

std::valarray< _Tp > - Smart array designed to support numeric processing.

SYNOPSIS


Public Types

typedef _Tp value_type

Public Member Functions

valarray ()
Construct an empty array.

template<class _Dom > valarray (const _Expr< _Dom, _Tp > &__e)

valarray (const _Tp &, size_t)
Construct an array with n elements initialized to t.

template<typename Tp > valarray (const Tp *__restrict __p, size_t __n)

valarray (const Tp *__restrict_, size_t)
Construct an array initialized to the first n elements of t.

valarray (const *gslice_array*< _Tp > &)
Construct an array with the same size and values in ga.

valarray (const *indirect_array*< _Tp > &)
Construct an array with the same size and values in ia.

valarray (const *mask_array*< _Tp > &)
Construct an array with the same size and values in ma.

valarray (const *slice_array*< _Tp > &)
Construct an array with the same size and values in sa.

valarray (const valarray &)
Copy constructor.

valarray (*initializer_list*< _Tp >)
Construct an array with an initializer_list of values.

valarray (size_t)
Construct an array with n elements.

valarray (valarray &&) noexcept
Move constructor.

_Expr< _ValFunClos< _ValArray, _Tp >, _Tp > apply (_Tp func(_Tp)) const
Apply a function to the array.

_Expr< _RefFunClos< _ValArray, _Tp >, _Tp > apply (_Tp func(const _Tp &)) const
Apply a function to the array.

valarray*< _Tp > *cshift (int __n) const
Return a rotated array.

_Tp max () const
Return the maximum element using operator<().

_Tp min () const
Return the minimum element using operator<().

_UnaryOp< __logical_not >::_Rt operator! () const
Return a new valarray by applying unary ! to each element.

template<class _Dom > valarray*< _Tp > & *operator%= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator%= (const _Tp &)
Set each element e of array to e % t.

valarray*< _Tp > & *operator%= (const *valarray*< _Tp > &)
Modulo elements of array by corresponding elements of v.

template<class _Dom > valarray*< _Tp > & *operator&= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator&= (const _Tp &)
Set each element e of array to e & t.

valarray*< _Tp > & *operator&= (const *valarray*< _Tp > &)
Logical and corresponding elements of v with elements of array.

template<class _Dom > valarray*< _Tp > & *operator*= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator*= (const _Tp &)
Multiply each element of array by t.

valarray*< _Tp > & *operator*= (const *valarray*< _Tp > &)
Multiply elements of array by corresponding elements of v.

_UnaryOp< __unary_plus >::_Rt operator+ () const
Return a new valarray by applying unary + to each element.

template<class _Dom > valarray*< _Tp > & *operator+= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator+= (const _Tp &)
Add t to each element of array.

valarray*< _Tp > & *operator+= (const *valarray*< _Tp > &)
Add corresponding elements of v to elements of array.

_UnaryOp< __negate >::_Rt operator- () const
Return a new valarray by applying unary - to each element.

template<class _Dom > valarray*< _Tp > & *operator-= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator-= (const _Tp &)
Subtract t to each element of array.

valarray*< _Tp > & *operator-= (const *valarray*< _Tp > &)
Subtract corresponding elements of v from elements of array.

template<class _Dom > valarray*< _Tp > & *operator/= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator/= (const _Tp &)
Divide each element of array by t.

valarray*< _Tp > & *operator/= (const *valarray*< _Tp > &)
Divide elements of array by corresponding elements of v.

template<class _Dom > valarray*< _Tp > & *operator<<= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator<<= (const _Tp &)
Left shift each element e of array by t bits.

valarray*< _Tp > & *operator<<= (const *valarray*< _Tp > &)
Left shift elements of array by corresponding elements of v.

template<class _Dom > valarray*< _Tp > & *operator= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator= (const _Tp &__t)
Assign elements to a value.

valarray*< _Tp > & *operator= (const *gslice_array*< _Tp > &__ga)
Assign elements to an array subset.

valarray*< _Tp > & *operator= (const *indirect_array*< _Tp > &__ia)
Assign elements to an array subset.

valarray*< _Tp > & *operator= (const *mask_array*< _Tp > &__ma)
Assign elements to an array subset.

valarray*< _Tp > & *operator= (const *slice_array*< _Tp > &__sa)
Assign elements to an array subset.

valarray*< _Tp > & *operator= (const *valarray*< _Tp > &__v)
Assign elements to an array.

valarray & operator= (*initializer_list*< _Tp > __l)
Assign elements to an initializer_list.

valarray*< _Tp > & *operator= (*valarray*< _Tp > &&__v) noexcept
Move assign elements to an array.

template<class _Dom > valarray*< _Tp > & *operator>>= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator>>= (const _Tp &)
Right shift each element e of array by t bits.

valarray*< _Tp > & *operator>>= (const *valarray*< _Tp > &)
Right shift elements of array by corresponding elements of v.

gslice_array*< _Tp > *operator[] (const gslice &__s)
Return a reference to an array subset.

_Expr< _GClos< _ValArray, _Tp >, _Tp > operator[] (const gslice &__s) const
Return an array subset.

mask_array*< _Tp > *operator[] (const *valarray*< bool > &__m)
Return a reference to an array subset.

valarray*< _Tp > *operator[] (const *valarray*< bool > &__m) const
Return an array subset.

indirect_array*< _Tp > *operator[] (const *valarray*< size_t > &__i)
Return a reference to an array subset.

_Expr< _IClos< _ValArray, _Tp >, _Tp > operator[] (const *valarray*< size_t > &__i) const
Return an array subset.

_Tp & operator[] (size_t __i)

const _Tp & operator[] (size_t) const

slice_array*< _Tp > *operator[] (slice __s)
Return a reference to an array subset.

_Expr< _SClos< _ValArray, _Tp >, _Tp > operator[] (slice __s) const
Return an array subset.

template<class _Dom > valarray*< _Tp > & *operator^= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator^= (const _Tp &)
Set each element e of array to e ^ t.

valarray*< _Tp > & *operator^= (const *valarray*< _Tp > &)
Logical xor corresponding elements of v with elements of array.

template<class _Dom > valarray*< _Tp > & *operator|= (const _Expr< _Dom, _Tp > &)

valarray*< _Tp > & *operator|= (const _Tp &)
Set each element e of array to e | t.

valarray*< _Tp > & *operator|= (const *valarray*< _Tp > &)
Logical or corresponding elements of v with elements of array.

_UnaryOp< __bitwise_not >::_Rt operator~ () const
Return a new valarray by applying unary ~ to each element.

void resize (size_t __size, _Tp __c=_Tp())
Resize array.

valarray*< _Tp > *shift (int __n) const
Return a shifted array.

size_t size () const
Return the number of elements in array.

_Tp sum () const
Return the sum of all elements in the array.

void swap (*valarray*< _Tp > &__v) noexcept
Swap.

Friends

struct _Array< _Tp >

Detailed Description

“template<class _Tp>


class std::valarray< _Tp >“Smart array designed to support numeric processing.

A valarray is an array that provides constraints intended to allow for effective optimization of numeric array processing by reducing the aliasing that can result from pointer representations. It represents a one-dimensional array from which different multidimensional subsets can be accessed and modified.

Template Parameters

_Tp Type of object in the array.

Definition at line 127 of file valarray.

Member Typedef Documentation

template<class _Tp > typedef _Tp *std::valarray*< _Tp >::value_type

Definition at line 136 of file valarray.

Constructor & Destructor Documentation

template<class _Tp > std::valarray*< _Tp >::*valarray (const _Tp *

__restrict__, size_t) Construct an array initialized to the first n elements of t.

Friends And Related Function Documentation

template<class _Tp > friend struct _Array< _Tp >= [friend]=

Definition at line 572 of file valarray.

Author

Generated automatically by Doxygen for libstdc++ from the source code.

Author: dt

Created: 2022-02-21 Mon 13:34