Changeset b86de7 for molecuilder/src/builder.cpp
- Timestamp:
- Oct 9, 2008, 6:27:56 PM (17 years ago)
- Children:
- d01f4d
- Parents:
- a7b3b8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
ra7b3b8 rb86de7 953 953 cout << Verbose(1) << "Depth-First-Search Analysis." << endl; 954 954 MoleculeLeafClass *Subgraphs = NULL; // list of subgraphs from DFS analysis 955 int *MinimumRingSize = NULL; 955 int *MinimumRingSize = new int[mol->AtomCount]; 956 atom ***ListOfLocalAtoms = NULL; 957 int FragmentCounter = 0; 958 class StackClass<bond *> *BackEdgeStack = NULL; 959 class StackClass<bond *> *LocalBackEdgeStack = NULL; 956 960 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr]), configuration.GetIsAngstroem()); 957 961 mol->CreateListOfBondsPerAtom((ofstream *)&cout); 958 Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, MinimumRingSize); 959 delete[](MinimumRingSize); 962 Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, BackEdgeStack); 960 963 if (Subgraphs != NULL) { 964 Subgraphs->next->FillBondStructureFromReference((ofstream *)&cout, mol, (FragmentCounter = 0), ListOfLocalAtoms, false); // we want to keep the created ListOfLocalAtoms 961 965 while (Subgraphs->next != NULL) { 962 966 Subgraphs = Subgraphs->next; 967 LocalBackEdgeStack = new StackClass<bond *> (Subgraphs->Leaf->BondCount); 968 Subgraphs->Leaf->PickLocalBackEdges((ofstream *)&cout, ListOfLocalAtoms[FragmentCounter++], BackEdgeStack, LocalBackEdgeStack); 969 Subgraphs->Leaf->CyclicStructureAnalysis((ofstream *)&cout, BackEdgeStack, MinimumRingSize); 970 delete(LocalBackEdgeStack); 963 971 delete(Subgraphs->previous); 964 972 } 965 973 delete(Subgraphs); 974 for (int i=0;i<FragmentCounter;i++) 975 Free((void **)&ListOfLocalAtoms[FragmentCounter], "ParseCommandLineOptions: **ListOfLocalAtoms[]"); 976 Free((void **)&ListOfLocalAtoms, "ParseCommandLineOptions: ***ListOfLocalAtoms"); 966 977 } 978 delete(BackEdgeStack); 979 delete[](MinimumRingSize); 967 980 } 968 981 argptr+=1; … … 1255 1268 int Z; 1256 1269 int j, axis, count, faktor; 1257 int *MinimumRingSize = NULL; 1270 clock_t start,end; 1271 // int *MinimumRingSize = NULL; 1258 1272 MoleculeLeafClass *Subgraphs = NULL; 1259 clock_t start,end;1273 // class StackClass<bond *> *BackEdgeStack = NULL; 1260 1274 element **Elements; 1261 1275 Vector **vectors; … … 1423 1437 1424 1438 case 'o': // create the connection matrix 1425 cout << Verbose(0) << "What's the maximum bond distance: "; 1426 cin >> tmp1; 1427 start = clock(); 1428 mol->CreateAdjacencyList((ofstream *)&cout, tmp1, configuration.GetIsAngstroem()); 1429 //mol->CreateListOfBondsPerAtom((ofstream *)&cout); 1430 Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, MinimumRingSize); 1431 while (Subgraphs->next != NULL) { 1432 Subgraphs = Subgraphs->next; 1433 delete(Subgraphs->previous); 1439 { 1440 cout << Verbose(0) << "What's the maximum bond distance: "; 1441 cin >> tmp1; 1442 start = clock(); 1443 mol->CreateAdjacencyList((ofstream *)&cout, tmp1, configuration.GetIsAngstroem()); 1444 mol->CreateListOfBondsPerAtom((ofstream *)&cout); 1445 // Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, BackEdgeStack); 1446 // while (Subgraphs->next != NULL) { 1447 // Subgraphs = Subgraphs->next; 1448 // Subgraphs->Leaf->CyclicStructureAnalysis((ofstream *)&cout, BackEdgeStack, MinimumRingSize); 1449 // delete(Subgraphs->previous); 1450 // } 1451 // delete(Subgraphs); // we don't need the list here, so free everything 1452 // delete[](MinimumRingSize); 1453 // Subgraphs = NULL; 1454 end = clock(); 1455 cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl; 1434 1456 } 1435 delete(Subgraphs); // we don't need the list here, so free everything1436 delete[](MinimumRingSize);1437 Subgraphs = NULL;1438 end = clock();1439 cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;1440 1457 break; 1441 1458
Note:
See TracChangeset
for help on using the changeset viewer.