import static General.Ops.*;

public class PowerMethod {
    double[][] a;
    double tol;
    double eigenValApprox;
    double[][] eigenVecApprox;

    public PowerMethod(double[][] a, double tol, double[][] initial) {
        this.a = a;
        this.tol = tol;
        eigenVecApprox = initial;
    }

    public int findErrorTol() {
        return 0;
    }

    public int powerMethod(double[][] a, double[][] vecApprox) {
        eigenValApprox = vecApprox[0][0];
        eigenVecApprox = scalarMult(matrixMult(a,  vecApprox), vecApprox[0][0]);
        //should be dandy//
        return 1;
    }

    public double getEigenValue() {
        return eigenValApprox;
    }

    public double[][] getEigenVec() {
        return eigenVecApprox;
    }
}

@@ -50,24 +50,32 @@
 ethod %7B%0A    
+private 
 double%5B%5D%5B%5D a
@@ -76,24 +76,32 @@
 %5B%5D%5B%5D a;%0A    
+private 
 double tol;%0A
@@ -100,24 +100,32 @@
 le tol;%0A    
+private 
 double eigen
@@ -139,16 +139,24 @@
 ox;%0A    
+private 
 double%5B%5D
@@ -173,16 +173,49 @@
 cApprox;
+%0A    private double iterationNum;
 %0A%0A    pu
@@ -368,64 +368,8 @@
  %7D%0A%0A
-    public int findErrorTol() %7B%0A        return 0;%0A    %7D%0A
 %0A   
@@ -426,24 +426,128 @@
 ecApprox) %7B%0A
+        double error = 100;%0A        while (error %3E tol) %7B%0A            double temp = eigenValApprox;%0A    
         eige
@@ -576,32 +576,36 @@
 %5B0%5D%5B0%5D;%0A        
+    
 eigenVecApprox =
@@ -642,16 +642,21 @@
 Approx),
+ (1 /
  vecAppr
@@ -664,16 +664,17 @@
 x%5B0%5D%5B0%5D)
+)
 ;%0A      
@@ -679,45 +679,130 @@
     
+    
-//should be dandy//%0A        return 1;
+iterationNum++;%0A            vecApprox = eigenVecApprox;%0A            error = Math.abs(temp - eigenValApprox);%0A        %7D
 %0A   
@@ -913,24 +913,24 @@
 igenVec() %7B%0A
-
         retu
@@ -954,10 +954,88 @@
 ;%0A    %7D%0A
+    %0A    public double getIterationNum() %7B%0A        return iterationNum;%0A    %7D%0A
 %7D%0A

Update PowerMethod.java