摘自Lingo users manul:
@SMAX( X1, X2,..., XN)
Returns the maximum value of X1, X2, ..., and XN.
@SMIN( X1, X2,..., XN)
Returns the minimum value of X1, X2, ..., and XN.
The @MIN and @MAX functions are used to find the minimum and maximum of an expression over members of a set.
建议使用集合函数@min, @max
MODEL:
SETS:
ROW/R1..R3/;
COLUM/C1..C3/;
RXC(ROW,COLUM):V;
ENDSETS
DATA:
@TEXT()=@WRITE("the maximal value of v is: ",@MAX(RXC:V));
ENDDATA
CALC:
@FOR(RXC(I,J):V(I,J)=I+J);
ENDCALC
END
复制代码
the maximal value of v is: 6
Variable Value
V( R1, C1) 2.000000
V( R1, C2) 3.000000
V( R1, C3) 4.000000
V( R2, C1) 3.000000
V( R2, C2) 4.000000
V( R2, C3) 5.000000
V( R3, C1) 4.000000
V( R3, C2) 5.000000
V( R3, C3) 6.000000 作者: xyp900708 时间: 2012-7-28 22:52
就是楼上的说法作者: 小小求知者 时间: 2012-7-30 17:19
qlb061 发表于 2012-7-28 21:16
摘自Lingo users manul:
@SMAX( X1, X2,..., XN)
Returns the maximum value of X1, X2, ..., and XN.