0

I am trying to improve memory use by setting Memory Emphasis parameter on and Preprocessing parameter off.

I found similar code for matlab and java but fail to do the same in c#.

Memory optimization while using CPLEX library in Java

https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014726909

ILOG.CP objects have SetParameter method, I tried below expressions but they give syntax errors.

cp.SetParameter (Cplex.Param.Preprocessing.Presolve, 0); cp.SetParameter(Cplex.Param.Emphasis.Memory, 1);

How can I set these parameters using C#?

Thank you very much in advance,

Xavier Nodet
  • 5,033
  • 2
  • 37
  • 48
Karen
  • 1
  • 1
  • Are you getting **syntax** errors, ` could not be found` errors, or something else? – Bob Kaufman May 11 '16 at 22:15
  • My wording may be misleading, exact errors are: The name 'Cplex' does not exist in the current context or 'ILOG.CP.CP' does not contain a definition for 'Param' and no extension method 'Param' accepting a first argument of type 'ILOG.CP.CP' could be found (are you missing a using directive or an assembly reference?) – Karen May 11 '16 at 22:19
  • 1
    Are you using CP rather than CPLEX? The sets of parameters are not the same for both. So setting a Cplex.Param on a CP engine may cause you problems like this? – TimChippingtonDerrick May 12 '16 at 05:43

1 Answers1

0

Thank you very much TimChippingtonDerrick for your comment.

For CP engine this expression works:

cp.SetParameter(CP.IntParam.Presolve, CP.ParameterValues.Off);

(I could not find a parameter corresponding to Memory Emphasis. List of parameters for C# in CP Optimizer are as given below.)

http://www.ibm.com/support/knowledgecenter/api/content/SSSA5P_12.6.1/ilog.odms.ide.help/refdotnetopl/html/AllMembers_T_ILOG_CP_CP_IntParam.htm

http://www.ibm.com/support/knowledgecenter/api/content/SSSA5P_12.6.1/ilog.odms.ide.help/refdotnetopl/html/AllMembers_T_ILOG_CP_CP_DoubleParam.htm

Community
  • 1
  • 1
Karen
  • 1
  • 1