Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
a793a96a
Commit
a793a96a
authored
May 31, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uppercase variables are now put at the end of a polynome, and the start of a monomial.
parent
1e478565
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
src/rules/integrals.py
src/rules/integrals.py
+1
-1
src/rules/sort.py
src/rules/sort.py
+10
-0
No files found.
src/rules/integrals.py
View file @
a793a96a
...
@@ -21,7 +21,7 @@ def choose_constant(integral):
...
@@ -21,7 +21,7 @@ def choose_constant(integral):
i
+=
2
if
i
==
98
else
1
i
+=
2
if
i
==
98
else
1
c
=
chr
(
i
)
c
=
chr
(
i
)
return
L
(
c
)
return
L
(
c
.
upper
()
)
def
solve_integral
(
integral
,
F
):
def
solve_integral
(
integral
,
F
):
...
...
src/rules/sort.py
View file @
a793a96a
...
@@ -26,6 +26,10 @@ def get_power_prop(node):
...
@@ -26,6 +26,10 @@ def get_power_prop(node):
return
root
.
value
,
exp
return
root
.
value
,
exp
def
is_upper
(
character
):
return
'A'
<=
character
<=
'Z'
def
swap_mono
((
left
,
right
)):
def
swap_mono
((
left
,
right
)):
"""
"""
Check if a pair of left and right multiplication factors in a monomial
Check if a pair of left and right multiplication factors in a monomial
...
@@ -46,6 +50,9 @@ def swap_mono((left, right)):
...
@@ -46,6 +50,9 @@ def swap_mono((left, right)):
# Same variable, compare exponents
# Same variable, compare exponents
return
left_exp
>
right_exp
return
left_exp
>
right_exp
if
is_upper
(
left_var
)
!=
is_upper
(
right_var
):
return
is_upper
(
left_var
)
<
is_upper
(
right_var
)
# Compare variable names alphabetically
# Compare variable names alphabetically
return
left_var
>
right_var
return
left_var
>
right_var
...
@@ -99,6 +106,9 @@ def swap_poly((left, right)):
...
@@ -99,6 +106,9 @@ def swap_poly((left, right)):
# Same variable, compare exponents
# Same variable, compare exponents
return
left_exp
<
right_exp
return
left_exp
<
right_exp
if
is_upper
(
left_var
)
!=
is_upper
(
right_var
):
return
is_upper
(
left_var
)
>
is_upper
(
right_var
)
# Compare variable names alphabetically
# Compare variable names alphabetically
return
left_var
>
right_var
return
left_var
>
right_var
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment