Skip to content
Commit bd13bed9 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

PwQPolynomial.eval_from_dict: Check whether eval point is in domain

parent b647af58
Loading
Loading
Loading
Pipeline #7426 passed with stage
in 3 minutes and 1 second
Loading
  • Author Owner

    @jdsteve2 The case that's caught by this could be causing you accuracy grief in the modeling. (not very likely, but worth it to rule out)

  • @inducer Initially this seems to be giving me that ValueError when I try to evaluate the 0 polynomial. Should it do that?

    >>> import islpy as isl
    >>> poly = isl.PwQPolynomial('{ 0 }')
    >>> param_dict = dict(n=128)
    >>> poly.eval_with_dict(param_dict)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/jdsteve2/src/islpy/islpy/__init__.py", line 691, in pwqpolynomial_eval_with_dict
        raise ValueError("evaluation point outside of domain of "
    ValueError: evaluation point outside of domain of definition of piecewise quasipolynomial
  • (also, this did help me find some incorrect assumptions in a few kernels, thanks!)

  • Author Owner

    Initially this seems to be giving me that ValueError when I try to evaluate the 0 polynomial. Should it do that?

    For the zero polynomial with the empty domain: yes. You'll probably need to construct a zero polynomial with the universe as its domain.

  • Author Owner

    Fwiw, in cases where assumptions were violated, this would (sometimes) silently evaluate to zero, leading to totally bogus results. Embarrassingly, this happened for the first time in a noticeable way while I was demoing something for Paul F...

  • Andreas Klöckner @inducer

    mentioned in commit f73aaeb0

    ·

    mentioned in commit f73aaeb0

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment