本文整理汇总了C++中OsiRowCut::consistent方法的典型用法代码示例。如果您正苦于以下问题:C++ OsiRowCut::consistent方法的具体用法?C++ OsiRowCut::consistent怎么用?C++ OsiRowCut::consistent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OsiRowCut
的用法示例。
在下文中一共展示了OsiRowCut::consistent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OsiCpxSolverInterfaceUnitTest
//.........这里部分代码省略.........
for (c=0;c<nc;c++) ub[c]=cplexColUB[c]-0.001;
OsiColCut cc;
cc.setLbs(nc,inx,lb);
cc.setUbs(nc,inx,ub);
cuts.insert(cc);
delete [] ub;
delete [] lb;
delete [] inx;
}
{
// Generate a row and column cut which have are ineffective
OsiRowCut * rcP= new OsiRowCut;
rcP->setEffectiveness(-1.);
cuts.insert(rcP);
assert(rcP==NULL);
OsiColCut * ccP= new OsiColCut;
ccP->setEffectiveness(-12.);
cuts.insert(ccP);
assert(ccP==NULL);
}
{
//Generate inconsistent Row cut
OsiRowCut rc;
const int ne=1;
int inx[ne]={-10};
double el[ne]={2.5};
rc.setRow(ne,inx,el);
rc.setLb(3.);
rc.setUb(4.);
assert(!rc.consistent());
cuts.insert(rc);
}
{
//Generate inconsistent col cut
OsiColCut cc;
const int ne=1;
int inx[ne]={-10};
double el[ne]={2.5};
cc.setUbs(ne,inx,el);
assert(!cc.consistent());
cuts.insert(cc);
}
{
// Generate row cut which is inconsistent for model m
OsiRowCut rc;
const int ne=1;
int inx[ne]={10};
double el[ne]={2.5};
rc.setRow(ne,inx,el);
assert(rc.consistent());
assert(!rc.consistent(im));
cuts.insert(rc);
}
{
// Generate col cut which is inconsistent for model m
OsiColCut cc;
const int ne=1;
int inx[ne]={30};
double el[ne]={2.0};
cc.setLbs(ne,inx,el);
assert(cc.consistent());
assert(!cc.consistent(im));
示例2: im
//.........这里部分代码省略.........
for (c=0;c<nc;c++) ub[c]=xprColUB[c]-0.001;
OsiColCut cc;
cc.setLbs(nc,inx,lb);
cc.setUbs(nc,inx,ub);
cuts.insert(cc);
delete [] ub;
delete [] lb;
delete [] inx;
}
{
// Generate a row and column cut which have are ineffective
OsiRowCut * rcP= new OsiRowCut;
rcP->setEffectiveness(-1.);
cuts.insert(rcP);
assert(rcP==NULL);
OsiColCut * ccP= new OsiColCut;
ccP->setEffectiveness(-12.);
cuts.insert(ccP);
assert(ccP==NULL);
}
{
//Generate inconsistent Row cut
OsiRowCut rc;
const int ne=1;
int inx[ne]={-10};
double el[ne]={2.5};
rc.setRow(ne,inx,el);
rc.setLb(3.);
rc.setUb(4.);
assert(!rc.consistent());
cuts.insert(rc);
}
{
//Generate inconsistent col cut
OsiColCut cc;
const int ne=1;
int inx[ne]={-10};
double el[ne]={2.5};
cc.setUbs(ne,inx,el);
assert(!cc.consistent());
cuts.insert(cc);
}
{
// Generate row cut which is inconsistent for model m
OsiRowCut rc;
const int ne=1;
int inx[ne]={10};
double el[ne]={2.5};
rc.setRow(ne,inx,el);
assert(rc.consistent());
assert(!rc.consistent(im));
cuts.insert(rc);
}
{
// Generate col cut which is inconsistent for model m
OsiColCut cc;
const int ne=1;
int inx[ne]={30};
double el[ne]={2.0};
cc.setLbs(ne,inx,el);
assert(cc.consistent());
assert(!cc.consistent(im));