polynomials_on_simplices.polynomial.code_generation.generate_polynomial_functions module

Generic functionality for generating Python code used to evaluate polynomials.

generate_docstring(m, r, basis, latex_str)[source]

Generate a docstring for a general function evaluating a polynomial given polynomial coefficients and a point of evaluation.

Parameters:
  • m (int) – Dimension of the domain of the polynomial.
  • r (int) – Degree of the polynomial space.
  • basis (str) – Name for the polynomial basis used.
  • latex_str (str) – Latex str for the calculation done by the function.
Returns:

Docstring for the function.

Return type:

str

generate_function_specific_name(a)[source]

Generate name for a general function evaluating a polynomial.

Parameters:a (Iterable[float]) – Coefficients for the polynomial used to generate a unique name.
Returns:Name for the function.
Return type:str