Quadripoint.hpp 847 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __QUADRIPOINT_HPP
  2. #define __QUADRIPOINT_HPP
  3. #include <functional>
  4. #include "Scalar.hpp"
  5. #include "print_helpers.hpp"
  6. extern "C" {
  7. #include "fp12e.h"
  8. }
  9. class Quadripoint
  10. {
  11. public:
  12. Quadripoint();
  13. Quadripoint(const fp12e_t& p1, const fp12e_t& p2, const fp12e_t& p3, const fp12e_t& p4);
  14. fp12e_t& operator[](int n);
  15. const fp12e_t& operator[](int n) const;
  16. Quadripoint operator+(const Quadripoint& b) const;
  17. Quadripoint operator*(const Scalar& exp) const;
  18. bool operator==(const Quadripoint& b) const;
  19. bool operator!=(const Quadripoint& b) const;
  20. Quadripoint square() const;
  21. friend class QuadripointHash;
  22. friend std::ostream& operator<<(std::ostream& os, const Quadripoint& output);
  23. private:
  24. fp12e_t point[4];
  25. };
  26. class QuadripointHash
  27. {
  28. public:
  29. size_t operator()(const Quadripoint& x) const;
  30. };
  31. #endif