本文整理汇总了Java中org.ojalgo.TestUtils.assertStateLessThanFeasible方法的典型用法代码示例。如果您正苦于以下问题:Java TestUtils.assertStateLessThanFeasible方法的具体用法?Java TestUtils.assertStateLessThanFeasible怎么用?Java TestUtils.assertStateLessThanFeasible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ojalgo.TestUtils
的用法示例。
在下文中一共展示了TestUtils.assertStateLessThanFeasible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testP20091102b
import org.ojalgo.TestUtils; //导入方法依赖的package包/类
/**
* Infeasible problem, but solver reports optimal solution!
*/
@SuppressWarnings("unchecked")
public void testP20091102b() {
final MatrixStore<Double>[] tmpMtrxs = new MatrixStore[6];
tmpMtrxs[0] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 1.0, 1.0, 1.0 } });
tmpMtrxs[1] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 1.0 } });
tmpMtrxs[2] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 3.400491304172128, 5.429710780966787, 5.910932781021423 },
{ 5.429710780966787, 23.181215288234903, 27.883770791602895 }, { 5.910932781021423, 27.883770791602895, 34.37266787775051 } });
tmpMtrxs[3] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 0.053 }, { 0.0755 }, { 0.0788 } });
tmpMtrxs[4] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 1.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }, { 0.0, 0.0, 1.0 }, { -0.053, -0.0755, -0.0788 },
{ -1.0, 0.0, 0.0 }, { 0.0, -1.0, 0.0 }, { 0.0, 0.0, -1.0 } });
tmpMtrxs[5] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 1.0 }, { 1.0 }, { 1.0 }, { -0.06 }, { -0.8 }, { 0.0 }, { 0.0 } });
final ConvexSolver.Builder tmpBuilder = new ConvexSolver.Builder(tmpMtrxs);
final ConvexSolver tmpSolver = tmpBuilder.build();
final Optimisation.Result tmpResult = tmpSolver.solve();
TestUtils.assertStateLessThanFeasible(tmpResult);
OptimisationConvexTests.assertDirectAndIterativeEquals(tmpBuilder, null);
}
示例2: testP20090924
import org.ojalgo.TestUtils; //导入方法依赖的package包/类
/**
* Infeasible problem, but solver reports optimal solution!
*/
@SuppressWarnings("unchecked")
public void testP20090924() {
final MatrixStore<Double>[] tmpMtrxs = new MatrixStore[6];
tmpMtrxs[0] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }, { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } });
tmpMtrxs[1] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 1.0 }, { 0.7027946085029227 } });
tmpMtrxs[2] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
{ 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0 },
{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0 } });
tmpMtrxs[3] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { -0.0 }, { 0.5 }, { 0.25 }, { 0.25 }, { 0.3 }, { -0.0 }, { 0.62 } });
tmpMtrxs[4] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, { 0.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 },
{ 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 },
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 },
{ 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0 },
{ 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0 } });
tmpMtrxs[5] = PrimitiveDenseStore.FACTORY.rows(new double[][] { { 0.17 }, { 0.52 }, { 0.3 }, { 0.3 }, { 0.3 }, { 0.15 }, { 1.0 }, { 0.31 },
{ -0.05960220972942152 }, { -0.1144024630877301 }, { -0.12289286964304823 }, { 0.0 }, { -0.02 }, { 0.0 } });
final ConvexSolver.Builder tmpBuilder = new ConvexSolver.Builder(tmpMtrxs);
final ConvexSolver tmpSolver = tmpBuilder.build();
final Optimisation.Result tmpResult = tmpSolver.solve();
TestUtils.assertStateLessThanFeasible(tmpResult);
OptimisationConvexTests.assertDirectAndIterativeEquals(tmpBuilder, null);
}
示例3: testP20150127
import org.ojalgo.TestUtils; //导入方法依赖的package包/类
/**
* Problemet var att en av noderna som IntegerSolver genererade var infeasible, men det misslyckades
* LinearSolver med att identifiera och returnerade en felaktig lösning som OPTIMAL. Detta testfall
* motsvarar
*/
public void testP20150127() {
final ExpressionsBasedModel tmpModel = P20150127b.getModel(true, true);
// tmpModel.options.debug(LinearSolver.class);
// Kan få testfallet att gå igenom, men dåsmäller andra testfall
// tmpModel.options.objective = tmpModel.options.objective.newScale(8);
final Result tmpResult = tmpModel.minimise();
TestUtils.assertStateLessThanFeasible(tmpResult); // Should be infeasible
TestUtils.assertFalse(tmpModel.validate(tmpResult));
}
示例4: testP20150127infeasibleNode
import org.ojalgo.TestUtils; //导入方法依赖的package包/类
public void testP20150127infeasibleNode() {
final ExpressionsBasedModel tmpModel = P20150127b.getModel(true, false);
final Optimisation.Result tmpResult = tmpModel.minimise();
// Model is infeasible, and must be reported as such
TestUtils.assertStateLessThanFeasible(tmpResult);
}