/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package stallone.doubles;

import stallone.api.doubles.IDoubleArray;

/**
 *
 * @author noe
 */
public class DoubleTableNonzeroIterator extends DoubleTableIterator
{

    public DoubleTableNonzeroIterator(IDoubleArray _x)
    {
        super(_x);
        proceedToNonzero();
    }

    @Override
    public void reset()
    {
        super.reset();
        proceedToNonzero();
    }

    private void proceedToNonzero()
    {
        if (hasNext())
        {
            while (hasNext() && X.get(i, j) == 0)
            {
                advance();
            }
        }
    }

    /**
     * Goes to the next value. Does not return anything. You have to get the
     * content with get(). Usage Example:
     *
     * for (IDoubleArrayIterator it = arr.iterator(); it.hasNext(); it.next) {
     * System.out.println("current element: " + it.get()); }
     */
    @Override
    public void advance()
    {
        super.advance();
        proceedToNonzero();
    }
}

@@ -523,45 +523,8 @@
   %7B%0A
-        if (hasNext())%0A        %7B%0A    
     
@@ -573,20 +573,16 @@
         
-    
 %7B%0A      
@@ -587,20 +587,22 @@
         
-    
+super.
 advance(
@@ -608,22 +608,8 @@
 ();%0A
-            %7D%0A
     

fix endless recursion