我有一组节点i并创建了一个别名(i,j)。现在我有一个参数c(i,j),我希望 i 元素能够独特地映射到 j 。例如,
set i /a,b,c/ ;
alias (i,j) ;
c(i,j) /#i.#j/ ;
Dot运算符映射了我不想包含的所有元素,如a.a,b.b,c.c。如何编写条件,只考虑a.b,a.c,b.c?
谢谢
答案 0 :(得分:2)
我不确定,您想要做什么,但以下代码中的两个分配中的一个应该满足您的需求:
set i /a,b,c/ ;
alias (i,j) ;
set c(i,j);
c(i,j) = not sameas(i,j);
display c;
$ontext
Results in:
---- 6 SET c
a b c
a YES YES
b YES YES
c YES YES
$offtext
c(i,j) = ord(i) < ord(j);
display c;
$ontext
Results in:
---- 27 SET c
b c
a YES YES
b YES
$offtext
最佳, 鲁兹