[Cmpl] Conditional creation of variables

mike.steglich at th-wildau.de mike.steglich at th-wildau.de
Mon Nov 20 05:44:06 EST 2017


Hi Haroldo,

 

Please use << to test wheter an entry is an element of a set. Your definition of the variables shout look like the following expression:

 

variables:

{ i in 1..count(s[]),j in 1..count(s[]), i<j, s[i]+s[j] << interactions : x[i,j] : binary; }

 

 

Thanks,

 

Mike

 

Von: Cmpl [mailto:cmpl-bounces at coin-or.org] Im Auftrag von Haroldo Santos
Gesendet: Sonntag, 19. November 2017 20:22
An: cmpl at list.coin-or.org
Betreff: [Cmpl] Conditional creation of variables

 

Hi,

 

I'm working with a computational biology problem where the input is a string.

 

I would like to create variables for pairs of positions (i,j : i<j) in this string where a matching is possible.

 

 

parameters:

    s[] := ("u", "c", "c", "a", "g", "c", "a", "g", "g", "a", "a", "a", "g", "c");

    interactions := set( "au", "cg", "gc", "gu", "ug", "ua" );

 

variables:

    { i in 1..count(s[]),j in 1..count(s[]), i<j && s[i]+s[j] in interactions : x[i,j] : binary; }

 

 

The error appeared after I inserted  && s[i]+s[j] in interactions  . The intent of this part was to limit the creation of these variables only for valid matches (specified in interactions).

 

Could someone tell me what is wrong ?

 

Thanks  

 


-- 

=============================================================
Haroldo Gambini Santos
Computing Department
Universidade Federal de Ouro Preto - UFOP
email: haroldo [at ] iceb.ufop.br <http://iceb.ufop.br> 
home/research page: www.decom.ufop.br/haroldo <http://www.decom.ufop.br/haroldo/> 


It has long been an axiom of mine that the little things are infinitely
the most important.
-- Sir Arthur Conan Doyle, "A Case of Identity"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cmpl/attachments/20171120/c5f70c05/attachment.html>


More information about the Cmpl mailing list