Package gnu.trove.iterator

Examples of gnu.trove.iterator.TIntIterator


     * vector changes.
     */
    @Override public double magnitude() {
        if (magnitude < 0) {
            magnitude = 0;
            TIntIterator iter = map.valueCollection().iterator();
            while (iter.hasNext()) {
                int i = iter.next();
                magnitude += i*i;
            }
            magnitude = Math.sqrt(magnitude);
        }
        return magnitude;
View Full Code Here


            }

            // The remaining non-zero values in left should be zero'd out
            // because they were effectively multiplied by zero by the right
            // vector.
            TIntIterator iter = lnz.iterator();
            while (iter.hasNext())
                left.set(iter.next(), 0);
        }
        else {
            int length = left.length();
            for (int i = 0; i < length; ++i)
                left.set(i, left.get(i) * right.get(i));
 
View Full Code Here

            // Some checking here
            curExtension = extensionStack.peek();
            if (curExtension == null)
                return null;

            TIntIterator iter = curExtension.iterator();
            int w = iter.next();
            iter.remove();
           
            vertsInSubgraph.push(w);
            // The return type of copy() isn't parameterized on the type of the
            // graph itself.  However, we know that all the current interfaces
            // confirm to the convention that the type is refined (narrowed,
View Full Code Here

            if (extension.isEmpty())
                return;

            // Choose and remove an aribitrary vertex from the extension           
            TIntIterator iter = extension.iterator();
            Integer w = iter.next();
            iter.remove();

            // The next extension is formed from all edges to vertices whose
            // indices are greater than the currently selected vertex, w,
            // and that point to a vertex in the exclusive neighborhood of
            // w.  The exclusive neighborhood is defined relative to a set
View Full Code Here

    }


    /** {@inheritDoc} */
    public boolean containsAll( TIntCollection collection ) {
        TIntIterator iter = collection.iterator();
        while ( iter.hasNext() ) {
            int element = iter.next();
            if ( ! contains( element ) ) {
                return false;
            }
        }
        return true;
View Full Code Here


    /** {@inheritDoc} */
    public boolean addAll( TIntCollection collection ) {
        boolean changed = false;
        TIntIterator iter = collection.iterator();
        while ( iter.hasNext() ) {
            int element = iter.next();
            if ( add( element ) ) {
                changed = true;
            }
        }
        return changed;
View Full Code Here

    /** {@inheritDoc} */
    @SuppressWarnings({"SuspiciousMethodCalls"})
    public boolean retainAll( Collection<?> collection ) {
        boolean modified = false;
      TIntIterator iter = iterator();
      while ( iter.hasNext() ) {
          if ( ! collection.contains( Integer.valueOf ( iter.next() ) ) ) {
            iter.remove();
            modified = true;
          }
      }
      return modified;
    }
View Full Code Here

    public boolean retainAll( TIntCollection collection ) {
        if ( this == collection ) {
            return false;
        }
        boolean modified = false;
      TIntIterator iter = iterator();
      while ( iter.hasNext() ) {
          if ( ! collection.contains( iter.next() ) ) {
            iter.remove();
            modified = true;
          }
      }
      return modified;
    }
View Full Code Here


    /** {@inheritDoc} */
    public boolean removeAll( TIntCollection collection ) {
        boolean changed = false;
        TIntIterator iter = collection.iterator();
        while ( iter.hasNext() ) {
            int element = iter.next();
            if ( remove( element ) ) {
                changed = true;
            }
        }
        return changed;
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean retainAll(Collection<?> collection) {
        boolean modified = false;
        TIntIterator iter = iterator();
        while (iter.hasNext()) {
            if (!collection.contains(Integer.valueOf(iter.next()))) {
                iter.remove();
                modified = true;
            }
        }
        return modified;
    }
View Full Code Here

TOP

Related Classes of gnu.trove.iterator.TIntIterator

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.