Lines Matching refs:constraint

43 SolverInterface::AddConstraint(Constraint* constraint, bool notifyListener)
45 return fLinearSpec->AddConstraint(constraint, notifyListener);
50 SolverInterface::RemoveConstraint(Constraint* constraint, bool deleteConstraint,
53 return fLinearSpec->RemoveConstraint(constraint, deleteConstraint,
76 SpecificationListener::ConstraintAdded(Constraint* constraint)
82 SpecificationListener::ConstraintRemoved(Constraint* constraint)
197 Constraint* constraint = constraints.ItemAt(i);
199 SummandList* summands = constraint->LeftSide();
203 markedForInvalidation.AddItem(constraint);
245 LinearSpec::AddConstraint(Constraint* constraint)
247 return AddConstraint(constraint, true);
252 LinearSpec::RemoveConstraint(Constraint* constraint, bool deleteConstraint)
254 return RemoveConstraint(constraint, deleteConstraint, true);
259 LinearSpec::AddConstraint(Constraint* constraint, bool notifyListener)
261 if (!fConstraints.AddItem(constraint))
265 SummandList* leftSide = constraint->LeftSide();
271 if (!fSolver->ConstraintAdded(constraint)) {
272 RemoveConstraint(constraint, false);
276 constraint->fLS = this;
280 fListeners.ItemAt(i)->ConstraintAdded(constraint);
288 LinearSpec::RemoveConstraint(Constraint* constraint, bool deleteConstraint,
291 if (constraint == NULL)
293 fSolver->ConstraintRemoved(constraint);
294 if (!fConstraints.RemoveItem(constraint))
297 SummandList* leftSide = constraint->LeftSide();
305 fListeners.ItemAt(i)->ConstraintRemoved(constraint);
308 constraint->fLS = NULL;
310 delete constraint;
333 LinearSpec::UpdateLeftSide(Constraint* constraint,
336 SummandList* leftSide = constraint->LeftSide();
351 if (!fSolver->LeftSideChanged(constraint))
358 LinearSpec::UpdateRightSide(Constraint* constraint)
360 if (!fSolver->RightSideChanged(constraint))
367 LinearSpec::UpdateOperator(Constraint* constraint)
369 if (!fSolver->OperatorChanged(constraint))
376 LinearSpec::UpdatePenalties(Constraint* constraint)
378 if (!fSolver->PenaltiesChanged(constraint))
385 * Adds a new soft linear constraint to the specification.
386 * i.e. a constraint that does not always have to be satisfied.
388 * @param coeffs the constraint's coefficients
389 * @param vars the constraint's variables
390 * @param op the constraint's operand
391 * @param rightSide the constant value on the constraint's right side
404 * Adds a new soft linear constraint to the specification with a single summand.
406 * @param coeff1 the constraint's first coefficient
407 * @param var1 the constraint's first variable
408 * @param op the constraint's operand
409 * @param rightSide the constant value on the constraint's right side
428 * Adds a new soft linear constraint to the specification with two summands.
430 * @param coeff1 the constraint's first coefficient
431 * @param var1 the constraint's first variable
432 * @param coeff2 the constraint's second coefficient
433 * @param var2 the constraint's second variable
434 * @param op the constraint's operand
435 * @param rightSide the constant value on the constraint's right side
456 * Adds a new soft linear constraint to the specification with three summands.
458 * @param coeff1 the constraint's first coefficient
459 * @param var1 the constraint's first variable
460 * @param coeff2 the constraint's second coefficient
461 * @param var2 the constraint's second variable
462 * @param coeff3 the constraint's third coefficient
463 * @param var3 the constraint's third variable
464 * @param op the constraint's operand
465 * @param rightSide the constant value on the constraint's right side
487 * Adds a new soft linear constraint to the specification with four summands.
489 * @param coeff1 the constraint's first coefficient
490 * @param var1 the constraint's first variable
491 * @param coeff2 the constraint's second coefficient
492 * @param var2 the constraint's second variable
493 * @param coeff3 the constraint's third coefficient
494 * @param var3 the constraint's third variable
495 * @param coeff4 the constraint's fourth coefficient
496 * @param var4 the constraint's fourth variable
497 * @param op the constraint's operand
498 * @param rightSide the constant value on the constraint's right side
561 Constraint* constraint = new(std::nothrow) Constraint(this, leftSide,
563 if (constraint == NULL)
565 if (!AddConstraint(constraint)) {
566 delete constraint;
569 return constraint;