#ifndef Morpheo_Average_h
#define Morpheo_Average_h

/*
 * $Id: Average.h 88 2008-12-10 18:31:39Z rosiere $
 *
 * [ Description ]
 * 
 */

namespace morpheo              {

  inline double average (double   val, double   val_max) {return ((val_max == 0)?0:(val/val_max));}
  inline double average (uint32_t val, double   val_max) {return (average(static_cast<double>(val),                    val_max ));}
  inline double average (double   val, uint32_t val_max) {return (average(                    val ,static_cast<double>(val_max)));}
  inline double average (uint32_t val, uint32_t val_max) {return (average(static_cast<double>(val),static_cast<double>(val_max)));}
  
}; // end namespace morpheo              

#endif
