help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Enhancement request [WITH PATCH]: need to add pow function


From: Yuri
Subject: [Help-glpk] Enhancement request [WITH PATCH]: need to add pow function
Date: Wed, 16 May 2007 23:25:58 +0400

It's nice (and easy) to add 'pow' function, I hit this when I needed to express
my parameter functional dependency on indices. I actually needed 'square'
function but 'pow' is more general.

Thanx,
Yuri


--- begin patch ---
diff -ru glpk-4.15.orig/src/glpmpl01.c glpk-4.15/src/glpmpl01.c
--- work.orig/glpk-4.15/src/glpmpl01.c  Tue May 15 16:45:22 2007
+++ work/glpk-4.15/src/glpmpl01.c       Sun Feb 18 01:00:00 2007
@@ -1122,8 +1122,6 @@
          op = O_LOG10;
       else if (strcmp(mpl->image, "sqrt") == 0)
          op = O_SQRT;
-      else if (strcmp(mpl->image, "pow") == 0)
-         op = O_POWER;
       else if (strcmp(mpl->image, "sin") == 0)
          op = O_SIN;
       else if (strcmp(mpl->image, "cos") == 0)
@@ -1209,7 +1207,7 @@
          else
             error(mpl, "syntax error in argument for %s", func);
       }
-      else if (op == O_ATAN || op == O_ROUND || op == O_TRUNC || op == O_POWER)
+      else if (op == O_ATAN || op == O_ROUND || op == O_TRUNC)
       {  /* atan, round, and trunc need one or two arguments */
          /* parse the first argument */
          arg.arg.x = numeric_argument(mpl, func);
@@ -1219,7 +1217,6 @@
             {  case O_ATAN:  op = O_ATAN2;  break;
                case O_ROUND: op = O_ROUND2; break;
                case O_TRUNC: op = O_TRUNC2; break;
-               case O_POWER: op = O_POWER;  break;
                default: insist(op != op);
             }
             get_token(mpl /* , */);
--- end patch ---







reply via email to

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