mathai 0.5.1__tar.gz → 0.5.2__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.5.1 → mathai-0.5.2}/PKG-INFO +1 -1
- {mathai-0.5.1 → mathai-0.5.2}/mathai/__init__.py +2 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/factor.py +2 -1
- mathai-0.5.2/mathai/matrix.py +22 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/simplify.py +6 -1
- {mathai-0.5.1 → mathai-0.5.2}/mathai/univariate_inequality.py +9 -1
- {mathai-0.5.1 → mathai-0.5.2}/mathai.egg-info/PKG-INFO +1 -1
- {mathai-0.5.1 → mathai-0.5.2}/mathai.egg-info/SOURCES.txt +1 -0
- {mathai-0.5.1 → mathai-0.5.2}/setup.py +1 -1
- {mathai-0.5.1 → mathai-0.5.2}/README.md +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/apart.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/base.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/bivariate_inequality.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/console.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/diff.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/expand.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/fraction.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/integrate.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/inverse.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/limit.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/linear.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/logic.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/ode.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/parser.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/printeq.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/structure.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/tool.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai/trig.py +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai.egg-info/dependency_links.txt +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai.egg-info/requires.txt +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/mathai.egg-info/top_level.txt +0 -0
- {mathai-0.5.1 → mathai-0.5.2}/setup.cfg +0 -0
|
@@ -171,7 +171,8 @@ def factor_quar_formula_init():
|
|
|
171
171
|
formula_gen9 = factor_quar_formula_init()
|
|
172
172
|
def factor_helper(equation, complexnum, power=2):
|
|
173
173
|
global formula_gen9
|
|
174
|
-
|
|
174
|
+
if equation.name in ["f_or", "f_and", "f_not", "f_eq", "f_gt", "f_lt", "f_ge", "f_le"]:
|
|
175
|
+
return TreeNode(equation.name, [factor_helper(child, complexnum, power) for child in equation.children])
|
|
175
176
|
maxnum=1
|
|
176
177
|
alloclst = []
|
|
177
178
|
for i in range(0,26):
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
def uncommute(eq, inside=False):
|
|
2
|
+
if not inside and eq.name in ["f_add", "f_mul"]:
|
|
3
|
+
return TreeNode(eq.name[:2]+"w"+eq.name[2:], [uncommute(child) for child in eq.children])
|
|
4
|
+
return TreeNode(eq.name, [uncommute(child, True) if eq.name == "f_list" else uncommute(child, inside) for child in eq.children])
|
|
5
|
+
|
|
6
|
+
def matrix_solve(eq):
|
|
7
|
+
if eq.name == "f_wadd":
|
|
8
|
+
output = None
|
|
9
|
+
output2 = []
|
|
10
|
+
for child in eq.children:
|
|
11
|
+
if child.name == "f_list":
|
|
12
|
+
if output is None:
|
|
13
|
+
output = []
|
|
14
|
+
for i in range(len(child.children)):
|
|
15
|
+
output.append([child.children[i]])
|
|
16
|
+
else:
|
|
17
|
+
for i in range(len(child.children)):
|
|
18
|
+
output[i] += [child.children[i]]
|
|
19
|
+
output.append(child)
|
|
20
|
+
else:
|
|
21
|
+
output2.append(child)
|
|
22
|
+
output = [summation(item) for item in output]
|
|
@@ -159,7 +159,12 @@ def clear_div(eq, denom=False):
|
|
|
159
159
|
if len(lst3) % 2 == 1:
|
|
160
160
|
sign = False
|
|
161
161
|
if denom:
|
|
162
|
-
|
|
162
|
+
eq2 = [item for item in lst if "v_" not in str_form(item)]
|
|
163
|
+
eq3 = [item for item in lst if "v_" in str_form(item)]
|
|
164
|
+
if eq3 == []:
|
|
165
|
+
return solve(product(eq2)),True
|
|
166
|
+
return solve(product(eq3)),sign
|
|
167
|
+
#return eq if sign else -eq, sign
|
|
163
168
|
lst = [item for item in lst if not(item.name == "f_pow" and frac(item.children[1]) is not None and frac(item.children[1]) == -1)]
|
|
164
169
|
|
|
165
170
|
lst2 = [item for item in lst if "v_" in str_form(item)]
|
|
@@ -361,7 +361,9 @@ def absolute(equation):
|
|
|
361
361
|
equation = TreeNode("f_or", out2)
|
|
362
362
|
return equation
|
|
363
363
|
def handle_sqrt(eq):
|
|
364
|
+
d= []
|
|
364
365
|
def helper2(eq):
|
|
366
|
+
nonlocal d
|
|
365
367
|
if eq.name in ["f_lt", "f_gt", "f_le", "f_ge","f_eq"]:
|
|
366
368
|
out = []
|
|
367
369
|
def helper(eq):
|
|
@@ -378,11 +380,17 @@ def handle_sqrt(eq):
|
|
|
378
380
|
eq2, sgn = inverse(simplify(eq.children[0]), str_form(item), True)
|
|
379
381
|
if sgn == False:
|
|
380
382
|
n = tree_form("d_-1")
|
|
383
|
+
d.append(TreeNode("f_ge", [eq2,tree_form("d_0")]))
|
|
384
|
+
#d.append(TreeNode("f_ge", [item.children[0],tree_form("d_0")]))
|
|
381
385
|
eq3 = simplify(expand(simplify(eq2**2)))
|
|
382
386
|
|
|
383
387
|
return simplify(TreeNode(eq.name, [simplify(n*item.children[0]-eq3*n), tree_form("d_0")]))
|
|
388
|
+
|
|
384
389
|
return TreeNode(eq.name, [helper2(child) for child in eq.children])
|
|
385
|
-
|
|
390
|
+
out = helper2(eq)
|
|
391
|
+
if len(d) == 0:
|
|
392
|
+
return out
|
|
393
|
+
return TreeNode("f_and", [helper2(eq)]+d)
|
|
386
394
|
def domain(eq):
|
|
387
395
|
eq = solve(eq, True)
|
|
388
396
|
out = []
|
|
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
|