Skip to content

Commit

Permalink
Cleanup naming in StaticLookupTable
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Feb 25, 2024
1 parent d27dc84 commit 0ff549b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/grit/math/static_lookup_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ struct StaticLookupTable

constexpr StaticLookupTable() = default;

template<etl::regular_invocable<etl::size_t> FunctionToApproximate>
requires(etl::same_as<etl::invoke_result_t<FunctionToApproximate, etl::size_t>, Float>)
explicit constexpr StaticLookupTable(FunctionToApproximate func)
template<etl::regular_invocable<etl::size_t> Function>
requires(etl::same_as<etl::invoke_result_t<Function, etl::size_t>, Float>)
explicit constexpr StaticLookupTable(Function func)
{
initialize(func);
}

template<etl::regular_invocable<etl::size_t> FunctionToApproximate>
requires(etl::same_as<etl::invoke_result_t<FunctionToApproximate, etl::size_t>, Float>)
constexpr auto initialize(FunctionToApproximate func) -> void
template<etl::regular_invocable<etl::size_t> Function>
requires(etl::same_as<etl::invoke_result_t<Function, etl::size_t>, Float>)
constexpr auto initialize(Function func) -> void
{
for (auto i = etl::size_t{0}; i < Size; ++i) {
auto value = func(i);
Expand Down
12 changes: 6 additions & 6 deletions lib/grit/math/static_lookup_table_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ struct StaticLookupTableTransform

constexpr StaticLookupTableTransform() = default;

template<etl::regular_invocable<Float> Func>
requires(etl::same_as<etl::invoke_result_t<Func, Float>, Float>)
explicit constexpr StaticLookupTableTransform(Func func, Float min, Float max)
template<etl::regular_invocable<Float> Function>
requires(etl::same_as<etl::invoke_result_t<Function, Float>, Float>)
explicit constexpr StaticLookupTableTransform(Function func, Float min, Float max)
{
initialize(func, min, max);
}

template<etl::regular_invocable<Float> Func>
requires(etl::same_as<etl::invoke_result_t<Func, Float>, Float>)
constexpr auto initialize(Func func, Float min, Float max) -> void
template<etl::regular_invocable<Float> Function>
requires(etl::same_as<etl::invoke_result_t<Function, Float>, Float>)
constexpr auto initialize(Function func, Float min, Float max) -> void
{
_min = min;
_max = max;
Expand Down

0 comments on commit 0ff549b

Please sign in to comment.