The library contains five module types recently. The GlobalOptimizer, Clusterizer, LocalOptimizer, LineSearch and Gradient computing. They are function interfaces and can be implemented in many ways. It is possible to create new structural units and reimplement built in ones for new functionality. As shown on the figure the call hierarchy consists of the five modules.
Structure of implementation
The global optimizers purpose is to combine the sampling, local optimizer, clusterizer and any other algorithms in order to effectively find the global optimum of the objective function. It is the main algorithmic module.
The module groups samples around local optimums to decrease function evaluation count or to find the area which converges into the optimum.
A local optimizer's goal is to find a local optimum near it's starting point. It can use the line search module and the gradient module in it's algorithm. All the implementations have to accept a starting point.
The line search is a special local optimizer, it optimizes in one dimension. The implementation must accept a starting point, a search direction in the n dimensional plane and a step length parameter.
The module approximates or calculates the exact gradient vector at a given point.
Every module type has its own package. Interchangeable implementations take place in the same packages while not compatible ones are separated. Even though the code separation is present, the algorithms may not work well with each other.
The implementation uses the so called "Builder" pattern which means that a builder class helps to instantiate the module implementation. The parameters can be set via the setter methods then a builder method checks the parameters and returns the new object.
Optimizer configurations are created from modules with dependency injection through builder classes.