Search in sources :

Example 1 with IterationPoint

use of org.ojalgo.optimisation.linear.SimplexTableau.IterationPoint in project ojAlgo by optimatika.

the class SimplexSolver method performIteration.

void performIteration(final IterationPoint pivot) {
    final double tmpPivotElement = myTableau.doubleValue(pivot.row, pivot.col);
    final int tmpColRHS = myTableau.countConstraints() + myTableau.countVariables();
    final double tmpPivotRHS = myTableau.doubleValue(pivot.row, tmpColRHS);
    myTableau.pivot(pivot);
    if (this.isDebug()) {
        this.log("Iteration Point <{},{}>\tPivot: {} => {}\tRHS: {} => {}.", pivot.row, pivot.col, tmpPivotElement, myTableau.doubleValue(pivot.row, pivot.col), tmpPivotRHS, myTableau.doubleValue(pivot.row, tmpColRHS));
    }
    if (options.validate) {
        // Right-most column of the tableau
        final Array1D<Double> tmpRHS = myTableau.sliceConstraintsRHS();
        final AggregatorFunction<Double> tmpMinAggr = PrimitiveAggregator.getSet().minimum();
        tmpRHS.visitAll(tmpMinAggr);
        final double tmpMinVal = tmpMinAggr.doubleValue();
        if ((tmpMinVal < ZERO) && !options.feasibility.isZero(tmpMinVal)) {
            this.log("\nNegative RHS! {}", tmpMinVal);
            if (this.isDebug()) {
                this.log("Entire RHS columns: {}\n", tmpRHS);
            }
        }
    }
}
Also used : IterationPoint(org.ojalgo.optimisation.linear.SimplexTableau.IterationPoint)

Aggregations

IterationPoint (org.ojalgo.optimisation.linear.SimplexTableau.IterationPoint)1