Skip to content

Commit

Permalink
Correct indexing in semi-analytic solution calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Harries committed Jan 24, 2017
1 parent dd39dde commit 4cd1903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meta/SemiAnalytic.m
Expand Up @@ -1019,7 +1019,7 @@

If[numCols === 1,
body = "rhs(j) = data[j]->model.get_" <> parStr <> "();\n";,
body = MapIndexed[("rhs(j, " <> ToString[First[#2]] <> ") = data[j]->model.get_"
body = MapIndexed[("rhs(j, " <> ToString[First[#2-1]] <> ") = data[j]->model.get_"
<> parStr <> "(" <> Utils`StringJoinWithSeparator[ToString /@ #1, ", "]
<> ");\n")&, GetAllIndexCombinations[dims]];
body = StringJoin[body];
Expand All @@ -1040,7 +1040,7 @@
<> StringJoin[MapIndexed[(coeffs[[i]] <> "("
<> Utils`StringJoinWithSeparator[ToString /@ #1, ", "]
<> ") = solution(" <> ToString[i-1] <> ", "
<> ToString[First[#2]] <> ");\n")&,
<> ToString[First[#2-1]] <> ");\n")&,
GetAllIndexCombinations[dims]]];
];
];
Expand Down

0 comments on commit 4cd1903

Please sign in to comment.