Changeset 13998
- Timestamp:
- 2012-11-20T21:45:04+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/BackEnd/IndexReduction.mo
r13997 r13998 1427 1427 process all strong connected components of the system and collect the 1428 1428 derived equations for dummy state selection" 1429 input Integer varSize;1430 input Integer eqnsSize;1431 input BackendDAE.EqSystem subsyst;1432 input BackendDAE.AdjacencyMatrixEnhanced me;1433 input BackendDAE.AdjacencyMatrixTEnhanced meT;1434 input array<list<Integer>> mapEqnIncRow1;1435 input array<Integer> mapIncRowEqn1;1436 input BackendDAE.EqSystem i syst;1437 input BackendDAE.Shared i shared;1438 input array<Integer> vec2;1429 input Integer inVarSize; 1430 input Integer inEqnsSize; 1431 input BackendDAE.EqSystem inSubsyst; 1432 input BackendDAE.AdjacencyMatrixEnhanced inMe; 1433 input BackendDAE.AdjacencyMatrixTEnhanced inMeT; 1434 input array<list<Integer>> inMapEqnIncRow1; 1435 input array<Integer> inMapIncRowEqn1; 1436 input BackendDAE.EqSystem inIsyst; 1437 input BackendDAE.Shared inIshared; 1438 input array<Integer> inVec2; 1439 1439 input BackendDAE.StructurallySingularSystemHandlerArg inArg; 1440 input list<BackendDAE.Var> hov;1440 input list<BackendDAE.Var> inHov; 1441 1441 input list<DAE.ComponentRef> inDummyStates; 1442 1442 output list<BackendDAE.Var> outDummyVars; … … 1446 1446 algorithm 1447 1447 (outDummyVars,outDummyStates,osyst,oshared) := 1448 matchcontinue( varSize,eqnsSize,subsyst,me,meT,mapEqnIncRow1,mapIncRowEqn1,isyst,ishared,vec2,inArg,hov,inDummyStates)1448 matchcontinue(inVarSize,inEqnsSize,inSubsyst,inMe,inMeT,inMapEqnIncRow1,inMapIncRowEqn1,inIsyst,inIshared,inVec2,inArg,inHov,inDummyStates) 1449 1449 local 1450 1450 BackendDAE.StateOrder so; … … 1468 1468 list<Integer> unassigned,assigned; 1469 1469 list<BackendDAE.Var> vlst; 1470 1470 1471 case (_,_,BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),_,_,_,_,_,_,_,(so,orgEqnsLst,mapEqnIncRow,mapIncRowEqn,noofeqns),_,_) 1471 1472 equation 1472 m = incidenceMatrixfromEnhanced2( me,vars);1473 mT = BackendDAEUtil.transposeMatrix(m, varSize);1473 m = incidenceMatrixfromEnhanced2(inMe,vars); 1474 mT = BackendDAEUtil.transposeMatrix(m,inVarSize); 1474 1475 Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpEqSystem, BackendDAE.EQSYSTEM(vars,eqns,SOME(m),SOME(mT),BackendDAE.NO_MATCHING())); 1475 Matching.matchingExternalsetIncidenceMatrix( eqnsSize,varSize,mT);1476 BackendDAEEXT.matching( eqnsSize,varSize,3,-1,1.0,1);1477 vec1 = arrayCreate( eqnsSize,-1);1478 vec2 = arrayCreate( varSize,-1);1476 Matching.matchingExternalsetIncidenceMatrix(inEqnsSize,inVarSize,mT); 1477 BackendDAEEXT.matching(inEqnsSize,inVarSize,3,-1,1.0,1); 1478 vec1 = arrayCreate(inEqnsSize,-1); 1479 vec2 = arrayCreate(inVarSize,-1); 1479 1480 BackendDAEEXT.getAssignment(vec2,vec1); 1480 Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpMatching, vec1);1481 Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpMatching, vec2);1482 1483 (dstates,states) = checkAssignment(1, varSize,vec2,vars,{},{});1484 unassigned = Matching.getUnassigned( eqnsSize, vec1, {});1485 assigned = Matching.getAssigned( eqnsSize, vec1, {});1481 Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpMatching, vec1); 1482 Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpMatching, vec2); 1483 1484 (dstates,states) = checkAssignment(1,inVarSize,vec2,vars,{},{}); 1485 unassigned = Matching.getUnassigned(inEqnsSize, vec1, {}); 1486 assigned = Matching.getAssigned(inEqnsSize, vec1, {}); 1486 1487 1487 1488 Debug.fcall(Flags.BLT_DUMP, print, ("dummyStates:\n")); … … 1497 1498 dummyStates = List.map(vlst,BackendVariable.varCref); 1498 1499 dummyStates = listAppend(dummyStates,inDummyStates); 1499 // (hov1,dummystates,lov,syst,shared) = selectDummyDerivatives2(dstates,states,unassigned,assigned,vec1,vec2,me,meT,iMapEqnIncRow,iMapIncRowEqn,vars,varSize,eqns,eqnsSize,eqnindxlst,hov,inDummyStates,isyst,ishared,inLov); 1500 then 1501 (vlst,dummyStates,isyst,ishared); 1500 // (hov1,dummystates,lov,syst,shared) = selectDummyDerivatives2(dstates,states,unassigned,assigned,vec1,vec2,me,meT,iMapEqnIncRow,iMapIncRowEqn,vars,varSize,eqns,eqnsSize,eqnindxlst,hov,inDummyStates,isyst,ishared,inLov); 1501 then 1502 (vlst,dummyStates,inIsyst,inIshared); 1503 1502 1504 end matchcontinue; 1503 1505 end processComps3New;
Note: See TracChangeset
for help on using the changeset viewer.