Skip to content

Commit 7f2c81a

Browse files
committed
Fix AD parameter multiplexing
1 parent 7106e9f commit 7f2c81a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/libcadet/model/ParameterMultiplexing.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,7 @@ bool singleTypeMultiplexCompTypeSecParameterAD(const ParameterId& pId, StringHas
377377

378378
sensParams.insert(&data[valTypeOffset + pId.component]);
379379

380-
const int nSec = valTypeOffset > 0 ? valTypeOffset / parTypeIdx / nComp : data.size() / nComp;
381-
382-
for (unsigned int s = 0; s < nSec; ++s)
383-
data[valTypeOffset + s * nComp + pId.component].setADValue(adDirection, adValue);
380+
data[valTypeOffset + pId.component].setADValue(adDirection, adValue);
384381

385382
return true;
386383
}
@@ -543,10 +540,7 @@ bool singleTypeMultiplexBndCompTypeSecParameterAD(const ParameterId& pId, String
543540

544541
sensParams.insert(&data[valTypeOffset + boundOffset[pId.component] + pId.boundState]);
545542

546-
const int nSec = valTypeOffset > 0 ? valTypeOffset / parTypeIdx / nComp : data.size() / nComp;
547-
548-
for (unsigned int s = 0; s < nSec; ++s)
549-
data[valTypeOffset + s * strideBound + boundOffset[pId.component] + pId.boundState].setADValue(adDirection, adValue);
543+
data[valTypeOffset + boundOffset[pId.component] + pId.boundState].setADValue(adDirection, adValue);
550544

551545
return true;
552546
}

0 commit comments

Comments
 (0)