repo.or.cz
/
sympyx.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
little refactoring
[sympyx.git]
/
q.py
blob
7c0f3d5da3657b857a102ecc4c9a96d2c0854fa7
1
from
csympy
import
HashTable
2
from
sympy
import
*
3
4
x
=
Symbol
(
"x"
)
5
y
=
Symbol
(
"y"
)
6
z
=
Symbol
(
"z"
)
7
a
=
Symbol
(
"x"
)
8
9
#h = HashTable()
10
#h[x+1] = 3
11
#h.insert(x, 3)
12
#h.insert(3, x**2)
13
#print h[x+1]
14
#print x+2 in h
15
#
16
#print ( x*(x+y)**2 + z*(x+y)**2 ).expand()
17
#print ( (x+z)*(x+y)**2 ).expand()
18
19
#print x*y+x+y+x**2 == y*x + x + y + x**2
20
e1
=
1
+
z
+
x
+
y
*
x
+
5
21
e2
=
1
+
x
*
y
+
5
+
x
+
z
22
f
=
e1
.
args
23
g
=
e2
.
args
24
print
f
25
print
g
26
print
set
(
f
) ==
set
(
g
)
27
d
= {}
28
d
[
e1
] =
1
29
print
e1
in
d
30
print
e2
in
d
31
32
e1
=
2
*
z
*
x
*
x
**
y
*
5
33
e2
=
2
*
x
**
y
*
5
*
x
*
z
34
35
print
e1
36
print
e2