added first (wrong) attempt at implementing the interpretation. Added input explanation to the readme for a better understanding
Some checks failed
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, 1.10) (push) Has been cancelled
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, 1.6) (push) Has been cancelled
CI / Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} (x64, ubuntu-latest, pre) (push) Has been cancelled

This commit is contained in:
Daniel 2024-07-24 14:42:26 +02:00
parent c871487a55
commit 6b7a4b4bca
5 changed files with 558 additions and 10 deletions

View File

@ -1,2 +1,15 @@
# master-thesis
Input:
- Vector of Expressions ```expressions::Vector{Expr}```
- Matrix for the variables of the expression (x1..xn) ```variables::Matrix{Float64}```
- Vector of Vectors for the parameters of the expression (p1..pn) ```parameters::Vector{Vector{Float64}}```
All expressions have to have the same number of variables. They do not need to appear in the same spot, they only need to be labled x1 through xn. However, they can have a different number of parameters. These can also appear at any given point and must be labled p1 through pn.
The Matrix has to be in a form, where each column corresponds to a variable. So the i-th column corresponds to the variable xi. Each row is another set of variables to use for an expression. For each expression, every row is used to calculate a result.
Every inner vector of the parameters corresponds to an expression. So the i-th inner vector stores the parameter values for the i-th expression. Parameter pi corresponds to the value stored at index i of the inner vector.
The figure below demonstrates how the input data is structured and how they work together. Note that all x1..xn and p1..pn are the markers for the variables and parameters used in the expressions and can have an arbitrary value. Not every p1 needs to have the same value and not every x1 needs to have the ame value.
![Explanation of the input data](images/input-explanation.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

View File

@ -0,0 +1,504 @@
<mxfile host="app.diagrams.net" modified="2024-07-24T12:37:01.199Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0" etag="LhDBOwM3VCB9XBT4hWlF" version="24.5.4" type="device">
<diagram name="Page-1" id="gpsZjoig8lt5hVv5Hzwz">
<mxGraphModel dx="1604" dy="920" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-13" value="" style="group" vertex="1" connectable="0" parent="1">
<mxGeometry x="520" y="360" width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="9Xn2HrUYLFHSwPnNgvM3-13">
<mxGeometry width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-2" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-13" source="9Xn2HrUYLFHSwPnNgvM3-1" target="9Xn2HrUYLFHSwPnNgvM3-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="40" y="60" as="sourcePoint" />
<mxPoint x="90" y="10" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-3" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-13">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="80" y="40" as="sourcePoint" />
<mxPoint x="80" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-4" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-13">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="119.89999999999998" y="40" as="sourcePoint" />
<mxPoint x="119.89999999999998" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-5" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-13">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="40" as="sourcePoint" />
<mxPoint x="160" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-6" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-13">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="200" y="40" as="sourcePoint" />
<mxPoint x="200" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-14" value="" style="group" vertex="1" connectable="0" parent="1">
<mxGeometry x="880" y="360" width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-7" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="9Xn2HrUYLFHSwPnNgvM3-14">
<mxGeometry width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-8" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" source="9Xn2HrUYLFHSwPnNgvM3-7" target="9Xn2HrUYLFHSwPnNgvM3-7" parent="9Xn2HrUYLFHSwPnNgvM3-14">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="40" y="60" as="sourcePoint" />
<mxPoint x="90" y="10" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-9" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-14">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="80" y="40" as="sourcePoint" />
<mxPoint x="80" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-10" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-14">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="119.89999999999998" y="40" as="sourcePoint" />
<mxPoint x="119.89999999999998" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-11" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-14">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="40" as="sourcePoint" />
<mxPoint x="160" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-12" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="9Xn2HrUYLFHSwPnNgvM3-14">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="200" y="40" as="sourcePoint" />
<mxPoint x="200" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-37" value="" style="rounded=0;whiteSpace=wrap;html=1;rotation=90;" vertex="1" parent="1">
<mxGeometry x="920" y="520" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-39" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1000" y="520" as="sourcePoint" />
<mxPoint x="1040" y="520" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-40" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1000" y="560" as="sourcePoint" />
<mxPoint x="1040" y="560" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-41" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1000" y="600" as="sourcePoint" />
<mxPoint x="1040" y="600" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-57" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1000" y="480" as="sourcePoint" />
<mxPoint x="1040" y="480" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-23" value="" style="rounded=0;whiteSpace=wrap;html=1;rotation=90;" vertex="1" parent="1">
<mxGeometry x="820" y="540" width="240" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-25" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="920" y="520" as="sourcePoint" />
<mxPoint x="960" y="520" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-26" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="920" y="560" as="sourcePoint" />
<mxPoint x="960" y="560" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-27" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="920" y="600" as="sourcePoint" />
<mxPoint x="960" y="600" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-28" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="920" y="640" as="sourcePoint" />
<mxPoint x="960" y="640" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-16" value="" style="rounded=0;whiteSpace=wrap;html=1;rotation=90;" vertex="1" parent="1">
<mxGeometry x="820" y="500" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-18" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="880" y="520" as="sourcePoint" />
<mxPoint x="920" y="520" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-19" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="880" y="560" as="sourcePoint" />
<mxPoint x="920" y="560" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-20" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="880" y="600" as="sourcePoint" />
<mxPoint x="920" y="600" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-30" value="" style="rounded=0;whiteSpace=wrap;html=1;rotation=90;" vertex="1" parent="1">
<mxGeometry x="940" y="460" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-32" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="960" y="520" as="sourcePoint" />
<mxPoint x="1000" y="520" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-44" value="" style="rounded=0;whiteSpace=wrap;html=1;rotation=90;" vertex="1" parent="1">
<mxGeometry x="1040" y="440" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-51" value="" style="rounded=0;whiteSpace=wrap;html=1;rotation=90;" vertex="1" parent="1">
<mxGeometry x="1040" y="480" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-53" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1080" y="520" as="sourcePoint" />
<mxPoint x="1120" y="520" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-58" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="880" y="480" as="sourcePoint" />
<mxPoint x="920" y="480" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-59" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="920" y="480" as="sourcePoint" />
<mxPoint x="960" y="480" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-60" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="960" y="480" as="sourcePoint" />
<mxPoint x="1000" y="480" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-61" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1040" y="480" as="sourcePoint" />
<mxPoint x="1080" y="480" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-62" value="" style="endArrow=none;html=1;rounded=0;exitX=0.167;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.167;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1080" y="480" as="sourcePoint" />
<mxPoint x="1120" y="480" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-64" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="899.83" y="400" as="sourcePoint" />
<mxPoint x="899.83" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-65" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="939.6700000000001" y="400" as="sourcePoint" />
<mxPoint x="939.6700000000001" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-66" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="979.83" y="400" as="sourcePoint" />
<mxPoint x="979.83" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-67" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1019.6700000000001" y="400" as="sourcePoint" />
<mxPoint x="1019.6700000000001" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-68" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1059.8300000000002" y="400" as="sourcePoint" />
<mxPoint x="1059.8300000000002" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-69" value="" style="endArrow=classic;html=1;rounded=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="1099.8300000000002" y="400" as="sourcePoint" />
<mxPoint x="1099.8300000000002" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-70" value="Parameters" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="810" y="370" width="70" height="20" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-71" value="Variable Matrix" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="450" y="520" width="70" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-79" value="p1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="880" y="440" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-80" value="p2" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="880" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-81" value="p3" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="880" y="520" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-82" value="p4" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="880" y="560" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-83" value="p1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="920" y="440" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-84" value="p2" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="920" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-85" value="p3" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="920" y="520" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-86" value="p4" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="920" y="560" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-87" value="&lt;div&gt;p5&lt;/div&gt;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="920" y="600" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-88" value="p6" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="920" y="640" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-89" value="p1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="960" y="440" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-90" value="p2" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="960" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-91" value="p1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1000" y="440" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-92" value="p2" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1000" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-93" value="p3" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1000" y="520" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-94" value="p4" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1000" y="560" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-95" value="&lt;div&gt;p5&lt;/div&gt;" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1000" y="600" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-96" value="p1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1040" y="440" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-97" value="p1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1080" y="440" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-98" value="p2" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1080" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-99" value="p3" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="1080" y="520" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-100" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="9Xn2HrUYLFHSwPnNgvM3-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="540" y="321" as="sourcePoint" />
<mxPoint x="900" y="360" as="targetPoint" />
<Array as="points">
<mxPoint x="540" y="340" />
<mxPoint x="900" y="340" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-101" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="580" y="360" as="sourcePoint" />
<mxPoint x="940" y="360" as="targetPoint" />
<Array as="points">
<mxPoint x="580" y="330" />
<mxPoint x="940" y="330" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-102" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="620" y="360" as="sourcePoint" />
<mxPoint x="980" y="360" as="targetPoint" />
<Array as="points">
<mxPoint x="620" y="320" />
<mxPoint x="980" y="320" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-103" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="660" y="360" as="sourcePoint" />
<mxPoint x="1020" y="360" as="targetPoint" />
<Array as="points">
<mxPoint x="660" y="310" />
<mxPoint x="1020" y="310" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-104" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="700" y="360" as="sourcePoint" />
<mxPoint x="1060" y="360" as="targetPoint" />
<Array as="points">
<mxPoint x="700" y="300" />
<mxPoint x="1060" y="300" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-105" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="740" y="360" as="sourcePoint" />
<mxPoint x="1100" y="360" as="targetPoint" />
<Array as="points">
<mxPoint x="740" y="290" />
<mxPoint x="1100" y="290" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-107" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="520" y="480" width="160" height="120" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-109" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="520" y="520" as="sourcePoint" />
<mxPoint x="680" y="520" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-110" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="639.66" y="480" as="sourcePoint" />
<mxPoint x="639.66" y="599.31" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-111" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="560" y="480" as="sourcePoint" />
<mxPoint x="560" y="599.31" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-112" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="599.66" y="480.69" as="sourcePoint" />
<mxPoint x="599.66" y="600" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-114" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="520" y="560" as="sourcePoint" />
<mxPoint x="680" y="560" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-115" value="Expressions" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="450" y="370" width="70" height="20" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-116" value="x1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="520" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-117" value="x2" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="560" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-118" value="x3" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="600" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-119" value="x4" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="640" y="480" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-120" value="x1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="520" y="520" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-121" value="x2" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="560" y="520" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-122" value="x3" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="600" y="520" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-123" value="x4" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="640" y="520" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-124" value="x1" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="520" y="560" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-125" value="x2" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="560" y="560" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-126" value="x3" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="600" y="560" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-127" value="x4" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="640" y="560" width="40" height="40" as="geometry" />
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-140" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="9Xn2HrUYLFHSwPnNgvM3-1" target="9Xn2HrUYLFHSwPnNgvM3-119">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="540" y="440" as="sourcePoint" />
<mxPoint x="760" y="520" as="targetPoint" />
<Array as="points">
<mxPoint x="540" y="440" />
<mxPoint x="700" y="440" />
<mxPoint x="700" y="500" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-141" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="9Xn2HrUYLFHSwPnNgvM3-123">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="700" y="500" as="sourcePoint" />
<mxPoint x="760" y="520" as="targetPoint" />
<Array as="points">
<mxPoint x="700" y="540" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-142" value="" style="endArrow=classic;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="700" y="540" as="sourcePoint" />
<mxPoint x="680" y="580" as="targetPoint" />
<Array as="points">
<mxPoint x="700" y="580" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-144" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="580" y="440" as="sourcePoint" />
<mxPoint x="579.83" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-145" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="620" y="440" as="sourcePoint" />
<mxPoint x="619.83" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-146" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="660" y="440" as="sourcePoint" />
<mxPoint x="659.83" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-147" value="" style="endArrow=none;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="700" y="460" as="sourcePoint" />
<mxPoint x="700" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="9Xn2HrUYLFHSwPnNgvM3-149" value="" style="endArrow=none;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="700" y="440" as="sourcePoint" />
<mxPoint x="740" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View File

@ -13,12 +13,14 @@ export interpret
function interpret(expressions::Vector{ExpressionProcessing.PostfixType}, variables::Matrix{Float64}, parameters::Vector{Vector{Float64}})
# TODO:
# create CUDA array for calculation results
variableRows = size(variables, 1)
cudaVars = CuArray(variables)
cudaParams = create_cuda_array(parameters, NaN64)
cudaExprs = create_cuda_array(expressions, ExpressionElement(EMPTY, 0))
cudaParams = create_cuda_array(parameters, NaN64) # column corresponds to data for one expression
cudaExprs = create_cuda_array(expressions, ExpressionElement(EMPTY, 0)) # column corresponds to data for one expression
cudaStepsize = CuArray([get_max_inner_length(expressions), get_max_inner_length(parameters)]) # put into seperate cuArray, as this is static and would be inefficient to send seperatly to every kernel
println(cudaVars)
# Start kernel for each expression to ensure that no warp is working on different expressions
for i in eachindex(expressions)
kernel = @cuda launch=false interpret_expression(cudaExprs, cudaVars, cudaParams, cudaStepsize, i)
@ -31,16 +33,45 @@ function interpret(expressions::Vector{ExpressionProcessing.PostfixType}, variab
end
function interpret_expression(expressions::CuDeviceArray{ExpressionElement}, variables::CuDeviceArray{Float64}, parameters::CuDeviceArray{Float64}, stepsize::CuDeviceArray{Int}, exprIndex::Int)
firstExprIndex = (exprIndex - 1 * stepsize[1]) + 1 # Inclusive
lastExprIndex = firstExprIndex + stepsize[1] # Exclusive
firstParamIndex = (exprIndex - 1 * stepsize[2]) + 1 # Inclusive
# lastParamIndex = firstParamIndex + stepsize[2] # Exclusive (probably not needed)
firstExprIndex = ((exprIndex - 1) * stepsize[1]) + 1 # Inclusive
lastExprIndex = firstExprIndex + stepsize[1] - 1 # Inclusive
firstParamIndex = ((exprIndex - 1) * stepsize[2]) + 1 # Inclusive
# lastParamIndex = firstParamIndex + stepsize[2] - 1 # Inclusive (probably not needed)
for i in 1:5
@cuprintln(variables[i])
end
# Not the correct approach. Redo this to be more stack based.
for i in firstExprIndex:lastExprIndex
# TODO Implement interpreter
# - start at firstExprIndex and interpret until the first ExpressionElement is "Empty" or we reached lastExprIndex
if expressions[i].Type == EMPTY
break
elseif expressions[i].Type == INT64
# TODO: Load value from variables/parameters matrix and store for calculation
val = expressions[i].Value
if val > 0
# TODO: access variables
else
val = abs(val)
# TODO: access parameters
end
continue
elseif expressions[i].Type == FLOAT64
# TODO: store value as is for calculation
continue
elseif expressions[i].Type == OPERATOR
# TODO: Perform calculation of the two stored values according to the operator
continue
else
# TODO: handle this case. Should not happen but in case it does, it needs to do something
continue
end
end
# TODO: Store computed value in output matrix
return
end

View File

@ -6,13 +6,13 @@ expressions = Vector{Expr}(undef, 2)
variables = Matrix{Float64}(undef, 2,2)
parameters = Vector{Vector{Float64}}(undef, 2)
# Resulting value should be 10
# Resulting value should be 10 for the first expression
expressions[1] = :(x1 + 1 * x2 + p1)
expressions[2] = :(5 + x1 + 1 * x2 + p1 + p2)
variables[1,1] = 2.0
variables[1,2] = 3.0
variables[2,1] = 2.0
variables[2,2] = 3.0
variables[2,1] = 0.0
variables[2,2] = 5.0
parameters[1] = Vector{Float64}(undef, 1)
parameters[2] = Vector{Float64}(undef, 2)
parameters[1][1] = 5.0