Open artofscience opened 2 years ago
Note the intervening object holds the y
and dy
methods, and the Approximation holds the g
and dg
methods. Basically both are functions and their derivatives, maybe give them the same name? Then Approximation
only needs to accept "an object" that has these methods.
Short discussion with Arnoud gave some conclusions; what we could do is something like:
subprob1 = Subproblem(Taylor1(Reciprocal())) subprob2 = Subproblem(Taylor2())
while not converged:
f = problem.g(x)
df = problem.dg(x)
subproblem1.build(x,f,df)
ddf = subproblem1.ddg(x)
subproblem2.build(x,f,df,ddf)
x = solver(subproblem2)
We can currently do:
To make the approximated approximations we "only" need to do:
This means we need to make Approximation accept Approximation.
How can we do this?