Return the hyperbolic secant of x.
775982
def sech(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_sech,
        (BigFloat._implicit_convert(x),),
        context,
    )
984204
def V(x, requires_grad=False, volatile=False):
    ''' '''
    return map_over(x, lambda o: V_(o, requires_grad, volatile))
1306981
def anorm(x, axis=None, keepdims=False):
  """"""
  return np.sqrt((x*x).sum(axis=axis, keepdims=keepdims))
1088763
def derivative(self, x):
        """"""
        if self.is_linear:
            return self
        else:
            left = self.right(x) * self.left.derivative(x)
            right = self.left(x) * self.right.derivative(x)
            return left + right
951874
def xAxisIsMajor(self):
        '''
        
        '''
        return max(self.radius.x, self.radius.y) == self.radius.x
237261
def obfn_f(self, X=None):
        
        """
        if X is None:
            X = self.X

        return 0.5 * np.linalg.norm((self.D.dot(X) - self.S).ravel())**2
303135
def _call(self, x):
        """"""
        return (self.functional(x) +
                self.quadratic_coeff * x.inner(x) +
                x.inner(self.linear_term) + self.constant)
219133
def cnst_AT(self, X):
        
        """

        return np.sum(self.cnst_A0T(X), axis=-1) + self.cnst_A1T(X)
878478
def _protected_inverse(x1):
    """"""
    with np.errstate(divide='ignore', invalid='ignore'):
        return np.where(np.abs(x1) > 0.001, 1. / x1, 0.)
610900
def _get_f2rx(self, C, r_x, r_1, r_2):
        
        drx = (r_x - r_1) / (r_2 - r_1)
        return self.CONSTS["h4"] + (C["h5"] * drx) + (C["h6"] * (drx ** 2.))
1321982
def skew_x(self, x):
        
        self.root.set("transform", "%s skewX(%f)" %
                      (self.root.get("transform") or '', x))
        return self
589311
def cnst_AT(self, X):
        
        """

        Xf = sl.rfftn(X, axes=self.axes)
        return np.sum(sl.irfftn(np.conj(self.GAf)*Xf, self.axsz,
                                axes=self.axes), axis=self.Y.ndim-1)
1195838
def cnst_A(self, X):
        
        """

        return self.block_cat(self.cnst_A0(X), self.cnst_A1(X))
310505
def _evalAndDer(self,x):
        '''
        
        '''
        y,dydx = self._evalOrDer(x,True,True)

        return y,dydx
975286
def _call(self, x):
        """"""
        if self.operator is None:
            return self.vector.inner(x) + self.constant
        elif self.vector is None:
            return x.inner(self.operator(x)) + self.constant
        else:
            tmp = self.operator(x)
            tmp += self.vector
            return x.inner(tmp) + self.constant
471561
def partsphere(self, x):
        """"""
        self.counter += 1
        # return np.random.rand(1)[0]**0 * sum(x**2) + 1 * np.random.rand(1)[0]
        dim = len(x)
        x = array([x[i % dim] for i in xrange(2 * dim)])
        N = 8
        i = self.counter % dim
        # f = sum(x[i:i + N]**2)
        f = sum(x[np.random.randint(dim, size=N)]**2)
        return f
397368
def sqr(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_sqr,
        (BigFloat._implicit_convert(x),),
        context,
    )