From e528fabbe4e841f5c4ea9d61d2e47c312a96f4f9 Mon Sep 17 00:00:00 2001 From: EvilSpirit Date: Thu, 23 Dec 2021 10:14:27 -0600 Subject: [PATCH] Add an early out in writing jacobian. Split from previous large 'Eigen library integration' commit. --- src/system.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/system.cpp b/src/system.cpp index c93b0a16..00f84c45 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -63,6 +63,8 @@ bool System::WriteJacobian(int tag) { if(j == paramToIndex.end()) continue; Expr *pd = f->PartialWrt(p); pd = pd->FoldConstants(); + if(pd->IsZeroConst()) + continue; mat.A.sym[i][j->second] = pd; } paramsUsed.Clear();