| 2219 | } |
| 2220 | |
| 2221 | shared_ptr<CoefficientFunction> DiffJacobi (const CoefficientFunction * var, T_DJC & cache) const override |
| 2222 | { |
| 2223 | auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this()); |
| 2224 | if (cache.find(thisptr) != cache.end()) |
| 2225 | return cache[thisptr]; |
| 2226 | int dimvar = var->Dimension(); |
| 2227 | int mydim = this->Dimension(); |
| 2228 | |
| 2229 | Array<int> dimres { this -> Dimensions() + var->Dimensions() }; |
| 2230 | |
| 2231 | if (this == var) |
| 2232 | return IdentityCF(this->Dimensions()); |
| 2233 | |
| 2234 | auto diffc1 = c1->DiffJacobi(var, cache); |
| 2235 | auto diffc2 = c2->DiffJacobi(var, cache); |
| 2236 | |
| 2237 | auto prod1_ = c2 -> Reshape(mydim, 1) * diffc1 -> Reshape(1, dimvar); |
| 2238 | auto prod1 = prod1_ -> Reshape(dimres); |
| 2239 | |
| 2240 | auto prod2 = c1 * diffc2; |
| 2241 | auto res = prod1 + prod2; |
| 2242 | cache[thisptr] = res; |
| 2243 | return res; |
| 2244 | } |
| 2245 | |
| 2246 | |
| 2247 |
nothing calls this directly
no test coverage detected