| 858 | } |
| 859 | |
| 860 | shared_ptr<CoefficientFunction> DiffJacobi (const CoefficientFunction * var, typename BASE::T_DJC & cache) const override |
| 861 | { |
| 862 | auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this()); |
| 863 | if (cache.find(thisptr) != cache.end()) |
| 864 | return cache[thisptr]; |
| 865 | |
| 866 | if (this == var) |
| 867 | return IdentityCF(this->Dimensions()); |
| 868 | |
| 869 | shared_ptr<CoefficientFunction> res; |
| 870 | |
| 871 | if (this->Dimensions()[0] == 2) |
| 872 | res = (TraceCF(c1)*IdentityCF(2)-TransposeCF(c1)) -> DiffJacobi (var, cache); |
| 873 | else if (this->Dimensions()[0] == 3) |
| 874 | { |
| 875 | auto trcf = TraceCF(c1); |
| 876 | auto prodcf = c1*c1; |
| 877 | res = (0.5*(trcf*trcf - TraceCF(prodcf))*IdentityCF(3) - trcf*TransposeCF(c1) + TransposeCF(prodcf)) -> DiffJacobi (var, cache); |
| 878 | } |
| 879 | else |
| 880 | res = (DeterminantCF(c1) * InverseCF(c1)->Transpose() ) -> DiffJacobi (var, cache); |
| 881 | cache[thisptr] = res; |
| 882 | return res; |
| 883 | } |
| 884 | |
| 885 | |
| 886 | }; |
nothing calls this directly
no test coverage detected