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

isFinite() sur les vector

parent 2f40b778
......@@ -43,7 +43,7 @@ public:
return true ;
}
const typename PFP::VEC3& getPosition()
const typename PFP::VEC3& getPosition() const
{
return m_position ;
}
......
......@@ -61,7 +61,7 @@ void ParticleCell2D<PFP>::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<PFP>::edgeState(const VEC3& goal, Geom::Orientation2D sideOf
CGoGNout << "edgeState" << d << CGoGNendl ;
#endif
assert(goal.isNormal()) ;
assert(goal.isFinite()) ;
// assert(Algo::Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
if (crossCell == NO_CROSS)
......@@ -262,8 +262,8 @@ void ParticleCell2D<PFP>::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<PFP>(m,d,m_positions,m_position,true));
Dart dd = d ;
......
......@@ -134,6 +134,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, Geom::Orientation2D
return ;
default :
this->setState(EDGE) ;
break ;
}
if (!Algo::Geometry::isPointOnHalfEdge < PFP
......
......@@ -143,7 +143,7 @@ public:
bool hasNan() const ;
bool isNormal() const ;
bool isFinite() const ;
/**
* Tests if the vector is normalized
......
......@@ -301,10 +301,10 @@ inline bool Vector<DIM, T>::hasNan() const
}
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)
if (!std::isnormal(m_data[i])) return false ;
if (!std::isfinite(m_data[i])) return false ;
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