Did I find the right examples for you? yes no

All Samples(206)  |  Call(197)  |  Derive(0)  |  Import(9)

src/s/y/sympy-0.7.5/sympy/matrices/tests/test_sparse.py   sympy(Download)
from sympy import S, Symbol, I, Rational, PurePoly
from sympy.matrices import Matrix, SparseMatrix, eye, zeros, ShapeError
from sympy.utilities.pytest import raises
 
 
 
    # creation args
    raises(TypeError, lambda: SparseMatrix(1, 2))
 
    a = SparseMatrix((
        (1, 0),
        (0, 1)
    ))
    assert SparseMatrix(a) == a
 
    # test element assignment
    a = SparseMatrix((
        (1, 0),
        (0, 1)

src/s/y/sympy-HEAD/sympy/matrices/tests/test_sparse.py   sympy(Download)
from sympy import S, Symbol, I, Rational, PurePoly
from sympy.matrices import Matrix, SparseMatrix, eye, zeros, ShapeError
from sympy.utilities.pytest import raises, XFAIL
 
 
 
    # creation args
    raises(TypeError, lambda: SparseMatrix(1, 2))
 
    a = SparseMatrix((
        (1, 0),
        (0, 1)
    ))
    assert SparseMatrix(a) == a
 
    # test element assignment
    a = SparseMatrix((
        (1, 0),
        (0, 1)

src/s/y/sympy-0.7.5/sympy/matrices/matrices.py   sympy(Download)
        LUsolve
        """
        from sympy.matrices import SparseMatrix
        zeros = SparseMatrix.zeros
        eye = SparseMatrix.eye

src/s/y/sympy-HEAD/sympy/matrices/matrices.py   sympy(Download)
        LUsolve
        """
        from sympy.matrices import SparseMatrix
        zeros = SparseMatrix.zeros
        eye = SparseMatrix.eye

src/s/y/sympy-0.7.5/sympy/matrices/tests/test_matrices.py   sympy(Download)
from sympy.matrices.matrices import (ShapeError, MatrixError,
    NonSquareMatrixError, DeferredVector)
from sympy.matrices import (
    GramSchmidt, ImmutableMatrix, ImmutableSparseMatrix, Matrix,
    SparseMatrix, casoratian, diag, eye, hessian,
 
    # A SparseMatrix can be equal to a Matrix
    C = SparseMatrix(((1, 0, 0), (0, 1, 0), (0, 0, 1)))
    D = Matrix(((1, 0, 0), (0, 1, 0), (0, 0, 1)))
    assert C == D
    assert not C != D
    s[0, 0] = Matrix([1, 1, 1])
    assert s[:, 0] == Matrix([1, 1, 1])
    s[0, 0] = SparseMatrix([1, 1, 1])
    assert s[:, 0] == Matrix([1, 1, 1])
 

src/s/y/sympy-HEAD/sympy/matrices/tests/test_matrices.py   sympy(Download)
from sympy.matrices.matrices import (ShapeError, MatrixError,
    NonSquareMatrixError, DeferredVector)
from sympy.matrices import (
    GramSchmidt, ImmutableMatrix, ImmutableSparseMatrix, Matrix,
    SparseMatrix, casoratian, diag, eye, hessian,
 
    # A SparseMatrix can be equal to a Matrix
    C = SparseMatrix(((1, 0, 0), (0, 1, 0), (0, 0, 1)))
    D = Matrix(((1, 0, 0), (0, 1, 0), (0, 0, 1)))
    assert C == D
    assert not C != D
    s[0, 0] = Matrix([1, 1, 1])
    assert s[:, 0] == Matrix([1, 1, 1])
    s[0, 0] = SparseMatrix([1, 1, 1])
    assert s[:, 0] == Matrix([1, 1, 1])
 

src/s/y/sympy-HEAD/sympy/utilities/tests/test_pickling.py   sympy(Download)
 
#================== matrices ====================
from sympy.matrices import Matrix, SparseMatrix
 
 
def test_matrices():
    for c in (Matrix, Matrix([1, 2, 3]), SparseMatrix, SparseMatrix([[1, 2], [3, 4]])):