◆ hmsb()

bitset<cardinal_of<Value>::value> boost::simd::hmsb ( Value const &  v)

Returns a bs::bitset build from the most significant bit of each value its argument.

Header <boost/simd/function/hmsb.hpp>
Example:
#include <boost/simd/pack.hpp>
#include <boost/simd/reduction.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_it = bs::pack<std::int32_t, 4>;
int main() {
pack_it pi = {1, 2, -1, 3};
std::cout << "---- simd" << '\n'
<< "<- pi = " << pi << '\n'
<< "-> bs::hmsb(pi) = " << bs::hmsb(pi) << '\n';
return 0;
}
Possible output:
---- simd
<- pi = (1, 2, -1, 3)
-> bs::hmsb(pi) = 0100
Parameters
vValue to process
Returns
A bitset-like structure of the size of cardinal(v) containing the most significant bits of each elements of v.