public class NDBitwise extends Object
Constructor and Description |
---|
NDBitwise() |
Modifier and Type | Method and Description |
---|---|
INDArray |
and(INDArray x,
INDArray y)
Bitwise AND operation.
|
INDArray |
bitRotl(INDArray x,
INDArray shift)
Roll integer bits to the left, i.e.
|
INDArray |
bitRotr(INDArray x,
INDArray shift)
Roll integer bits to the right, i.e.
|
INDArray |
bitsHammingDistance(INDArray x,
INDArray y)
Bitwise Hamming distance reduction over all elements of both input arrays.
For example, if x=01100000 and y=1010000 then the bitwise Hamming distance is 2 (due to differences at positions 0 and 1) Inputs must satisfy the following constraints: Must be same types: isSameType(x, y) |
INDArray |
bitShift(INDArray x,
INDArray shift)
Shift integer bits to the left, i.e.
|
INDArray |
bitShiftRight(INDArray x,
INDArray shift)
Shift integer bits to the right, i.e.
|
INDArray |
leftShift(INDArray x,
INDArray y)
Bitwise left shift operation.
|
INDArray |
leftShiftCyclic(INDArray x,
INDArray y)
Bitwise left cyclical shift operation.
|
INDArray |
or(INDArray x,
INDArray y)
Bitwise OR operation.
|
INDArray |
rightShift(INDArray x,
INDArray y)
Bitwise right shift operation.
|
INDArray |
rightShiftCyclic(INDArray x,
INDArray y)
Bitwise right cyclical shift operation.
|
INDArray |
xor(INDArray x,
INDArray y)
Bitwise XOR operation (exclusive OR).
|
public INDArray and(INDArray x, INDArray y)
x
- First input array (INT type)y
- Second input array (INT type)public INDArray bitRotl(INDArray x, INDArray shift)
x
- Input 1 (INT type)shift
- Number of bits to shift. (INT type)public INDArray bitRotr(INDArray x, INDArray shift)
x
- Input 1 (INT type)shift
- Number of bits to shift. (INT type)public INDArray bitShift(INDArray x, INDArray shift)
x
- Input 1 (INT type)shift
- Number of bits to shift. (INT type)public INDArray bitShiftRight(INDArray x, INDArray shift)
x
- Input 1 (INT type)shift
- Number of bits to shift. (INT type)public INDArray bitsHammingDistance(INDArray x, INDArray y)
x
- First input array. (INT type)y
- Second input array. (INT type)public INDArray leftShift(INDArray x, INDArray y)
x
- Input to be bit shifted (INT type)y
- Amount to shift elements of x array (INT type)public INDArray leftShiftCyclic(INDArray x, INDArray y)
leftShift(INDArray, INDArray)
the bits will "wrap around":leftShiftCyclic(01110000, 2) -> 11000001
x
- Input to be bit shifted (INT type)y
- Amount to shift elements of x array (INT type)public INDArray or(INDArray x, INDArray y)
x
- First input array (INT type)y
- First input array (INT type)public INDArray rightShift(INDArray x, INDArray y)
x
- Input to be bit shifted (INT type)y
- Amount to shift elements of x array (INT type)public INDArray rightShiftCyclic(INDArray x, INDArray y)
rightShift(INDArray, INDArray)
the bits will "wrap around":rightShiftCyclic(00001110, 2) -> 10000011
x
- Input to be bit shifted (INT type)y
- Amount to shift elements of x array (INT type)public INDArray xor(INDArray x, INDArray y)
x
- First input array (INT type)y
- First input array (INT type)Copyright © 2020. All rights reserved.