Changeset 1f2e46 for molecuilder/src/parser.cpp
- Timestamp:
- Apr 22, 2010, 2:00:03 PM (15 years ago)
- Children:
- 423c7b
- Parents:
- c43766
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/parser.cpp
rc43766 r1f2e46 32 32 if (input == NULL) { 33 33 if (!test) 34 Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl;34 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl); 35 35 return false; 36 36 } … … 109 109 bool MatrixContainer::InitialiseIndices(class MatrixContainer *Matrix) 110 110 { 111 Log() << Verbose(0) << "Initialising indices";111 DoLog(0) && (Log() << Verbose(0) << "Initialising indices"); 112 112 if (Matrix == NULL) { 113 Log() << Verbose(0) << " with trivial mapping." << endl;113 DoLog(0) && (Log() << Verbose(0) << " with trivial mapping." << endl); 114 114 Indices = Malloc<int*>(MatrixCounter + 1, "MatrixContainer::InitialiseIndices: **Indices"); 115 115 for(int i=MatrixCounter+1;i--;) { … … 119 119 } 120 120 } else { 121 Log() << Verbose(0) << " from other MatrixContainer." << endl;121 DoLog(0) && (Log() << Verbose(0) << " from other MatrixContainer." << endl); 122 122 if (MatrixCounter != Matrix->MatrixCounter) 123 123 return false; … … 269 269 input.open(file.str().c_str(), ios::in); 270 270 if (input == NULL) { 271 Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;271 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl); 272 272 return false; 273 273 } … … 278 278 } 279 279 input.close(); 280 Log() << Verbose(0) << "Determined " << MatrixCounter << " fragments." << endl;281 282 Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl;280 DoLog(0) && (Log() << Verbose(0) << "Determined " << MatrixCounter << " fragments." << endl); 281 282 DoLog(0) && (Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl); 283 283 Header = ReAlloc<char*>(Header, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: **Header"); // one more each for the total molecule 284 284 Matrix = ReAlloc<double**>(Matrix, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule … … 469 469 char *FragmentNumber = NULL; 470 470 471 Log() << Verbose(0) << "Writing fragment files." << endl;471 DoLog(0) && (Log() << Verbose(0) << "Writing fragment files." << endl); 472 472 for(int i=0;i<MatrixCounter;i++) { 473 473 stringstream line; … … 503 503 stringstream line; 504 504 505 Log() << Verbose(0) << "Writing matrix values of " << suffix << "." << endl;505 DoLog(0) && (Log() << Verbose(0) << "Writing matrix values of " << suffix << "." << endl); 506 506 line << name << prefix << suffix; 507 507 output.open(line.str().c_str(), ios::out); … … 529 529 bool EnergyMatrix::ParseIndices() 530 530 { 531 Log() << Verbose(0) << "Parsing energy indices." << endl;531 DoLog(0) && (Log() << Verbose(0) << "Parsing energy indices." << endl); 532 532 Indices = Malloc<int*>(MatrixCounter + 1, "EnergyMatrix::ParseIndices: **Indices"); 533 533 for(int i=MatrixCounter+1;i--;) { … … 588 588 } 589 589 // allocate last plus one matrix 590 Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;590 DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl); 591 591 Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 592 592 for(int j=0;j<=RowCounter[MatrixCounter];j++) … … 615 615 stringstream line; 616 616 617 Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl;617 DoLog(0) && (Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl); 618 618 Indices = Malloc<int*>(MatrixCounter + 1, "ForceMatrix::ParseIndices: **Indices"); 619 619 line << name << FRAGMENTPREFIX << FORCESFILE; … … 621 621 //Log() << Verbose(0) << "Opening " << line.str() << " ... " << input << endl; 622 622 if (input == NULL) { 623 Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;623 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl); 624 624 return false; 625 625 } … … 700 700 input.open(file.str().c_str(), ios::in); 701 701 if (input == NULL) { 702 Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;702 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl); 703 703 return false; 704 704 } … … 724 724 725 725 // allocate last plus one matrix 726 Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;726 DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl); 727 727 Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 728 728 for(int j=0;j<=RowCounter[MatrixCounter];j++) … … 753 753 stringstream line; 754 754 755 Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl;755 DoLog(0) && (Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl); 756 756 Indices = Malloc<int*>(MatrixCounter + 1, "HessianMatrix::ParseIndices: **Indices"); 757 757 line << name << FRAGMENTPREFIX << FORCESFILE; … … 759 759 //Log() << Verbose(0) << "Opening " << line.str() << " ... " << input << endl; 760 760 if (input == NULL) { 761 Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;761 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl); 762 762 return false; 763 763 } … … 930 930 input.open(file.str().c_str(), ios::in); 931 931 if (input == NULL) { 932 Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;932 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl); 933 933 return false; 934 934 } … … 952 952 953 953 // allocate last plus one matrix 954 Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;954 DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl); 955 955 Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 956 956 for(int j=0;j<=RowCounter[MatrixCounter];j++) … … 1007 1007 1008 1008 FragmentCounter = FCounter; 1009 Log() << Verbose(0) << "Parsing key sets." << endl;1009 DoLog(0) && (Log() << Verbose(0) << "Parsing key sets." << endl); 1010 1010 KeySets = Malloc<int*>(FragmentCounter, "KeySetsContainer::ParseKeySets: **KeySets"); 1011 1011 for(int i=FragmentCounter;i--;) … … 1014 1014 input.open(file.str().c_str(), ios::in); 1015 1015 if (input == NULL) { 1016 Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;1016 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl); 1017 1017 return false; 1018 1018 } … … 1048 1048 int Counter; 1049 1049 1050 Log() << Verbose(0) << "Creating Fragment terms." << endl;1050 DoLog(0) && (Log() << Verbose(0) << "Creating Fragment terms." << endl); 1051 1051 // scan through all to determine maximum order 1052 1052 Order=0; … … 1059 1059 Order = Counter; 1060 1060 } 1061 Log() << Verbose(0) << "Found Order is " << Order << "." << endl;1061 DoLog(0) && (Log() << Verbose(0) << "Found Order is " << Order << "." << endl); 1062 1062 1063 1063 // scan through all to determine fragments per order … … 1073 1073 } 1074 1074 for(int i=0;i<Order;i++) 1075 Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl;1075 DoLog(0) && (Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl); 1076 1076 1077 1077 // scan through all to gather indices to each order set … … 1089 1089 FragmentsPerOrder[Counter-1]++; 1090 1090 } 1091 Log() << Verbose(0) << "Printing OrderSet." << endl;1091 DoLog(0) && (Log() << Verbose(0) << "Printing OrderSet." << endl); 1092 1092 for(int i=0;i<Order;i++) { 1093 1093 for (int j=0;j<FragmentsPerOrder[i];j++) { 1094 Log() << Verbose(0) << " " << OrderSet[i][j];1095 } 1096 Log() << Verbose(0) << endl;1097 } 1098 Log() << Verbose(0) << endl;1094 DoLog(0) && (Log() << Verbose(0) << " " << OrderSet[i][j]); 1095 } 1096 DoLog(0) && (Log() << Verbose(0) << endl); 1097 } 1098 DoLog(0) && (Log() << Verbose(0) << endl); 1099 1099 1100 1100
Note:
See TracChangeset
for help on using the changeset viewer.