Skip to content

Commit 3d24a10

Browse files
committed
feat: remove find_power_of and vector_xreplace
1 parent f22f928 commit 3d24a10

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

sumpy/symbolic.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -268,28 +268,6 @@ def make_sym_vector(name: str, components: int) -> Matrix:
268268
return Matrix([Symbol(f"{name}{i}") for i in range(components)])
269269

270270

271-
def vector_xreplace(expr: Expr, from_vec: Matrix, to_vec: Matrix) -> Expr:
272-
substs = {}
273-
assert (from_vec.rows, from_vec.cols) == (to_vec.rows, to_vec.cols)
274-
for irow in range(from_vec.rows):
275-
for icol in range(from_vec.cols):
276-
substs[from_vec[irow, icol]] = to_vec[irow, icol]
277-
278-
return expr.xreplace(substs)
279-
280-
281-
def find_power_of(base: Basic, prod: Basic) -> int | Basic:
282-
# FIXME: this does not actually work with symengine (Wild is not implemented)
283-
remdr = sym.Wild("remdr")
284-
power = sym.Wild("power")
285-
286-
result = prod.match(remdr*base**power)
287-
if result is None:
288-
return 0
289-
290-
return result[power]
291-
292-
293271
@prim.expr_dataclass()
294272
class SpatialConstant(prim.Variable):
295273
"""A symbolic constant to represent a symbolic variable that is spatially constant.

0 commit comments

Comments
 (0)