From 58dd1c2f848110bbcb7e253750ae54b2429e77b3 Mon Sep 17 00:00:00 2001 From: David Cazier Date: Thu, 25 Oct 2012 18:36:58 +0200 Subject: [PATCH] isFinite() sur les vector --- include/Algo/MovingObjects/particle_base.h | 2 +- include/Algo/MovingObjects/particle_cell_2D.hpp | 8 ++++---- include/Algo/MovingObjects/particle_cell_2D_memo.hpp | 1 + include/Geometry/vector_gen.h | 2 +- include/Geometry/vector_gen.hpp | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/Algo/MovingObjects/particle_base.h b/include/Algo/MovingObjects/particle_base.h index c109248f..980db15e 100644 --- a/include/Algo/MovingObjects/particle_base.h +++ b/include/Algo/MovingObjects/particle_base.h @@ -43,7 +43,7 @@ public: return true ; } - const typename PFP::VEC3& getPosition() + const typename PFP::VEC3& getPosition() const { return m_position ; } diff --git a/include/Algo/MovingObjects/particle_cell_2D.hpp b/include/Algo/MovingObjects/particle_cell_2D.hpp index 5a8953d9..73787227 100644 --- a/include/Algo/MovingObjects/particle_cell_2D.hpp +++ b/include/Algo/MovingObjects/particle_cell_2D.hpp @@ -61,7 +61,7 @@ void ParticleCell2D::vertexState(const VEC3& goal) #ifdef DEBUG CGoGNout << "vertexState" << d << CGoGNendl ; #endif - assert(goal.isNormal()) ; + assert(goal.isFinite()) ; crossCell = CROSS_OTHER ; @@ -132,7 +132,7 @@ void ParticleCell2D::edgeState(const VEC3& goal, Geom::Orientation2D sideOf CGoGNout << "edgeState" << d << CGoGNendl ; #endif - assert(goal.isNormal()) ; + assert(goal.isFinite()) ; // assert(Algo::Geometry::isPointOnEdge(m,d,m_positions,m_position)); if (crossCell == NO_CROSS) @@ -262,8 +262,8 @@ void ParticleCell2D::faceState(const VEC3& goal) CGoGNout << "faceState" << d << CGoGNendl ; #endif - assert(this->getPosition().isNormal()); - assert(goal.isNormal()) ; + assert(this->getPosition().isFinite()); + assert(goal.isFinite()) ; // assert(Algo::Geometry::isPointInConvexFace2D(m,d,m_positions,m_position,true)); Dart dd = d ; diff --git a/include/Algo/MovingObjects/particle_cell_2D_memo.hpp b/include/Algo/MovingObjects/particle_cell_2D_memo.hpp index 315a7930..70363e67 100644 --- a/include/Algo/MovingObjects/particle_cell_2D_memo.hpp +++ b/include/Algo/MovingObjects/particle_cell_2D_memo.hpp @@ -134,6 +134,7 @@ void ParticleCell2DMemo::edgeState(const VEC3& current, Geom::Orientation2D return ; default : this->setState(EDGE) ; + break ; } if (!Algo::Geometry::isPointOnHalfEdge < PFP diff --git a/include/Geometry/vector_gen.h b/include/Geometry/vector_gen.h index 885cc831..d86471cd 100644 --- a/include/Geometry/vector_gen.h +++ b/include/Geometry/vector_gen.h @@ -143,7 +143,7 @@ public: bool hasNan() const ; - bool isNormal() const ; + bool isFinite() const ; /** * Tests if the vector is normalized diff --git a/include/Geometry/vector_gen.hpp b/include/Geometry/vector_gen.hpp index 4c27d4b8..fb0dfd3c 100644 --- a/include/Geometry/vector_gen.hpp +++ b/include/Geometry/vector_gen.hpp @@ -301,10 +301,10 @@ inline bool Vector::hasNan() const } template -inline bool Vector::isNormal() const +inline bool Vector::isFinite() const { for (unsigned int i = 0; i < DIM; ++i) - if (!std::isnormal(m_data[i])) return false ; + if (!std::isfinite(m_data[i])) return false ; return true ; } -- GitLab