Cortex: Math Library
The math library is the most central and fundamental part of Cortex, it will probably be used be almost every other module in the library, so is a pretty important thing to get right. Also, because it is something that people have used dozens of different versions of (possibly even written a few themselves) there should be some pretty strong opinions about its features and design.
Use an Existing or Custom Math Library?
The first issue is whether to reinvent the wheel one more time. Some of the arguments for and against writing a custom math library for Cortex are:
For:
- avoid an external dependency
- full control, can add any features
- nice to start with a clean slate
- fully integrated, e.g. doxygen code docs or minor changes to help the python scripting can be made
- not that much work really, and most of the code already exists in people's own libraries
Against:
- reinventing the wheel, there are good ones already available
- if we use IMath, then we get also get EXR Image IO in Cortex without any further optional dependencies
- immature - it would take a while before bugs in a new library would be sorted out, even if starting with someone's existing code as a base (though we could use something like IMath to unit test the custom library)
- introduces a performance hit where fine-grained integration with existing software using a different library is required
If we were to use an external library, we would still have a lot of work to do to in providing wrappers and adapters to make it work with the different libraries and SDKs that Cortex will inter-operate with.
Here is a list of potential 3rd party math libraries to use:
Desirable Features
- choice of float or double precision via templates
- ...
