cplex - 从 CPLEX 中的 excel 读取在元组内声明的简单一维数组
问题描述
当我尝试读取已在元组数组中声明的一维数组时,弹出错误“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 个组件的元组集,然后将其转换为正确的结构。
参见示例
推荐阅读
- javascript - 如何根据顺序中剩余的文本框对齐密码框
- javascript - 在登录页面从数据库中检索选择框的值
- stanford-nlp - 使用 Stanford CoreNLP 中的 Simple API,有没有办法获得多令牌实体提及?
- hibernate - 即使外键在 HQL 中为空也返回数据
- php - Laravel 中添加标签的解决方案
- android - 解析失败:Lorg/jsoup/Jsoup;
- c# - If-Statement 没有被观察到
- amazon-web-services - CloudFront TTL 到期和失效之间的区别?
- mysql - 转义 HQL 查询中的特殊字符
- python - 如何在 html 页面中打印 matplotlib 图