-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIteratorCheck.java
More file actions
35 lines (33 loc) · 1.18 KB
/
IteratorCheck.java
File metadata and controls
35 lines (33 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class IteratorCheck
{
// instance variables - replace the example below with your own
Matrices matrix = new Matrices();
Normas norma = new Normas();
/**
* Constructor for objects of class IteratorCheck
*/
public IteratorCheck()
{
// initialise instance variables
}
public double[] check(double a[], double b[]){
double [] resultado = new double [a.length];
double error = 0.005;
resultado = matrix.restaSimple(a,b);
double numerador = norma.normaInfinitoColumna(resultado);
double denominador = norma.normaInfinitoColumna(a);
double res = norma.normaInfinitoColumna(resultado)/ norma.normaInfinitoColumna(a);
if(res < error){
System.out.printf("El numerador es: %f\n",numerador);
System.out.println("El denomiador es : "+denominador);
System.out.printf("dexp: %f\n",res);
System.out.println("es menor al error");
resultado = a;
} else {
System.out.printf("dexp: %f\n",res);
System.out.println("es mayor al error");
resultado = null;
}
return resultado;
}
}