@@ -4529,12 +4529,13 @@ public static void backwardBuild(int r, ArrayList<Integer> degrees,ArrayList<Int
45294529 mat2 [k ][l ]=A [k ][l ];
45304530 }
45314531 }
4532- if (connectivityTest (hIndex ,A )){
4532+ System .out .println ("h" +" " +hIndex );
4533+ if (connectivityTest (6 ,addHydrogens (A ,6 ))){
45334534 pWriter .println ("done bu" );
45344535 System .out .println ("done" );
45354536 pWriter .print (hoppa +" " +Arrays .deepToString (A )+"\n " );
4536- System .out .println (Arrays .deepToString (addHydrogens (A ,hIndex )));
4537- depict (buildC (addHydrogens (A ,hIndex )),"C:\\ Users\\ mehme\\ Desktop\\ outputs\\ " +hoppa +".png" );
4537+ System .out .println (Arrays .deepToString (addHydrogens (A ,6 )));
4538+ // depict(buildC(addHydrogens(A,hIndex)),"C:\\Users\\mehme\\Desktop\\outputs\\"+hoppa+".png");
45384539 hoppa ++;
45394540 }
45404541 //System.out.println(Arrays.deepToString(addHydrogens(A,4)));
@@ -5249,12 +5250,8 @@ public static boolean blockDemo(int index, int r, int[][] A, ArrayList<Integer>
52495250 pWriter .print ("representatives" +" " +index +" " +representatives .get (i )+"\n " );
52505251 }
52515252
5252- System .out .println ("p" +" " +partition +" " +newPartition );
52535253 pWriter .print (Arrays .deepToString (A )+"\n " );
52545254
5255- for (int p =0 ;p <representatives .size ();p ++) {
5256- System .out .println ("rep bas" +" " +representatives .get (p )+" " +p );
5257- }
52585255
52595256 System .out .println (Arrays .deepToString (A ));
52605257 int y = findY (r );
@@ -5264,7 +5261,6 @@ public static boolean blockDemo(int index, int r, int[][] A, ArrayList<Integer>
52645261 int total = sum (partition );
52655262 ArrayList <Permutation > cycleTrans = cycleTranspositions (index ,partition );
52665263 for (Permutation cycle : cycleTrans ) {
5267- System .out .println ("cycle" +" " +cycle .toCycleString ());
52685264 pWriter .print ("cycle" +" " +cycle .toCycleString ()+"\n " );
52695265 }
52705266 for (Permutation cycle : cycleTrans ) {
@@ -5338,18 +5334,18 @@ public static boolean formerPermutationsCheck(int index, int y, int total, int[]
53385334 break ;
53395335 }
53405336 }else {
5341- // if(test.equals(former.multiply(canonical))) {
5342- addRepresentatives (index , perm .multiply (canonical ), pWriter );
5343- // addRepresentatives(index, idPermutation(total), pWriter);
5337+ if (test .equals (former .multiply (canonical ))) {
5338+ // addRepresentatives(index, perm.multiply(canonical), pWriter);
5339+ addRepresentatives (index , idPermutation (total ), pWriter );
53445340 /**boolean formerTest = formerBlocksRepresentatives(index,y, A, newPartition, canonical, pWriter);
53455341 if(!formerTest) {
53465342 check=false;
53475343 break;
53485344 }else {
53495345 addRepresentatives(index, idPermutation(total), pWriter);
53505346 }**/
5351- // }else {
5352- // addRepresentatives(index, canonical,pWriter);
5347+ }else {
5348+ addRepresentatives (index , canonical ,pWriter );
53535349 /**boolean formerTest = formerBlocksRepresentatives(index,y, A, newPartition, canonical, pWriter);
53545350 if(!formerTest) {
53555351 check=false;
@@ -5358,7 +5354,7 @@ public static boolean formerPermutationsCheck(int index, int y, int total, int[]
53585354 pWriter.print("add rep"+" "+index+" "+representatives.size()+" "+canonical.toCycleString()+" "+"\n");
53595355 addRepresentatives(index, canonical,pWriter);
53605356 }**/
5361- // }
5357+ }
53625358 }
53635359 //}
53645360
@@ -5448,7 +5444,7 @@ public static Permutation getCanonicalPermutatiom(int index, int y, int total, i
54485444 if (!equalBlockCheck (cycleM ,newPartition ,index ,y ,A ,idPermutation (total ), pWriter )) {
54495445 canonical =getEqualPermutation (cycleM , index , y , total ,A , partition , newPartition , pWriter );
54505446 pWriter .print ("equal perm" +" " +canonical .toCycleString ()+"\n " );
5451- // canonical=cycle.multiply(canonical);
5447+ canonical =cycle .multiply (canonical );
54525448 /**if(canonical.isIdentity()) {
54535449 if(!descBlockCheck2(cycleM,newPartition,index,y,A,idPermutation(total),2,pWriter)) {
54545450 canonical = idPermutation(total);
@@ -5459,7 +5455,7 @@ public static Permutation getCanonicalPermutatiom(int index, int y, int total, i
54595455 canonical=cycle.multiply(canonical);
54605456 }**/
54615457 }else {
5462- // canonical=cycle.multiply(canonical);
5458+ canonical =cycle .multiply (canonical );
54635459 }
54645460 }
54655461 pWriter .print ("getCanonical permutation" +" " +canonical .toCycleString ());
@@ -6173,7 +6169,9 @@ public static boolean equalBlockCheck(Permutation cycleM,ArrayList<Integer> part
61736169 int [] original = A [index ];
61746170 //System.out.println(cycleM.toCycleString()+" "+perm.toCycleString());
61756171 pWriter .print (cycleM .toCycleString ()+" " +perm .toCycleString ()+"\n " );
6176- original =actArray (actArray (A [cycleM .get (index )],cycleM ),perm );
6172+ Permutation mult =cycleM .multiply (perm );
6173+ original =actArray (A [mult .get (index )],mult );
6174+ //original=actArray(actArray(A[cycleM.get(index)],cycleM),perm);
61776175 //System.out.println("equalBlockCheck"+" "+Arrays.toString(canonical));
61786176 pWriter .print ("equalBlockCheck" +" " +Arrays .toString (canonical )+"\n " );
61796177 //System.out.println("equalBlockCheck"+" "+Arrays.toString(original));
@@ -7636,7 +7634,7 @@ public static void canonicalBlockbasedGenerator(ArrayList<Integer> degrees, Arra
76367634 size = sum (partition );
76377635 initialDegrees =degrees ;
76387636 inputPartition =partition ;
7639- List <ArrayList <Integer >> newDegrees = distributeHydrogens (partition , degrees );
7637+ // List<ArrayList<Integer>> newDegrees= distributeHydrogens(partition, degrees);
76407638 FileWriter fWriter = new FileWriter ("C:\\ Users\\ mehme\\ Desktop\\ output.txt" );
76417639 PrintWriter pWriter = new PrintWriter (fWriter );
76427640 pWriter .print ("Result" +"\n " );
@@ -7654,10 +7652,10 @@ public static void canonicalBlockbasedGenerator(ArrayList<Integer> degrees, Arra
76547652 partitionList.add(0,inputPartition);
76557653 forwardBuild(r,degrees,inputPartition,A,max,L,C,indices,pWriter); **/
76567654 partitionList .add (0 ,inputPartition );
7657-
7658- for (ArrayList <Integer > degree : newDegrees ) {
7655+ gen ( degrees , pWriter );
7656+ /** for(ArrayList<Integer> degree: newDegrees) {
76597657 gen(degree, pWriter);
7660- }
7658+ }**/
76617659 fWriter .close ();
76627660 pWriter .close ();
76637661 long endTime = System .nanoTime ()- startTime ;
@@ -8496,22 +8494,15 @@ public static void main(String[] args) throws CloneNotSupportedException, CDKExc
84968494 PrintWriter pWriter = new PrintWriter (fWriter );
84978495
84988496 ArrayList <Integer > degrees = new ArrayList <Integer >();
8499- degrees .add (4 );
8500- degrees .add (4 );
8501- degrees .add (4 );
8502- degrees .add (4 );
8503- degrees .add (4 );
8504- degrees .add (4 );
8505- degrees .add (1 );
8506- degrees .add (1 );
8507- degrees .add (1 );
8508- degrees .add (1 );
8509- degrees .add (1 );
8510- degrees .add (1 );
8497+ degrees .add (3 );
8498+ degrees .add (3 );
8499+ degrees .add (3 );
8500+ degrees .add (3 );
8501+ degrees .add (3 );
8502+ degrees .add (3 );
85118503
85128504 ArrayList <Integer > partition = new ArrayList <Integer >();
85138505 partition .add (6 );
8514- partition .add (6 );
85158506
85168507 ArrayList <Integer > newPartition = new ArrayList <Integer >();
85178508 newPartition .add (1 );
@@ -8597,7 +8588,7 @@ public static void main(String[] args) throws CloneNotSupportedException, CDKExc
85978588
85988589 canonicalBlockbasedGenerator (degrees ,partition );
85998590 System .out .println (hoppa );
8600- // fWriter.close();
8601- // pWriter.close();
8591+ fWriter .close ();
8592+ pWriter .close ();
86028593 }
86038594}
0 commit comments