# Question:Bad solution display from LPSolve

## Question:Bad solution display from LPSolve

Maple 2022

The solution from LPSolve shown in the worksheet below is displayed very weirdly:

1. The first element is rounded to 3 significant digits.
2. The variable indices have decimal points.
3. Zeros are displayed as just decimal points with no digit 0.

Closer inspection (with, say, lprint) will reveal that the weirdness is only with the prettyprinting; the actual entries are as expected.

 > restart:
 > <(kernelopts,interface)(version), interface~([prettyprint, typesetting])[]>;

 > (a,b,c):= (2,4,5):
 > X:= Matrix((a,b), symbol= x): Y:= Matrix((b,c), symbol= y): Z:= Matrix((a,c), symbol= z):
 > RegionC:= <5, 15, 8, 10, 15>:
 > RegionA:= <90, 75>:
 > RegionB:= <35, 20, 30, 15>:
 > Cost1:= <     2, 1, 3/2,   3;   5/2, 2, 7/2, 3/2 >:
 > Cost2:= <     3/2, 4/5, 1/2, 3/2,   3;       1, 1/2, 1/2,   1, 1/2;       1, 3/2,   2,   2, 1/2;     5/2, 3/2, 3/5, 3/2, 1/2 >:
 > Cost3:= <     11/4, 7/2, 5/2, 3,   5/2;        3, 7/2, 7/2, 5/2, 2 >:
 > Cost__Total:= (add@(add@`*`~)~)([Cost||(1..3)], [X,Y,Z]):
 > CapB:= add(X[i], i= 1..a) <=~ RegionB:
 > CapA:= add([..,j], j= 1..b+c) <=~ RegionA:
 > ReqC:= add([i], i= 1..a+b) >=~ RegionC:
 > InEqOutB:= add([i], i= 1..a+c) =~ 0:
 > Cons:= seq~({CapA, CapB, ReqC, InEqOutB}):
 > Sol:= Optimization:-LPSolve(Cost__Total, Cons, assume= nonnegative);

 >

Download BadLPSolveDisp.mw

﻿