Package gnu.trove

Examples of gnu.trove.TIntArrayList.toNativeArray()


        break;
      }
    }

    int[] szs = computeSizes (ptl);
    SparseMatrixn m = new SparseMatrixn (szs, idxList.toNativeArray (), valList.toNativeArray ());

    TableFactor result = new TableFactor (computeVars (ptl));
    result.setValues (m);

    return result;
View Full Code Here


        idxs.add (i);
        vals.add (2.0 * i);
      }
    }

    SparseMatrixn a = new SparseMatrixn (sizes, idxs.toNativeArray (), vals.toNativeArray ());
    return a;
  }

  public void testSparseMatrixnSerializable () throws IOException, ClassNotFoundException
  {
View Full Code Here

      for (int j = 0; j < lbls.size (); j++) {
        Label lbl = lbls.get (j);
        vals.add (lbl.getIndex ());
      }
    }
    return vals.toNativeArray ();
  }

  private void setupLabel2Var ()
  {
    idx2var = new Variable [lblseq.size ()][];
View Full Code Here

                        new Integer(label), record.toString(),
                        record.toString()));
        }
      }
      clusterings[i] =
          new Clustering(instances, subdirs.length, labels.toNativeArray());
    }

    logger.info("\nread " + fi + " objects in " + clusterings.length + " clusterings.");
    try {
      ObjectOutputStream oos =
View Full Code Here

  public static int[] getIds(final IterablePosting ip) throws IOException
  {
    final TIntArrayList ids = new TIntArrayList();
    while(ip.next() != IterablePosting.EOL)
      ids.add(ip.getId());
    return ids.toNativeArray();
  }
 
  /** Get an array of all the ids in a given IterablePosting stream,
   * where the length of the stream is known */
  public static int[] getIds(final IterablePosting ip, final int numPointers) throws IOException
View Full Code Here

          tmpBlocks[j] = previousBlockId = file.readGamma() + previousBlockId;
        }
        blockids.add(tmpBlocks);
      }
    }
    documentTerms[documentTerms.length -1] = blockids.toNativeArray();
    return documentTerms;
  }

}
View Full Code Here

            tmpBlocks[j] = previousBlockId = file.readGamma() + previousBlockId;
          }
          blockids.add(tmpBlocks);
        }
      }
      documentTerms[documentTerms.length-1] = blockids.toNativeArray();
      return documentTerms;
    } catch (IOException ioe) {
      logger.error("Problem reading block inverted index", ioe);
      return null;
    }
View Full Code Here

    doccount++;
    rq.setNumberOfDocumentsAfterFiltering(doccount);
    if (docatnumbers.size() < docids.length)
    {
      //result set is definently shorter, replace with new one
      rq.setResultSet( results.getResultSet(docatnumbers.toNativeArray()));
      rq.getResultSet().setExactResultSize(results.getExactResultSize());
    }
  }
           
        catch(Exception e){}
View Full Code Here

    for (int i : arr2) {
      if (set.contains(i)) {
        list.add(i);
      }
    }
    return list.toNativeArray();
  }

  /**
   * union 2 int[]
   * @param arr1
View Full Code Here

          tmpBlocks[j] = previousBlockId = file.readGamma() + previousBlockId;
        }
        blockids.add(tmpBlocks);
      }
    }
    documentTerms[documentTerms.length -1] = blockids.toNativeArray();
    return documentTerms;
  }
   
  /*public int[][] getNextTerms(BitIndexPointer pointer) throws IOException
  {
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.