Did I find the right examples for you? yes no

All Samples(11)  |  Call(9)  |  Derive(0)  |  Import(2)

src/m/d/mdp-toolkit-HEAD/mdp/utils/__init__.py   mdp-toolkit(Download)
__docformat__ = "restructuredtext en"
 
from routines import (timediff, refcast, scast, rotate, random_rot,
                      permute, symrand, norm2, cov2,
                      mult_diag, comb, sqrtm, get_dtypes, nongeneral_svd,
# 'f' is upcasted at least in the following functions
_inv = _mdp.numx_linalg.inv
inv = lambda x: refcast(_inv(x), x.dtype)
_pinv = _mdp.numx_linalg.pinv
pinv = lambda x: refcast(_pinv(x), x.dtype)
_solve = _mdp.numx_linalg.solve
solve = lambda x, y: refcast(_solve(x, y), x.dtype)
        if compute_uv:
            u, s, v = _mdp.numx_linalg.svd(x)
            return refcast(u, tc), refcast(s, tc), refcast(v, tc)
        else:
            s = _mdp.numx_linalg.svd(x, compute_uv=False)

src/m/d/mdp-toolkit-HEAD/mdp/utils/quad_forms.py   mdp-toolkit(Download)
import mdp
from routines import refcast
numx = mdp.numx
numx_linalg = mdp.numx_linalg
 
            raise QuadraticFormException('H does not seem to be symmetric')
 
        self.H = refcast(H, dtype)
        if f is None:
            f = numx.zeros((H.shape[0],), dtype=dtype)
        if c is None:
            c = 0
        self.f = refcast(f, dtype)