visual-c++ - 约束中系数矩阵的函数
问题描述
我需要约束中的系数矩阵。CPLEX Concert C++ 中有一个函数 getObjCoef 用于目标系数,但我不知道是否有任何函数可以检索系数矩阵?
解决方案
尝试使用 IloExpr::LinearIterator 迭代系数
IloExpr exprCt = rangeCt.getExpr();
for (IloExpr::LinearIterator t = exprCt.getLinearIterator(); t.ok(); ++t)
{ std::cout << t.getCoef() << " * " << t.getVar() << std::endl; }
推荐阅读
- ruby-on-rails - Shrine Gem Ruby on Rails 无服务器图像处理程序,后台作业
- javascript - 为什么 Prettier 将我的 JSON 对象分成多行?
- c# - 清洁架构和 Asp.Net 核心标识
- rust - 在方法中使用结构字段会导致不可变自借?
- firebase - Flutter firebase如何用google登录用户
- swiftui - 尝试在 swiftUI 中调整 UIImage 的 UIViewRepresentable 的大小
- c# - LINQ to Entities 无法识别方法“Boolean IsMatch”
- arrays - Bash:循环仅迭代数组中的第一个条目
- reactjs - 输入不显示初始值
- android - Android应用程序在真实设备上崩溃但在模拟器上工作