interpolate if necessary
This commit is contained in:
parent
0781605f78
commit
2ade1a678b
1 changed files with 4 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
from functools import singledispatch
|
from functools import singledispatch
|
||||||
from operator import sub, add
|
from operator import sub, add
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
from lenses import lens
|
from lenses import lens
|
||||||
|
|
||||||
import stl.ast
|
import stl.ast
|
||||||
|
|
@ -52,6 +53,7 @@ op_lookup = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@pointwise_robustness.register(stl.LinEq)
|
@pointwise_robustness.register(stl.LinEq)
|
||||||
def _(stl):
|
def _(stl):
|
||||||
op = op_lookup[stl.op]
|
op = op_lookup[stl.op]
|
||||||
|
|
@ -64,4 +66,5 @@ def eval_terms(lineq, x, t):
|
||||||
|
|
||||||
|
|
||||||
def eval_term(x, t):
|
def eval_term(x, t):
|
||||||
return lambda term: term.coeff*x[term.id.name][t]
|
# TODO(lift interpolation much higher)
|
||||||
|
return lambda term: term.coeff*np.interp(t, x.index, x[term.id.name])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue