macformula / racecar

Monorepo for all firmware running on our custom ECUs.
https://macformula.github.io/racecar/
9 stars 2 forks source link

Template `LookupTable` class to support different numeric types (And other mappers if needed) #285

Open jabrap1 opened 1 week ago

jabrap1 commented 1 week ago

Template LookupTable Class and others in the mappers folder if they are not up to date

Description: The LookupTable class is currently designed to work only with float types. To increase its flexibility, we could template the class to support different numeric types (e.g., double, int).

Proposal: Add a template parameter typename T to LookupTable.

BlakeFreer commented 1 week ago

I agree with the templating but only for double / float. It doesn't make much sense to have an interpolating table when you're restricted to a discrete set.

BlakeFreer commented 1 week ago

This is a textbook use for concepts & requires, see std::floating_point