Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 092daf6

Browse files
Willi BraunOpenModelica-Hudson
authored andcommitted
[Backend] Fix coloring of sparse matrix
Belonging to [master]: - #2206
1 parent b44f0a7 commit 092daf6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Compiler/BackEnd/SymbolicJacobian.mo

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ algorithm
11481148
list<tuple<Integer, list<Integer>>> sparseGraph, sparseGraphT;
11491149
array<tuple<Integer, list<Integer>>> arraysparseGraph;
11501150

1151-
Integer sizeN, adjSize, adjSizeT;
1151+
Integer sizeN, sizeM, adjSize, adjSizeT;
11521152
Integer nonZeroElements, maxColor;
11531153
list<Integer> nodesList, nodesEqnsIndex;
11541154
list<list<Integer>> sparsepattern,sparsepatternT, coloredlist;
@@ -1186,6 +1186,7 @@ algorithm
11861186
// create jacobian vars
11871187
jacDiffVars := list(BackendVariable.createpDerVar(v) for v in independentVars);
11881188
sizeN := arrayLength(inDepCompRefs);
1189+
sizeM := arrayLength(depCompRefs);
11891190

11901191
// generate adjacency matrix including diff vars
11911192
(syst1 as BackendDAE.EQSYSTEM(orderedVars=varswithDiffs,orderedEqs=orderedEqns)) := BackendDAEUtil.addVarsToEqSystem(syst,jacDiffVars);
@@ -1268,7 +1269,7 @@ algorithm
12681269
if debug then execStat("generateSparsePattern -> coloring start "); end if;
12691270
if not Flags.isSet(Flags.DISABLE_COLORING) then
12701271
// get coloring based on sparse pattern
1271-
coloredArray := createColoring(sparseArray, sparseArrayT, sizeN, adjSize);
1272+
coloredArray := createColoring(sparseArray, sparseArrayT, sizeN, sizeM);
12721273
coloring := list(list(arrayGet(inDepCompRefs, i) for i in lst) for lst in coloredArray);
12731274
else
12741275
//without coloring

0 commit comments

Comments
 (0)