Package gnu.trove.iterator

Examples of gnu.trove.iterator.TIntFloatIterator.advance()


    private void updateBaseDist(int classid, HashSparseVector vector) {
        float base = baseDistList.get(classid);
        TIntFloatHashMap center = classCenter.get(classid).data;
        TIntFloatIterator it =  vector.data.iterator();
        while (it.hasNext()) {
            it.advance();
            if (!center.containsKey(it.key())) {
                base += it.value() * it.value();
            }
            else {
                float temp = center.get(it.key());
View Full Code Here


    private float getBaseDist(int classid) {
        float base = 0.0f;
        TIntFloatIterator it = classCenter.get(classid).data.iterator();
        while (it.hasNext()) {
            it.advance();
            base += it.value() * it.value();
        }
        return base;
    }

View Full Code Here

    cl.factory.setDefaultFeatureAlphabet(newfeat);
    for(int i=0;i<weights.length;i++){
        TIntFloatIterator itt = weights[i].data.iterator();
        HashSparseVector ww = new HashSparseVector();
        while(itt.hasNext()){
          itt.advance();
          float v = itt.value();
          if(Math.abs(v)<1e-3f)
            continue;
          String fea = index.get(itt.key());
          int newidx = newfeat.lookupIndex(fea);
View Full Code Here

    this.values = new float[values.size()];
    // Import and sort the indexes
    {
      TIntFloatIterator iter = values.iterator();
      for (int i = 0; iter.hasNext(); i++) {
        iter.advance();
        this.indexes[i] = iter.key();
        i++;
      }
      Arrays.sort(this.indexes);
    }
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.