Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
951bf82b
Commit
951bf82b
authored
Jun 27, 2021
by
Miroslav Kratochvil
Browse files
make the symbolics translation a bit more comprehensive
parent
6c2df2d6
Changes
1
Show whitespace changes
Inline
Side-by-side
src/symbolics.jl
View file @
951bf82b
...
@@ -11,21 +11,10 @@ unambiguously represented in Julia; it is supposed to be extended by the user
...
@@ -11,21 +11,10 @@ unambiguously represented in Julia; it is supposed to be extended by the user
if more functions need to be supported.
if more functions need to be supported.
"""
"""
const
default_symbolics_mapping
=
Dict
{
String
,
Any
}(
const
default_symbolics_mapping
=
Dict
{
String
,
Any
}(
"*"
=>
:*
,
"+"
=>
:+
,
"+"
=>
:+
,
"-"
=>
:-
,
"-"
=>
:-
,
"*"
=>
:*
,
"/"
=>
:/
,
"/"
=>
:/
,
"power"
=>
:^
,
"lt"
=>
:<
,
"leq"
=>
:<=
,
"geq"
=>
:>=
,
"gt"
=>
:>
,
"ceiling"
=>
:
ceil
,
"floor"
=>
:
floor
,
"piecewise"
=>
:
(
Core
.
ifelse
),
"ln"
=>
:
log
,
"exp"
=>
:
exp
,
"abs"
=>
:
abs
,
"abs"
=>
:
abs
,
"arccos"
=>
:
acos
,
"arccos"
=>
:
acos
,
"arccosh"
=>
:
acosh
,
"arccosh"
=>
:
acosh
,
...
@@ -39,6 +28,7 @@ const default_symbolics_mapping = Dict{String,Any}(
...
@@ -39,6 +28,7 @@ const default_symbolics_mapping = Dict{String,Any}(
"arcsinh"
=>
:
asinh
,
"arcsinh"
=>
:
asinh
,
"arctan"
=>
:
atan
,
"arctan"
=>
:
atan
,
"arctanh"
=>
:
atanh
,
"arctanh"
=>
:
atanh
,
"ceiling"
=>
:
ceil
,
"cos"
=>
:
cos
,
"cos"
=>
:
cos
,
"cosh"
=>
:
cosh
,
"cosh"
=>
:
cosh
,
"cot"
=>
:
cot
,
"cot"
=>
:
cot
,
...
@@ -46,17 +36,32 @@ const default_symbolics_mapping = Dict{String,Any}(
...
@@ -46,17 +36,32 @@ const default_symbolics_mapping = Dict{String,Any}(
"csc"
=>
:
csc
,
"csc"
=>
:
csc
,
"csch"
=>
:
csch
,
"csch"
=>
:
csch
,
"eq"
=>
:
isequal
,
"eq"
=>
:
isequal
,
"exp"
=>
:
exp
,
"factorial"
=>
:
factorial
,
"factorial"
=>
:
factorial
,
# "log" => :log, # fix
"floor"
=>
:
floor
,
# "root" => ,
"geq"
=>
:>=
,
"sec"
=>
:
sec
,
"gt"
=>
:>
,
"leq"
=>
:<=
,
"ln"
=>
:
log
,
"log"
=>
:
sbmlLog
,
"lt"
=>
:<
,
"piecewise"
=>
:
(
Core
.
ifelse
),
"power"
=>
:^
,
"root"
=>
:
sbmlRoot
,
"sech"
=>
:
sech
,
"sech"
=>
:
sech
,
"s
in
"
=>
:
s
in
,
"s
ec
"
=>
:
s
ec
,
"sinh"
=>
:
sinh
,
"sinh"
=>
:
sinh
,
"
ta
n"
=>
:
ta
n
,
"
si
n"
=>
:
si
n
,
"tanh"
=>
:
tanh
,
"tanh"
=>
:
tanh
,
"tan"
=>
:
tan
,
)
)
sbmlLog
(
x
)
=
log
(
x
,
10
)
sbmlLog
(
base
,
x
)
=
log
(
x
,
base
)
sbmlRoot
(
x
)
=
sqrt
(
x
)
sbmlRoot
(
power
,
x
)
=
x
^
(
1
/
power
)
allowed_sym
(
x
,
allowed_funs
)
=
allowed_sym
(
x
,
allowed_funs
)
=
haskey
(
allowed_funs
,
x
)
?
allowed_funs
[
x
]
:
haskey
(
allowed_funs
,
x
)
?
allowed_funs
[
x
]
:
throw
(
DomainError
(
x
,
"Unknown SBML function"
))
throw
(
DomainError
(
x
,
"Unknown SBML function"
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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