Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
42bfd0a1
Commit
42bfd0a1
authored
Jan 26, 2021
by
Miroslav Kratochvil
Browse files
wrapper base
parent
f554869e
Changes
3
Hide whitespace changes
Inline
Side-by-side
libsbml-cxxwrapjl/src/readsbml.cpp
View file @
42bfd0a1
...
...
@@ -111,13 +111,13 @@ model_data read_sbml(const std::string& fn) {
}
void
define_readsbml
(
jlcxx
::
Module
&
mod
)
{
mod
.
add_type
<
species_info
>
(
"Species"
);
mod
.
add_type
<
unit_part
>
(
"UnitPart"
);
mod
.
add_type
<
stoi
>
(
"Stoichiometry"
);
mod
.
add_type
<
reaction
>
(
"Reaction"
).
constructor
();
mod
.
add_type
<
model_data
>
(
"Model"
);
mod
.
add_type
<
species_info
>
(
"Species
Cxx
"
);
mod
.
add_type
<
unit_part
>
(
"UnitPart
Cxx
"
);
mod
.
add_type
<
stoi
>
(
"Stoichiometry
Cxx
"
);
mod
.
add_type
<
reaction
>
(
"Reaction
Cxx
"
).
constructor
();
mod
.
add_type
<
model_data
>
(
"Model
Cxx
"
);
mod
.
method
(
"readSBML"
,
&
read_sbml
);
mod
.
method
(
"readSBML
_internal
"
,
&
read_sbml
);
#define access(t, n) mod.method(#n, [](const t& x) { return x.n; })
...
...
src/SBML.jl
View file @
42bfd0a1
module
SBML
include
(
"readsbml.jl"
)
using
CxxWrap
using
SBML_jll
@wrapmodule
(
libsbml
)
# version tools
export
getLibSBMLDependencyVersionOf
,
getLibSBMLDottedVersion
,
getLibSBMLVersion
,
getLibSBMLVersionString
,
isLibSBMLCompiledWith
export
getLibSBMLDottedVersion
,
readSBML
function
__init__
()
@initcxx
...
...
src/readsbml.jl
0 → 100644
View file @
42bfd0a1
struct
UnitPart
kind
::
String
exponent
::
Int
scale
::
Int
multiplier
::
Float64
UnitPart
(
k
,
e
,
s
,
m
)
=
new
(
k
,
e
,
s
,
m
)
end
struct
Reaction
stoichiometry
::
Dict
{
String
,
Float64
}
lb
::
Tuple
{
Float64
,
String
}
ub
::
Tuple
{
Float64
,
String
}
oc
::
Float64
Reaction
()
=
new
()
end
struct
Species
name
::
String
compartment
::
String
Species
(
n
,
c
)
=
new
(
n
,
c
)
end
struct
Model
units
::
Dict
{
String
,
Vector
{
UnitPart
}}
compartments
::
Vector
{
String
}
species
::
Dict
{
String
,
Species
}
reactions
::
Dict
{
String
,
Reaction
}
Model
()
=
new
()
end
function
readSMBL
(
fn
::
String
)
::
Model
mi
=
readSBML_internal
(
fn
)
if
length
(
errors
(
mi
))
@error
"Loading failed!"
errors
(
mi
)
end
m
=
Model
()
m
.
compartments
=
compartments
(
mi
)
return
m
end
function
getS
(
m
::
Model
)
::
Matrix
{
Float64
}
end
function
getLBs
(
m
::
Model
)
::
Vector
{
Tuple
{
Float64
,
String
}}
end
function
getUBs
(
m
::
Model
)
::
Vector
{
Tuple
{
Float64
,
String
}}
end
function
getOCs
(
m
::
Model
)
::
Vector
{
Float64
}
end
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