t7100-solver-blend.pl 588 Bytes
Newer Older
Morten Welinder's avatar
Morten Welinder committed
1 2 3 4 5 6 7
#!/usr/bin/perl -w
# -----------------------------------------------------------------------------

use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;

8 9 10
&GnumericTest::report_skip ("No linear solver found")
    unless &GnumericTest::has_linear_solver ();

Morten Welinder's avatar
Morten Welinder committed
11
my $file = "blend.mps";
12 13 14
my $answer = -30.8121498458281;
# lp_solve:  -30.81221619004;
my $tol = 1e-4;
Morten Welinder's avatar
Morten Welinder committed
15 16 17 18 19
&message ("Check solver on $file problem.");
&test_sheet_calc ("$samples/solver/$file", ['--solve'], "B5",
		  sub {
		      chomp;
		      return (/^[-+]?(\d|\.\d)/ &&
20
			      abs ($answer - $_) < $tol);
Morten Welinder's avatar
Morten Welinder committed
21
		  });