A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../keyword/../numeric/valarray.html below:

std::valarray - cppreference.com

template< class T >
class valarray;

std::valarray 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.

[edit] Notes

std::valarray and helper classes are defined to be free of certain forms of aliasing, thus allowing operations on these classes to be optimized similar to the effect of the keyword restrict in the C programming language. In addition, functions and operators that take valarray arguments are allowed to return proxy objects to make it possible for the compiler to optimize an expression such as v1 = a * v2 + v3; as a single loop that executes v1[i] = a * v2[i] + v3[i]; avoiding any temporaries or multiple passes. However, expression templates make the same optimization technique available for any C++ container, and the majority of numeric libraries prefer expression templates to valarrays for flexibility. Some C++ standard library implementations use expression templates to implement efficient operations on std::valarray (e.g. GNU libstdc++ and LLVM libc++). Only rarely are valarrays optimized any further, as in e.g. Intel Integrated Performance Primitives.

[edit] Template parameters T - the type of the elements. The type must meet the NumericType requirements [edit] Member types Member type Definition value_type T [edit] Member functions [edit] Non-member functions [edit] Helper classes BLAS-like slice of a valarray: starting index, length, stride
(class) [edit] proxy to a subset of a valarray after applying a slice
(class template) [edit] generalized slice of a valarray: starting index, set of lengths, set of strides
(class) [edit] proxy to a subset of a valarray after applying a gslice
(class template) [edit] proxy to a subset of a valarray after applying a boolean mask operator[]
(class template) [edit] proxy to a subset of a valarray after applying indirect operator[]
(class template) [edit] [edit] Deduction guides(since C++17) [edit] See also convenience alias template for basic_simd that can specify its width
(alias template)[edit] convenience alias template for basic_simd_mask that can specify its width
(alias template)[edit] data-parallel vector type
(class template) [edit] data-parallel type with the element type bool
(class template) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4