ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/minimizers/PRCG.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/minimizers/PRCG.cpp (file contents):
Revision 2204 by gezelter, Fri Apr 15 22:04:00 2005 UTC vs.
Revision 2759 by tim, Wed May 17 21:51:42 2006 UTC

# Line 69 | Line 69 | namespace oopse {
69    }
70  
71    void PRCGMinimizer::prepareStep(){
72 <    std::vector<double> deltaGrad;
73 <    double beta;
72 >    std::vector<RealType> deltaGrad;
73 >    RealType beta;
74      size_t i;
75  
76      deltaGrad.resize(ndim);
# Line 83 | Line 83 | namespace oopse {
83   #ifndef IS_MPI
84      beta = dotProduct(deltaGrad, curG) / dotProduct(prevG, prevG);
85   #else
86 <    double localDP1;
87 <    double localDP2;
88 <    double globalDP1;
89 <    double globalDP2;
86 >    RealType localDP1;
87 >    RealType localDP2;
88 >    RealType globalDP1;
89 >    RealType globalDP2;
90  
91      localDP1 =  dotProduct(deltaGrad, curG);
92      localDP2 = dotProduct(prevG, prevG);
93  
94 <    MPI_Allreduce(&localDP1, &globalDP1, 1, MPI_DOUBLE,MPI_SUM, MPI_COMM_WORLD);
95 <    MPI_Allreduce(&localDP2, &globalDP2, 1, MPI_DOUBLE,MPI_SUM, MPI_COMM_WORLD);
94 >    MPI_Allreduce(&localDP1, &globalDP1, 1, MPI_REALTYPE,MPI_SUM, MPI_COMM_WORLD);
95 >    MPI_Allreduce(&localDP2, &globalDP2, 1, MPI_REALTYPE,MPI_SUM, MPI_COMM_WORLD);
96    
97      beta = globalDP1 / globalDP2;
98   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines