Changeset 543794 for molecuilder/src


Ignore:
Timestamp:
Oct 17, 2009, 5:49:05 AM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
e72287
Parents:
746bb4
Message:

flip() is now templated.
Signed-off-by: Frederik Heber <heber@…>

Location:
molecuilder/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/helpers.cpp

    r746bb4 r543794  
    4949  while (*b < lower_bound)
    5050    *b += step;
    51 };
    52 
    53 /** Flips two doubles.
    54  * \param *x pointer to first double
    55  * \param *y pointer to second double
    56  */
    57 void flip(double *x, double *y)
    58 {
    59   double tmp;
    60   tmp = *x;
    61   *x = *y;
    62   *y = tmp;
    6351};
    6452
  • molecuilder/src/helpers.hpp

    r746bb4 r543794  
    4444bool check_bounds(double *x, double *cell_size);
    4545void bound(double *b, double lower_bound, double upper_bound);
    46 void flip(double *x, double *y);
    4746int pot(int base, int n);
    4847int CountLinesinFile(ifstream &InputFile);
     
    5453
    5554/********************************************** helpful template functions *********************************/
     55
     56/** Flips two values.
     57 * \param *x pointer to first value
     58 * \param *y pointer to second value
     59 */
     60template <typename T> void flip(T *x, T *y)
     61{
     62  T tmp;
     63  tmp = *x;
     64  *x = *y;
     65  *y = tmp;
     66};
    5667
    5768/** Creates a lookup table for true father's Atom::Nr -> atom ptr.
Note: See TracChangeset for help on using the changeset viewer.