Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/numeric/valarray"

From cppreference.com
< cpp‎ | numeric
(ditto for arrays)
m (atan2 is two-argument)
Line 38: Line 38:
 
{{dcl list tfun | cpp/numeric/valarray/operator_binary | title=operator*<br>operator/<br>operator%<br>operator+<br>operator-<br>operator^<br>operator&<br>operator{{!}}<br>operator<<<br>operator>><br>operator&&<br>operator{{!!}} | applies binary operators to each element of two valarrays, or a valarray and a value }}
 
{{dcl list tfun | cpp/numeric/valarray/operator_binary | title=operator*<br>operator/<br>operator%<br>operator+<br>operator-<br>operator^<br>operator&<br>operator{{!}}<br>operator<<<br>operator>><br>operator&&<br>operator{{!!}} | applies binary operators to each element of two valarrays, or a valarray and a value }}
 
{{dcl list tfun | cpp/numeric/valarray/operator_comp | title=operator==<br>operator!=<br>operator<<br>operator><br>operator<=<br>operator>=<br> | compares two valarrays or a valarray with a value }}
 
{{dcl list tfun | cpp/numeric/valarray/operator_comp | title=operator==<br>operator!=<br>operator<<br>operator><br>operator<=<br>operator>=<br> | compares two valarrays or a valarray with a value }}
{{dcl list tfun | cpp/numeric/valarray/sin | title=sin{{small|(std::valarray)}}    | applies the function {{cpp|std::sin}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/sin | title=sin{{small|(std::valarray)}}    | applies the function {{cpp|std::sin}} to each element of valarray }}
{{dcl list tfun | cpp/numeric/valarray/cos | title=cos{{small|(std::valarray)}}    | applies the function {{cpp|std::cos}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/cos | title=cos{{small|(std::valarray)}}    | applies the function {{cpp|std::cos}} to each element of valarray }}
{{dcl list tfun | cpp/numeric/valarray/tan | title=tan{{small|(std::valarray)}}    | applies the function {{cpp|std::tan}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/tan | title=tan{{small|(std::valarray)}}    | applies the function {{cpp|std::tan}} to each element of valarray }}
{{dcl list tfun | cpp/numeric/valarray/asin | title=asin{{small|(std::valarray)}}    | applies the function {{cpp|std::asin}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/asin | title=asin{{small|(std::valarray)}}    | applies the function {{cpp|std::asin}} to each element of valarray }}
{{dcl list tfun | cpp/numeric/valarray/acos | title=acos{{small|(std::valarray)}}    | applies the function {{cpp|std::acos}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/acos | title=acos{{small|(std::valarray)}}    | applies the function {{cpp|std::acos}} to each element of valarray }}
{{dcl list tfun | cpp/numeric/valarray/atan | title=atan{{small|(std::valarray)}}    | applies the function {{cpp|std::atan}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/atan | title=atan{{small|(std::valarray)}}    | applies the function {{cpp|std::atan}} to each element of valarray }}
{{dcl list tfun | cpp/numeric/valarray/atan2 | title=atan2{{small|(std::valarray)}}  | applies the function {{cpp|std::atan2}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/atan2 | title=atan2{{small|(std::valarray)}}  | applies the function {{cpp|std::atan2}} to a valarray and a value }}
{{dcl list tfun | cpp/numeric/valarray/sinh | title=sinh{{small|(std::valarray)}}    | applies the function {{cpp|std::sinh}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/sinh | title=sinh{{small|(std::valarray)}}    | applies the function {{cpp|std::sinh}} to each element of valarray }}
{{dcl list tfun | cpp/numeric/valarray/cosh | title=cosh{{small|(std::valarray)}}    | applies the function {{cpp|std::cosh}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/cosh | title=cosh{{small|(std::valarray)}}    | applies the function {{cpp|std::cosh}} to each element of valarray }}
{{dcl list tfun | cpp/numeric/valarray/tanh | title=tanh{{small|(std::valarray)}}    | applies the function {{cpp|std::tanh}} to each element of an array }}
+
{{dcl list tfun | cpp/numeric/valarray/tanh | title=tanh{{small|(std::valarray)}}    | applies the function {{cpp|std::tanh}} to each element of valarray }}
 
{{dcl list tfun | cpp/numeric/valarray/abs  |  title=abs{{small|(std::valarray)}} | applies the function {{cpp|std::abs}} to each element of valarray }}
 
{{dcl list tfun | cpp/numeric/valarray/abs  |  title=abs{{small|(std::valarray)}} | applies the function {{cpp|std::abs}} to each element of valarray }}
 
{{dcl list tfun | cpp/numeric/valarray/exp  |  title=exp{{small|(std::valarray)}} | applies the function {{cpp|std::exp}} to each element of valarray}}
 
{{dcl list tfun | cpp/numeric/valarray/exp  |  title=exp{{small|(std::valarray)}} | applies the function {{cpp|std::exp}} to each element of valarray}}

Revision as of 07:56, 28 September 2011

Template:cpp/numeric/valarray/sidebar

Defined in header <valarray>
template< class >
class valarray;

Template:cpp is the class for representing and manipulating arrays of values. It supports element-wise mathematical operations and various forms of generalized subscript operators, slicing and indirect access. Template:cpp and helper classes are defined to be free of certain forms of aliasing, thus allowing operations on these classes to be optimized.

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list end

Member functions

constructs new valarray
(public member function)
destructs the valarray
(public member function)
replaces the contents of valarray
(public member function)
get/set valarray element, slice, or mask
(public member function)
applies a unary arithmetic operator to each element of the valarray
(public member function)
applies compound assignment operator to each element of the valarray
(public member function)
swaps with another valarray
(public member function)
returns the size of valarray
(public member function)
changes the size of valarray
(public member function)
calculates the sum of all elements
(public member function)
returns the smallest element
(public member function)
returns the largest element
(public member function)
zero-filling shift the elements of the valarray
(public member function)
circular shift of the elements of the valarray
(public member function)
applies a function to every element of a valarray
(public member function)

Non-member functions

specializes the Template:cpp/ltf algorithm
(function template)
applies binary operators to each element of two valarrays, or a valarray and a value
(function template)
compares two valarrays or a valarray with a value
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to a valarray and a value
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to each element of valarray
(function template)
applies the function Template:cpp to two valarrays or a valarray and a value
(function template)
applies the function Template:cpp to each element of valarray
(function template)
returns a RandomAccessIterator to the first element of the valarray
(function template)
returns a RandomAccessIterator one past the last element of the valarray
(function template)

Helper classes

BLAS-like slice of a valarray: starting index, length, stride
(class)
proxy to a subset of a valarray after applying a slice
(class template)
generalized slice of a valarray: starting index, set of lengths, set of strides
(class)
proxy to a subset of a valarray after applying a gslice
(class template)
proxy to a subset of a valarray after applying a boolean mask operator[]
(class template)
proxy to a subset of a valarray after applying indirect operator[]
(class template)