Did I find the right examples for you? yes no

All Samples(1471)  |  Call(1372)  |  Derive(1)  |  Import(98)

src/s/y/sympy-0.7.5/sympy/integrals/prde.py   sympy(Download)
from sympy.core import Dummy, ilcm, Add, Mul, Pow, S
 
from sympy.matrices import Matrix, zeros, eye
 
from sympy import im, sqrt, re
    if not all([ri.is_zero for _, ri in Q]):
        N = max([ri.degree(DE.t) for _, ri in Q])
        M = Matrix(N + 1, m, lambda i, j: Q[j][1].nth(i))
    else:
        M = Matrix()  # No constraints, return the empty matrix.
 
    qs, _ = list(zip(*Q))
    return (qs, M)
 
                A = A.col_join(Rm1)
                u = u.col_join(Matrix([um1]))
 
    return (A, u)

src/s/y/sympy-HEAD/sympy/integrals/prde.py   sympy(Download)
from sympy.core import Dummy, ilcm, Add, Mul, Pow, S
 
from sympy.matrices import Matrix, zeros, eye
 
from sympy import im, sqrt, re
    if not all([ri.is_zero for _, ri in Q]):
        N = max([ri.degree(DE.t) for _, ri in Q])
        M = Matrix(N + 1, m, lambda i, j: Q[j][1].nth(i))
    else:
        M = Matrix()  # No constraints, return the empty matrix.
 
    qs, _ = list(zip(*Q))
    return (qs, M)
 
                A = A.col_join(Rm1)
                u = u.col_join(Matrix([um1]))
 
    return (A, u)

src/s/y/sympy-0.7.5/sympy/combinatorics/generators.py   sympy(Download)
from sympy.utilities.iterables import variations, rotate_left
from sympy.core.symbol import symbols
from sympy.matrices import Matrix
from sympy.core.compatibility import xrange
 
    def setr(f, i, s):
        faces[f][:, n - i] = Matrix(n, 1, s)
 
    def setl(f, i, s):
        faces[f][:, i - 1] = Matrix(n, 1, s)
 
    def setu(f, i, s):
        faces[f][i - 1, :] = Matrix(1, n, s)
    def setd(f, i, s):
        faces[f][n - i, :] = Matrix(1, n, s)
 
    # motion of a single face
    def cw(F, r=1):

src/s/y/sympy-HEAD/sympy/combinatorics/generators.py   sympy(Download)
from sympy.utilities.iterables import variations, rotate_left
from sympy.core.symbol import symbols
from sympy.matrices import Matrix
from sympy.core.compatibility import xrange
 
    def setr(f, i, s):
        faces[f][:, n - i] = Matrix(n, 1, s)
 
    def setl(f, i, s):
        faces[f][:, i - 1] = Matrix(n, 1, s)
 
    def setu(f, i, s):
        faces[f][i - 1, :] = Matrix(1, n, s)
    def setd(f, i, s):
        faces[f][n - i, :] = Matrix(1, n, s)
 
    # motion of a single face
    def cw(F, r=1):

src/s/y/sympy-HEAD/sympy/geometry/curve.py   sympy(Download)
        Curve((-x, x), (x, 0, 1))
        """
        from sympy.matrices import Matrix, rot_axis3
        pt = -Point(pt or (0, 0))
        rv = self.translate(*pt.args)
        f = list(rv.functions)
        f.append(0)
        f = Matrix(1, 3, f)

src/s/y/sympy-HEAD/sympy/solvers/recurr.py   sympy(Download)
from sympy.polys import Poly, quo, gcd, lcm, roots, resultant
from sympy.functions import binomial, factorial, FallingFactorial, RisingFactorial
from sympy.matrices import Matrix, casoratian
from sympy.concrete import product
from sympy.core.compatibility import default_sort_key, xrange
                    alpha[i] += I[k]*B*D
 
        V = Matrix(U, A, lambda i, j: int(i == j))
 
        if homogeneous:
 
                    for j in xrange(0, A):
                        v[j] += B * V[i - k, j]
 
                denom = alpha[-A].subs(x, i)
 
                for j in xrange(0, A):
                    V[i, j] = -v[j] / denom
 
                    for j in xrange(0, A):
                        v[j] += B * V[i - k, j]
 
                    g += B * G[i - k]

src/s/y/sympy-0.7.5/sympy/simplify/hyperexpand.py   sympy(Download)
def add_formulae(formulae):
    """ Create our knowledge base. """
    from sympy.matrices import Matrix
 
    a, b, c, z = symbols('a b c, z', cls=Dummy)
    # 2F1
    addb((a, a - S.Half), (2*a, ),
         Matrix([HyperRep_power2(a, z),
                 HyperRep_power2(a + S(1)/2, z)/2]),
         Matrix([[1, 0]]),
         Matrix([[(a - S.Half)*z/(1 - z), (S.Half - a)*z/(1 - z)],
                 [a/(1 - z), a*(z - 2)/(1 - z)]]))
    addb((1, 1), (2, ),
         Matrix([HyperRep_log1(z), 1]), Matrix([[-1/z, 0]]),

src/s/y/sympy-HEAD/sympy/simplify/hyperexpand.py   sympy(Download)
def add_formulae(formulae):
    """ Create our knowledge base. """
    from sympy.matrices import Matrix
 
    a, b, c, z = symbols('a b c, z', cls=Dummy)
    # 2F1
    addb((a, a - S.Half), (2*a, ),
         Matrix([HyperRep_power2(a, z),
                 HyperRep_power2(a + S(1)/2, z)/2]),
         Matrix([[1, 0]]),
         Matrix([[(a - S.Half)*z/(1 - z), (S.Half - a)*z/(1 - z)],
                 [a/(1 - z), a*(z - 2)/(1 - z)]]))
    addb((1, 1), (2, ),
         Matrix([HyperRep_log1(z), 1]), Matrix([[-1/z, 0]]),

src/s/y/sympy-0.7.5/sympy/crypto/crypto.py   sympy(Download)
from sympy.core import Rational, S, Symbol
from sympy.core.numbers import igcdex
from sympy.matrices import Matrix
from sympy.ntheory import isprime, totient, primitive_root
from sympy.polys.domains import FF
        P = P + [0]*(n - m*k)
        m = m + 1
    C = [list(key*Matrix(k, 1, [P[i] for i in range(k*j, k*(j + 1))])) for j in range(m)]
    C = flatten(C)
    return "".join([A[i % N] for i in C])
        m = m + 1
    key_inv = key.inv_mod(N)
    P = [list(key_inv*Matrix(k, 1, [C[i] for i in range(k*j, k*(j + 1))])) for j in range(m)]
    P = flatten(P)
    return "".join([A[i % N] for i in P])
    long_key = key0 + [x for x in A if (not(x in key0) and x != "J")]
    f = lambda i, j: Symbol(long_key[5*i + j])
    M = Matrix(5, 5, f)
    return M
 

src/s/y/sympy-0.7.5/sympy/matrices/expressions/blockmatrix.py   sympy(Download)
from sympy.matrices.expressions.slice import MatrixSlice
from sympy.matrices.expressions.inverse import Inverse
from sympy.matrices import Matrix, eye, ShapeError
 
 
    def _eval_transpose(self):
        # Flip all the individual matrices
        matrices = [transpose(matrix) for matrix in self.blocks]
        # Make a copy
        M = Matrix(self.blockshape[0], self.blockshape[1], matrices)
def blockinverse_1x1(expr):
    if isinstance(expr.arg, BlockMatrix) and expr.arg.blockshape == (1, 1):
        mat = Matrix([[expr.arg.blocks[0].inverse()]])
        return BlockMatrix(mat)
    return expr

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next