use of org.knime.core.data.vector.bitvector.DenseBitVectorCellFactory in project knime-core by knime.
the class BitVectorIntersectionOperator method computeInternal.
/**
* {@inheritDoc}
*/
@Override
protected boolean computeInternal(final DataCell cell) {
if (cell instanceof BitVectorValue) {
BitVectorValue val = (BitVectorValue) cell;
if (m_v == null) {
final DenseBitVectorCellFactory dbv = new DenseBitVectorCellFactory(val.length());
long nextSetBit = val.nextSetBit(0);
while (nextSetBit >= 0) {
dbv.set(nextSetBit);
nextSetBit = val.nextSetBit(nextSetBit + 1);
}
m_v = dbv.createDataCell();
} else {
m_v = DenseBitVectorCellFactory.and(m_v, val);
}
}
return false;
}
use of org.knime.core.data.vector.bitvector.DenseBitVectorCellFactory in project knime-core by knime.
the class BitVectorUnionOperator method computeInternal.
/**
* {@inheritDoc}
*/
@Override
protected boolean computeInternal(final DataCell cell) {
if (cell instanceof BitVectorValue) {
BitVectorValue val = (BitVectorValue) cell;
if (m_v == null) {
m_v = new DenseBitVectorCellFactory(val.length()).createDataCell();
}
m_v = DenseBitVectorCellFactory.or(m_v, val);
}
return false;
}
use of org.knime.core.data.vector.bitvector.DenseBitVectorCellFactory in project knime-core by knime.
the class BitVectorXOrOperator method computeInternal.
/**
* {@inheritDoc}
*/
@Override
protected boolean computeInternal(final DataCell cell) {
if (cell instanceof BitVectorValue) {
final BitVectorValue val = (BitVectorValue) cell;
if (m_v == null) {
m_v = new DenseBitVectorCellFactory(val.length());
m_allSetBits = new DenseBitVectorCellFactory(val.length());
}
long nextSetBit = val.nextSetBit(0);
while (nextSetBit >= 0) {
if (!m_allSetBits.get(nextSetBit)) {
m_v.set(nextSetBit);
} else {
m_v.set(nextSetBit, false);
}
m_allSetBits.set(nextSetBit);
nextSetBit = val.nextSetBit(nextSetBit + 1);
}
}
return false;
}
use of org.knime.core.data.vector.bitvector.DenseBitVectorCellFactory in project knime-core by knime.
the class BitVectorPerformanceComparisonBug1532 method createNewDenseBitVectorCells.
private DenseBitVectorCell[] createNewDenseBitVectorCells(final int count, final long vectorLength, final long seed) {
Random r = new Random(seed);
DenseBitVectorCell[] result = new DenseBitVectorCell[count];
int hexLength = (int) (vectorLength / 4);
StringBuilder b = new StringBuilder(hexLength);
for (int i = 0; i < count; i++) {
b.setLength(0);
for (int j = 0; j < hexLength; j++) {
b.append(HEX_CHARS[r.nextInt(16)]);
}
result[i] = new DenseBitVectorCellFactory(b.toString()).createDataCell();
}
return result;
}
Aggregations