Learn R Programming

linprog (version 0.9-4)

print.solveLP: Print Objects of Class solveLP

Description

This method prints the results of the Linear Programming algorithm.

Usage

# S3 method for solveLP
print( x, digits=6, ...)

Value

print.solveLP invisibly returns the object given in argument x.

Arguments

x

an object returned by solveLP.

digits

number of digits to print.

...

currently ignored.

Author

Arne Henningsen

See Also

solveLP, summary.solveLP, readMps, writeMps

Examples

Run this code

## example of Steinhauser, Langbehn and Peters (1992)
if (FALSE) library( linprog )

## Production activities
cvec <- c(1800, 600, 600)  # gross margins
names(cvec) <- c("Milk","Bulls","Pigs")

## Constraints (quasi-fix factors)
bvec <- c(40, 90, 2500)  # endowment
names(bvec) <- c("Land","Stable","Labor")

## Needs of Production activities
Amat <- rbind( c(  0.7,   0.35,   0 ),
               c(  1.5,   1,      3 ),
               c( 50,    12.5,   20 ) )

## Maximize the gross margin
res <- solveLP( cvec, bvec, Amat, TRUE )

## print the results
print( res )

Run the code above in your browser using DataLab