Advertisement
Guest User

MainClass.java

a guest
Apr 25th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.43 KB | None | 0 0
  1. package curse;
  2.  
  3. import java.util.HashSet;
  4. import java.util.Iterator;
  5.  
  6. public class MainClass {
  7.     static int mod = R.mod; //характеристика поля
  8.     static int n = M.n; //размер матриц
  9.  
  10.     public static void main(String[] args){
  11.         R q = new R(2);
  12.         int sqrt2 = q.r();
  13.        
  14.         int[][] g1 = new int[n][n];
  15.         for (int i = 0; i < n; i++)
  16.             for (int j = 0; j < n; j++){
  17.                 g1[i][j] = 0;
  18.             }
  19.         g1[0][1]=sqrt2; g1[4][0]=mod-sqrt2; g1[2][6]=mod-1; g1[3][5]=1;
  20.         M G1 = new M(g1);
  21.         System.out.println("g_1");
  22.         G1.print();
  23.        
  24.         int[][] g2 = new int[n][n];
  25.         for (int i = 0; i < n; i++)
  26.             for (int j = 0; j < n; j++){
  27.                 g2[i][j] = 0;
  28.             }
  29.         g2[0][2]=sqrt2; g2[5][0]=mod-sqrt2; g2[1][6]=1; g2[3][4]=mod-1;
  30.         M G2 = new M(g2);
  31.         System.out.println("\ng_2");
  32.         G2.print();
  33.        
  34.         int[][] g3 = new int[n][n];
  35.         for (int i = 0; i < n; i++)
  36.             for (int j = 0; j < n; j++){
  37.                 g3[i][j] = 0;
  38.             }
  39.         g3[0][6]=sqrt2; g3[3][0]=mod-sqrt2; g3[5][1]=1; g3[4][2]=mod-1;
  40.         M G3 = new M(g3);
  41.         System.out.println("\ng_-3");
  42.         G3.print();
  43.        
  44.         int[][] g12 = new int[n][n];
  45.         for (int i = 0; i < n; i++)
  46.             for (int j = 0; j < n; j++){
  47.                 g12[i][j] = 0;
  48.             }
  49.         g12[1][2]=sqrt2; g12[5][4]=mod-sqrt2;
  50.         M G12 = new M(g12);
  51.         System.out.println("\ng_1,-2");
  52.         G12.print();
  53.        
  54.         int[][] g31 = new int[n][n];
  55.         for (int i = 0; i < n; i++)
  56.             for (int j = 0; j < n; j++){
  57.                 g31[i][j] = 0;
  58.             }
  59.         g31[3][1]=1; g31[4][6]=mod-1;
  60.         M G31 = new M(g31);
  61.         System.out.println("\ng_3,-1");
  62.         G31.print();
  63.        
  64.         int[][] g32 = new int[n][n];
  65.         for (int i = 0; i < n; i++)
  66.             for (int j = 0; j < n; j++){
  67.                 g32[i][j] = 0;
  68.             }
  69.         g32[3][2]=1; g32[5][6]=mod-1;
  70.         M G32 = new M(g32);
  71.         System.out.println("\ng_3,-2");
  72.         G32.print();
  73.        
  74.         HashSet<M> Nalg = new HashSet<M>();//подалгебра n
  75.         int i1, i2, i3, i4, i5, i6;
  76.         for (i1 = 0; i1 < mod; i1++)
  77.             for (i2 = 0; i2 < mod; i2++)
  78.                 for (i3 = 0; i3 < mod; i3++)
  79.                     for (i4 = 0; i4 < mod; i4++)
  80.                         for (i5 = 0; i5 < mod; i5++)
  81.                             for (i6 = 0; i6 < mod; i6++){
  82.                                 Nalg.add(G1.scal(i1).plus(G2.scal(i2).plus(G3.scal(i3).plus(G12.scal(i4).plus(G31.scal(i5).plus(G32.scal(i6)))))));
  83.                             }
  84.        
  85.         HashSet<M> Ualg = new HashSet<M>();//множество U
  86.         Iterator<M> Nitr = Nalg.iterator();
  87.         while (Nitr.hasNext()) {
  88.             Ualg.add(Nitr.next().exp());
  89.         }
  90.  
  91.         System.out.println(Ualg.size());
  92.        
  93.         int vol = 0;   
  94.         HashSet<M>[] OG1 = new HashSet[6]; //орбита для g1
  95.         HashSet<M>[] OG2 = new HashSet[6];
  96.         HashSet<M>[] OG3 = new HashSet[6];
  97.         HashSet<M>[] OG12 = new HashSet[6];
  98.         HashSet<M>[] OG31 = new HashSet[6];
  99.         HashSet<M>[] OG32 = new HashSet[6];
  100.         HashSet<M>[] OG1and12 = new HashSet[6];
  101.         HashSet<M>[] OG1and2 = new HashSet[6];
  102.         HashSet<M>[] OG1and32 = new HashSet[6];
  103.         HashSet<M>[] OG31and2 = new HashSet[6];
  104.         HashSet<M>[] OG31and12 = new HashSet[6];
  105.         HashSet<M>[] OG3and12 = new HashSet[6];
  106.         for(int i = 1; i < mod; i++){//проходим по всем фунциям для одноэлементных множеств
  107.             OG1[i-1]= new HashSet<M>();
  108.             OG2[i-1]= new HashSet<M>();
  109.             OG3[i-1]= new HashSet<M>();
  110.             OG12[i-1]= new HashSet<M>();
  111.             OG31[i-1]= new HashSet<M>();
  112.             OG32[i-1]= new HashSet<M>();
  113.             OG1and12[i-1]= new HashSet<M>();
  114.             OG1and2[i-1]= new HashSet<M>();
  115.             OG1and32[i-1]= new HashSet<M>();
  116.             OG31and2[i-1]= new HashSet<M>();
  117.             OG31and12[i-1]= new HashSet<M>();
  118.             OG3and12[i-1]= new HashSet<M>();
  119.             Iterator<M> Uitr = Ualg.iterator();        
  120.             while (Uitr.hasNext()) {//проходим по U
  121.                 M tcd = Uitr.next();
  122.                 M RD1 = tcd.Ad(G1.scal(i));            
  123.                 M RD2 = tcd.Ad(G2.scal(i));            
  124.                 M RD3 = tcd.Ad(G3.scal(i));            
  125.                 M RD12 = tcd.Ad(G12.scal(i));              
  126.                 M RD31 = tcd.Ad(G31.scal(i));
  127.                 M RD32 = tcd.Ad(G32.scal(i));
  128.                 OG1[i-1].add(RD1);
  129.                 OG2[i-1].add(RD2);
  130.                 OG3[i-1].add(RD3);
  131.                 OG12[i-1].add(RD12);
  132.                 OG31[i-1].add(RD31);
  133.                 OG32[i-1].add(RD32);
  134.                 OG1and12[i-1].add(RD1.plus(RD12));
  135.                 OG1and2[i-1].add(RD1.plus(RD2));
  136.                 OG1and32[i-1].add(RD1.plus(RD32));
  137.                 OG31and2[i-1].add(RD2.plus(RD2));
  138.                 OG31and12[i-1].add(RD31.plus(RD12));
  139.                 OG3and12[i-1].add(RD3.plus(RD12));
  140.             }
  141.             vol += OG1[i-1].size();
  142.             vol += OG2[i-1].size();
  143.             vol += OG3[i-1].size();
  144.             vol += OG12[i-1].size();
  145.             vol += OG31[i-1].size();
  146.             vol += OG32[i-1].size();
  147.             vol += OG1and12[i-1].size();
  148.             vol += OG1and2[i-1].size();
  149.             vol += OG1and32[i-1].size();
  150.             vol += OG31and2[i-1].size();
  151.             vol += OG31and12[i-1].size();
  152.             vol += OG3and12[i-1].size();
  153.         }
  154.         System.out.println(vol);
  155.        
  156.         HashSet<M> all = new HashSet<M>();
  157.         for(int i = 1; i < mod; i++){      
  158.             Iterator<M>[] MIT = new Iterator[12];
  159.             MIT[0] = OG1[i-1].iterator();
  160.             MIT[1] = OG2[i-1].iterator();
  161.             MIT[2] = OG3[i-1].iterator();
  162.             MIT[3] = OG12[i-1].iterator();
  163.             MIT[4] = OG31[i-1].iterator();
  164.             MIT[5] = OG32[i-1].iterator();
  165.             MIT[6] = OG1and12[i-1].iterator();
  166.             MIT[7] = OG1and2[i-1].iterator();
  167.             MIT[8] = OG1and32[i-1].iterator();
  168.             MIT[9] = OG31and2[i-1].iterator();
  169.             MIT[10] = OG31and12[i-1].iterator();
  170.             MIT[11] = OG3and12[i-1].iterator();
  171.            
  172.             int ind =1;
  173.             for(int j = 0; j < 12; j++){
  174.                 if(ind == 1){
  175.                 while (MIT[j].hasNext()) {
  176.                     M tjj = MIT[j].next();
  177.                     if(all.contains(tjj)) {
  178.                         System.out.println("FOUND" + i + " " + j);
  179.                         tjj.print();
  180.                         ind = 0;
  181.                         break;
  182.                     }
  183.                     else all.add(tjj);
  184.                 }
  185.                 }
  186.             }
  187.         }
  188.        
  189.        
  190.     }
  191. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement