Parent: MorphoOptimizationProject

Header File Structure

It is desirable to have the headers files form a simple tree

  1. A single header file that defines some widely available commonly used support for bounds checking and similar assertions, malloc et. al, simple math functions (max,min,square,squareroot,abs...). It can include the system-supplied headers that are widely used.
    • This file was missing. I have created one include/base.h

    • The files that were closest to it or widely used - const.h and others - now include it, so it is now included almost everywhere

    • If overrides, such as the optional #define malloc, are included before the system file they wrap, then compilation errors result. The include/base.h includes such header files prior to defining the overriding their functions to avoid this

  2. The various system-supplied header files that are not widely used.
  3. The various third-party header files.
  4. A set of header files defining widely used utilities such as Matrix math. We have this part about right, but there is some near-duplication in areas such as Matrix manipulation because of the history of using third party libraries that had their own definitions
  5. The header files defining our own subsystems
    • These are often put in their own directory rather than having a single include directory, such as we have, to make it easier to associate them with their subsystem

Where to declare variables

Array Bounds

Dangling and uninitialized pointers