Skip to content

Commit

Permalink
- more cleanup
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24872 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Mar 3, 2015
1 parent b36365b commit ab6c8f4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 203 deletions.
34 changes: 0 additions & 34 deletions Compiler/BackEnd/ExpressionSolve.mo
Expand Up @@ -502,40 +502,6 @@ algorithm
end match;
end solveSimple;


protected function generateAssertZero
input DAE.Exp inExp1;
input DAE.Exp inExp2;
input DAE.Exp inExp3;
input DAE.Exp a;
input list<DAE.Statement> inAsserts;
output list<DAE.Statement> outAsserts;
algorithm
outAsserts := matchcontinue (inExp1,inExp2,inExp3,a,inAsserts)
local
DAE.Exp z;
DAE.Type tp;
String estr,se1,se2,se3,sa;
case (_,_,_,_,_)
equation
// zero check already done
true = Expression.isConst(a);
then
inAsserts;
else
equation
tp = Expression.typeof(a);
(z,_) = Expression.makeZeroExpression(Expression.arrayDimension(tp));
se1 = ExpressionDump.printExpStr(inExp2);
se2 = ExpressionDump.printExpStr(inExp1);
se3 = ExpressionDump.printExpStr(inExp3);
sa = ExpressionDump.printExpStr(a);
estr = stringAppendList({"Singular expression ",se1," = ",se2," because ",sa," is Zero! When solving for exp: ", se3, "."});
then
DAE.STMT_ASSERT(DAE.RELATION(a,DAE.NEQUAL(tp),z,-1,NONE()),DAE.SCONST(estr),DAE.ASSERTIONLEVEL_WARNING,DAE.emptyElementSource)::inAsserts;
end matchcontinue;
end generateAssertZero;

protected function generateAssertType
input DAE.Type tp;
input DAE.ComponentRef cr;
Expand Down
89 changes: 0 additions & 89 deletions Compiler/BackEnd/Matching.mo
Expand Up @@ -4427,72 +4427,6 @@ algorithm
end match;
end cheapmatchingalgorithm1;


protected function matchSingleVars
"function matchSingleVars, match all vars with one equation
author: Frenkel TUD 2012-04"
input Integer i;
input Integer nv;
input Integer ne;
input BackendDAE.IncidenceMatrix m "m[eqnindx] = list(varindx)";
input BackendDAE.IncidenceMatrixT mT "mT[varindx] = list(eqnindx)";
input array<Integer> ass1 "ass[eqnindx]=varindx";
input array<Integer> ass2 "ass[varindx]=eqnindx";
algorithm
_:=
matchcontinue (i,nv,ne,m,mT,ass1,ass2)
local
list<Integer> rows;
case (_,_,_,_,_,_,_)
equation
true=intGt(i,ne);
then
();
case (_,_,_,_,_,_,_)
equation
// search cheap matching
rows = List.select(m[i], Util.intPositive);
matchSingleVars1(rows,i,ass1,ass2);
matchSingleVars(i+1,nv,ne,m,mT,ass1,ass2);
then
();
case (_,_,_,_,_,_,_)
equation
matchSingleVars(i+1,nv,ne,m,mT,ass1,ass2);
then
();
else
equation
Error.addInternalError("function matchSingleVars failed in equation " + intString(i), sourceInfo());
then
fail();
end matchcontinue;
end matchSingleVars;

protected function matchSingleVars1
"function helper for matchSingleVars
author: Frenkel TUD 2012-03"
input list<Integer> rows;
input Integer c;
input array<Integer> ass1;
input array<Integer> ass2;
algorithm
_:=
match (rows,c,ass1,ass2)
local
list<Integer> rest;
Integer r;
case (r::{},_,_,_)
equation
// row is unmatched -> return
true = intLt(ass2[r],0);
arrayUpdate(ass1,c,r);
arrayUpdate(ass2,r,c);
then
();
end match;
end matchSingleVars1;

protected function cheapmatching
"function cheapmatching, traverses all colums and look for a cheap matching, a unmatch row
author: Frenkel TUD 2012-03"
Expand Down Expand Up @@ -5884,29 +5818,6 @@ algorithm
end matchcontinue;
end assignmentsArrayExpand;

protected function prune
"author: Frenkel TUD 2012-06
function to prune, mark as never again test, collums"
input list<Integer> inVisitedcolums;
input Integer ne;
input array<Integer> rowmarks;
input array<Integer> ass1;
algorithm
_:= match (inVisitedcolums,ne,rowmarks,ass1)
local
Integer c,r;
list<Integer> rest;
case ({},_,_,_) then ();
case (c::rest,_,_,_)
equation
r = ass1[c];
arrayUpdate(rowmarks,r,ne+1);
prune(rest,ne,rowmarks,ass1);
then
();
end match;
end prune;

protected function checkAssignment
"author: Frenkel TUD 2012-06
Check if the assignment is complet/maximum,
Expand Down
38 changes: 0 additions & 38 deletions Compiler/BackEnd/OnRelaxation.mo
Expand Up @@ -727,44 +727,6 @@ algorithm
end matchcontinue;
end generateCliquesResidual2;

protected function getTearingConstraints "author: Frenkel TUD 2012-07"
input list<Integer> inOrphans;
input array<Integer> ass1;
input array<list<Integer>> ass2;
input BackendDAE.IncidenceMatrix m;
input BackendDAE.IncidenceMatrixT mt;
input BackendDAE.Variables vars;
input list<Integer> iconstraints;
output list<Integer> oconstraints;
algorithm
oconstraints := matchcontinue(inOrphans,ass1,ass2,m,mt,vars,iconstraints)
local
list<Integer> rest,constraints,elst,rlst;
Integer o;
Boolean constr;
list<Boolean> blst;
list<BackendDAE.Var> vlst;
case ({},_,_,_,_,_,_)
then
iconstraints;
case (o::rest,_,_,_,_,_,_)
equation
elst = mt[o];
rlst = List.flatten(List.map1r(elst,arrayGet,ass2));
// check for partner
// BackendDump.debuglst((rlst,intString,", ","\n"));
vlst = List.map1r(rlst,BackendVariable.getVarAt,vars);
blst = List.map(vlst,BackendVariable.isFlowVar);
constr = Util.boolAndList(blst);
constraints = List.consOnTrue(constr, o, iconstraints);
then
getTearingConstraints(rest,ass1,ass2,m,mt,vars,constraints);
case (_::rest,_,_,_,_,_,_)
then
getTearingConstraints(rest,ass1,ass2,m,mt,vars,iconstraints);
end matchcontinue;
end getTearingConstraints;

protected function prepairOrphansOrder "author: Frenkel TUD 2012-07"
input list<Integer> inOrphans;
input array<Integer> ass1;
Expand Down
10 changes: 0 additions & 10 deletions Compiler/BackEnd/RemoveSimpleEquations.mo
Expand Up @@ -2054,16 +2054,6 @@ algorithm
end match;
end getAliasContinue;

protected function appendNextRow "author: Frenkel TUD 2012-12"
input Integer nr;
input Integer mark;
input array<SimpleContainer> simpleeqnsarr;
input list<Integer> iNext;
output list<Integer> oNext;
algorithm
oNext := List.consOnTrue(intNe(getVisited(simpleeqnsarr[nr]), mark), nr, iNext);
end appendNextRow;

protected function isVisited "author: Frenkel TUD 2012-12"
input Integer mark;
input SimpleContainer iS;
Expand Down
32 changes: 0 additions & 32 deletions Compiler/BackEnd/XMLDump.mo
Expand Up @@ -2527,38 +2527,6 @@ algorithm
end matchcontinue;
end dumpLstIntAttr;


protected function dumpLstStr "
function dumpLsTStr dumps a list
of String as a list of XML Element.
The method takes the String list as
input. The output is:

<ELEMENT>FirstStringOfList</ELEMENT>
..
<ELEMENT>LastStringOfList</ELEMENT>

"
input list<String> inLstStr;
algorithm
_:=
matchcontinue(inLstStr)
local
String h;
list<String> t;
case {} then ();
case {h}
equation
dumpStrTagContent(ELEMENT,h);
then ();
case (h :: t)
equation
dumpStrTagContent(ELEMENT,h);
dumpLstStr(t);
then();
end matchcontinue;
end dumpLstStr;

protected function dumpMatching
"author: Frenkel TUD 2011-05
prints the matching information on stdout."
Expand Down

0 comments on commit ab6c8f4

Please sign in to comment.