Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/helpers.hpp

    re138de ra67d19  
    7676};
    7777
     78/** returns greater of the two values.
     79 * \param x first value
     80 * \param y second value
     81 * \return greater of the two (by operator>())
     82 */
     83template <typename T> T Max(T x, T y)
     84{
     85  if (x > y)
     86    return x;
     87  else return y;
     88};
     89
     90/** returns smaller of the two values.
     91 * \param x first value
     92 * \param y second value
     93 * \return smaller of the two (by operator<())
     94 */
     95template <typename T> T Min(T x, T y)
     96{
     97  if (x < y)
     98    return x;
     99  else return y;
     100};
     101
    78102/** Creates a lookup table for true father's Atom::Nr -> atom ptr.
    79103 * \param *start begin of chain list
     
    90114
    91115  if (LookupTable != NULL) {
    92     Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl;
     116    DoLog(0) && (Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl);
    93117    return false;
    94118  }
     
    103127  }
    104128  if (count <= 0) {
    105     Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl;
     129    DoLog(0) && (Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl);
    106130    return false;
    107131  }
     
    110134  LookupTable = Calloc<T*>(count, "CreateFatherLookupTable - **LookupTable");
    111135  if (LookupTable == NULL) {
    112     eLog() << Verbose(0) << "LookupTable memory allocation failed!" << endl;
     136    DoeLog(0) && (eLog()<< Verbose(0) << "LookupTable memory allocation failed!" << endl);
     137    performCriticalExit();
    113138    status = false;
    114139  } else {
     
    121146        LookupTable[AtomNo] = Walker;
    122147      } else {
    123         Log() << Verbose(0) << "Walker " << *Walker << " exceeded range of nuclear ids [0, " << count << ")." << endl;
     148        DoLog(0) && (Log() << Verbose(0) << "Walker " << *Walker << " exceeded range of nuclear ids [0, " << count << ")." << endl);
    124149        status = false;
    125150        break;
Note: See TracChangeset for help on using the changeset viewer.