| 2875 | |
| 2876 | |
| 2877 | shared_ptr<CoefficientFunction> DiffJacobi (const CoefficientFunction * var, T_DJC & cache) const override |
| 2878 | { |
| 2879 | auto thisptr = const_pointer_cast<CoefficientFunction>(this->shared_from_this()); |
| 2880 | if (cache.find(thisptr) != cache.end()) |
| 2881 | return cache[thisptr]; |
| 2882 | |
| 2883 | if (this == var) |
| 2884 | return make_shared<ConstantCoefficientFunction> (1); |
| 2885 | |
| 2886 | shared_ptr<CoefficientFunction> dv1v1; |
| 2887 | int dimip = c1->Dimension(); |
| 2888 | int dimvar = var->Dimension(); |
| 2889 | |
| 2890 | auto vc1 = c1->Reshape( dimip ); |
| 2891 | |
| 2892 | if (c1.get() == var) |
| 2893 | dv1v1 = c1; |
| 2894 | else |
| 2895 | { |
| 2896 | auto dvc1 = c1->DiffJacobi (var, cache); |
| 2897 | dv1v1 = dvc1 -> Reshape(dimip, dimvar) -> Transpose() * vc1; |
| 2898 | dv1v1 = dv1v1 -> Reshape (var->Dimensions()); |
| 2899 | } |
| 2900 | auto res = 2*dv1v1; |
| 2901 | cache[thisptr] = res; |
| 2902 | return res; |
| 2903 | } |
| 2904 | |
| 2905 | |
| 2906 | virtual void NonZeroPattern (const class ProxyUserData & ud, |
nothing calls this directly
no test coverage detected