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.

100 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. meancomp.h
  5. Abstract:
  6. SIS Groveler mean comparitor headers
  7. Authors:
  8. John Douceur, 1998
  9. Environment:
  10. User Mode
  11. Revision History:
  12. --*/
  13. #ifndef _INC_MEANCOMP
  14. #define _INC_MEANCOMP
  15. class MeanComparator
  16. {
  17. public:
  18. MeanComparator(
  19. int num_clans,
  20. int sample_group_size,
  21. double acceptance_p_value,
  22. double rejection_p_value,
  23. double tolerance);
  24. ~MeanComparator();
  25. void reset();
  26. void sample(
  27. int clan,
  28. double value);
  29. bool within(
  30. double compare_value,
  31. ...);
  32. bool exceeds(
  33. double compare_value,
  34. ...);
  35. private:
  36. struct PTableDescriptor
  37. {
  38. double p_value;
  39. int table_size;
  40. int *p_table;
  41. PTableDescriptor *next;
  42. PTableDescriptor *prev;
  43. int ref_count;
  44. };
  45. struct Sample
  46. {
  47. int clan;
  48. double value;
  49. };
  50. static PTableDescriptor *add_p_value(
  51. double p_value,
  52. int sample_table_size);
  53. static bool remove_p_value(
  54. PTableDescriptor *ptd);
  55. static const int max_sample_table_size;
  56. static PTableDescriptor p_list;
  57. int num_clans;
  58. int sample_group_size;
  59. int sample_table_size;
  60. PTableDescriptor *acceptance_table;
  61. PTableDescriptor *rejection_table;
  62. double tolerance;
  63. Sample *samples;
  64. double *compare_values;
  65. int current_offset;
  66. int current_group_size;
  67. };
  68. #endif /* _INC_MEANCOMP */