- The C Standard Library
- The C Standard Library
- The C++ Standard Library
- C++ Library - Home
- C++ Library - <fstream>
- C++ Library - <iomanip>
- C++ Library - <ios>
- C++ Library - <iosfwd>
- C++ Library - <iostream>
- C++ Library - <istream>
- C++ Library - <ostream>
- C++ Library - <sstream>
- C++ Library - <streambuf>
- C++ Library - <atomic>
- C++ Library - <complex>
- C++ Library - <exception>
- C++ Library - <functional>
- C++ Library - <limits>
- C++ Library - <locale>
- C++ Library - <memory>
- C++ Library - <new>
- C++ Library - <numeric>
- C++ Library - <regex>
- C++ Library - <stdexcept>
- C++ Library - <string>
- C++ Library - <thread>
- C++ Library - <tuple>
- C++ Library - <typeinfo>
- C++ Library - <utility>
- C++ Library - <valarray>
- The C++ STL Library
- C++ Library - <array>
- C++ Library - <bitset>
- C++ Library - <deque>
- C++ Library - <forward_list>
- C++ Library - <list>
- C++ Library - <map>
- C++ Library - <queue>
- C++ Library - <set>
- C++ Library - <stack>
- C++ Library - <unordered_map>
- C++ Library - <unordered_set>
- C++ Library - <vector>
- C++ Library - <algorithm>
- C++ Library - <iterator>
- C++ Programming Resources
- C++ Programming Tutorial
- C++ Useful Resources
- C++ Discussion
C++ Library - <valarray>
Introduction
It is designed to hold an array of values, and easily perform mathematical operations on them. It also allows special mechanisms to refer to subsets of elements in the arrays.
Declaration
Following is the declaration for std::valarray.
template <class T> class valarray;
C++11
template <class T> class valarray;
Parameters
T − It is a type of the elements contained in the valarray.
Member functions
Sr.No. | Member function & description |
---|---|
1 | (constructor)
It is a valarray constructor. |
2 | (destructor)
It is a valarray destructor. |
3 | valarray operators
It is a valarray operators. |
4 | apply
It is an apply function. |
5 | cshift
It is a circularly shift elements. |
6 | max
It returns greatest value. |
7 | min
It returns smallest value. |
8 | operator=
It assigns the content. |
9 | operator[]
It is used to access element or subscript. |
10 | resize
It is used to resize valarray. |
11 | shift
It is used to shift elements. |
12 | size
It returns size. |
13 | sum
It returns sum of elements. |
14 | swap
It swaps valarray contents. |
Non-member overloads
Sr.No. | Non-member overload & description |
---|---|
1 | valarray operators
It is a valarray operators. |
2 | swap
It is a swap valarrays. |
3 | begin
It iterators to beginning. |
4 | end
It iterators to end. |