Commit 6cfc352f authored by berenger-bramas's avatar berenger-bramas

Rename list & vector methods

(step1/2)

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@101 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 148bdf5c
...@@ -27,7 +27,7 @@ public: ...@@ -27,7 +27,7 @@ public:
* @param particle the new particle * @param particle the new particle
*/ */
void push(const ParticleClass& particle){ void push(const ParticleClass& particle){
this->particles.pushFront(particle); this->particles.push(particle);
} }
/** /**
......
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
typename FList<ParticleClass>::BasicIterator iter(*particles); typename FList<ParticleClass>::BasicIterator iter(*particles);
while( iter.isValide() ){ while( iter.isValide() ){
iter.value().setDataDown(iter.value().getDataDown() + local->getDataDown()); iter.value().setDataDown(iter.value().getDataDown() + local->getDataDown());
iter.progress(); iter.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -97,7 +97,7 @@ public: ...@@ -97,7 +97,7 @@ public:
typename FList<ParticleClass>::BasicIterator iter(*targets); typename FList<ParticleClass>::BasicIterator iter(*targets);
while( iter.isValide() ){ while( iter.isValide() ){
iter.value().setDataDown(iter.value().getDataDown() + inc); iter.value().setDataDown(iter.value().getDataDown() + inc);
iter.progress(); iter.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -120,7 +120,7 @@ public: ...@@ -120,7 +120,7 @@ public:
typename FList<ParticleClass>::BasicIterator iter(*targets); typename FList<ParticleClass>::BasicIterator iter(*targets);
while( iter.isValide() ){ while( iter.isValide() ){
iter.value().setDataDown(iter.value().getDataDown() + inc); iter.value().setDataDown(iter.value().getDataDown() + inc);
iter.progress(); iter.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -185,7 +185,7 @@ void ValidateFMMAlgo(FOctree<ParticleClass, CellClass, LeafClass, TreeHeight , S ...@@ -185,7 +185,7 @@ void ValidateFMMAlgo(FOctree<ParticleClass, CellClass, LeafClass, TreeHeight , S
(isUsingTsm && iter.value().getDataDown() != NbPart) ){ (isUsingTsm && iter.value().getDataDown() != NbPart) ){
std::cout << "Problem L2P + P2P : " << iter.value().getDataDown() << "\n"; std::cout << "Problem L2P + P2P : " << iter.value().getDataDown() << "\n";
} }
iter.progress(); iter.gotoNext();
} }
} while(octreeIterator.moveRight()); } while(octreeIterator.moveRight());
} }
......
...@@ -29,8 +29,8 @@ public: ...@@ -29,8 +29,8 @@ public:
* @param particle the new particle * @param particle the new particle
*/ */
void push(const ParticleClass& particle){ void push(const ParticleClass& particle){
if(particle.isTarget()) this->targets.pushFront(particle); if(particle.isTarget()) this->targets.push(particle);
else if(particle.isSource()) this->sources.pushFront(particle); else if(particle.isSource()) this->sources.push(particle);
else assert(false, "Error particle has undefined type.", __LINE__, __FILE__); else assert(false, "Error particle has undefined type.", __LINE__, __FILE__);
} }
......
...@@ -95,10 +95,10 @@ public: ...@@ -95,10 +95,10 @@ public:
} }
/** /**
* Push an element in the front of the list * Push an element in the head of the list
* @param inObject the object to insert * @param inObject the object to insert
*/ */
void pushFront(const Object& inObject){ void push(const Object& inObject){
Node* newNode = new Node; Node* newNode = new Node;
newNode->target = inObject; newNode->target = inObject;
newNode->next = this->root; newNode->next = this->root;
...@@ -109,35 +109,35 @@ public: ...@@ -109,35 +109,35 @@ public:
/** /**
* To get front value (last pushed value) * To get head value (last pushed value)
* if size == 0 then defaultValue is returned * if size == 0 then defaultValue is returned
* the list is unchanged after this function * the list is unchanged after this function
* @param defaultValue as the returned value in case size == 0, equal Object() if no param as passed * @param defaultValue as the returned value in case size == 0, equal Object() if no param as passed
* @return first value if exists or defaultValue otherwise * @return first value if exists or defaultValue otherwise
*/ */
Object& front(Object& defaultValue = Object()){ Object& head(Object& defaultValue = Object()){
if(this->size) return this->root->target; if(this->size) return this->root->target;
else return defaultValue; else return defaultValue;
} }
/** /**
* To get front value as const * To get head value as const
* if size == 0 then defaultValue is return * if size == 0 then defaultValue is return
* the list is unchanged after this function * the list is unchanged after this function
* @param defaultValue as the returned value in case size == 0, equal Object() if no param as passed * @param defaultValue as the returned value in case size == 0, equal Object() if no param as passed
* @return first value if exists or defaultValue otherwise * @return first value if exists or defaultValue otherwise
*/ */
const Object& front(const Object& defaultValue = Object()) const { const Object& head(const Object& defaultValue = Object()) const {
if(this->size) return this->root->target; if(this->size) return this->root->target;
else return defaultValue; else return defaultValue;
} }
/** /**
* To get the front value and remove it from the list * To get the head value and remove it from the list
* @return first value * @return first value
* @warning you must check the list's size before calling this function! * @warning you must check the list's size before calling this function!
*/ */
Object popFront(){ Object pop(){
--this->size; --this->size;
Node* newNode = this->root; Node* newNode = this->root;
this->root = this->root->next; this->root = this->root->next;
...@@ -166,7 +166,7 @@ public: ...@@ -166,7 +166,7 @@ public:
* FList<int>::BasicIterator iter(values); <br> * FList<int>::BasicIterator iter(values); <br>
* while( iter.isValide() ){ <br> * while( iter.isValide() ){ <br>
* iter.value() += 1; <br> * iter.value() += 1; <br>
* iter.progress(); <br> * iter.gotoNext(); <br>
* } <br> * } <br>
* </code> * </code>
*/ */
...@@ -182,8 +182,8 @@ public: ...@@ -182,8 +182,8 @@ public:
BasicIterator(FList& list) : iter(list.root){ BasicIterator(FList& list) : iter(list.root){
} }
/** To progress on the list */ /** To gotoNext on the list */
void progress(){ void gotoNext(){
if(this->iter) this->iter = this->iter->next; if(this->iter) this->iter = this->iter->next;
} }
...@@ -205,7 +205,7 @@ public: ...@@ -205,7 +205,7 @@ public:
/** /**
* To know if an iterator is at the end of the list * To know if an iterator is at the end of the list
* @return true if the current iterator can progress and access to value, else false * @return true if the current iterator can gotoNext and access to value, else false
*/ */
bool isValide() const{ bool isValide() const{
return iter; return iter;
...@@ -223,7 +223,7 @@ public: ...@@ -223,7 +223,7 @@ public:
* FList<int>::ConstBasicIterator iter(values); <br> * FList<int>::ConstBasicIterator iter(values); <br>
* while( iter.isValide() ){ <br> * while( iter.isValide() ){ <br>
* iter.value() += 1; <br> * iter.value() += 1; <br>
* iter.progress(); <br> * iter.gotoNext(); <br>
* } <br> * } <br>
* </code> * </code>
*/ */
...@@ -239,8 +239,8 @@ public: ...@@ -239,8 +239,8 @@ public:
ConstBasicIterator(const FList& list) : iter(list.root){ ConstBasicIterator(const FList& list) : iter(list.root){
} }
/** to progress on the list */ /** to gotoNext on the list */
void progress(){ void gotoNext(){
if(this->iter) this->iter = this->iter->next; if(this->iter) this->iter = this->iter->next;
} }
...@@ -262,7 +262,7 @@ public: ...@@ -262,7 +262,7 @@ public:
/** /**
* To know if an iterator is at the end of the list * To know if an iterator is at the end of the list
* @return true if the current iterator can progress and access to value, else false * @return true if the current iterator can gotoNext and access to value, else false
*/ */
bool isValide() const{ bool isValide() const{
return iter; return iter;
......
...@@ -304,7 +304,7 @@ public: ...@@ -304,7 +304,7 @@ public:
* After that point we do not know where we are but we know that there is some data * After that point we do not know where we are but we know that there is some data
* on the right (without knowing our position!) * on the right (without knowing our position!)
* *
* We progress on the brother to find an allocated cell (->) * We gotoNext on the brother to find an allocated cell (->)
* for example if we are on index 2 we will look until 8 = 2 | 7 + 1 * for example if we are on index 2 we will look until 8 = 2 | 7 + 1
* if we arrive a 8 without finding a cell we go upper and do the same * if we arrive a 8 without finding a cell we go upper and do the same
* we know we will find something because we are not at the right limit * we know we will find something because we are not at the right limit
......
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
*@brief last data *@brief last data
*@return end->data *@return end->data
*/ */
const T& front() const { const T& head() const {
return this->array[this->index - 1]; return this->array[this->index - 1];
} }
...@@ -120,7 +120,7 @@ public: ...@@ -120,7 +120,7 @@ public:
*@brief last data *@brief last data
*@return end->data *@return end->data
*/ */
T& front() { T& head() {
return this->array[this->index - 1]; return this->array[this->index - 1];
} }
...@@ -145,15 +145,15 @@ public: ...@@ -145,15 +145,15 @@ public:
/** /**
*@brief pop the first node *@brief pop the first node
*/ */
void popFront(){ void pop(){
(&this->array[--this->index])->~T(); (&this->array[--this->index])->~T();
} }
/** /**
*@brief push a new node in front *@brief push a new node in head
*@param inValue the new value *@param inValue the new value
*/ */
void pushFront( const T & inValue ){ void push( const T & inValue ){
if( this->index == this->capacity ){ if( this->index == this->capacity ){
setCapacity(this->capacity * 1.5); setCapacity(this->capacity * 1.5);
} }
...@@ -174,7 +174,7 @@ public: ...@@ -174,7 +174,7 @@ public:
BasicIterator(FVector<T>& inVector) : vector(&inVector), index(0){} BasicIterator(FVector<T>& inVector) : vector(&inVector), index(0){}
void progress(){ void gotoNext(){
++this->index; ++this->index;
} }
...@@ -205,7 +205,7 @@ public: ...@@ -205,7 +205,7 @@ public:
ConstBasicIterator(const FVector<T>& inVector) : vector(&inVector), index(0){} ConstBasicIterator(const FVector<T>& inVector) : vector(&inVector), index(0){}
void progress(){ void gotoNext(){
++this->index; ++this->index;
} }
......
...@@ -666,7 +666,7 @@ public: ...@@ -666,7 +666,7 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) ); FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles); for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles);
iterParticle.isValide() ; iterParticle.progress()){ iterParticle.isValide() ; iterParticle.gotoNext()){
//std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n"; //std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n";
...@@ -1283,7 +1283,7 @@ public: ...@@ -1283,7 +1283,7 @@ public:
iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());*/ iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());*/
//printf("p_potential = %lf\n", potential); //printf("p_potential = %lf\n", potential);
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -1344,26 +1344,26 @@ public: ...@@ -1344,26 +1344,26 @@ public:
while( iterSource.isValide() ){ while( iterSource.isValide() ){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSource.value()); iterSource.value());
iterSource.progress(); iterSource.gotoNext();
} }
} }
} }
typename FList<ParticleClass>::BasicIterator iterSameBox = iterTarget;//(*targets); typename FList<ParticleClass>::BasicIterator iterSameBox = iterTarget;//(*targets);
iterSameBox.progress(); iterSameBox.gotoNext();
while( iterSameBox.isValide() ){ while( iterSameBox.isValide() ){
if(&iterSameBox.value() < &iterTarget.value()){ if(&iterSameBox.value() < &iterTarget.value()){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value()); iterSameBox.value());
} }
iterSameBox.progress(); iterSameBox.gotoNext();
} }
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ()); //printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ()); //printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential()); //printf("\t potential = %e \n",iterTarget.value()->getPotential());
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -1420,7 +1420,7 @@ public: ...@@ -1420,7 +1420,7 @@ public:
while( iterSource.isValide() ){ while( iterSource.isValide() ){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSource.value()); iterSource.value());
iterSource.progress(); iterSource.gotoNext();
} }
} }
...@@ -1430,14 +1430,14 @@ public: ...@@ -1430,14 +1430,14 @@ public:
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value()); iterSameBox.value());
} }
iterSameBox.progress(); iterSameBox.gotoNext();
} }
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ()); //printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ()); //printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential()); //printf("\t potential = %e \n",iterTarget.value()->getPotential());
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
......
...@@ -677,7 +677,7 @@ public: ...@@ -677,7 +677,7 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) ); FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles); for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles);
iterParticle.isValide() ; iterParticle.progress()){ iterParticle.isValide() ; iterParticle.gotoNext()){
//std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n"; //std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n";
...@@ -1333,7 +1333,7 @@ public: ...@@ -1333,7 +1333,7 @@ public:
iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());*/ iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());*/
//printf("p_potential = %lf\n", potential); //printf("p_potential = %lf\n", potential);
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -1395,26 +1395,26 @@ public: ...@@ -1395,26 +1395,26 @@ public:
while( iterSource.isValide() ){ while( iterSource.isValide() ){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSource.value()); iterSource.value());
iterSource.progress(); iterSource.gotoNext();
} }
} }
} }
typename FList<ParticleClass>::BasicIterator iterSameBox = iterTarget;//(*targets); typename FList<ParticleClass>::BasicIterator iterSameBox = iterTarget;//(*targets);
iterSameBox.progress(); iterSameBox.gotoNext();
while( iterSameBox.isValide() ){ while( iterSameBox.isValide() ){
if(&iterSameBox.value() < &iterTarget.value()){ if(&iterSameBox.value() < &iterTarget.value()){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value()); iterSameBox.value());
} }
iterSameBox.progress(); iterSameBox.gotoNext();
} }
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ()); //printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ()); //printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential()); //printf("\t potential = %e \n",iterTarget.value()->getPotential());
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -1471,7 +1471,7 @@ public: ...@@ -1471,7 +1471,7 @@ public:
while( iterSource.isValide() ){ while( iterSource.isValide() ){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSource.value()); iterSource.value());
iterSource.progress(); iterSource.gotoNext();
} }
} }
...@@ -1481,14 +1481,14 @@ public: ...@@ -1481,14 +1481,14 @@ public:
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value()); iterSameBox.value());
} }
iterSameBox.progress(); iterSameBox.gotoNext();
} }
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ()); //printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ()); //printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential()); //printf("\t potential = %e \n",iterTarget.value()->getPotential());
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
......
...@@ -854,7 +854,7 @@ public: ...@@ -854,7 +854,7 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) ); FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles); for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles);
iterParticle.isValide() ; iterParticle.progress()){ iterParticle.isValide() ; iterParticle.gotoNext()){
//std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n"; //std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n";
...@@ -1587,7 +1587,7 @@ public: ...@@ -1587,7 +1587,7 @@ public:
iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());*/ iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());*/
//printf("p_potential = %lf\n", potential); //printf("p_potential = %lf\n", potential);
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -1648,26 +1648,26 @@ public: ...@@ -1648,26 +1648,26 @@ public:
while( iterSource.isValide() ){ while( iterSource.isValide() ){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSource.value()); iterSource.value());
iterSource.progress(); iterSource.gotoNext();
} }
} }
} }
typename FList<ParticleClass>::BasicIterator iterSameBox = iterTarget;//(*targets); typename FList<ParticleClass>::BasicIterator iterSameBox = iterTarget;//(*targets);
iterSameBox.progress(); iterSameBox.gotoNext();
while( iterSameBox.isValide() ){ while( iterSameBox.isValide() ){
if(&iterSameBox.value() < &iterTarget.value()){ if(&iterSameBox.value() < &iterTarget.value()){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value()); iterSameBox.value());
} }
iterSameBox.progress(); iterSameBox.gotoNext();
} }
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ()); //printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ()); //printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential()); //printf("\t potential = %e \n",iterTarget.value()->getPotential());
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
...@@ -1724,7 +1724,7 @@ public: ...@@ -1724,7 +1724,7 @@ public:
while( iterSource.isValide() ){ while( iterSource.isValide() ){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSource.value()); iterSource.value());
iterSource.progress(); iterSource.gotoNext();
} }
} }
...@@ -1734,14 +1734,14 @@ public: ...@@ -1734,14 +1734,14 @@ public:
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(), DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value()); iterSameBox.value());
} }
iterSameBox.progress(); iterSameBox.gotoNext();
} }
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ()); //printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ()); //printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential()); //printf("\t potential = %e \n",iterTarget.value()->getPotential());
iterTarget.progress(); iterTarget.gotoNext();
} }
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) ); FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
} }
......
...@@ -132,7 +132,7 @@ int main(int argc, char ** argv){ ...@@ -132,7 +132,7 @@ int main(int argc, char ** argv){
//printf("\t\t Sum Forces ( %e , %e , %e)\n", //printf("\t\t Sum Forces ( %e , %e , %e)\n",
//forces.getX(),forces.getY(),forces.getZ()); //forces.getX(),forces.getY(),forces.getZ());
iter.progress(); iter.gotoNext();
} }
} while(octreeIterator.moveRight()); } while(octreeIterator.moveRight());
......
...@@ -235,8 +235,8 @@ void ValidateFMMAlgoProc(FOctree<ParticleClass, CellClass, LeafClass, OctreeHeig ...@@ -235,8 +235,8 @@ void ValidateFMMAlgoProc(FOctree<ParticleClass, CellClass, LeafClass, OctreeHeig
<< " y " << iterValide.value().getForces().getY() << " " << iter.value().getForces().getY() << " y " << iterValide.value().getForces().getY() << " " << iter.value().getForces().getY()
<< " z " << iterValide.value().getForces().getZ() << " " << iter.value().getForces().getZ() << "\n"; << " z " << iterValide.value().getForces().getZ() << " " << iter.value().getForces().getZ() << "\n";
} }
iter.progress(); iter.gotoNext();
iterValide.progress(); iterValide.gotoNext();
} }
octreeIterator.moveRight(); octreeIterator.moveRight();
...@@ -365,9 +365,9 @@ int main(int argc, char ** argv){ ...@@ -365,9 +365,9 @@ int main(int argc, char ** argv){
#ifdef VALIDATE_FMM #ifdef VALIDATE_FMM
potentialValide += iterValide.value().getPotential() * iterValide.value().getPhysicalValue(); potentialValide += iterValide.value().getPotential() * iterValide.value().getPhysicalValue();
forcesValide += iterValide.value().getForces(); forcesValide += iterValide.value().getForces();
iterValide.progress(); iterValide.gotoNext();
#endif #endif
iter.progress(); iter.gotoNext();
} }