float pFL(Points *points, int *feasible, int numfeasible, float z, long *k, double cost, long iter, float e) { long i; long x; double change; long numberOfPoints; change = cost; /* continue until we run iter iterations without improvement */ /* stop instead if improvement is less than e */ while (change/cost > 1.0*e) { change = 0.0; numberOfPoints = points->num; /* randomize order in which centers are considered */ intshuffle(feasible, numfeasible); for (i=0;i<iter;i++) { x = i%numfeasible; change += pgain(feasible[x], points, z, k); } cost -= change; } return(cost); }
void mtsPIDQtWidget::SlotPGainChanged(void) { vctDoubleVec pgain(NumberOfAxis, 0.0); QVWPGainWidget->GetValue(pgain); PID.SetPGain(pgain); }