NAMD
Public Member Functions | List of all members
HashReal Class Reference

Public Member Functions

 HashReal (Real v)
 
 operator Real & ()
 
 operator const Real & () const
 
int hash () const
 

Detailed Description

Definition at line 288 of file CompressPsf.C.

Constructor & Destructor Documentation

HashReal::HashReal ( Real  v)
inline

Definition at line 291 of file CompressPsf.C.

291 : val(v) {}

Member Function Documentation

int HashReal::hash ( ) const
inline

Definition at line 295 of file CompressPsf.C.

295  {
296  const char* d = (const char *)&val;
297  int ret=0;
298  for (int i=0;i < sizeof(Real);i++) {
299  int shift1=((5*i)%16)+0;
300  int shift2=((6*i)%16)+8;
301  ret+=((0xa5^d[i])<<shift2)+(d[i]<<shift1);
302  }
303  return ret;
304  };
float Real
Definition: common.h:109
HashReal::operator const Real & ( ) const
inline

Definition at line 293 of file CompressPsf.C.

293 { return val; }
HashReal::operator Real & ( )
inline

Definition at line 292 of file CompressPsf.C.

292 { return val; }

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