繁体   English   中英

在CPLEX中从Excel读取元组内部声明的简单一维数组

[英]Reading a simple 1D array declared inside tuple from excel in CPLEX

当我尝试读取在元组数组内声明的一维数组时,弹出错误“ IBM ILOG Concert:excel:范围宽度不适合元组的数量”。 我在这里做错了什么?

* .mod文件为:

 int a=5;
 range r=1..a;

 tuple new{
    int b;
    int c;
    int d;
    int e[1..4]; 
 }

 new test[r]=...;

* .dat文件是:

SheetConnection sheet("test_sheet.xlsx");


test from SheetRead(sheet,"data");

在“ test_excel.xlsx”文件中定义的“数据”(5行7列):

b   c   d   e[1]    e[2]    e[3]    e[4]
10  9   6    5       4       6       4
4   8   7    5       10      5       5
8   9   5    1       2       4       9
8   2   1    1       4       7       3
5   4   9    5       7       8       5

我将阅读包含7个组件的元组集,然后将其转换为正确的结构。

参见示例

https://www.ibm.com/developerworks/community/forums/html/topic?id=cc929555-fab5-4895-a33c-9522e43148f6&ps=25

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM