Miscellaneous
Sign manipulation:
per slot sign extraction |
|
per slot sign extraction on non null elements |
|
per slot sign bit extraction |
|
per slot sign copy |
Stream operation:
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 ofy
.- Parameters:
x – batch of scalars
y – batch of scalars
- Returns:
batch whose absolute value matches that of
x
, but whose sign bit matches that ofy
.
-
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