Miscellaneous

Sign manipulation:

sign()

per slot sign extraction

signnz()

per slot sign extraction on non null elements

bitofsign()

per slot sign bit extraction

copysign()

per slot sign copy

Stream operation:

operator<<()

batch pretty-printing


template<class T, class A>
inline batch<T, A> bitofsign(batch<T, A> const &x) noexcept

Computes the bit of sign of x.

Parameters:

x – batch of scalar

Returns:

bit of sign of x

template<class T, class A>
inline batch<T, A> copysign(batch<T, A> const &x, batch<T, A> const &y) noexcept

Computes a value whose absolute value matches that of x, but whose sign bit matches that of y.

Parameters:
  • x – batch of scalars

  • y – batch of scalars

Returns:

batch whose absolute value matches that of x, but whose sign bit matches that of y.

template<class T, class A>
inline batch<T, A> sign(batch<T, A> const &x) noexcept

Computes the sign of x.

Parameters:

x – batch

Returns:

-1 for each negative element, -1 or +1 for each null element and +1 for each element

template<class T, class A>
inline batch<T, A> signnz(batch<T, A> const &x) noexcept

Computes the sign of x, assuming x doesn’t have any zero.

Parameters:

x – batch

Returns:

-1 for each negative element, -1 or +1 for each null element and +1 for each element

template<class T, class A>
inline std::ostream &operator<<(std::ostream &o, batch<T, A> const &x) noexcept

Dump the content of batch x to stream o.

Parameters:
  • o – the stream where the batch is dumped

  • x – batch to dump.

Returns:

a reference to o

template<class T, class A>
inline std::ostream &operator<<(std::ostream &o, batch_bool<T, A> const &x) noexcept

Dump the content of batch x to stream o.

Parameters:
  • o – the stream where the batch is dumped

  • x – batch to dump.

Returns:

a reference to o