本文整理汇总了C++中VariableList::CountItems方法的典型用法代码示例。如果您正苦于以下问题:C++ VariableList::CountItems方法的具体用法?C++ VariableList::CountItems怎么用?C++ VariableList::CountItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VariableList
的用法示例。
在下文中一共展示了VariableList::CountItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* Creates and caches a simplified version of the linear programming problem,
* where redundant rows, columns and constraints are removed,
* if it has not been created before.
* Then, the simplified problem is solved.
*
* @return the result of the solving attempt
*/
ResultType
LPSolveInterface::_Presolve(const VariableList& variables)
{
if (fLpPresolved == NULL) {
fLpPresolved = copy_lp(fLP);
set_presolve(fLpPresolved, PRESOLVE_ROWS | PRESOLVE_COLS
| PRESOLVE_LINDEP, get_presolveloops(fLpPresolved));
}
ResultType result = (ResultType)solve(fLpPresolved);
if (result == OPTIMAL) {
int32 size = variables.CountItems();
for (int32 i = 0; i < size; i++) {
Variable* current = variables.ItemAt(i);
current->SetValue(get_var_primalresult(fLpPresolved,
get_Norig_rows(fLpPresolved) + current->GlobalIndex() + 1));
}
}
return result;
}