| 5 | { |
| 6 | template <int D> |
| 7 | shared_ptr<CoefficientFunction> |
| 8 | DiffOpHesse<D>:: |
| 9 | DiffShape (shared_ptr<CoefficientFunction> proxy, |
| 10 | shared_ptr<CoefficientFunction> dir, |
| 11 | bool eulerian) |
| 12 | { |
| 13 | if(eulerian) |
| 14 | throw Exception("DiffShape Eulerian not implemented for Hesse!"); |
| 15 | |
| 16 | auto grad_proxy = proxy->Primary()->Operator("Grad")->Reshape(Array<int>{-1,D}); |
| 17 | auto hesse_grad_dir = proxy->Reshape(Array<int>({-1,D})) * dir->Operator("Grad"); |
| 18 | const auto& shape = proxy->Dimensions(); |
| 19 | return - (grad_proxy * dir->Operator("hesse")->Reshape(Array<int>{D,-1}))->Reshape(shape) |
| 20 | - hesse_grad_dir->Reshape(Array<int>{-1,D,D})->TensorTranspose(1,2)->Reshape(shape) |
| 21 | - hesse_grad_dir->Reshape(shape); |
| 22 | }; |
| 23 | |
| 24 | template <int D, typename FEL> |
| 25 | shared_ptr<CoefficientFunction> |
nothing calls this directly
no test coverage detected