| 1315 | } |
| 1316 | |
| 1317 | void EinsumCoefficientFunction::NonZeroPattern( |
| 1318 | const class ProxyUserData &ud, |
| 1319 | FlatVector<AutoDiffDiff<1, NonZero>> values) const |
| 1320 | { |
| 1321 | if (node) |
| 1322 | { |
| 1323 | node->NonZeroPattern(ud, values); |
| 1324 | return; |
| 1325 | } |
| 1326 | |
| 1327 | Array<Vector<AutoDiffDiff<1, NonZero>>> vecs(cfs.Size()); |
| 1328 | for (int i: Range(cfs)) { |
| 1329 | vecs[i].SetSize(cfs[i]->Dimension()); |
| 1330 | cfs[i]->NonZeroPattern(ud, vecs[i]); |
| 1331 | } |
| 1332 | |
| 1333 | values = NonZero(false); |
| 1334 | const auto cres = cfs.Size(); |
| 1335 | for (size_t I: Range(index_maps.Height())) { |
| 1336 | if (!nz_all(I)) |
| 1337 | continue; |
| 1338 | const auto& I_map = index_maps.Row(I); |
| 1339 | AutoDiffDiff<1, NonZero> tmp(true); |
| 1340 | for (size_t i: Range(vecs)) |
| 1341 | tmp *= vecs[i](I_map(i)); |
| 1342 | values(I_map(cres)) += tmp; |
| 1343 | } |
| 1344 | } |
| 1345 | |
| 1346 | void EinsumCoefficientFunction::NonZeroPattern( |
| 1347 | const class ProxyUserData &ud, |
no test coverage detected