stl valarray

1.成批操作。源可以是一个valarray也可以是单个值,若是valarray时则必须要大于等于目标


分别重载了: += -= *= /= |= &= >>= <<= ^= %= 和 !, ~ + -




2.对每个元素调用函数对象,产生一个新数组


valarray<Type> apply(
   Type _Func(Type)
) const;
valarray<Type> apply(
   Type _Func(const Type&)
) const;  


3.循环左移动,产生新数组


valarray<Type> cshift(
   int _Count    //左移次数
) const;




valarray<Type> shift(
   int _Count
) const;    //算术左移,右边用0填充,若为负则向右移动






4.最大,最小


Type max( ) const;
Type min( ) const;




5.非空数组求和
Type sum( ) const;

你可能感兴趣的:(STL,valarray)