hey, im new to gams and i was trying to make a set(i,j) of i and j than only contains the (i,j) such that i its different than j. can it be made using conditionals or something else than assigning them manually ?

sets
i /1*3/
j /1*5/;
set newset(i,j) = the i and j such i its different than j

thanks in advance

asked 29 May '16, 02:20

jmslaterc's gravatar image

jmslaterc
154
accept rate: 0%

edited 29 May '16, 04:43

fbahr's gravatar image

fbahr ♦
4.6k716


set newset(i,j);
newset(i,j)$(ord(i) <> ord(j)) = yes;

display newset;

----     12 SET newset  
            1           2           3           4           5
1                     YES         YES         YES         YES
2         YES                     YES         YES         YES
3         YES         YES                     YES         YES
link

answered 29 May '16, 05:26

fbahr's gravatar image

fbahr ♦
4.6k716
accept rate: 13%

thanks for the answer

(30 May '16, 14:57) jmslaterc
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×51
×4
×4

Asked: 29 May '16, 02:20

Seen: 552 times

Last updated: 30 May '16, 14:57

OR-Exchange! Your site for questions, answers, and announcements about operations research.