Package it.unimi.dsi.fastutil.doubles

Examples of it.unimi.dsi.fastutil.doubles.DoubleArrayList


  public DocumentIteratorBuilderVisitor( final Object2ReferenceMap<String,Index> indexMap, final Reference2ReferenceMap<Index,Object> index2Parser, final Index defaultIndex, final int limit ) {
    this.indexMap = indexMap;
    this.defaultIndex = defaultIndex;
    this.index2Parser = index2Parser;
    this.limit = limit;
    weights = new DoubleArrayList();
    weight = Double.NaN;
    curr = new ObjectArrayList<Index>();
    curr.push( defaultIndex );
    this.numberOfDocuments = defaultIndex.numberOfDocuments;
  }
View Full Code Here


  }

  @Override
  public void initialize(int capacity) {
    neighbors = new LongArrayList(capacity);
    edgeValues = new DoubleArrayList(capacity);
  }
View Full Code Here

  }

  @Override
  public void initialize() {
    neighbors = new LongArrayList();
    edgeValues = new DoubleArrayList();
  }
View Full Code Here

  @Override
  protected List<?> buildPrimitiveList(int capacity)
  {
    _type = Double.class;
    return capacity > 0 ? new DoubleArrayList(capacity) : new DoubleArrayList();
  }
View Full Code Here

  @Override
  protected List<?> buildPrimitiveList(int capacity)
  {
    _type = Double.class;
    return capacity > 0 ? new DoubleArrayList(capacity) : new DoubleArrayList();
  }
View Full Code Here

        initialize(cap);
    }

    private void initialize(int cap) {
        ids = new CompactableLongArrayList(cap);
        scores = new DoubleArrayList(cap);
        channels = new Reference2ObjectArrayMap<Symbol, ChannelStorage>();
        typedChannels = new Reference2ObjectArrayMap<TypedSymbol<?>, TypedChannelStorage<?>>();
    }
View Full Code Here

        Map<Symbol, DoubleList> chans;
        Map<TypedSymbol<?>, List<?>> typedChans;
        if (size() > 0) {
            ImmutableMap.Builder<Symbol, DoubleList> cbld = ImmutableMap.builder();
            for (ChannelStorage chan: channels.values()) {
                DoubleArrayList built;
                if (reuse) {
                    built = chan.values;
                    built.trim();
                } else {
                    built = new DoubleArrayList(chan.values);
                }
                cbld.put(chan.symbol, built);
            }
            chans = cbld.build();
            ImmutableMap.Builder<TypedSymbol<?>, List<?>> tcbld = ImmutableMap.builder();
            for (TypedChannelStorage<?> chan: typedChannels.values()) {
                List<?> built;
                if (reuse) {
                    chan.values.trimToSize();
                    built = chan.values;
                } else {
                    built = new ArrayList<Object>(chan.values);
                }
                tcbld.put(chan.symbol, built);
            }
            typedChans = tcbld.build();
        } else {
            chans = Collections.emptyMap();
            typedChans = Collections.emptyMap();
        }
        LongList builtIds;
        DoubleList builtScores;
        if (reuse) {
            ids.trim();
            builtIds = ids;
            scores.trim();
            builtScores = scores;
            clear();
        } else {
            builtIds = new CompactableLongArrayList(ids);
            builtScores = new DoubleArrayList(scores);
        }
        return new PackedScoredIdList(builtIds, builtScores, typedChans, chans);
    }
View Full Code Here

        private DoubleArrayList values;

        public ChannelStorage(Symbol sym, double dft) {
            symbol = sym;
            defaultValue = dft;
            values = new DoubleArrayList(scores.elements().length);
            for (int i = size() - 1; i >= 0; i--) {
                values.add(defaultValue);
            }
        }
View Full Code Here

     * Get the collection of values of this vector.
     *
     * @return The collection of all values in this vector.
     */
    public DoubleCollection values() {
        DoubleArrayList lst = new DoubleArrayList(size());
        IntIterator iter = keys.activeIndexIterator(false);
        while (iter.hasNext()) {
            int idx = iter.nextInt();
            lst.add(values[idx]);
        }
        return lst;
    }
View Full Code Here

        assert heap.size() == size;

        if (items == null) {
            int isize = findInitialSize(count + 1);

            scores = new DoubleArrayList(isize);
            items = new CompactableLongArrayList(isize);
        }

        assert items.size() == scores.size();
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.doubles.DoubleArrayList

Copyright © 2018 www.massapicom. 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.