Commit 6e572ed1 authored by Kirill Terekhov's avatar Kirill Terekhov

Fix naming

parent a5eb08dd
......@@ -2958,13 +2958,13 @@ namespace INMOST
bool operator() (HandleType a, integer gid) const {if( a == InvalidHandle() ) return false; return m->GlobalID(a) < gid;}
};
class IerarhyComparator
class HierarchyComparator
{
Mesh * m;
public:
IerarhyComparator(Mesh * m) :m(m) {}
IerarhyComparator(const IerarhyComparator & other) :m(other.m){}
IerarhyComparator & operator = (IerarhyComparator const & other) { m = other.m; return *this;}
HierarchyComparator(Mesh * m) :m(m) {}
HierarchyComparator(const HierarchyComparator & other) :m(other.m){}
HierarchyComparator & operator = (HierarchyComparator const & other) { m = other.m; return *this;}
int CompareNodes(HandleType a, HandleType b) const;
int CompareElements(HandleType a, HandleType b) const;
bool operator() (HandleType a, HandleType b) const {if( a == InvalidHandle() || b == InvalidHandle() ) return a > b; return CompareElements(a,b) < 0;}
......
......@@ -42,7 +42,7 @@ namespace INMOST
}
int Mesh::IerarhyComparator::CompareNodes(HandleType a, HandleType b) const
int Mesh::HierarchyComparator::CompareNodes(HandleType a, HandleType b) const
{
real_array ca = m->RealArrayDF(a,m->CoordsTag());
real_array cb = m->RealArrayDF(b,m->CoordsTag());
......@@ -57,7 +57,7 @@ namespace INMOST
}
return 0;
}
int Mesh::IerarhyComparator::CompareElements(HandleType a, HandleType b) const
int Mesh::HierarchyComparator::CompareElements(HandleType a, HandleType b) const
{
integer ia = GetHandleElementNum(a);
integer ib = GetHandleElementNum(b);
......
......@@ -609,7 +609,7 @@ namespace INMOST
find = std::lower_bound(lc.begin(),lc.begin()+sorted,e);
break;
case HIERARCHY_COMPARATOR:
find = std::lower_bound(lc.begin(),lc.begin()+sorted,e,Mesh::IerarhyComparator(m));
find = std::lower_bound(lc.begin(),lc.begin()+sorted,e,Mesh::HierarchyComparator(m));
break;
case GLOBALID_COMPARATOR:
find = std::lower_bound(lc.begin(),lc.begin()+sorted,e,Mesh::GlobalIDComparator(m));
......@@ -785,7 +785,7 @@ namespace INMOST
{
// sort
array<HandleType> sorted(h,h+num);
std::sort(sorted.begin(),sorted.end(),Mesh::IerarhyComparator(m));
std::sort(sorted.begin(),sorted.end(),Mesh::HierarchyComparator(m));
//now merge with sorted part
Element::adj_type merge(lc.size()+sorted.size());
Element::adj_type::iterator it = lc.begin(), iend = lc.begin()+hSorted(hc);
......@@ -797,7 +797,7 @@ namespace INMOST
{
if( *it == InvalidHandle() || m->GetPrivateMarker(*it,mrk) ) ++it;
else if( *jt == InvalidHandle() || m->GetPrivateMarker(*jt,mrk) ) ++jt;
else if( Mesh::IerarhyComparator(m)(*it,*jt) )
else if( Mesh::HierarchyComparator(m)(*it,*jt) )
{
*mit = *it;
m->SetPrivateMarker(*mit,mrk);
......@@ -929,7 +929,7 @@ namespace INMOST
find = std::lower_bound(lc.begin(),lc.begin()+sorted,e->GetHandle());
break;
case HIERARCHY_COMPARATOR:
find = std::lower_bound(lc.begin(),lc.begin()+sorted,e->GetHandle(),Mesh::IerarhyComparator(m));
find = std::lower_bound(lc.begin(),lc.begin()+sorted,e->GetHandle(),Mesh::HierarchyComparator(m));
break;
case GLOBALID_COMPARATOR:
find = std::lower_bound(lc.begin(),lc.begin()+sorted,e->GetHandle(),Mesh::GlobalIDComparator(m));
......@@ -1152,7 +1152,7 @@ namespace INMOST
switch(cmp)
{
case HANDLE_COMPARATOR: cmp_res = *it < *jt; break;
case HIERARCHY_COMPARATOR: cmp_res = Mesh::IerarhyComparator(m)(*it,*jt); break;
case HIERARCHY_COMPARATOR: cmp_res = Mesh::HierarchyComparator(m)(*it,*jt); break;
case CENTROID_COMPARATOR: cmp_res = Mesh::CentroidComparator(m)(*it,*jt); break;
case GLOBALID_COMPARATOR: cmp_res = Mesh::GlobalIDComparator(m)(*it,*jt); break;
default: assert(false);
......@@ -1380,7 +1380,7 @@ namespace INMOST
case HIERARCHY_COMPARATOR:
{
Element::adj_type::size_type start = hSorted(hc);
std::sort(lc->begin()+start,lc->end(),Mesh::IerarhyComparator(m));
std::sort(lc->begin()+start,lc->end(),Mesh::HierarchyComparator(m));
if( start > 0 ) //need to merge two parts
{
Element::adj_type temp(lc->size());
......@@ -1391,7 +1391,7 @@ namespace INMOST
{
if( *it == InvalidHandle() ) ++it;
else if( *jt == InvalidHandle() ) ++jt;
else if( Mesh::IerarhyComparator(m)(*it,*jt) ) *t++ = *it++;
else if( Mesh::HierarchyComparator(m)(*it,*jt) ) *t++ = *it++;
else *t++ = *jt++;
}
assert(it == iend || jt == jend);
......@@ -1564,7 +1564,7 @@ namespace INMOST
else if( cmp == HIERARCHY_COMPARATOR && use_cmp )
{
Element::adj_type::size_type sorted = static_cast<Element::adj_type::size_type>(hSorted(m->HighConn(GetHandle())));
Element::adj_type::iterator find = std::lower_bound(lc.begin(),lc.end(),h,Mesh::IerarhyComparator(m));
Element::adj_type::iterator find = std::lower_bound(lc.begin(),lc.end(),h,Mesh::HierarchyComparator(m));
if( find != lc.end() )
{
if( *find == h )
......
......@@ -167,7 +167,7 @@ namespace INMOST
m->GetGeometricData(GetHandle(),NORMAL,nrm);
integer dim = m->GetDimensions();
real l = ::sqrt(vec_dot_product(nrm,nrm,dim));
if(fabs(l) > m->GetEpsilon())
if(::fabs(l) > m->GetEpsilon())
{
for(integer i = 0; i < dim; i++)
nrm[i] /= l;
......@@ -971,7 +971,7 @@ namespace INMOST
for(i = 3; i < s; i++)
{
vec_diff(p[i].Coords().data(),p[0].Coords().data(),v[0],3);
if( fabs(vec_dot_product(v[0],v[1],3)) > m->GetEpsilon() ) return false;
if( ::fabs(vec_dot_product(v[0],v[1],3)) > m->GetEpsilon() ) return false;
}
return true;
}
......@@ -1038,13 +1038,13 @@ namespace INMOST
vec_normalize(cf,dim);
dot = vec_dot_product(nf,cf,dim);
//~ c = FrontCell();
if( fabs(dot) < 0.25 && c2.isValid() )
if( ::fabs(dot) < 0.25 && c2.isValid() )
{
c2->Centroid(cc);
vec_diff(cc,fc,cf,dim);
vec_normalize(cf,dim);
dot2 = vec_dot_product(nf,cf,dim);
if( fabs(dot2) > fabs(dot) )
if( ::fabs(dot2) > ::fabs(dot) )
dot = -dot2;
}
if( dot > 0 )
......@@ -1391,7 +1391,7 @@ namespace INMOST
vec_cross_product(a,b,n);
d = -vec_dot_product(n,tri[0],dim);
m = vec_dot_product(n,dir,dim);
if( !(fabs(m) < 1.0e-25) )
if( !(::fabs(m) < 1.0e-25) )
{
k = -(d + vec_dot_product(n,pos,dim))/m;
if( k >= 0 )
......@@ -1407,7 +1407,7 @@ namespace INMOST
invdenom = (dot00*dot11 - dot01*dot01);
uq = (dot11*dot02-dot01*dot12);
vq = (dot00*dot12-dot01*dot02);
if( !(fabs(invdenom) < 1.0e-25 && fabs(uq) >= 0.0 && fabs(vq) >= 0.0) )
if( !(::fabs(invdenom) < 1.0e-25 && ::fabs(uq) >= 0.0 && ::fabs(vq) >= 0.0) )
{
uq = uq/invdenom;
vq = vq/invdenom;
......
......@@ -797,7 +797,7 @@ namespace INMOST
__INLINE bool compare_coord(Storage::real * a, Storage::real * b, INMOST_DATA_ENUM_TYPE dim, Storage::real eps)
{
for(INMOST_DATA_ENUM_TYPE i = 0; i < dim; i++)
if( fabs(a[i]-b[i]) > eps ) return a[i] <= b[i];
if( ::fabs(a[i]-b[i]) > eps ) return a[i] <= b[i];
return true;
}
......@@ -874,7 +874,7 @@ namespace INMOST
{
same_box = true;
for(integer j = 0; j < dim*2; j++)
same_box &= fabs(bbox[j] - bboxs[k*dim*2+j]) < epsilon;
same_box &= ::fabs(bbox[j] - bboxs[k*dim*2+j]) < epsilon;
same_boxes &= same_box;
}
......@@ -1075,7 +1075,7 @@ namespace INMOST
{
int res = 0;
for(integer k = 0; k < dim; k++)
if( fabs((*(it1+k))-(*(it2+k))) > epsilon )
if( ::fabs((*(it1+k))-(*(it2+k))) > epsilon )
{
if( (*(it1+k)) < (*(it2+k)) ) res = -1;
else res = 1;
......
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