Package gnu.trove.list.array

Examples of gnu.trove.list.array.TIntArrayList.removeAt()


    assertEquals( Integer.valueOf( 3 ), wrapped_list.get( 1 ) );
    assertEquals( Integer.valueOf( 4 ), wrapped_list.get( 2 ) );
    assertEquals( Integer.valueOf( 5 ), wrapped_list.get( 3 ) );
    assertEquals( Integer.valueOf( 6 ), wrapped_list.get( 4 ) );

    list.removeAt( 1 );

    assertEquals( 4, list.size() );
    assertEquals( Integer.valueOf( 2 ), wrapped_list.get( 0 ) );
    assertEquals( Integer.valueOf( 4 ), wrapped_list.get( 1 ) );
    assertEquals( Integer.valueOf( 5 ), wrapped_list.get( 2 ) );
View Full Code Here


      fromOutList.resetQuick();
    } else {
      int index = this.getNeighborIx(from, to);
      // switch the out edge in the list
      fromOutList.set(index, fromOutList.get(fromOutList.size() - 1));
      fromOutList.removeAt(index);

      // change the incoming edge index in the new node in the old
      // position
      final TIntArrayList toInList = this.inAdjLists.get(fromOutList
          .get(index));
View Full Code Here

      toInList.set(index, toInList.get(toInList.size() - 1));
      toInIndexList.set(index,
          toInIndexList.get(toInIndexList.size() - 1));
      // remove the last location
      toInList.removeAt(toInList.size() - 1);
      toInIndexList.removeAt(toInIndexList.size() - 1);
    }
  }

  /**
   * Returns the number of nodes in the graph
View Full Code Here

        : sequence.length;

    //part 1
    for (int seqIx = seqStart; seqIx < seqEnd; ++seqIx) {
      if (structure[seqIx] == CLOSE_BRACKET) {
        int left = leftBrackets.removeAt(leftBrackets.size() - 1);
        pairs[left] = seqIx;
        pairs[seqIx] = left;
        if (!leftBrackets.isEmpty()) {
          ++branches[leftBrackets.get(leftBrackets.size() - 1)];
        }
View Full Code Here

      uList.resetQuick();
    } else {
      int index = this.getNeighborIx(u, v);
      // switch the out edge in the list
      uList.set(index, uList.get(uList.size() - 1));
      uList.removeAt(index);
    }
    final TIntArrayList vList = this.adjLists.get(v);
    if (vList.size() == 1) {
      vList.resetQuick();
    } else {
View Full Code Here

      vList.resetQuick();
    } else {
      int index = this.getNeighborIx(v, u);
      // switch the out edge in the list
      vList.set(index, vList.get(vList.size() - 1));
      vList.removeAt(index);
    }
    edgeNum--;
    calcMaxDeg();
  }
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.