Java API By Example, From Geeks To Geeks.

# Java > Open Source Codes > TestBiorthogonalityDau2

 `1 import JSci.maths.*;2 import JSci.maths.wavelet.*;3 import JSci.maths.wavelet.daubechies2.*;4 5 /****************************************6 * Test the biorthogonality7 * @author Daniel Lemire8 *****************************************/9 public class TestBiorthogonalityDau2 {10         public static void main(String arg[]) {11                 int n0=8;12                 int j0=0;13                 new TestBiorthogonalityDau2(n0,j0);14         }15 16         public TestBiorthogonalityDau2(int n0, int j0) {17                 double[][] mat=new double[2*n0-2][2*n0-2];18                 for(int k=0;kmax) {46                                         max=Math.abs(Id[k][l]-mat[k][l]);47                                 }48                         }49                 }50 51                 ImprimeMatrice(mat,n0);52                 System.out.println("Max = "+max);53         }54         public void ImprimeMatrice(double[][] mat, int n0) {55                 for(int k=0;k<2*n0-2;k++) {56                         for(int l=0;l<2*n0-2;l++) {57                                 if(Math.abs(mat[k][l])>0.000001) {58                                         System.out.println(" mat [ "+k+" , "+l+" ] = "+mat[k][l]);59                                 }60                         }61                 }62         }63         public double EcheEche(int k, int l,int n0,int j0) {64                 MultiscaleFunction Primaire=new Scaling2(n0,k);65                 MultiscaleFunction Duale=new Scaling2(n0,l);66                 return(DiscreteHilbertSpace.integrate(Primaire,Duale,j0));67         }68         public double EcheOnde(int k, int l,int n0, int j0) {69                 MultiscaleFunction Primaire=new Scaling2(n0,k);70                 MultiscaleFunction Duale=new Wavelet2(n0,l);71                 return(DiscreteHilbertSpace.integrate(Primaire,Duale,j0));72         }73         public double OndeEche(int k, int l,int n0,int j0) {74                 MultiscaleFunction Primaire=new Wavelet2(n0,k);75                 MultiscaleFunction Duale=new Scaling2(n0,l);76                 return(DiscreteHilbertSpace.integrate(Primaire,Duale,j0));77         }78         public double OndeOnde(int k, int l,int n0, int j0) {79                 MultiscaleFunction Primaire=new Wavelet2(n0,k);80                 MultiscaleFunction Duale=new Wavelet2(n0,l);81                 return(DiscreteHilbertSpace.integrate(Primaire,Duale,j0 ));82         }83 }84 85 ` Popular Tags