Returns integral of the linear growth factor from z=200 to z=z
517285
def _int_growth(z, **cosmo):
    

    zmax = 200

    if hasattr(z, "__len__"):
        for zval in z:
            assert(zval < zmax)
    else:
        assert(z < zmax)

    y, yerr = scipy.integrate.quad(
        lambda z: (1 + z)/(cosmo['omega_M_0']*(1 + z)**3 +
                           cosmo['omega_lambda_0'])**(1.5),
        z, zmax)

    return(y)
1187265
def Ode(self, z):
        
        return self.bg.Omega_lambda(z) + self.bg.Omega_fld(z)
591905
def _compute_integral_x(self):
        
        # The integral of any linear function over a triangle is the average of
        # the values of the function in each of the three corners, times the
        # area of the triangle.
        right_triangle_vols = self.cell_partitions

        node_edges = self.idx_hierarchy

        corner = self.node_coords[node_edges]
        edge_midpoints = 0.5 * (corner[0] + corner[1])
        cc = self.cell_circumcenters

        average = (corner + edge_midpoints[None] + cc[None, None]) / 3.0

        contribs = right_triangle_vols[None, :, :, None] * average

        return node_edges, contribs
108445
def exp(self):
        
        
        # Init
        vecNorm = self.x**2 + self.y**2 + self.z**2
        wPart = np.exp(self.w)        
        q = Quaternion()
        
        # Calculate
        q.w = wPart * np.cos(vecNorm)
        q.x = wPart * self.x * np.sin(vecNorm) / vecNorm
        q.y = wPart * self.y * np.sin(vecNorm) / vecNorm
        q.z = wPart * self.z * np.sin(vecNorm) / vecNorm
        
        return q
1076587
def _vmomentsurfaceMCIntegrand(vz,vR,vT,R,z,df,sigmaR1,gamma,sigmaz1,mvT,n,m,o):
    """"""
    return vR**n*vT**m*vz**o*df(R,vR*sigmaR1,vT*sigmaR1*gamma,z,vz*sigmaz1,use_physical=False)*numpy.exp(vR**2./2.+(vT-mvT)**2./2.+vz**2./2.)
1028248
def logx_linear(x, a, b):
    
    x = np.log(x)
    return a*x + b
1179219
def _force_xyz(self,x,y,z,i):
        """"""
        return -4.*numpy.pi*self._b*self._c\
            *_forceInt(x,y,z,
                       lambda m: self._mdens(m),
                       self._b2,self._c2,i,glx=self._glx,glw=self._glw)
110534
public double getValue(int index, double x, double y, double z) {
        double sum = 0;
        for (int i = 0; i < count_basis; i++)
            if (C.matrix[i][index] != 0d) sum += C.matrix[i][index] * basis.getValue(i, x, y, z);
        return sum;
    }
161225
def get_lr(lr, epoch, steps, factor):
    """"""
    for s in steps:
        if epoch >= s:
            lr *= factor
    return lr
1282771
def xyz2lab(x__, y__, z__):
    

    def f__(arr):
        """f__ function
        """

        return np.where(arr > 216.0 / 24389.0,
                        arr ** (1.0/3.0),
                        (1.0 / 3.0) * (29.0 / 6.0) * (29.0 / 6.0) * arr
                        + 4.0 / 29.0)
    fy_ = f__(y__ / 100.0)
    l__ = 116 * fy_ - 16
    a__ = 500.0 * (f__(x__ / 95.047) - fy_)
    b__ = 200.0 * (fy_ - f__(z__ / 108.883))
    return l__, a__, b__
1141866
def gammalnStirling(z):
    
    return (0.5 * (np.log(2. * np.pi) - np.log(z))) \
           + (z * (np.log(z + (1. / ((12. * z) - (1. / (10. * z))))) - 1.))
1096821
def get_total_spatial_integral(self, z=None):  
        

        dL= self.l_max.value-self.l_min.value if self.l_max.value > self.l_min.value else 360 + self.l_max.value - self.l_max.value

        #integral -inf to inf exp(-b**2 / 2*sigma_b**2 ) db = sqrt(2pi)*sigma_b 
        #Note that K refers to the peak diffuse flux (at b = 0) per square degree.
        integral = np.sqrt( 2*np.pi ) * self.sigma_b.value * self.K.value * dL 

        if isinstance( z, u.Quantity):
            z = z.value
        return integral * np.power( 180. / np.pi, -2 ) * np.ones_like( z )
685628
def _evaluate_xyz(self,x,y,z):
        """"""
        return 2.*numpy.pi*self._b*self._c\
            *_potInt(x,y,z,self._psi,
                     self._b2,self._c2,glx=self._glx,glw=self._glw)
289527
public void calcExpectation(double[] expected, double Z, int size)
    {
        double c = Math.exp(lnode.alpha + cost + rnode.beta - Z);
        for (int i = 0; fvector.get(i) != -1; i++)
        {
            int idx = fvector.get(i) + lnode.y * size + rnode.y;
            expected[idx] += c;
        }
    }
927307
def Integrate(self):
        
        area = 0.
        X = self.GetX()
        Y = self.GetY()
        for i in range(self.GetN() - 1):
            area += (X[i + 1] - X[i]) * (Y[i] + Y[i + 1]) / 2.
        return area
498164
public static double Phi(double z) {
        if (z < -8.0) return 0.0;
        if (z >  8.0) return 1.0;
        double sum = 0.0, term = z;
        for (int i = 3; sum + term != sum; i += 2) {
            sum  = sum + term;
            term = term * z * z / i;
        }
        return 0.5 + sum * phi(z);
    }
770333
def annealing_linear(start:Number, end:Number, pct:float)->Number:
    ""
    return start + pct * (end-start)