Decision Optimization

 View Only
  • 1.  CPLEX Operator not available for {float} * {int}

    Posted 16 days ago
    Edited by Omar Abbaas 12 days ago

    Can you please take a look at the following piece of code and help me understand why I am getting the error below and how to fix it?

    {int} Q1=...;

    {float} q[CmRange]=...;

      
     dexpr float SVM = Q1* q[j]

    Error:

    Operator not available for {float} * {int}



  • 2.  RE: CPLEX Operator not available for {float} * {int}

    Posted 15 days ago

    Hi,

    you mix sets and scalar values.

    Let me fix the objective to help you undestand.

    dexpr float SVM = 
     first(Q1)*(sum(j in CommunitiesRange, i in CandidateSitesRange)first(q[j])*n[j]*d[j][i]) 
     + first(Q2)*(sum(j in CommunitiesRange, i in CandidateSitesRange)first(l[i])*first(f[j])*n[j]*d[j][i]);
    

    would work fine.

    Q1 is a set. You can use an element of a set in an equation but not the set itself

    regards



    ------------------------------
    [Alex] [Fleischer]
    [Data and AI Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: CPLEX Operator not available for {float} * {int}

    Posted 14 days ago

    Thank you so much Alex!



    ------------------------------
    Omar Abbaas
    ------------------------------