void Mean::finish(){ setOutputValue( getFinalValue(0) / getFinalValue(1) ); double denom=getFinalValue(1); std::vector<double> df(2); df[0] = 1.0 / denom; if(diffweight) df[1] = -getFinalValue(0) / (denom*denom); else df[1]=0.0; mergeFinalDerivatives( df ); }
void ZpathVessel::finish(){ double sum = getFinalValue(0); std::vector<double> df(2); setOutputValue( -invlambda*std::log( sum ) ); df[0] = -invlambda / sum; df[1] = 0.0; mergeFinalDerivatives( df ); }
void DHEnergy::finish(){ setOutputValue( getFinalValue(0) ); df[0]=1.0; df[1]=0.0; mergeFinalDerivatives( df ); }
void Max::finish(){ double valin=getFinalValue(0); double dist=beta*std::log( valin ); setOutputValue( dist ); df[0]=beta/valin; df[1]=0.0; mergeFinalDerivatives( df ); }