Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
749 B

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. peakfind.h
  5. Abstract:
  6. SIS Groveler peak finder headers
  7. Authors:
  8. John Douceur, 1998
  9. Environment:
  10. User Mode
  11. Revision History:
  12. --*/
  13. #ifndef _INC_PEAKFIND
  14. #define _INC_PEAKFIND
  15. class PeakFinder
  16. {
  17. public:
  18. PeakFinder(
  19. double accuracy,
  20. double range);
  21. ~PeakFinder();
  22. void reset();
  23. void sample(
  24. double value,
  25. int weight);
  26. bool found() const;
  27. double mode() const;
  28. double median() const;
  29. private:
  30. int num_bins;
  31. int *bins;
  32. double base;
  33. double multiplier;
  34. int floor_exp;
  35. double floor_value;
  36. int target_sample_size;
  37. int sample_size;
  38. int total_weight;
  39. };
  40. #endif /* _INC_PEAKFIND */