This group includes various structures and tools for polynomials.
Include the following at the top of any translation unit that uses geometry functions or classes.
You will also need to link to -lecl_geometry.
Polynomials are embedded in the usual c++ wrapper. Coefficient storage is based on the array class in ecl_containers, so comma initialisation can be used to configure the polynomial appropriately.
There is also a method for shifting the polynomial on the horizontal axis (later, if there is a need a vertical shift will be added).
Rather than specifying the degree of the polynomial with a template argument, a few more convenient typedefs are available:
There are also some blueprints for generating polynomials that interpolate between two end points. These can be accessed via static methods that are inherited by the polynomial's class. For example:
Pascal's triangle is used to calculate the coefficients for polynomial expansion. The class here accepts a template parameter N and calculates all the coefficients up to order N (i.e. for polynomial expansion up to (x+y)^N).
You can stream the output directly if you just need to view them or you can use an stl style iterator to traverse the rows diagonally. Simply call the usual begin function with an integer argument representing the diagonal you're interested in. The first iterator will traverse from the top of the triangle to the bottom right. As you increase the index the diagonals shift down and to the left.
There may be a future addition to allow horizontal row representations. Also note, specialised (low N) versions of these exist that directly set coefficients so as to avoid expensive calculations.
There also exist various functions that operate on polynomials. These currently include:
They can also be called from the function classes themselves if it is preferred, e.g.