Changeset b4c71a for molecuilder/src/parser.cpp
- Timestamp:
- Oct 18, 2008, 3:05:54 PM (17 years ago)
- Children:
- 94ca12
- Parents:
- d87482
- File:
-
- 1 edited
-
molecuilder/src/parser.cpp (modified) (31 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/parser.cpp
rd87482 rb4c71a 59 59 Matrix = (double ***) Malloc(sizeof(double **)*(1), "MatrixContainer::MatrixContainer: ***Matrix"); // one more each for the total molecule 60 60 RowCounter = (int *) Malloc(sizeof(int)*(1), "MatrixContainer::MatrixContainer: *RowCounter"); 61 ColumnCounter = (int *) Malloc(sizeof(int)*(1), "MatrixContainer::MatrixContainer: *ColumnCounter"); 61 62 Matrix[0] = NULL; 62 63 RowCounter[0] = -1; 63 64 MatrixCounter = 0; 64 ColumnCounter = 0;65 ColumnCounter[0] = -1; 65 66 }; 66 67 … … 70 71 if (Matrix != NULL) { 71 72 for(int i=MatrixCounter;i--;) { 72 if ( RowCounter != NULL) {73 if ((ColumnCounter != NULL) && (RowCounter != NULL)) { 73 74 for(int j=RowCounter[i]+1;j--;) 74 75 Free((void **)&Matrix[i][j], "MatrixContainer::~MatrixContainer: *Matrix[][]"); … … 76 77 } 77 78 } 78 if (( RowCounter != NULL) && (Matrix[MatrixCounter] != NULL))79 if ((ColumnCounter != NULL) && (RowCounter != NULL) && (Matrix[MatrixCounter] != NULL)) 79 80 for(int j=RowCounter[MatrixCounter]+1;j--;) 80 81 Free((void **)&Matrix[MatrixCounter][j], "MatrixContainer::~MatrixContainer: *Matrix[MatrixCounter][]"); … … 91 92 Free((void **)&Header, "MatrixContainer::~MatrixContainer: *Header"); 92 93 Free((void **)&RowCounter, "MatrixContainer::~MatrixContainer: *RowCounter"); 93 }; 94 94 Free((void **)&ColumnCounter, "MatrixContainer::~MatrixContainer: *RowCounter"); 95 }; 96 97 /** Either copies index matrix from another MatrixContainer or initialises with trivial mapping if NULL. 98 * This either copies the index matrix or just maps 1 to 1, 2 to 2 and so on for all fragments. 99 * \param *Matrix pointer to other MatrixContainer 100 * \return true - copy/initialisation sucessful, false - dimension false for copying 101 */ 102 bool MatrixContainer::InitialiseIndices(class MatrixContainer *Matrix) 103 { 104 cout << "Initialising indices"; 105 if (Matrix == NULL) { 106 cout << " with trivial mapping." << endl; 107 Indices = (int **) Malloc(sizeof(int *)*(MatrixCounter+1), "MatrixContainer::InitialiseIndices: **Indices"); 108 for(int i=MatrixCounter+1;i--;) { 109 Indices[i] = (int *) Malloc(sizeof(int)*RowCounter[i], "MatrixContainer::InitialiseIndices: *Indices[]"); 110 for(int j=RowCounter[i];j--;) 111 Indices[i][j] = j; 112 } 113 } else { 114 cout << " from other MatrixContainer." << endl; 115 if (MatrixCounter != Matrix->MatrixCounter) 116 return false; 117 Indices = (int **) Malloc(sizeof(int *)*(MatrixCounter+1), "MatrixContainer::InitialiseIndices: **Indices"); 118 for(int i=MatrixCounter+1;i--;) { 119 if (RowCounter[i] != Matrix->RowCounter[i]) 120 return false; 121 Indices[i] = (int *) Malloc(sizeof(int)*Matrix->RowCounter[i], "MatrixContainer::InitialiseIndices: *Indices[]"); 122 for(int j=Matrix->RowCounter[i];j--;) 123 Indices[i][j] = Matrix->Indices[i][j]; 124 } 125 } 126 return true; 127 }; 95 128 96 129 /** Parsing a number of matrices. … … 130 163 line >> Header; 131 164 //cout << line.str() << endl; 132 ColumnCounter =0;165 ColumnCounter[MatrixNr]=0; 133 166 while ( getline(line,token, '\t') ) { 134 167 if (token.length() > 0) 135 ColumnCounter ++;168 ColumnCounter[MatrixNr]++; 136 169 } 137 170 //cout << line.str() << endl; 138 //cout << "ColumnCounter: " << ColumnCounter<< "." << endl;139 if (ColumnCounter == 0)140 cerr << "ColumnCounter : " << ColumnCounter<< " from file " << name << ", this is probably an error!" << endl;171 cout << "ColumnCounter[" << MatrixNr << "]: " << ColumnCounter[MatrixNr] << "." << endl; 172 if (ColumnCounter[MatrixNr] == 0) 173 cerr << "ColumnCounter[" << MatrixNr << "]: " << ColumnCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl; 141 174 142 175 // scan rest for number of rows/lines … … 150 183 } 151 184 } 152 //cout << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << "." << endl;185 cout << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << "." << endl; 153 186 if (RowCounter[MatrixNr] == 0) 154 187 cerr << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl; 155 188 156 189 // allocate matrix if it's not zero dimension in one direction 157 if ((ColumnCounter > 0) && (RowCounter[MatrixNr] > -1)) {190 if ((ColumnCounter[MatrixNr] > 0) && (RowCounter[MatrixNr] > -1)) { 158 191 Matrix[MatrixNr] = (double **) Malloc(sizeof(double *)*(RowCounter[MatrixNr]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 159 192 … … 168 201 strncpy(Header, line.str().c_str(), 1023); 169 202 for(int j=0;j<RowCounter[MatrixNr];j++) { 170 Matrix[MatrixNr][j] = (double *) Malloc(sizeof(double)*ColumnCounter , "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");203 Matrix[MatrixNr][j] = (double *) Malloc(sizeof(double)*ColumnCounter[MatrixNr], "MatrixContainer::ParseFragmentMatrix: *Matrix[][]"); 171 204 input.getline(filename, 1023); 172 205 stringstream lines(filename); … … 174 207 for(int k=skipcolumns;k--;) 175 208 lines >> filename; 176 for(int k=0;(k<ColumnCounter ) && (!lines.eof());k++) {209 for(int k=0;(k<ColumnCounter[MatrixNr]) && (!lines.eof());k++) { 177 210 lines >> Matrix[MatrixNr][j][k]; 178 211 //cout << " " << setprecision(2) << Matrix[MatrixNr][j][k];; 179 212 } 180 213 //cout << endl; 181 Matrix[MatrixNr][ RowCounter[MatrixNr] ] = (double *) Malloc(sizeof(double)*ColumnCounter , "MatrixContainer::ParseFragmentMatrix: *Matrix[RowCounter[MatrixNr]][]");182 for(int j=ColumnCounter ;j--;)214 Matrix[MatrixNr][ RowCounter[MatrixNr] ] = (double *) Malloc(sizeof(double)*ColumnCounter[MatrixNr], "MatrixContainer::ParseFragmentMatrix: *Matrix[RowCounter[MatrixNr]][]"); 215 for(int j=ColumnCounter[MatrixNr];j--;) 183 216 Matrix[MatrixNr][ RowCounter[MatrixNr] ][j] = 0.; 184 217 } 185 218 } else { 186 cerr << "ERROR: Matrix nr. " << MatrixNr << " has column and row count of (" << ColumnCounter << "," << RowCounter[MatrixNr] << "), could not allocate nor parse!" << endl;219 cerr << "ERROR: Matrix nr. " << MatrixNr << " has column and row count of (" << ColumnCounter[MatrixNr] << "," << RowCounter[MatrixNr] << "), could not allocate nor parse!" << endl; 187 220 } 188 221 input.close(); … … 235 268 Matrix = (double ***) ReAlloc(Matrix, sizeof(double **)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule 236 269 RowCounter = (int *) ReAlloc(RowCounter, sizeof(int)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: *RowCounter"); 270 ColumnCounter = (int *) ReAlloc(ColumnCounter, sizeof(int)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: *ColumnCounter"); 237 271 for(int i=MatrixCounter+1;i--;) { 238 272 Matrix[i] = NULL; 239 273 RowCounter[i] = -1; 274 ColumnCounter[i] = -1; 240 275 } 241 276 for(int i=0; i < MatrixCounter;i++) { … … 255 290 * \param MCounter number of matrices 256 291 * \param *RCounter number of rows for each matrix 257 * \param CCounter number of columns for allmatrices292 * \param *CCounter number of columns for each matrices 258 293 * \return Allocation successful 259 294 */ 260 bool MatrixContainer::AllocateMatrix(char *GivenHeader, int MCounter, int *RCounter, int CCounter)295 bool MatrixContainer::AllocateMatrix(char *GivenHeader, int MCounter, int *RCounter, int *CCounter) 261 296 { 262 297 Header = (char *) Malloc(sizeof(char)*1024, "MatrixContainer::ParseFragmentMatrix: *EnergyHeader"); … … 264 299 265 300 MatrixCounter = MCounter; 266 ColumnCounter = CCounter;267 301 Matrix = (double ***) Malloc(sizeof(double **)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule 268 302 RowCounter = (int *) Malloc(sizeof(int)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: *RowCounter"); 303 ColumnCounter = (int *) Malloc(sizeof(int)*(MatrixCounter+1), "MatrixContainer::ParseFragmentMatrix: *ColumnCounter"); 269 304 for(int i=MatrixCounter+1;i--;) { 270 305 RowCounter[i] = RCounter[i]; 306 ColumnCounter[i] = CCounter[i]; 271 307 Matrix[i] = (double **) Malloc(sizeof(double *)*(RowCounter[i]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 272 308 for(int j=RowCounter[i]+1;j--;) { 273 Matrix[i][j] = (double *) Malloc(sizeof(double)*ColumnCounter , "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");274 for(int k=ColumnCounter ;k--;)309 Matrix[i][j] = (double *) Malloc(sizeof(double)*ColumnCounter[i], "MatrixContainer::ParseFragmentMatrix: *Matrix[][]"); 310 for(int k=ColumnCounter[i];k--;) 275 311 Matrix[i][j][k] = 0.; 276 312 } … … 286 322 for(int i=MatrixCounter+1;i--;) 287 323 for(int j=RowCounter[i]+1;j--;) 288 for(int k=ColumnCounter ;k--;)324 for(int k=ColumnCounter[i];k--;) 289 325 Matrix[i][j][k] = 0.; 290 326 return true; … … 299 335 for(int i=MatrixCounter+1;i--;) 300 336 for(int j=RowCounter[i]+1;j--;) 301 for(int k=ColumnCounter ;k--;)337 for(int k=ColumnCounter[i];k--;) 302 338 if (fabs(Matrix[i][j][k]) > max) 303 339 max = fabs(Matrix[i][j][k]); … … 315 351 for(int i=MatrixCounter+1;i--;) 316 352 for(int j=RowCounter[i]+1;j--;) 317 for(int k=ColumnCounter ;k--;)353 for(int k=ColumnCounter[i];k--;) 318 354 if (fabs(Matrix[i][j][k]) < min) 319 355 min = fabs(Matrix[i][j][k]); … … 331 367 { 332 368 for(int j=RowCounter[MatrixCounter]+1;j--;) 333 for(int k=skipcolumns;k<ColumnCounter ;k++)369 for(int k=skipcolumns;k<ColumnCounter[MatrixCounter];k++) 334 370 Matrix[MatrixCounter][j][k] = value; 335 371 return true; … … 344 380 { 345 381 for(int j=RowCounter[MatrixCounter]+1;j--;) 346 for(int k=skipcolumns;k<ColumnCounter ;k++)382 for(int k=skipcolumns;k<ColumnCounter[MatrixCounter];k++) 347 383 Matrix[MatrixCounter][j][k] = values[j][k]; 348 384 return true; … … 351 387 /** Sums the energy with each factor and put into last element of \a ***Energies. 352 388 * Sums over "E"-terms to create the "F"-terms 353 * \param Matrix MatrixContainer with matrices (LevelCounter by ColumnCounter) with all the energies.389 * \param Matrix MatrixContainer with matrices (LevelCounter by *ColumnCounter) with all the energies. 354 390 * \param KeySet KeySetContainer with bond Order and association mapping of each fragment to an order 355 391 * \param Order bond order … … 384 420 } 385 421 if (Order == SubOrder) { // equal order is always copy from Energies 386 for(int l=ColumnCounter ;l--;) // then adds/subtract each column422 for(int l=ColumnCounter[ KeySet.OrderSet[SubOrder][j] ];l--;) // then adds/subtract each column 387 423 Matrix[ KeySet.OrderSet[Order][CurrentFragment] ][m][l] += MatrixValues.Matrix[ KeySet.OrderSet[SubOrder][j] ][k][l]; 388 424 } else { 389 for(int l=ColumnCounter ;l--;)425 for(int l=ColumnCounter[ KeySet.OrderSet[SubOrder][j] ];l--;) 390 426 Matrix[ KeySet.OrderSet[Order][CurrentFragment] ][m][l] -= Matrix[ KeySet.OrderSet[SubOrder][j] ][k][l]; 391 427 } 392 428 } 393 //if ((ColumnCounter >1) && (RowCounter[0]-1 >= 1))429 //if ((ColumnCounter[ KeySet.OrderSet[SubOrder][j] ]>1) && (RowCounter[0]-1 >= 1)) 394 430 //cout << "Fragments[ KeySet.OrderSet[" << Order << "][" << CurrentFragment << "]=" << KeySet.OrderSet[Order][CurrentFragment] << " ][" << RowCounter[0]-1 << "][" << 1 << "] = " << Matrix[ KeySet.OrderSet[Order][CurrentFragment] ][RowCounter[0]-1][1] << endl; 395 431 } … … 428 464 output << Header << endl; 429 465 for(int j=0;j<RowCounter[i];j++) { 430 for(int k=0;k<ColumnCounter ;k++)466 for(int k=0;k<ColumnCounter[i];k++) 431 467 output << scientific << Matrix[i][j][k] << "\t"; 432 468 output << endl; … … 457 493 output << Header << endl; 458 494 for(int j=0;j<RowCounter[MatrixCounter];j++) { 459 for(int k=0;k<ColumnCounter ;k++)495 for(int k=0;k<ColumnCounter[MatrixCounter];k++) 460 496 output << scientific << Matrix[MatrixCounter][j][k] << "\t"; 461 497 output << endl; … … 467 503 // ======================================= CLASS EnergyMatrix ============================= 468 504 469 /** Create a trivial energy index mapping.470 * This just maps 1 to 1, 2 to 2 and so on for all fragments.471 * \return creation sucessful472 */473 bool EnergyMatrix::ParseIndices()474 {475 cout << "Parsing energy indices." << endl;476 Indices = (int **) Malloc(sizeof(int *)*(MatrixCounter+1), "EnergyMatrix::ParseIndices: **Indices");477 for(int i=MatrixCounter+1;i--;) {478 Indices[i] = (int *) Malloc(sizeof(int)*RowCounter[i], "EnergyMatrix::ParseIndices: *Indices[]");479 for(int j=RowCounter[i];j--;)480 Indices[i][j] = j;481 }482 return true;483 };484 485 505 /** Sums the energy with each factor and put into last element of \a EnergyMatrix::Matrix. 486 506 * Sums over the "F"-terms in ANOVA decomposition. 487 * \param Matrix MatrixContainer with matrices (LevelCounter by ColumnCounter) with all the energies.507 * \param Matrix MatrixContainer with matrices (LevelCounter by *ColumnCounter) with all the energies. 488 508 * \param CorrectionFragments MatrixContainer with hydrogen saturation correction per fragments 489 509 * \param KeySet KeySetContainer with bond Order and association mapping of each fragment to an order … … 498 518 for(int i=KeySet.FragmentsPerOrder[Order];i--;) 499 519 for(int j=RowCounter[ KeySet.OrderSet[Order][i] ];j--;) 500 for(int k=ColumnCounter ;k--;)520 for(int k=ColumnCounter[ KeySet.OrderSet[Order][i] ];k--;) 501 521 Matrix[MatrixCounter][j][k] += sign*Fragments.Matrix[ KeySet.OrderSet[Order][i] ][j][k]; 502 522 else 503 523 for(int i=KeySet.FragmentsPerOrder[Order];i--;) 504 524 for(int j=RowCounter[ KeySet.OrderSet[Order][i] ];j--;) 505 for(int k=ColumnCounter ;k--;)525 for(int k=ColumnCounter[ KeySet.OrderSet[Order][i] ];k--;) 506 526 Matrix[MatrixCounter][j][k] += sign*(Fragments.Matrix[ KeySet.OrderSet[Order][i] ][j][k] + CorrectionFragments->Matrix[ KeySet.OrderSet[Order][i] ][j][k]); 507 527 return true; … … 524 544 // count maximum of columns 525 545 RowCounter[MatrixCounter] = 0; 526 for(int j=0; j < MatrixCounter;j++) // (energy matrix might be bigger than number of atoms in terms of rows) 546 ColumnCounter[MatrixCounter] = 0; 547 for(int j=0; j < MatrixCounter;j++) { // (energy matrix might be bigger than number of atoms in terms of rows) 527 548 if (RowCounter[j] > RowCounter[MatrixCounter]) 528 549 RowCounter[MatrixCounter] = RowCounter[j]; 550 if (ColumnCounter[j] > ColumnCounter[MatrixCounter]) // take maximum of all for last matrix 551 ColumnCounter[MatrixCounter] = ColumnCounter[j]; 552 } 529 553 // allocate last plus one matrix 530 cout << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter << " columns." << endl;554 cout << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl; 531 555 Matrix[MatrixCounter] = (double **) Malloc(sizeof(double *)*(RowCounter[MatrixCounter]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 532 556 for(int j=0;j<=RowCounter[MatrixCounter];j++) 533 Matrix[MatrixCounter][j] = (double *) Malloc(sizeof(double)*ColumnCounter , "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");557 Matrix[MatrixCounter][j] = (double *) Malloc(sizeof(double)*ColumnCounter[MatrixCounter], "MatrixContainer::ParseFragmentMatrix: *Matrix[][]"); 534 558 535 559 // try independently to parse global energysuffix file if present … … 589 613 590 614 /** Sums the forces and puts into last element of \a ForceMatrix::Matrix. 591 * \param Matrix MatrixContainer with matrices (LevelCounter by ColumnCounter) with all the energies.615 * \param Matrix MatrixContainer with matrices (LevelCounter by *ColumnCounter) with all the energies. 592 616 * \param KeySet KeySetContainer with bond Order and association mapping of each fragment to an order 593 617 * \param Order bond order … … 609 633 if (j != -1) { 610 634 //if (j == 0) cout << "Summing onto ion 0, type 0 from fragment " << FragmentNr << ", ion " << l << "." << endl; 611 for(int k=2;k<ColumnCounter ;k++)635 for(int k=2;k<ColumnCounter[MatrixCounter];k++) 612 636 Matrix[MatrixCounter][j][k] += sign*Fragments.Matrix[ FragmentNr ][l][k]; 613 637 } … … 655 679 RowCounter[MatrixCounter]++; // nr start at 0, count starts at 1 656 680 input.close(); 681 682 ColumnCounter[MatrixCounter] = 0; 683 for(int j=0; j < MatrixCounter;j++) { // (energy matrix might be bigger than number of atoms in terms of rows) 684 if (ColumnCounter[j] > ColumnCounter[MatrixCounter]) // take maximum of all for last matrix 685 ColumnCounter[MatrixCounter] = ColumnCounter[j]; 686 } 657 687 658 688 // allocate last plus one matrix 659 cout << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter << " columns." << endl;689 cout << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl; 660 690 Matrix[MatrixCounter] = (double **) Malloc(sizeof(double *)*(RowCounter[MatrixCounter]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 661 691 for(int j=0;j<=RowCounter[MatrixCounter];j++) 662 Matrix[MatrixCounter][j] = (double *) Malloc(sizeof(double)*ColumnCounter , "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");692 Matrix[MatrixCounter][j] = (double *) Malloc(sizeof(double)*ColumnCounter[MatrixCounter], "MatrixContainer::ParseFragmentMatrix: *Matrix[][]"); 663 693 664 694 // try independently to parse global forcesuffix file if present … … 686 716 stringstream line; 687 717 688 cout << "Parsing forceindices for " << MatrixCounter << " matrices." << endl;718 cout << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl; 689 719 Indices = (int **) Malloc(sizeof(int *)*(MatrixCounter+1), "HessianMatrix::ParseIndices: **Indices"); 690 720 line << name << FRAGMENTPREFIX << FORCESFILE; … … 720 750 721 751 /** Sums the hessian entries and puts into last element of \a HessianMatrix::Matrix. 722 * \param Matrix MatrixContainer with matrices (LevelCounter by ColumnCounter) with all the energies.752 * \param Matrix MatrixContainer with matrices (LevelCounter by *ColumnCounter) with all the energies. 723 753 * \param KeySet KeySetContainer with bond Order and association mapping of each fragment to an order 724 754 * \param Order bond order … … 739 769 } 740 770 if (j != -1) { 741 //for(int m=0;m<ColumnCounter[ FragmentNr ];m++) { 742 for(int m=0;m<ColumnCounter;m++) { 771 for(int m=0;m<ColumnCounter[ FragmentNr ];m++) { 743 772 int k = Indices[ FragmentNr ][m]; 744 // if (k > ColumnCounter[MatrixCounter]) { 745 // cerr << "Current hessian index " << k << " is greater than " << ColumnCounter[MatrixCounter] << "!" << endl; 746 if (k > ColumnCounter) { 747 cerr << "Current hessian index " << k << " is greater than " << ColumnCounter << "!" << endl; 773 if (k > ColumnCounter[MatrixCounter]) { 774 cerr << "Current hessian index " << k << " is greater than " << ColumnCounter[MatrixCounter] << "!" << endl; 748 775 return false; 749 776 } … … 784 811 } 785 812 RowCounter[MatrixCounter] = 0; 813 ColumnCounter[MatrixCounter] = 0; 786 814 while (!input.eof()) { 787 815 input.getline(filename, 1023); … … 790 818 zeile >> nr; 791 819 //cout << "Current index: " << nr << "." << endl; 792 if (nr > RowCounter[MatrixCounter]) 820 if (nr > RowCounter[MatrixCounter]) { 793 821 RowCounter[MatrixCounter] = nr; 822 ColumnCounter[MatrixCounter] = nr; 823 } 794 824 } 795 825 } 796 826 RowCounter[MatrixCounter]++; // nr start at 0, count starts at 1 827 ColumnCounter[MatrixCounter]++; // nr start at 0, count starts at 1 797 828 input.close(); 798 829 799 830 // allocate last plus one matrix 800 cout << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter << " columns." << endl;831 cout << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl; 801 832 Matrix[MatrixCounter] = (double **) Malloc(sizeof(double *)*(RowCounter[MatrixCounter]+1), "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 802 833 for(int j=0;j<=RowCounter[MatrixCounter];j++) 803 Matrix[MatrixCounter][j] = (double *) Malloc(sizeof(double)*ColumnCounter , "MatrixContainer::ParseFragmentMatrix: *Matrix[][]");834 Matrix[MatrixCounter][j] = (double *) Malloc(sizeof(double)*ColumnCounter[MatrixCounter], "MatrixContainer::ParseFragmentMatrix: *Matrix[][]"); 804 835 805 836 // try independently to parse global forcesuffix file if present
Note:
See TracChangeset
for help on using the changeset viewer.
