/// <summary> /// Try to add expr directly to the tableau without creating an /// artificial variable. /// </summary> /// <remarks> /// We are trying to add the constraint expr=0 to the appropriate /// tableau. /// </remarks> /// <returns> /// True if successful and false if not. /// </returns> private bool TryAddingDirectly(ClLinearExpression expr) /* throws ExClRequiredFailure */ { ClAbstractVariable subject = ChooseSubject(expr); if (subject == null) { return(false); } expr.NewSubject(subject); if (ColumnsHasKey(subject)) { SubstituteOut(subject, expr); } AddRow(subject, expr); return(true); // succesfully added directly }
/// <summary> /// Try to add expr directly to the tableau without creating an /// artificial variable. /// </summary> /// <remarks> /// We are trying to add the constraint expr=0 to the appropriate /// tableau. /// </remarks> /// <returns> /// True if successful and false if not. /// </returns> protected bool TryAddingDirectly(ClLinearExpression expr) /* throws ExClRequiredFailure */ { if (Trace) FnEnterPrint("TryAddingDirectly: " + expr); ClAbstractVariable subject = ChooseSubject(expr); if (subject == null) { if (Trace) FnExitPrint("returning false"); return false; } expr.NewSubject(subject); if (ColumnsHasKey(subject)) { SubstituteOut(subject, expr); } AddRow(subject, expr); if (Trace) FnExitPrint("returning true"); return true; // succesfully added directly }