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

Fix naming

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