Quadripoint.hpp 889 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. friend class QuadripointHash;
  21. friend std::ostream& operator<<(std::ostream& os, const Quadripoint& output);
  22. friend std::istream& operator>>(std::istream& is, Quadripoint& input);
  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