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
70eeb83e
Commit
70eeb83e
authored
Mar 14, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added overwrite fucntion for derivative line generation.
parent
20c54e4e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
external/graph_drawing
external/graph_drawing
+1
-1
src/node.py
src/node.py
+9
-0
tests/test_node.py
tests/test_node.py
+4
-0
No files found.
graph_drawing
@
775db0cb
Subproject commit
c0a73ab43d1ef2ffdb1f1177afb006a983978150
Subproject commit
775db0cb2ceeb6e795db7303bf1c747ae2bd53c5
src/node.py
View file @
70eeb83e
...
...
@@ -239,6 +239,15 @@ class ExpressionNode(Node, ExpressionBase):
self
.
type
=
TYPE_OPERATOR
self
.
op
=
OP_MAP
[
args
[
0
]]
def
construct_function
(
self
,
children
):
if
self
.
op
==
OP_DERIV
:
f
=
children
[
0
]
if
len
(
children
)
<
2
:
return
'['
+
f
+
']
\
'
'
return
'd/d'
+
children
[
1
]
+
' ('
+
f
+
')'
def
__str__
(
self
):
# pragma: nocover
return
generate_line
(
self
)
...
...
tests/test_node.py
View file @
70eeb83e
...
...
@@ -218,3 +218,7 @@ class TestNode(RulesTestCase):
self
.
assertFalse
(
bc
.
contains
(
a
))
self
.
assertTrue
(
ln0
.
contains
(
a
))
self
.
assertFalse
(
ln1
.
contains
(
a
))
def
test_construct_function
(
self
):
self
.
assertEqual
(
str
(
tree
(
'der(x ^ 2)'
)),
'[x ^ 2]
\
'
'
)
self
.
assertEqual
(
str
(
tree
(
'der(x ^ 2, x)'
)),
'd/dx (x ^ 2)'
)
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