--- trunk/OOPSE/staticProps/AllCorr.cpp 2003/10/10 17:10:22 803 +++ trunk/OOPSE/staticProps/AllCorr.cpp 2003/10/17 21:19:07 810 @@ -1,6 +1,8 @@ #include +#include #include +#include "simError.h" #include "AllCorr.hpp" @@ -28,7 +30,7 @@ void AllCorr::setNbins( double theNbins ){ haveLength = true; } -void AllCorr::setNbins( double theNbins ){ +void AllCorr::setNbins( int theNbins ){ nBins = theNbins; haveNbins = true; } @@ -88,8 +90,6 @@ void AllCorr::setPairCorrList( vector & } - theList.sort(); - nPairs = (int)theList.size(); pairCorrs = new PairCorrType*[nPairs]; @@ -123,7 +123,7 @@ void AllCorr::initCorrelations( char* theOutPrefix, bo bool theHavePairCorrs, bool theHaveStaticCorrs ){ int i; - atomName* theNames = new atomNames[nAtoms]; + atomName* theNames = new atomName[nAtoms]; havePairCorrs = theHavePairCorrs; haveStaticCorrs = theHaveStaticCorrs; @@ -144,7 +144,7 @@ void AllCorr::initCorrelations( char* theOutPrefix, bo } for(i=0;iinitCoor(maxLength, theNames ); + pairCorrs[i]->initCorr(maxLength, theNames ); } } @@ -160,7 +160,7 @@ void AllCorr::calcCorrelations(){ void AllCorr::calcCorrelations(){ - SimInfor* currInfo; + SimInfo* currInfo; int i,j,k,l; double rij[3], rDist, uHatI[3], uHatJ[3]; double* grndOut = NULL; @@ -205,28 +205,28 @@ void AllCorr::calcCorrelations(){ // calc rdist and rij; currInfo->atoms[i]->getPos( ri ); - currInfo->wrapVector( ri ); + + currInfo->atoms[j]->getPos( rj ); - currInfo->atoms[i]->getPos( rj ); - currInfo->wrapVector( rj ); - for(l=0;l<3;l++) rij[l] = rj[l] - ri[l]; - + + currInfo->wrapVector( rij ); + dSqr=0; for(l=0;l<3;l++) - dSqr += rj[l] * rj[l]; + dSqr += rij[l] * rij[l]; rDist = sqrt( dSqr ); if( currInfo->atoms[i]->isDirectional() ){ - dAtom = (directionalAtom*)currInfo->atoms[i]; + dAtom = (DirectionalAtom*)currInfo->atoms[i]; dAtom->getU( uHatI ); if( currInfo->atoms[j]->isDirectional() ){ - dAtom = (directionalAtom*)currInfo->atoms[j]; + dAtom = (DirectionalAtom*)currInfo->atoms[j]; dAtom->getU( uHatJ ); this->pairCorrelate( rij, rDist, uHatI, uHatJ ); @@ -238,7 +238,7 @@ void AllCorr::calcCorrelations(){ } else if( currInfo->atoms[j]->isDirectional() ){ - dAtom = (directionalAtom*)currInfo->atoms[j]; + dAtom = (DirectionalAtom*)currInfo->atoms[j]; dAtom->getU( uHatJ ); this->pairCorrelate( rij, rDist, grndOut, uHatJ ); @@ -296,13 +296,13 @@ void AllCorr::pairCorrelate( double[3] Rij, double dis return result; } -void AllCorr::pairCorrelate( double[3] Rij, double dist, - double[3] uHatI, double[3] uHatJ ){ +void AllCorr::pairCorrelate( double Rij[3], double dist, + double uHatI[3], double uHatJ[3] ){ int i; for(i=0;icorrelate( Rij, dist, uHatI, uHatj ); + pairCorrs[i]->correlate( Rij, dist, uHatI, uHatJ ); } void AllCorr::setFrameVolume( double theVolume ){ @@ -327,7 +327,7 @@ void AllCorr::accumulateFrame( void ){ if( havePairCorrs ){ - for(i=0;iaccumulateFrame(); } @@ -345,7 +345,7 @@ void AllCorr::writeCorrs( void ){ if( havePairCorrs ){ for(i=0;iwriteCorrs( outPrefix ); + pairCorrs[i]->writeCorr( outPrefix ); } if( haveStaticCorrs ){