Search in sources :

Example 11 with UnsupportedOperationException

use of org.apache.ignite.ml.math.exceptions.UnsupportedOperationException in project ignite by apache.

the class CacheVectorTest method testTimesVector.

/**
 */
public void testTimesVector() {
    IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName());
    IdentityValueMapper valMapper = new IdentityValueMapper();
    CacheVector<Integer, Double> cacheVector = new CacheVector<>(size, getCache(), keyMapper, valMapper);
    cacheVector.assign(1d);
    Vector testVec = new DenseLocalOnHeapVector(IntStream.range(0, size).asDoubleStream().toArray());
    try {
        cacheVector.times(testVec);
        TestCase.fail();
    } catch (UnsupportedOperationException ignored) {
    }
}
Also used : IdentityValueMapper(org.apache.ignite.ml.math.IdentityValueMapper) Vector(org.apache.ignite.ml.math.Vector) UnsupportedOperationException(org.apache.ignite.ml.math.exceptions.UnsupportedOperationException)

Example 12 with UnsupportedOperationException

use of org.apache.ignite.ml.math.exceptions.UnsupportedOperationException in project ignite by apache.

the class CacheVectorTest method testLike.

/**
 */
public void testLike() {
    IgniteUtils.setCurrentIgniteName(ignite.configuration().getIgniteInstanceName());
    IdentityValueMapper valMapper = new IdentityValueMapper();
    CacheVector<Integer, Double> cacheVector = new CacheVector<>(size, getCache(), keyMapper, valMapper);
    try {
        cacheVector.like(size);
        TestCase.fail("Unsupported case");
    } catch (UnsupportedOperationException ignored) {
    }
}
Also used : IdentityValueMapper(org.apache.ignite.ml.math.IdentityValueMapper) UnsupportedOperationException(org.apache.ignite.ml.math.exceptions.UnsupportedOperationException)

Example 13 with UnsupportedOperationException

use of org.apache.ignite.ml.math.exceptions.UnsupportedOperationException 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) {
    }
}
Also used : IdentityValueMapper(org.apache.ignite.ml.math.IdentityValueMapper) UnsupportedOperationException(org.apache.ignite.ml.math.exceptions.UnsupportedOperationException)

Aggregations

UnsupportedOperationException (org.apache.ignite.ml.math.exceptions.UnsupportedOperationException)13 IdentityValueMapper (org.apache.ignite.ml.math.IdentityValueMapper)8 Vector (org.apache.ignite.ml.math.Vector)5 ExternalizeTest (org.apache.ignite.ml.math.ExternalizeTest)2 Matrix (org.apache.ignite.ml.math.Matrix)2 Test (org.junit.Test)2 DenseLocalOffHeapVector (org.apache.ignite.ml.math.impls.vector.DenseLocalOffHeapVector)1 DenseLocalOnHeapVector (org.apache.ignite.ml.math.impls.vector.DenseLocalOnHeapVector)1 RandomVector (org.apache.ignite.ml.math.impls.vector.RandomVector)1 SparseLocalVector (org.apache.ignite.ml.math.impls.vector.SparseLocalVector)1