use of org.apache.ignite.ml.math.IdentityValueMapper in project ignite by apache.
the class CacheVectorTest method testCopy.
/**
*/
public void testCopy() {
IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName());
IdentityValueMapper valMapper = new IdentityValueMapper();
CacheVector<Integer, Double> cacheVector = new CacheVector<>(size, getCache(), keyMapper, valMapper);
try {
cacheVector.copy();
TestCase.fail("Unsupported case");
} catch (UnsupportedOperationException ignored) {
}
}
use of org.apache.ignite.ml.math.IdentityValueMapper in project ignite by apache.
the class CacheVectorTest method testMapBiFunc.
/**
*/
public void testMapBiFunc() {
IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName());
IdentityValueMapper valMapper = new IdentityValueMapper();
CacheVector<Integer, Double> cacheVector = new CacheVector<>(size, getCache(), keyMapper, valMapper);
initVector(cacheVector);
cacheVector.map(Functions.PLUS, 1d);
for (int i = 0; i < size; i++) assertEquals("Unexpected value.", cacheVector.get(i), 1d, 0d);
}
Aggregations