本文整理匯總了Python中immutable.ImmutableMatrix._sympify方法的典型用法代碼示例。如果您正苦於以下問題:Python ImmutableMatrix._sympify方法的具體用法?Python ImmutableMatrix._sympify怎麽用?Python ImmutableMatrix._sympify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類immutable.ImmutableMatrix
的用法示例。
在下文中一共展示了ImmutableMatrix._sympify方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: zeros
# 需要導入模塊: from immutable import ImmutableMatrix [as 別名]
# 或者: from immutable.ImmutableMatrix import _sympify [as 別名]
def zeros(cls, r, c=None):
"""Return an r x c matrix of zeros, square if c is omitted."""
if is_sequence(r):
SymPyDeprecationWarning(
feature="The syntax zeros([%i, %i])" % tuple(r),
useinstead="zeros(%i, %i)." % tuple(r),
issue=3381, deprecated_since_version="0.7.2",
).warn()
r, c = r
else:
c = r if c is None else c
r = as_int(r)
c = as_int(c)
return cls._new(r, c, [cls._sympify(0)]*r*c)
示例2: eye
# 需要導入模塊: from immutable import ImmutableMatrix [as 別名]
# 或者: from immutable.ImmutableMatrix import _sympify [as 別名]
def eye(cls, n):
"""Return an n x n identity matrix."""
n = as_int(n)
mat = [cls._sympify(0)]*n*n
mat[::n + 1] = [cls._sympify(1)]*n
return cls._new(n, n, mat)