Changeset 36e658
- Timestamp:
- Apr 21, 2008, 2:19:25 PM (17 years ago)
- Children:
- 2cab03a
- Parents:
- d48972
- git-author:
- Frederik Heber <heber@…> (04/18/08 15:38:00)
- git-committer:
- Frederik Heber <heber@…> (04/21/08 14:19:25)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/grad.c
rd48972 r36e658 624 624 S[2] = PsiSP[1]; 625 625 if (step) { // only in later steps is the scalar product used, but always condir stored in oldcondir and Ortho (working gradient) 626 if (fabs(S[1]) < MYEPSILON) fprintf(stderr,"CalculateConDir: S[1] = %lg\n",S[1]);627 Gamma = (S[0]-S[2])/S[1]; // the final CG beta coefficient (Polak-Ribiere)628 626 if (fabs(S[1]) < MYEPSILON) { 629 627 if (fabs((S[0]-S[2])) < MYEPSILON) … … 631 629 else 632 630 Gamma = 0.0; 633 } 631 } else 632 Gamma = (S[0]-S[2])/S[1]; // the final CG beta coefficient (Polak-Ribiere) 634 633 if (Gamma < 0) { // Polak-Ribiere with automatic restart: gamma = max {0, gamma} 635 634 Gamma = 0.;
Note:
See TracChangeset
for help on using the changeset viewer.