help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] How to get a variable's absolute value with GNU mathprog


From: hhb83
Subject: [Help-glpk] How to get a variable's absolute value with GNU mathprog
Date: Fri, 27 Feb 2009 00:39:37 -0800 (PST)

Hello, 
Would anyone tell me how to get a variable's absolute value with GNU
mathprog? 
var X;
var Xabs;
s.t. absolte: Xabs = abs(X);
It always says: argument for abs has invalid type.

If I write this:
s.t absolte: Xabs = if X<=0 then (-1)*X else X;
It says: operand proceding <= has invalid type.
Then what should I do?
Thank you!
Haibin




-- 
View this message in context: 
http://www.nabble.com/How-to-get-a-variable%27s-absolute-value-with-GNU-mathprog-tp22241565p22241565.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]