Skip to content

Commit

Permalink
- get rid of bootstrapping warnings
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12384 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Jul 31, 2012
1 parent 59eac3b commit 0f1e199
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions Compiler/BackEnd/IndexReduction.mo
Expand Up @@ -432,8 +432,8 @@ algorithm
(orgEqnsLst,_) = traverseOrgEqnsExp(inOrgEqnsLst,(cr,exp1,exp2),replaceAliasStateExp,{});
e1 = inAss1[i];
b = intGt(e1,0);
ass1 = Debug.bcallret3(b,arrayUpdate,inAss1,i,-1,inAss1);
ass2 = Debug.bcallret3(b,arrayUpdate,inAss2,e1,-1,inAss2);
ass1 = consArrayUpdate(b, inAss1,i,-1);
ass2 = consArrayUpdate(b, inAss2,e1,-1);
syst = BackendDAE.EQSYSTEM(v1,eqns_1,SOME(m),SOME(mt),matching);
changedEqns = List.unique(List.map1r(changedEqns,arrayGet,imapIncRowEqn));
(syst,mapEqnIncRow,mapIncRowEqn) = BackendDAEUtil.updateIncidenceMatrixScalar(syst, shared,BackendDAE.SOLVABLE(), changedEqns, imapEqnIncRow, imapIncRowEqn);
Expand Down Expand Up @@ -2346,14 +2346,30 @@ algorithm
(_,i::_) = BackendVariable.getVarDAE(cr,isyst);
(_,syst,shared,changedeqns) = BackendDAETransform.makeDummyState(cr,i,isyst,ishared,mapIncRowEqn);
e = inAss1[i];
_ = Debug.bcallret3(intGt(e,0), arrayUpdate, inAss1, e, -1, inAss1);
_ = Debug.bcallret3(intGt(i,0), arrayUpdate, inAss2, i, -1, inAss2);
_ = consArrayUpdate(intGt(e,0), inAss1, e, -1);
_ = consArrayUpdate(intGt(i,0), inAss2, i, -1);
(syst,shared,changedeqns) = addDummyStates(rest,syst,shared,inAss1,inAss2,mapIncRowEqn,listAppend(ichangedeqns,changedeqns));
then
(syst,shared,changedeqns);
end match;
end addDummyStates;

protected function consArrayUpdate
input Boolean cond;
input array<Type_a> arr;
input Integer index;
input Type_a newValue;
output array<Type_a> oarr;
replaceable type Type_a subtypeof Any;
algorithm
oarr := match(cond,arr,index,newValue)
case(true,_,_,_)
then
arrayUpdate(arr,index,newValue);
case(false,_,_,_) then arr;
end match;
end consArrayUpdate;

/*****************************************
calculation of the determinant of a square matrix .
*****************************************/
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/Matching.mo
Expand Up @@ -5553,7 +5553,7 @@ algorithm
equation
eqn_str = "";
var_str = "";
source = BackendEquation.markedEquationSource(isyst, listGet({},1));
source = DAE.emptyElementSource;
info = DAEUtil.getElementSourceFileInfo(source);
Error.addSourceMessage(Error.STRUCT_SINGULAR_SYSTEM, {eqn_str,var_str}, info);
then
Expand Down

0 comments on commit 0f1e199

Please sign in to comment.