R/check.tb.R

Defines functions check.tb

Documented in check.tb

check.tb <- function( tab )
{
###
### This function checks for negative target values and repairs the tableau
###
### Parameter
### tab = a list of named components that specifies the modified simplex tableau
###
    for ( i in 1:tab$objectives ) {
        if ( tab$tb[i] < 0.0 ) {
            for ( j in 1:tab$variables ) {
                tab$te[i,j] <- -tab$te[i,j]
            }
            tab <- swp.headings( tab, i, i + tab$variables )
            tab <- swp.vec( tab, i, i + tab$variables )
        }
    }
    return( tab )
}

Try the goalprog package in your browser

Any scripts or data that you put into this service are public.

goalprog documentation built on May 30, 2017, 5:07 a.m.