Skip to content

Commit

Permalink
added cases for getNumJacEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
vruge authored and OpenModelica-Hudson committed Mar 20, 2016
1 parent 473cb9c commit e022be4
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1913,18 +1913,24 @@ protected function getNumJacEntries
input BackendDAE.Jacobian inJac;
output Integer numEntries;
algorithm
numEntries := match(inJac)
numEntries := match inJac
local
list<tuple<Integer, Integer, BackendDAE.Equation>> jac;
case (BackendDAE.FULL_JACOBIAN(NONE()))
equation
then -1;
case (BackendDAE.FULL_JACOBIAN(SOME(jac)))
equation
list<BackendDAE.Var> vars1, vars2;
case BackendDAE.FULL_JACOBIAN(NONE())
then -1;
case BackendDAE.FULL_JACOBIAN(SOME(jac))
then listLength(jac);
/* TODO: implement for GENERIC_JACOBIAN */
case (_)
case BackendDAE.EMPTY_JACOBIAN()
then -1;
/* TODO: implement/check for GENERIC_JACOBIAN */
case BackendDAE.GENERIC_JACOBIAN(jacobian=(_,_,vars1,vars2,_))
guard
listLength(vars1) == listLength(vars2)
then listLength(vars1);
else
equation
//print(BackendDump.jacobianString(inJac));
print("another JAC\n");
then -1;
end match;
Expand Down

0 comments on commit e022be4

Please sign in to comment.