Skip to content

Commit

Permalink
- added experimental functions to manipulate systems of equations (wo…
Browse files Browse the repository at this point in the history
…rk in progress)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22443 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Sep 26, 2014
1 parent ccd5f2f commit 4f8d431
Show file tree
Hide file tree
Showing 4 changed files with 516 additions and 3 deletions.
17 changes: 17 additions & 0 deletions Compiler/BackEnd/BackendEquation.mo
Expand Up @@ -1226,6 +1226,23 @@ algorithm
outEquationArray := BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, newEquOptArr);
end setAtIndex;

public function setAtIndexFirst "author: waurich
Sets the n-th array element of an EquationArray but with index at first argument.
Please note: one-based indexing"
input Integer inPos "one-based indexing";
input BackendDAE.Equation inEquation;
input BackendDAE.EquationArray inEquationArray;
output BackendDAE.EquationArray outEquationArray;
protected
array<Option<BackendDAE.Equation>> equOptArr, newEquOptArr;
Integer size, numberOfElement, arrSize;
algorithm
BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, equOptArr) := inEquationArray;
size := size -equationOptSize(equOptArr[inPos]) +equationSize(inEquation);
newEquOptArr := arrayUpdate(equOptArr, inPos, SOME(inEquation));
outEquationArray := BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, newEquOptArr);
end setAtIndexFirst;

public function getEqns "author: Frenkel TUD 2011-05
returns the equations given by the list of indexes"
input list<Integer> inIndices "one-based indexing";
Expand Down
4 changes: 2 additions & 2 deletions Compiler/BackEnd/ResolveLoops.mo
Expand Up @@ -316,7 +316,7 @@ algorithm
eqLst := Util.if_(isSimple,eq::eqLst,eqLst);
end getSimpleEquations;

protected function resolveLoops_findLoops "author:Waurich TUD 2014-02
public function resolveLoops_findLoops "author:Waurich TUD 2014-02
gets the crossNodes for the partitions and searches for loops"
input list<list<Integer>> partitionsIn;
input BackendDAE.IncidenceMatrix mIn; // the whole system of simpleEquations
Expand Down Expand Up @@ -897,7 +897,7 @@ algorithm
end matchcontinue;
end resolveClosedLoop2;

protected function sortLoop "author:Waurich TUD 2014-01
public function sortLoop "author:Waurich TUD 2014-01
sorts the equations in a loop so that they are solved in a row."
input list<Integer> loopIn;
input BackendDAE.IncidenceMatrix m;
Expand Down

0 comments on commit 4f8d431

Please sign in to comment.