Commit 58dd1c2f authored by David Cazier's avatar David Cazier

isFinite() sur les vector

parent 2f40b778
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
return true ; return true ;
} }
const typename PFP::VEC3& getPosition() const typename PFP::VEC3& getPosition() const
{ {
return m_position ; return m_position ;
} }
......
...@@ -61,7 +61,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal) ...@@ -61,7 +61,7 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& goal)
#ifdef DEBUG #ifdef DEBUG
CGoGNout << "vertexState" << d << CGoGNendl ; CGoGNout << "vertexState" << d << CGoGNendl ;
#endif #endif
assert(goal.isNormal()) ; assert(goal.isFinite()) ;
crossCell = CROSS_OTHER ; crossCell = CROSS_OTHER ;
...@@ -132,7 +132,7 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf ...@@ -132,7 +132,7 @@ void ParticleCell2D<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
CGoGNout << "edgeState" << d << CGoGNendl ; CGoGNout << "edgeState" << d << CGoGNendl ;
#endif #endif
assert(goal.isNormal()) ; assert(goal.isFinite()) ;
// assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position)); // assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
if (crossCell == NO_CROSS) if (crossCell == NO_CROSS)
...@@ -262,8 +262,8 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal) ...@@ -262,8 +262,8 @@ void ParticleCell2D<PFP>::faceState(const VEC3& goal)
CGoGNout << "faceState" << d << CGoGNendl ; CGoGNout << "faceState" << d << CGoGNendl ;
#endif #endif
assert(this->getPosition().isNormal()); assert(this->getPosition().isFinite());
assert(goal.isNormal()) ; assert(goal.isFinite()) ;
// assert(Algo::Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true)); // assert(Algo::Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
Dart dd = d ; Dart dd = d ;
......
...@@ -134,6 +134,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, Geom::Orientation2D ...@@ -134,6 +134,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, Geom::Orientation2D
return ; return ;
default : default :
this->setState(EDGE) ; this->setState(EDGE) ;
break ;
} }
if (!Algo::Geometry::isPointOnHalfEdge < PFP if (!Algo::Geometry::isPointOnHalfEdge < PFP
......
...@@ -143,7 +143,7 @@ public: ...@@ -143,7 +143,7 @@ public:
bool hasNan() const ; bool hasNan() const ;
bool isNormal() const ; bool isFinite() const ;
/** /**
* Tests if the vector is normalized * Tests if the vector is normalized
......
...@@ -301,10 +301,10 @@ inline bool Vector<DIM, T>::hasNan() const ...@@ -301,10 +301,10 @@ inline bool Vector<DIM, T>::hasNan() const
} }
template <unsigned int DIM, typename T> template <unsigned int DIM, typename T>
inline bool Vector<DIM, T>::isNormal() const inline bool Vector<DIM, T>::isFinite() const
{ {
for (unsigned int i = 0; i < DIM; ++i) 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 ; return true ;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment