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

Public Member Functions

 lssDistSort ()
 
 lssDistSort (int newType, Real newDist)
 
 lssDistSort (const lssDistSort &ref)
 
lssDistSortoperator= (const lssDistSort &ref)
 
bool operator== (const lssDistSort &ref)
 
bool operator< (const lssDistSort &ref)
 

Public Attributes

int type
 
Real dist
 
SortedArray< idIndxStridIndx
 

Detailed Description

Definition at line 242 of file ComputeQM.C.

Constructor & Destructor Documentation

◆ lssDistSort() [1/3]

lssDistSort::lssDistSort ( )
inline

Definition at line 249 of file ComputeQM.C.

References idIndx, and ResizeArray< Elem >::resize().

249  {
250  idIndx.resize(0);
251  };
SortedArray< idIndxStr > idIndx
Definition: ComputeQM.C:247
void resize(int i)
Definition: ResizeArray.h:84

◆ lssDistSort() [2/3]

lssDistSort::lssDistSort ( int  newType,
Real  newDist 
)
inline

Definition at line 252 of file ComputeQM.C.

References dist, idIndx, ResizeArray< Elem >::resize(), and type.

252  {
253  type = newType;
254  dist = newDist;
255  idIndx.resize(0);
256  }
SortedArray< idIndxStr > idIndx
Definition: ComputeQM.C:247
void resize(int i)
Definition: ResizeArray.h:84

◆ lssDistSort() [3/3]

lssDistSort::lssDistSort ( const lssDistSort ref)
inline

Definition at line 257 of file ComputeQM.C.

References dist, idIndx, SortedArray< Elem >::insert(), ResizeArray< Elem >::resize(), ResizeArray< Elem >::size(), SortedArray< Elem >::sort(), and type.

257  {
258  type = ref.type;
259  dist = ref.dist;
261  for (int i=0; i<ref.idIndx.size(); i++) idIndx.insert(ref.idIndx[i]) ;
262  idIndx.sort();
263  }
int size(void) const
Definition: ResizeArray.h:131
void sort(void)
Definition: SortedArray.h:66
SortedArray< idIndxStr > idIndx
Definition: ComputeQM.C:247
void resize(int i)
Definition: ResizeArray.h:84
int insert(const Elem &elem)
Definition: SortedArray.h:81

Member Function Documentation

◆ operator<()

bool lssDistSort::operator< ( const lssDistSort ref)
inline

Definition at line 292 of file ComputeQM.C.

References dist.

292 {return dist < ref.dist;}

◆ operator=()

lssDistSort& lssDistSort::operator= ( const lssDistSort ref)
inline

Definition at line 265 of file ComputeQM.C.

References dist, idIndx, SortedArray< Elem >::insert(), ResizeArray< Elem >::resize(), ResizeArray< Elem >::size(), SortedArray< Elem >::sort(), and type.

265  {
266  type = ref.type;
267  dist = ref.dist;
269  for (int i=0; i<ref.idIndx.size(); i++) idIndx.insert(ref.idIndx[i]) ;
270  idIndx.sort();
271 
272  return *this;
273  }
int size(void) const
Definition: ResizeArray.h:131
void sort(void)
Definition: SortedArray.h:66
SortedArray< idIndxStr > idIndx
Definition: ComputeQM.C:247
void resize(int i)
Definition: ResizeArray.h:84
int insert(const Elem &elem)
Definition: SortedArray.h:81

◆ operator==()

bool lssDistSort::operator== ( const lssDistSort ref)
inline

Definition at line 275 of file ComputeQM.C.

References dist, idIndx, ResizeArray< Elem >::size(), and type.

275  {
276  bool returnVal = true;
277 
278  if (! (type == ref.type && dist == ref.dist))
279  return false;
280 
281  if (idIndx.size() != ref.idIndx.size())
282  return false;
283 
284  for (int i=0; i<ref.idIndx.size(); i++) {
285  if (idIndx[i] != ref.idIndx[i])
286  return false;
287  }
288 
289  return returnVal;
290  }
int size(void) const
Definition: ResizeArray.h:131
SortedArray< idIndxStr > idIndx
Definition: ComputeQM.C:247

Member Data Documentation

◆ dist

Real lssDistSort::dist

Definition at line 244 of file ComputeQM.C.

Referenced by lssDistSort(), operator<(), operator=(), and operator==().

◆ idIndx

SortedArray<idIndxStr> lssDistSort::idIndx

Definition at line 247 of file ComputeQM.C.

Referenced by lssDistSort(), operator=(), and operator==().

◆ type

int lssDistSort::type

Definition at line 243 of file ComputeQM.C.

Referenced by lssDistSort(), operator=(), and operator==().


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