21721a484a979a3b6ed2f17a31301ee8ffd85d95,src/chaospy/distributions/operators/multiply.py,Mul,_pdf,#Mul#Any#Any#Any#Any#,380

Before Change


            >>> print(dist.pdf([[0.5, 0.6, 1.5], [0.5, 0.6, 1.5]]))
            [0.5 0.5 0. ]
        
        if isinstance(left, Dist) and left in cache:
            left = cache[left]
        if isinstance(right, Dist) and right in cache:
            right = cache[right]

        if isinstance(left, Dist):
            if isinstance(right, Dist):
                raise evaluation.DependencyError(
                    "under-defined distribution {} or {}".format(left, right))
        elif not isinstance(right, Dist):
            return numpy.inf

        else:
            if self.matrix:
                Ci = numpy.linalg.inv(left)
                xloc = numpy.dot(Ci, xloc)

            else:
                left = (numpy.asfarray(left).T+numpy.zeros(xloc.shape).T).T
                valids = left != 0
                xloc.T[valids.T] = xloc.T[valids.T]/left.T[valids.T]

            pdf = evaluation.evaluate_density(right, xloc, cache)
            if self.matrix:

After Change


            >>> print(dist.pdf([[0.5, 0.6, 1.5], [0.5, 0.6, 1.5]]))
            [0.5 0.5 0. ]
        
        left = evaluation.get_forward_cache(left, cache)
        right = evaluation.get_forward_cache(right, cache)

        if isinstance(left, Dist):
            if isinstance(right, Dist):
                raise evaluation.DependencyError(
                    "under-defined distribution {} or {}".format(left, right))
        elif not isinstance(right, Dist):
            return numpy.inf

        else:
            if self.matrix:
                Ci = numpy.linalg.inv(left)
                xloc = numpy.dot(Ci, xloc)

            else:
                left = (numpy.asfarray(left).T+numpy.zeros(xloc.shape).T).T
                valids = left != 0
                xloc.T[valids.T] = xloc.T[valids.T]/left.T[valids.T]

            pdf = evaluation.evaluate_density(right, xloc, cache)
            if self.matrix:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 18

Instances


Project Name: jonathf/chaospy
Commit Name: 21721a484a979a3b6ed2f17a31301ee8ffd85d95
Time: 2018-12-15
Author: jonathf@gmail.com
File Name: src/chaospy/distributions/operators/multiply.py
Class Name: Mul
Method Name: _pdf


Project Name: jonathf/chaospy
Commit Name: 21721a484a979a3b6ed2f17a31301ee8ffd85d95
Time: 2018-12-15
Author: jonathf@gmail.com
File Name: src/chaospy/distributions/operators/multiply.py
Class Name: Mul
Method Name: _pdf


Project Name: jonathf/chaospy
Commit Name: 21721a484a979a3b6ed2f17a31301ee8ffd85d95
Time: 2018-12-15
Author: jonathf@gmail.com
File Name: src/chaospy/distributions/operators/multiply.py
Class Name: Mul
Method Name: _cdf


Project Name: jonathf/chaospy
Commit Name: d0df30627550710563e730586bdaf5908a3680ab
Time: 2019-02-17
Author: jonathf@gmail.com
File Name: chaospy/distributions/operators/power.py
Class Name: Pow
Method Name: _bnd