pyccel.complexity.basic module

pyccel.complexity.basic module#

Module containing the Complexity class which provides an interface for calculating the computational complexity of a given piece of code. This base class may be extended to compute, e.g., the operation/time complexity, or the memory/space complexity.

class pyccel.complexity.basic.Complexity(filename_or_text)[source]View on GitHub#

Bases: object

Abstract class for complexity computation.

Abstract class for complexity computation.

Parameters:

filename_or_text (str) – Name of the file containing the abstract grammar or input code to parse as a string.

property astView on GitHub#

Returns the Abstract Syntax Tree.

cost()[source]View on GitHub#

Computes the complexity of the given code.