| 5103 | } |
| 5104 | |
| 5105 | shared_ptr<CoefficientFunction> DiffJacobi (const CoefficientFunction * var, T_DJC & cache) const override |
| 5106 | { |
| 5107 | auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this()); |
| 5108 | if (cache.find(thisptr) != cache.end()) |
| 5109 | return cache[thisptr]; |
| 5110 | |
| 5111 | if (this == var) return IdentityCF(this->Dimensions()); |
| 5112 | |
| 5113 | Array<int> resdims; |
| 5114 | resdims += Dimensions(); |
| 5115 | resdims += var->Dimensions(); |
| 5116 | |
| 5117 | Array<int> resstride(resdims.Size()); |
| 5118 | resstride.Range(0, dims.Size()) = stride; |
| 5119 | resstride.Range(dims.Size(), END) = 1; |
| 5120 | for (int i = resdims.Size() - 1; i >= dims.Size(); i--) |
| 5121 | for (int j = 0; j < i; ++j) |
| 5122 | resstride[j] *= resdims[i]; |
| 5123 | |
| 5124 | // cout << "new stride: " << resstride << endl; |
| 5125 | auto diffc1 = c1->DiffJacobi (var, cache); |
| 5126 | auto res = MakeExtendDimensionCoefficientFunction (diffc1, std::move(resdims), Array<int>(pos), std::move(resstride)); |
| 5127 | cache[thisptr] = res; |
| 5128 | return res; |
| 5129 | } |
| 5130 | |
| 5131 | virtual void NonZeroPattern (const class ProxyUserData & ud, |
| 5132 | FlatVector<AutoDiffDiff<1,NonZero>> values) const override |
nothing calls this directly
no test coverage detected