Examples of TIntArrayList


Examples of gnu.trove.TIntArrayList

      idxs[i] = ptl.indexAtLocation (i);
      vals[i] = ptl.logValue (i);
    }

    RankedFeatureVector rfv = new RankedFeatureVector (new Alphabet(), idxs, vals);
    TIntArrayList idxList = new TIntArrayList ();
    TDoubleArrayList valList = new TDoubleArrayList ();

    double mass = Double.NEGATIVE_INFINITY;
    double logAlpha = Math.log (alpha);
    for (int rank = 0; rank < rfv.numLocations (); rank++) {
      int idx = rfv.getIndexAtRank (rank);
      double val = rfv.value (idx);
      mass = Maths.sumLogProb (mass, val);
      idxList.add (idx);
      valList.add (val);
      if (mass > logAlpha) {
        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

Examples of gnu.trove.list.array.TIntArrayList

     * @param initialCapacity an <code>int</code> value
     * @return an <code>int</code> value
     */
    @Override
    public int setUp(int initialCapacity) {
        order = new TIntArrayList(initialCapacity) {
            /**
             * Grow the internal array as needed to accommodate the specified number of elements.
             * The size of the array bytes on each resize unless capacity requires more than twice
             * the current capacity.
             */
 
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

     * specified capacity.
     *
     * @param capacity the initial depth of the stack
     */
    public TIntArrayStack( int capacity ) {
        _list = new TIntArrayList( capacity );
    }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

     *
     * @param capacity the initial depth of the stack
     * @param no_entry_value value that represents null
     */
    public TIntArrayStack( int capacity, int no_entry_value ) {
        _list = new TIntArrayList( capacity, no_entry_value );
    }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

     * @param stack the instance to copy
     */
    public TIntArrayStack( TIntStack stack ) {
        if ( stack instanceof TIntArrayStack ) {
            TIntArrayStack array_stack = ( TIntArrayStack ) stack;
            this._list = new TIntArrayList( array_stack._list );
        } else {
            throw new UnsupportedOperationException( "Only support TIntArrayStack" );
        }
    }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

    if (!_existIndexes) {
      tuplesToJoin.copy(oppositeStorage);
      return;
    }

    final TIntArrayList rowIds = new TIntArrayList();
    // If there is atleast one index (so we have single join conditions with
    // 1 index per condition)
    // Get the row indices in the storage of the opposite relation that
    // satisfy each join condition (equijoin / inequality)
    // Then take the intersection of the returned row indices since each
    // join condition
    // is separated by AND

    for (int i = 0; i < oppositeIndexes.size(); i++) {
      TIntArrayList currentRowIds = null;

      final Index currentOpposIndex = oppositeIndexes.get(i);
      final String value = valuesToApplyOnIndex.get(i);

      int currentOperator = _operatorForIndexes.get(i);
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

      boolean isFromFirstEmitter, List<String> valuesToApplyOnIndex, TupleStorage tuplesToJoin) {
    if (!_existIndexes) {
      tuplesToJoin.copy(oppositeStorage);
      return;
    }
    final TIntArrayList rowIds = new TIntArrayList();
    // If there is atleast one index (so we have single join conditions with
    // 1 index per condition)
    // Get the row indices in the storage of the opposite relation that
    // satisfy each join condition (equijoin / inequality)
    // Then take the intersection of the returned row indices since each
    // join condition
    // is separated by AND

    for (int i = 0; i < oppositeIndexes.size(); i++) {
      TIntArrayList currentRowIds = null;

      final Index currentOpposIndex = oppositeIndexes.get(i);
      final String value = valuesToApplyOnIndex.get(i);

      int currentOperator = _operatorForIndexes.get(i);
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

    if (!_existIndexes) {
      tuplesToJoin.copy(oppositeStorage);
      return;
    }

    final TIntArrayList rowIds = new TIntArrayList();
    // If there is atleast one index (so we have single join conditions with
    // 1 index per condition)
    // Get the row indices in the storage of the opposite relation that
    // satisfy each join condition (equijoin / inequality)
    // Then take the intersection of the returned row indices since each
    // join condition
    // is separated by AND
    for (int i = 0; i < oppositeIndexes.size(); i++) {
      TIntArrayList currentRowIds = null;
      final Index currentOpposIndex = oppositeIndexes.get(i);
      final String value = valuesToApplyOnIndex.get(i);
      int currentOperator = _operatorForIndexes.get(i);
      // Switch inequality operator if the tuple coming is from the other
      // relation
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

    bbt.put(6, 6);
    bbt.put(2, 1);
    bbt.put(5, 5);
    bbt.put(9, 1);

    final TIntArrayList list = bbt.getValues(ComparisonPredicate.NONLESS_OP, 5);
    for (int i = 0; i < list.size(); i++)
      LOG.info(list.get(i));

  }
View Full Code Here

Examples of gnu.trove.list.array.TIntArrayList

    _index = new TreeMap<KeyType, TIntArrayList>();
  }

  private TIntArrayList flatten(Collection<TIntArrayList> sets) {

    final TIntArrayList result = new TIntArrayList();
    for (final Iterator iterator = sets.iterator(); iterator.hasNext();) {
      final TIntArrayList tIntArrayList = (TIntArrayList) iterator.next();
      result.addAll(tIntArrayList);
    }
    return result;
  }
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.