首页 > 中学考试杂题 > 题目详情
我要用lingo定义一个0-1矩阵,如何定义?要求每行和每列只有一个1,其余都为0sets:e/1..11/;matri
题目内容:
我要用lingo定义一个0-1矩阵,如何定义?要求每行和每列只有一个1,其余都为0
sets:
e/1..11/;
matrix1/e,e/:a;
endsets
@for(matrix1:@bin(a));
@for(e(i):@sum(e(j):a(i,j))>0);
这是我自己定义的一个 但是总是报错,LINGO’s predefined functions generally expect a specific number of arguments.You’ll get this message if you are passing an incorrect number of arguments.Check the syntax of the function in question.
我要用lingo定义一个0-1矩阵,如何定义?要求每行和每列只有一个1,其余都为0
sets:
e/1..11/;
matrix1/e,e/:a;
endsets
@for(matrix1:@bin(a));
@for(e(i):@sum(e(j):a(i,j))>0);
这是我自己定义的一个 但是总是报错,LINGO’s predefined functions generally expect a specific number of arguments.You’ll get this message if you are passing an incorrect number of arguments.Check the syntax of the function in question.
sets:
e/1..11/;
matrix1/e,e/:a;
endsets
@for(matrix1:@bin(a));
@for(e(i):@sum(e(j):a(i,j))>0);
这是我自己定义的一个 但是总是报错,LINGO’s predefined functions generally expect a specific number of arguments.You’ll get this message if you are passing an incorrect number of arguments.Check the syntax of the function in question.
本题链接: