Tools for testing Jastacry on runtime https://jastacry.org
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.

MeasureEntropy.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * @file MeasureEntropy.h
  3. * @author Kai KRETSCHMANN
  4. *
  5. * @copyright SPDX-License-Identifier: MIT
  6. *
  7. * @brief Real entropy calculation class for doing measurements.
  8. *
  9. **/
  10. #pragma once
  11. #ifndef MEASUREENTROPY_H_
  12. #define MEASUREENTROPY_H_
  13. #include "MeasureBase.h"
  14. namespace jastacry {
  15. /**
  16. * @brief MeasureEntropy class.
  17. */
  18. class MeasureEntropy: public MeasureBase {
  19. private:
  20. /**
  21. * @brief Internal log function.
  22. * @param number [in] - double to calculate log2 on.
  23. * @return double as result.
  24. */
  25. double log2(const double number);
  26. double _infocontent;
  27. public:
  28. /**
  29. * @brief Constructor for class.
  30. *
  31. * @param filename [in] - String by reference of file to read.
  32. *
  33. */
  34. explicit MeasureEntropy(const std::string& filename);
  35. /**
  36. * @brief Main measure function. Reads from file buffer and sets internal property to entropy value.
  37. */
  38. virtual void measure() override;
  39. /**
  40. * @brief Print entropy to logging.
  41. */
  42. virtual void printResult() override;
  43. /**
  44. * @brief Return entropy as double.
  45. */
  46. virtual double getResult() override;
  47. };
  48. } /* namespace jastacry */
  49. #endif /* MEASUREENTROPY_H_ */
Social stuff:
Mastodon