Пример #1
0
bool Variable::violated(
	Active<Constraint, Variable> *constraints,
	double *y,
	double *r) const
{
	double rc = redCost(constraints, y);

	if (r) *r = rc;

	return violated(rc);
}
Пример #2
0
bool Variable::useful(
	Active<Constraint, Variable> *actCon,
	double *y,
	double lpVal) const
{
	if (!discrete()) return true;

	double rc = redCost(actCon, y);

	if (master_->optSense()->max())
		return (lpVal + rc > master_->primalBound());
	else
		return (lpVal + rc < master_->primalBound());
}
Пример #3
0
float totalCost(int numBlue, int numRed, int numWhite, float length)
{
	return redCost(numRed) +  blueCost(numBlue) + threadCost(length);
	//return beadCost(numBlue, numRed, numWhite) + threadCost(length);
}