⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 valarray

📁 realview22.rar
💻
📖 第 1 页 / 共 5 页
字号:
               __rhs._C_array.begin (), _C_array.begin (), 
               _RW::shift_left<_TypeT>());

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>&
valarray<_TypeT>::operator>>= (const valarray<_TypeT>& __rhs)
{
    transform (_C_array.begin (), 
               _C_array.begin () + _STD::min (size (), __rhs.size ()), 
               __rhs._C_array.begin (), _C_array.begin (), 
               _RW::shift_right<_TypeT>());

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>&
valarray<_TypeT>::operator*= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (multiplies<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator/= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (divides<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator+= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (plus<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator-= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (minus<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator%= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (modulus<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator^= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (_RW::exclusive_or<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator&= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (_RW::bitwise_and<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator|= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (_RW::bitwise_or<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator<<= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (_RW::shift_left<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>& valarray<_TypeT>::operator>>= (const _TypeT& __rhs)
{
    transform (_C_array.begin (), _C_array.end (), _C_array.begin (), 
               bind2nd (_RW::shift_right<_TypeT>(), __rhs));

    return *this;
}


template <class _TypeT>
inline valarray<_TypeT>
valarray<_TypeT>::apply (value_type __fun (value_type)) const
{
    return _RW::__rw_unary_function (*this, __fun);
}


template <class _TypeT>
inline valarray<_TypeT>
valarray<_TypeT>::apply (value_type __fun (const value_type&)) const
{
    return _RW::__rw_unary_function (*this, __fun);
} 


// 26.3.3 - valarray non-members


// 26.3.3.1 - valarray binary operators
template<class _TypeT>
inline valarray<_TypeT>
operator* (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) *= __rhs;
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator/ (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) /= __rhs;
}
 

template<class _TypeT>
inline valarray<_TypeT>
operator% (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) %= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator+ (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) += __rhs;
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator- (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) -= __rhs;
}
  
template<class _TypeT>
inline valarray<_TypeT>
operator^ (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) ^= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator& (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) &= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator| (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) |= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator<< (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) <<= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator>>(const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return valarray<_TypeT>(__lhs) >>= __rhs;
}

template<class _TypeT>
inline valarray<bool>
operator&& (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__lhs, __rhs, logical_and<_TypeT>());
}

template<class _TypeT>
inline valarray<bool>
operator|| (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__lhs, __rhs, logical_or<_TypeT>());
}

template<class _TypeT>
inline valarray<_TypeT>
operator* (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) *= __rhs;
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator/ (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) /= __rhs;
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator% (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) %= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator+ (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) += __rhs;
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator- (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) -= __rhs;
}
  
template<class _TypeT>
inline valarray<_TypeT>
operator^ (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) ^= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator& (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) &= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator| (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) |= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator<< (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) <<= __rhs;
}

template<class _TypeT>
inline valarray<_TypeT>
operator>>(const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return valarray<_TypeT>(__lhs) >>= __rhs;
}


// 26.3.3.2 - valarray logical operators
template<class _TypeT>
inline valarray<bool>
operator&& (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return _RW::__rw_binary_function (__lhs,
                                      bind2nd (equal_to<_TypeT>(), __rhs));
}

template<class _TypeT>
inline valarray<bool>
operator|| (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return _RW::__rw_binary_function (__lhs,
                                      bind2nd (logical_or<_TypeT>(), __rhs));
}


template<class _TypeT>
inline valarray<_TypeT>
operator* (const _TypeT& __lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs,
                                      bind1st (multiplies<_TypeT>(), __lhs));
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator/ (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs,
                                      bind1st (divides<_TypeT>(), __lhs));
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator% (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs,
                                      bind1st (modulus<_TypeT>(), __lhs));
}

template<class _TypeT>
inline valarray<_TypeT>
operator+ (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, bind1st (plus<_TypeT>(), __lhs));
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator- (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, bind1st (minus<_TypeT>(), __lhs));
}
 
template<class _TypeT>
inline valarray<_TypeT>
operator^ (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, 
                                 bind1st (_RW::exclusive_or<_TypeT>(), __lhs));
}

template<class _TypeT>
inline valarray<_TypeT>
operator& (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, 
                                 bind1st (_RW::bitwise_and<_TypeT>(), __lhs));
}

template<class _TypeT>
inline valarray<_TypeT>
operator| (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, 
                                 bind1st (_RW::bitwise_or<_TypeT>(), __lhs));
}


template<class _TypeT>
inline valarray<_TypeT>
operator<< (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, 
                                 bind1st (_RW::shift_left<_TypeT>(), __lhs));
}

template<class _TypeT>
inline valarray<_TypeT>
operator>>(const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, 
                                 bind1st (_RW::shift_right<_TypeT>(), __lhs));
}

template<class _TypeT>
inline valarray<bool>
operator&& (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, 
                                 bind1st (logical_and<_TypeT>(), __lhs));
}

template<class _TypeT>
inline valarray<bool>
operator|| (const _TypeT &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__rhs, 
                                 bind1st (logical_or<_TypeT>(), __lhs));
}

template<class _TypeT>
inline valarray<bool>
operator== (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__lhs, __rhs, equal_to<_TypeT>());
}
    
template<class _TypeT>
inline valarray<bool>
operator!= (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__lhs, __rhs, not_equal_to<_TypeT>());
}
   
template<class _TypeT>
inline valarray<bool>
operator< (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__lhs, __rhs, less<_TypeT>());
}
 
template<class _TypeT>
inline valarray<bool>
operator>(const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__lhs, __rhs, greater<_TypeT>());
}
   
template<class _TypeT>
inline valarray<bool>
operator<= (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__lhs, __rhs, less_equal<_TypeT>());
}

template<class _TypeT>
valarray<bool>
operator>= (const valarray<_TypeT> &__lhs, const valarray<_TypeT> &__rhs)
{
    return _RW::__rw_binary_function (__lhs, __rhs, greater_equal<_TypeT>());
}
 
template<class _TypeT>
inline valarray<bool>
operator== (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return _RW::__rw_binary_function (__lhs,
                                      bind2nd (equal_to<_TypeT>(), __rhs));
}
 
template<class _TypeT>
inline valarray<bool>
operator!= (const valarray<_TypeT> &__lhs, const _TypeT &__rhs)
{
    return _RW::__rw_binary_function (__lhs, 
                                      bind2nd (not_equal_to<_TypeT>(), __rhs));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -