algorithm.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef SIMPLE_GEOM_ALGORITHM_H
  2. #define SIMPLE_GEOM_ALGORITHM_H
  3. #include "vector.hpp"
  4. #include "simple/support/range.hpp"
  5. namespace simple::geom
  6. {
  7. template <typename Coordinate, size_t Dimensions, typename Order, typename Function, size_t LoopDimesntions = Dimensions>
  8. constexpr void loop_on
  9. (
  10. vector<Coordinate, Dimensions, Order>& index,
  11. const vector<Coordinate, Dimensions, Order>& lower,
  12. const vector<Coordinate, Dimensions, Order>& upper,
  13. const vector<Coordinate, Dimensions, Order>& step,
  14. Function&& callback
  15. );
  16. template <typename Coordinate, size_t Dimensions, typename Order, typename Function>
  17. constexpr void loop
  18. (
  19. const vector<Coordinate, Dimensions, Order>& lower,
  20. const vector<Coordinate, Dimensions, Order>& upper,
  21. const vector<Coordinate, Dimensions, Order>& step,
  22. Function&& callback
  23. );
  24. template <typename Coordinate, size_t Dimensions, typename Order, typename Function, size_t LoopDimesntions = Dimensions>
  25. constexpr void loop_on
  26. (
  27. vector<Coordinate, Dimensions, Order>& index,
  28. const support::range<vector<Coordinate, Dimensions, Order>>&,
  29. const vector<Coordinate, Dimensions, Order>& step,
  30. Function&& callback
  31. );
  32. template <typename Coordinate, size_t Dimensions, typename Order, typename Function>
  33. constexpr void loop
  34. (
  35. const support::range<vector<Coordinate, Dimensions, Order>>&,
  36. const vector<Coordinate, Dimensions, Order>& step,
  37. Function&& callback
  38. );
  39. template <typename Coordinate,
  40. size_t Rows, size_t Columns,
  41. typename RowOrder, typename ColumnOrder
  42. >
  43. constexpr auto gauss_jordan_elimination
  44. (
  45. vector<
  46. vector<Coordinate, Columns, ColumnOrder>,
  47. Rows, RowOrder
  48. >
  49. );
  50. template <typename Transform, typename Vector,
  51. typename AnotherCoord = std::invoke_result_t<Transform,
  52. typename Vector::meta::coordinate_type>,
  53. typename Result = typename Vector::
  54. template map_coordinate_t<AnotherCoord>
  55. >
  56. [[nodiscard]] constexpr Result
  57. deeply_transformed(const Vector&, Transform&&);
  58. } // namespace simple::geom
  59. #endif /* end of include guard */