Package org.grouplens.lenskit.symbols

Examples of org.grouplens.lenskit.symbols.Symbol.withType()


        if (channelVectors != null) {
            for (Map.Entry<Symbol, MutableSparseVector> entry : channelVectors.entrySet()) {
                Symbol key = entry.getKey();
                MutableSparseVector msv = entry.getValue().copy();
                newChanVectors.put(key, msv);
                newChannels.put(key.withType(Double.class), new MutableSparseVectorMap(msv));
            }
        }
        // copy all remaining channels into the channel map
        if (channels != null) {
            for (Entry<TypedSymbol<?>, Long2ObjectMap<?>> entry : channels.entrySet()) {
View Full Code Here


        if (channelVectors != null) {
            for (Map.Entry<Symbol, MutableSparseVector> entry : channelVectors.entrySet()) {
                Symbol key = entry.getKey();
                ImmutableSparseVector chan = entry.getValue().immutable(freeze, newDomain);
                newChannelVectors.put(key, chan);
                newChannels.put(key.withType(Double.class), new SparseVectorMap(chan));
            }
        }

        if (channels != null) {
            for (Entry<TypedSymbol<?>, Long2ObjectMap<?>> entry : channels.entrySet()) {
View Full Code Here

    }

    @Test
    public void testIncludesUnboxedChannels() {
        Symbol sym = Symbol.of("foo");
        TypedSymbol<Double> tsym = sym.withType(Double.class);
        PackedScoredIdList list = builder.addChannel(sym)
                                         .add(42, 3.9)
                                         .build();
        ScoredId sid = list.get(0);
        assertThat(sid.hasUnboxedChannel(sym), equalTo(true));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.