mathai 0.6.5__tar.gz → 0.6.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mathai-0.6.5 → mathai-0.6.6}/PKG-INFO +1 -1
- {mathai-0.6.5 → mathai-0.6.6}/mathai/base.py +3 -2
- {mathai-0.6.5 → mathai-0.6.6}/mathai/matrix.py +1 -1
- {mathai-0.6.5 → mathai-0.6.6}/mathai/simplify.py +6 -1
- {mathai-0.6.5 → mathai-0.6.6}/mathai.egg-info/PKG-INFO +1 -1
- {mathai-0.6.5 → mathai-0.6.6}/setup.py +1 -1
- {mathai-0.6.5 → mathai-0.6.6}/README.md +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/__init__.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/apart.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/bivariate_inequality.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/console.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/diff.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/expand.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/factor.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/fraction.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/integrate.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/inverse.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/limit.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/linear.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/logic.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/ode.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/parser.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/parsetab.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/printeq.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/structure.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/tool.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/trig.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai/univariate_inequality.py +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai.egg-info/SOURCES.txt +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai.egg-info/dependency_links.txt +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai.egg-info/requires.txt +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/mathai.egg-info/top_level.txt +0 -0
- {mathai-0.6.5 → mathai-0.6.6}/setup.cfg +0 -0
|
@@ -19,7 +19,7 @@ class TreeNode:
|
|
|
19
19
|
children = copy.deepcopy(children)
|
|
20
20
|
self.name = name
|
|
21
21
|
|
|
22
|
-
if name == "f_add" or (name == "f_mul" and
|
|
22
|
+
if name == "f_add" or (name == "f_mul" and TreeNode.matmul is None):
|
|
23
23
|
keyed = [(str_form(c), c) for c in children]
|
|
24
24
|
self.children = [c for _, c in sorted(keyed)]
|
|
25
25
|
|
|
@@ -366,7 +366,8 @@ def product(lst):
|
|
|
366
366
|
def flatten_tree(node, add=[]):
|
|
367
367
|
if not node.children:
|
|
368
368
|
return node
|
|
369
|
-
|
|
369
|
+
ad = []
|
|
370
|
+
if node.name in ["f_add", "f_mul", "f_and", "f_or", "f_wmul"]:
|
|
370
371
|
merged_children = []
|
|
371
372
|
for child in node.children:
|
|
372
373
|
flattened_child = flatten_tree(child, add)
|
|
@@ -217,7 +217,7 @@ def use(eq):
|
|
|
217
217
|
def _matrix_solve(eq):
|
|
218
218
|
if TreeNode.matmul == True:
|
|
219
219
|
TreeNode.matmul = False
|
|
220
|
-
eq = flat(
|
|
220
|
+
eq = flat(fold_wmul(flat(eq)))
|
|
221
221
|
TreeNode.matmul = True
|
|
222
222
|
return eq
|
|
223
223
|
def matrix_solve(eq):
|
|
@@ -500,6 +500,9 @@ def solve3(eq):
|
|
|
500
500
|
def simplify(eq, basic=True):
|
|
501
501
|
if eq is None:
|
|
502
502
|
return None
|
|
503
|
+
orig = TreeNode.matmul
|
|
504
|
+
if TreeNode.matmul == True:
|
|
505
|
+
TreeNode.matmul = False
|
|
503
506
|
if eq.name == "f_and" or eq.name == "f_not" or eq.name == "f_or":
|
|
504
507
|
new_children = []
|
|
505
508
|
for child in eq.children:
|
|
@@ -518,4 +521,6 @@ def simplify(eq, basic=True):
|
|
|
518
521
|
eq = flatten_tree(eq)
|
|
519
522
|
if basic:
|
|
520
523
|
eq = convert_to_basic(eq)
|
|
521
|
-
|
|
524
|
+
eq = solve3(eq)
|
|
525
|
+
TreeNode.matmul = orig
|
|
526
|
+
return eq
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|