NAMD
Public Member Functions | Public Attributes | List of all members
patch_sortop_curve_c Struct Reference

Public Member Functions

 patch_sortop_curve_c (PatchMap *m)
 
bool operator() (int p1, int p2) const
 

Public Attributes

PatchMappmap
 

Detailed Description

Definition at line 2076 of file WorkDistrib.C.

Constructor & Destructor Documentation

◆ patch_sortop_curve_c()

patch_sortop_curve_c::patch_sortop_curve_c ( PatchMap m)
inline

Definition at line 2078 of file WorkDistrib.C.

2078 : pmap(m) {}

Member Function Documentation

◆ operator()()

bool patch_sortop_curve_c::operator() ( int  p1,
int  p2 
) const
inline

Definition at line 2079 of file WorkDistrib.C.

References PatchMap::index_a(), PatchMap::index_b(), PatchMap::index_c(), and pmap.

2079  {
2080  int a1 = pmap->index_c(p1);
2081  int a2 = pmap->index_c(p2);
2082  if ( a1 < a2 ) return true;
2083  if ( a1 > a2 ) return false;
2084  int dir = ( (a1 & 1) ? -1 : 1 );
2085  int b1 = pmap->index_a(p1);
2086  int b2 = pmap->index_a(p2);
2087  if ( b1 * dir < b2 * dir ) return true;
2088  if ( b1 * dir > b2 * dir ) return false;
2089  dir *= ( (b1 & 1) ? -1 : 1 );
2090  int c1 = pmap->index_b(p1);
2091  int c2 = pmap->index_b(p2);
2092  if ( c1 * dir < c2 * dir ) return true;
2093  return false;
2094  }
int index_a(int pid) const
Definition: PatchMap.h:86
int index_b(int pid) const
Definition: PatchMap.h:87
int index_c(int pid) const
Definition: PatchMap.h:88

Member Data Documentation

◆ pmap

PatchMap* patch_sortop_curve_c::pmap

Definition at line 2077 of file WorkDistrib.C.

Referenced by operator()().


The documentation for this struct was generated from the following file: