Пример #1
0
Файл: scs.c Проект: tkelman/scs
static void setSolution(Data * d, Work * w, Sol * sol, Info * info) {
	idxint l = d->n + d->m + 1;
	setx(d, w, sol);
	sety(d, w, sol);
	sets(d, w, sol);
	if (info->statusVal == 0 || info->statusVal == SOLVED) {
		pfloat tau = w->u[l - 1];
		pfloat kap = ABS(w->v[l - 1]);
		if (tau > INDETERMINATE_TOL && tau > kap) {
			info->statusVal = solved(d, sol, info, tau);
		} else {
			if (calcNorm(w->u, l) < INDETERMINATE_TOL * SQRTF((pfloat) l)) {
				info->statusVal = indeterminate(d, sol, info);
			} else {
				pfloat bTy = innerProd(d->b, sol->y, d->m);
				pfloat cTx = innerProd(d->c, sol->x, d->n);
				if (bTy < cTx) {
					info->statusVal = infeasible(d, sol, info);
				} else {
					info->statusVal = unbounded(d, sol, info);
				}
			}
		}
	} else if (info->statusVal == INFEASIBLE) {
		info->statusVal = infeasible(d, sol, info);
	} else {
		info->statusVal = unbounded(d, sol, info);
	}
}
Пример #2
0
void UpdateInfo::updateUnbounded(const DeltaRational& delta, int ec, int f){
  d_limiting = NullConstraint;
  d_nonbasicDelta = delta;
  d_errorsChange = ec;
  d_focusDirection = f;
  d_tableauCoefficient.clear();
  updateWitness();
  Assert(unbounded());
  Assert(improvement(d_witness));
  Assert(!describesPivot());
  Assert(debugSgnAgreement());
}
Пример #3
0
bool UpdateInfo::describesPivot() const {
  return !unbounded() && d_nonbasic != d_limiting->getVariable();
}