Return the object representing the primitive of self over the domain. The
        output starts at zero on the left-hand side of the domain.
963117
def integrate(self):
        
        coeffs = self.coefficients()
        a,b = self.domain()
        int_coeffs = 0.5*(b-a)*poly.chebyshev.chebint(coeffs)
        antiderivative = self.from_coeff(int_coeffs, domain=self.domain())
        return antiderivative - antiderivative(a)
441029
def tagger(self):
        
        domain = 0
        if domain not in self.domains:
            self.register_domain(domain=domain)
        return self.domains[domain].tagger
478955
def get_domain(self):
        
        points = np.vstack([place.get_domain() for place in self])
        return np.array([points.min(axis=0), points.max(axis=0)])
465086
def _call(self, x):
        
        y = self.data
        r = self.background

        obj = self.domain.zero()

        # x + r - y + y * log(y / (x + r)) = x - y * log(x + r) + c1
        # with c1 = r - y + y * log y
        i = x.ufuncs.greater_equal(0)
        obj[i] = x[i] + r[i] - y[i]

        j = y.ufuncs.greater(0)
        k = i.ufuncs.logical_and(j)
        obj[k] += y[k] * (y[k] / (x[k] + r[k])).ufuncs.log()

        # (y / (2 * r^2)) * x^2 + (1 - y / r) * x + r - b + b * log(b / r)
        # = (y / (2 * r^2)) * x^2 + (1 - y / r) * x + c2
        # with c2 = r - b + b * log(b / r)
        i = i.ufuncs.logical_not()
        obj[i] += (y[i] / (2 * r[i]**2) * x[i]**2 + (1 - y[i] / r[i]) * x[i] +
                   r[i] - y[i])

        k = i.ufuncs.logical_and(j)
        obj[k] += y[k] * (y[k] / r[k]).ufuncs.log()

        return obj.inner(self.domain.one())
892234
def _call(self, x):
        """"""
        result = 0
        for i in range(0, self.domain.size - 1):
            result += (self.scale * (x[i + 1] - x[i] ** 2) ** 2 +
                       (x[i] - 1) ** 2)

        return result
1234744
def primitive(self, primitive):
        """"""
        self.entry_number = primitive['entry-number']
        self.item_hash = primitive['item-hash']
        self.timestamp = primitive['timestamp']
1223638
def _call(self, x):
        """"""
        if self.exponent == 0:
            return self.domain.one().inner(np.not_equal(x, 0))
        elif self.exponent == 1:
            return x.ufuncs.absolute().inner(self.domain.one())
        elif self.exponent == 2:
            return np.sqrt(x.inner(x))
        elif np.isfinite(self.exponent):
            tmp = x.ufuncs.absolute()
            tmp.ufuncs.power(self.exponent, out=tmp)
            return np.power(tmp.inner(self.domain.one()), 1 / self.exponent)
        elif self.exponent == np.inf:
            return x.ufuncs.absolute().ufuncs.max()
        elif self.exponent == -np.inf:
            return x.ufuncs.absolute().ufuncs.min()
        else:
            raise RuntimeError('unknown exponent')
305167
def adjoint(self):
        
        return Laplacian(self.range, self.domain,
                         pad_mode=self.pad_mode, pad_const=0)
1048831
def primitive(self):
        """"""
        primitive = copy(self.item.primitive)
        primitive.update(self.entry.primitive)
        return primitive
666082
def getBottomRight(self):
        
        return (float(self.get_x()) + float(self.get_width()), float(self.get_y()))
511026
def value(self) -> Optional[int]:
        
        if self.symbolic:
            return None
        assert isinstance(self.raw, z3.BitVecNumRef)
        return self.raw.as_long()
422935
def primitive(self, dictionary):
        """"""
        self.__dict__ = {k: v for k, v in dictionary.items() if v}
720163
def adjoint(self):
        
        if self.domain.exponent == 2.0 and self.range.exponent == 2.0:
            return self.inverse
        else:
            raise NotImplementedError(
                'no adjoint defined for exponents ({}, {}) != (2, 2)'
                ''.format(self.domain.exponent, self.range.exponent))
1371902
def get_domain(self):
        
        if isinstance(self.model, BayesianModel):
            cpds = self.model.get_cpds()
            cpds.sort(key=lambda x: x.variable)
            domain = {}
            for cpd in cpds:
                domain[cpd.variable] = str(cpd.variable_card)
            return domain
        elif isinstance(self.model, MarkovModel):
            factors = self.model.get_factors()
            domain = {}
            for factor in factors:
                variables = factor.variables
                for var in variables:
                    if var not in domain:
                        domain[var] = str(factor.get_cardinality([var])[var])
            return domain
        else:
            raise TypeError("Model must be an instance of Markov or Bayesian model.")
1204736
def p_const_value_primitive(self, p):
        ''''''
        p[0] = ast.ConstPrimitiveValue(p[1], lineno=p.lineno(1))
1235337
def to_primitive(self, context=None):
        
        primitive = super(ValueConstant, self).to_primitive(context)
        value = self.value

        if hasattr(value, 'isoformat'):
            value = value.isoformat()
        elif callable(value):
            value = value()

        primitive['value'] = value
        return primitive
88753
def primitive_form(obj, **kwargs):
    ''''''
    if isinstance(obj, type):
        return obj
    return Type.dispatch(obj).primitive_form(**kwargs)