◆ logical_not()

 as_logical_t boost::simd::logical_not ( Value0 const & x, Value1 const & y )

This function object returns the return the logical negation of the argument.

Infix notation can be used with operator '!'

logical_notor, logical_xor, logical_andnot, logical_notand, logical_ornot, logical_and, logical_or
Example:
#include <boost/simd/boolean.hpp>
#include <boost/simd/pack.hpp>
#include <boost/simd/constant/valmax.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 4>;
int main()
{
pack_ft pf = { 3.0f, 0.0f, -3.0f, -0.0 };
std::cout
<< "---- simd" << '\n'
<< " <- pf = " << pf << '\n'
<< " -> bs::logical_not(pf) = " << bs::logical_not(pf) << '\n';
std::int32_t xf = 3, yf = 0;
std::cout
<< "---- scalar" << '\n'
<< " xf = " << xf << '\n'
<< " yf = " << yf << '\n'
<< " -> bs::logical_not(xf) = " << bs::logical_not(xf) << '\n'
<< " -> bs::logical_not(yf) = " << bs::logical_not(yf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (3, 0, -3, -0)
-> bs::logical_not(pf) = (false, true, false, true)
---- scalar
xf = 3
yf = 0
-> bs::logical_not(xf) = false
-> bs::logical_not(yf) = true