Structure of the Diophantine equation module
The structure of the module is going to be essentially the same as SymPy’s ODE module. ODE module and Diophantine equations (DE) module both need to pattern match a given equation to identify which category it falls and carry out solution procedure accordingly. Below is a pseudo-code representation of the rough structure I wish to follow in the DE module.
type = classify_diop(eq)
# The required solution routine will be called based on the type
# returned by classify_diop(). The types returned will be linear,
# quadratic, pell, and so on.
# Matching “eq” with currently solved equations takes place here.
# This will return the type of DE and information that was found during
# matching which will be helpful in solving equation.
# eg: linear, quadratic, pell … etc.
# This will solve linear DEs.
# This will solve Pell’s equations.
A separate method will be implemented for each “type” returned by classify_diop(). This structure provide a convenient interface for adding solutions for new type of equations. We just need to implement a solver function for that method and add a line in diop_solve() to call that function if the type returned by classify_diop() is the same.
- Posted in: GSoC-2013-SymPy