Top
Back: D.7.2.7 lex_solve
Forward: D.7.2.9 triangLf_solve
FastBack: D. SINGULAR libraries
FastForward: E. Release Notes
Up: D.7.2 solve_lib
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

D.7.2.8 simplexOut

Procedure from library solve.lib (see solve_lib).

Usage:

simplexOut(l); l list

Assume:

l is the output of simplex.

Return:

nothing. The procedure prints the computed solution of simplex (as strings) in a nice format.

Example:

 
LIB "solve.lib";
ring r = (real,10),(x),lp;
// consider the max. problem:
//
//    maximize  x(1) + x(2) + 3*x(3) - 0.5*x(4)
//
//  with constraints:   x(1) +          2*x(3)          <= 740
//                             2*x(2)          - 7*x(4) <=   0
//                               x(2) -   x(3) + 2*x(4) >=   0.5
//                      x(1) +   x(2) +   x(3) +   x(4)  =   9
//
matrix sm[5][5]=   0, 1, 1, 3,-0.5,
740,-1, 0,-2, 0,
0, 0,-2, 0, 7,
0.5, 0,-1, 1,-2,
9,-1,-1,-1,-1;
int n = 4;  // number of constraints
int m = 4;  // number of variables
int m1= 2;  // number of <= constraints
int m2= 1;  // number of >= constraints
int m3= 1;  // number of == constraints
list sol=simplex(sm, n, m, m1, m2, m3);
simplexOut(sol);
→ z = 17.025
→ x2 = 3.325
→ x4 = 0.95
→ x3 = 4.725

See also: simplex.


Top Back: D.7.2.7 lex_solve Forward: D.7.2.9 triangLf_solve FastBack: D. SINGULAR libraries FastForward: E. Release Notes Up: D.7.2 solve_lib Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.