40 constexpr bool scalarA = EntryA::rows*EntryA::cols==1;
41 constexpr bool scalarB = EntryB::rows*EntryB::cols==1;
42 using Entry = std::conditional_t<scalarA,
44 std::conditional_t<scalarB,
47 static_assert(scalarA || scalarB || (int)EntryA::cols==(int)EntryB::rows,
48 "Entry size has to match");
59 std::mutex creatorMutex;
63 std::vector<IndexA> cidx, tmp, tmp2;
65 for (IndexA i=k*A.
N()/n; i<(k+1)*A.
N()/n; ++i)
70 for (
auto cai=rowA.begin(); cai!=rowA.end(); ++cai)
73 auto rowB = B[cai.index()];
74 for (
auto cbi=rowB.begin(); cbi!=rowB.end(); ++cbi)
75 tmp.push_back(cbi.index());
80 std::back_inserter(tmp2));
84 std::lock_guard<std::mutex> creatorLock(creatorMutex);
97 for (auto cai=rowA.begin(); cai!=rowA.end(); ++cai)
99 auto rowB = B[cai.index()];
100 for (auto cbi=rowB.begin(); cbi!=rowB.end(); ++cbi)
101 rowC[cbi.index()] += normalForm(*cai) * normalForm(*cbi);
void addElements(IterRow const fromRow, IterRow const toRow, IterCol const fromCol, IterCol const toCol, bool colIsSorted=false)
Enters entries into the sparsity pattern.