Common mathematical functions | |||||||||||||||||||||||||||||||
Mathematical special functions(C++17) | |||||||||||||||||||||||||||||||
Mathematical constants(C++20) | |||||||||||||||||||||||||||||||
Basic linear algebra algorithms(C++26) | |||||||||||||||||||||||||||||||
Data-parallel types (SIMD)(C++26) | |||||||||||||||||||||||||||||||
Floating-point environment(C++11) | |||||||||||||||||||||||||||||||
Complex numbers | |||||||||||||||||||||||||||||||
Numeric array (valarray ) | |||||||||||||||||||||||||||||||
Pseudo-random number generation | |||||||||||||||||||||||||||||||
Bit manipulation(C++20) | |||||||||||||||||||||||||||||||
Saturation arithmetic(C++26) | |||||||||||||||||||||||||||||||
Factor operations | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
Interpolations | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
Generic numeric operations | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
C-style checked integer arithmetic | |||||||||||||||||||||||||||||||
|
void resize(std::size_t count, T value= T()); | ||
Resizes the valarray to containcount elements and assignsvalue to each element.
This functions invalidates all pointers and references to elements in the array.
Contents |
count | - | new size of the container |
value | - | the value to initialize the new elements with |
(none)
#include <iostream>#include <valarray> int main(){std::valarray<int> v{1,2,3}; v.resize(10);for(int n: v)std::cout<< n<<' ';std::cout<<'\n';}
Output:
0 0 0 0 0 0 0 0 0 0
returns the size of valarray (public member function)[edit] |