本文整理匯總了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);
}