dCds] = policy.fcn(policy, m, s);
    dd = length(M); dCds = reshape(dCds,d,dd,d,d); df = zeros(d,dd,d*(d+1)/2);
    <span class="keyword">for</span> i=1:d; <span class="keyword">for</span> j=1:dd
        dCdsi = squeeze(dCds(i,j,:,:)); dCdsi = dCdsi+dCdsi'-diag(diag(dCdsi));
        df(i,j,:) = dCdsi(tril(ones(d))==1);
    <span class="keyword">end</span>; <span class="keyword">end</span>
<span class="keyword">end</span>
f = C;

<span class="keyword">function</span> [f, df] = conT6(p, policy, m, s)        