| 1178 | } |
| 1179 | |
| 1180 | shared_ptr<CoefficientFunction> DiffJacobi (const CoefficientFunction * var, T_DJC & cache) const override |
| 1181 | { |
| 1182 | auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this()); |
| 1183 | if (cache.find(thisptr) != cache.end()) |
| 1184 | return cache[thisptr]; |
| 1185 | |
| 1186 | if (this == var) |
| 1187 | return IdentityCF(this->Dimensions()); |
| 1188 | |
| 1189 | auto diffc1 = c1->DiffJacobi (var, cache); |
| 1190 | auto res = 0.5*(diffc1 - diffc1 -> TensorTranspose( 0, 1 )); |
| 1191 | cache[thisptr] = res; |
| 1192 | return res; |
| 1193 | } |
| 1194 | }; |
| 1195 | |
| 1196 |
no test coverage detected