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

Commit

Permalink
added cases for getNumJacEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
vruge committed Mar 20, 2016
1 parent 48b3784 commit 75fe4c7
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 @@ -1910,18 +1910,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 75fe4c7

Please sign in to comment.