Skip to content

Instantly share code, notes, and snippets.

@msakai
Created Jul 16, 2015
Embed
What would you like to do?
{-# LANGUAGE ScopedTypeVariables #-}
import qualified Data.Vector.Storable as VS
import Data.Vector.Generic ((!))
import qualified Data.Vector.Generic as VG
import Ipopt.Raw
( addIpoptNumOption,
addIpoptStrOption,
addIpoptIntOption,
ipoptSolve,
createIpoptProblemAD,
IpOptSolved(..) )
type Weight = Int
type Lit = Int
type Clause = [Lit]
main :: IO ()
main = do
let fromList = VS.unsafeThaw . VS.fromList
xL <- fromList (replicate nv 0)
xU <- fromList (replicate nv 1)
gL <- fromList []
gU <- fromList []
let f x = sum [fromIntegral w * product [evalLit l x | l <- ls] | (w,ls) <- obj]
g x = VG.empty
nlp <- createIpoptProblemAD xL xU gL gU f g
addIpoptNumOption nlp "tol" 1.0e-3
addIpoptStrOption nlp "mu_strategy" "adaptive"
-- addIpoptIntOption nlp "print_level" 0
x <- fromList $ replicate nv 0.5
(result :: IpOptSolved VS.Vector) <- ipoptSolve nlp x
print $ _ipOptSolved_status result
print $ _ipOptSolved_objective result
print $ f (_ipOptSolved_x result)
return ()
where
(nv, nc, wclauses) = wcnf
obj :: [(Weight, [Lit])]
obj = [(w, [-l | l <- ls]) | (w,ls) <- wclauses]
evalLit :: (VG.Vector v a, Num a) => Lit -> v a -> a
evalLit l xs = if l > 0 then xs ! (v - 1) else 1 - (xs ! (v - 1))
where v = abs l
wcnf :: (Int, Int, [(Weight, Clause)])
wcnf = (nv, nc, wclauses)
where
nv = read nv'
nc = read nc'
[_p, _wcnf_, nv', nc'] = words (head wcnf_file)
wclauses = do
l <- tail wcnf_file
let (w:ls) = words l
return (read w, map read (init ls))
wcnf_file :: [String]
wcnf_file =
[ "p wcnf 45 330"
, " 890 1 2 10 0"
, " 238 1 3 11 0"
, " 352 2 3 18 0"
, " 853 10 11 18 0"
, " 319 1 4 12 0"
, " 129 2 4 19 0"
, " 656 10 12 19 0"
, " 870 3 4 25 0"
, " 88 11 12 25 0"
, " 705 18 19 25 0"
, " 415 1 5 13 0"
, " 955 2 5 20 0"
, " 56 10 13 20 0"
, " 178 3 5 26 0"
, " 610 11 13 26 0"
, " 81 18 20 26 0"
, " 239 4 5 31 0"
, " 830 12 13 31 0"
, " 393 19 20 31 0"
, " 433 25 26 31 0"
, " 124 1 6 14 0"
, " 385 2 6 21 0"
, " 605 10 14 21 0"
, " 525 3 6 27 0"
, " 793 11 14 27 0"
, " 657 18 21 27 0"
, " 177 4 6 32 0"
, " 423 12 14 32 0"
, " 509 19 21 32 0"
, " 616 25 27 32 0"
, " 40 5 6 36 0"
, " 183 13 14 36 0"
, " 356 20 21 36 0"
, " 996 26 27 36 0"
, " 163 31 32 36 0"
, " 658 1 7 15 0"
, " 582 2 7 22 0"
, " 566 10 15 22 0"
, " 357 3 7 28 0"
, " 764 11 15 28 0"
, " 267 18 22 28 0"
, " 187 4 7 33 0"
, " 454 12 15 33 0"
, " 359 19 22 33 0"
, " 923 25 28 33 0"
, " 784 5 7 37 0"
, " 497 13 15 37 0"
, " 846 20 22 37 0"
, " 680 26 28 37 0"
, " 363 31 33 37 0"
, " 563 6 7 40 0"
, " 623 14 15 40 0"
, " 653 21 22 40 0"
, " 183 27 28 40 0"
, " 847 32 33 40 0"
, " 519 36 37 40 0"
, " 140 1 8 16 0"
, " 221 2 8 23 0"
, " 618 10 16 23 0"
, " 317 3 8 29 0"
, " 260 11 16 29 0"
, " 56 18 23 29 0"
, " 698 4 8 34 0"
, " 522 12 16 34 0"
, " 661 19 23 34 0"
, " 283 25 29 34 0"
, " 62 5 8 38 0"
, " 464 13 16 38 0"
, " 928 20 23 38 0"
, " 597 26 29 38 0"
, " 200 31 34 38 0"
, " 888 6 8 41 0"
, " 304 14 16 41 0"
, " 664 21 23 41 0"
, " 860 27 29 41 0"
, " 139 32 34 41 0"
, " 365 36 38 41 0"
, " 908 7 8 43 0"
, " 807 15 16 43 0"
, " 80 22 23 43 0"
, " 256 28 29 43 0"
, " 336 33 34 43 0"
, " 200 37 38 43 0"
, " 855 40 41 43 0"
, " 131 1 9 17 0"
, " 523 2 9 24 0"
, " 239 10 17 24 0"
, " 634 3 9 30 0"
, " 407 11 17 30 0"
, " 895 18 24 30 0"
, " 694 4 9 35 0"
, " 456 12 17 35 0"
, " 466 19 24 35 0"
, " 417 25 30 35 0"
, " 931 5 9 39 0"
, " 300 13 17 39 0"
, " 429 20 24 39 0"
, " 826 26 30 39 0"
, " 85 31 35 39 0"
, " 508 6 9 42 0"
, " 619 14 17 42 0"
, " 526 21 24 42 0"
, " 984 27 30 42 0"
, " 682 32 35 42 0"
, " 354 36 39 42 0"
, " 271 7 9 44 0"
, " 450 15 17 44 0"
, " 187 22 24 44 0"
, " 675 28 30 44 0"
, " 762 33 35 44 0"
, " 623 37 39 44 0"
, " 378 40 42 44 0"
, " 652 8 9 45 0"
, " 288 16 17 45 0"
, " 900 23 24 45 0"
, " 675 29 30 45 0"
, " 883 34 35 45 0"
, " 524 38 39 45 0"
, " 147 41 42 45 0"
, " 622 43 44 45 0"
, " 809 -1 -2 -3 -10 -11 -18 0"
, " 624 -1 -2 -4 -10 -12 -19 0"
, " 784 -1 -3 -4 -11 -12 -25 0"
, " 43 -2 -3 -4 -18 -19 -25 0"
, " 485 -10 -11 -12 -18 -19 -25 0"
, " 722 -1 -2 -5 -10 -13 -20 0"
, " 382 -1 -3 -5 -11 -13 -26 0"
, " 424 -2 -3 -5 -18 -20 -26 0"
, " 406 -10 -11 -13 -18 -20 -26 0"
, " 979 -1 -4 -5 -12 -13 -31 0"
, " 394 -2 -4 -5 -19 -20 -31 0"
, " 648 -10 -12 -13 -19 -20 -31 0"
, " 44 -3 -4 -5 -25 -26 -31 0"
, " 286 -11 -12 -13 -25 -26 -31 0"
, " 637 -18 -19 -20 -25 -26 -31 0"
, " 209 -1 -2 -6 -10 -14 -21 0"
, " 694 -1 -3 -6 -11 -14 -27 0"
, " 766 -2 -3 -6 -18 -21 -27 0"
, " 167 -10 -11 -14 -18 -21 -27 0"
, " 20 -1 -4 -6 -12 -14 -32 0"
, " 272 -2 -4 -6 -19 -21 -32 0"
, " 181 -10 -12 -14 -19 -21 -32 0"
, " 153 -3 -4 -6 -25 -27 -32 0"
, " 960 -11 -12 -14 -25 -27 -32 0"
, " 678 -18 -19 -21 -25 -27 -32 0"
, " 384 -1 -5 -6 -13 -14 -36 0"
, " 388 -2 -5 -6 -20 -21 -36 0"
, " 257 -10 -13 -14 -20 -21 -36 0"
, " 358 -3 -5 -6 -26 -27 -36 0"
, " 930 -11 -13 -14 -26 -27 -36 0"
, " 59 -18 -20 -21 -26 -27 -36 0"
, " 859 -4 -5 -6 -31 -32 -36 0"
, " 688 -12 -13 -14 -31 -32 -36 0"
, " 981 -19 -20 -21 -31 -32 -36 0"
, " 393 -25 -26 -27 -31 -32 -36 0"
, " 907 -1 -2 -7 -10 -15 -22 0"
, " 796 -1 -3 -7 -11 -15 -28 0"
, " 622 -2 -3 -7 -18 -22 -28 0"
, " 824 -10 -11 -15 -18 -22 -28 0"
, " 425 -1 -4 -7 -12 -15 -33 0"
, " 464 -2 -4 -7 -19 -22 -33 0"
, " 717 -10 -12 -15 -19 -22 -33 0"
, " 274 -3 -4 -7 -25 -28 -33 0"
, " 370 -11 -12 -15 -25 -28 -33 0"
, " 714 -18 -19 -22 -25 -28 -33 0"
, " 430 -1 -5 -7 -13 -15 -37 0"
, " 211 -2 -5 -7 -20 -22 -37 0"
, " 157 -10 -13 -15 -20 -22 -37 0"
, " 728 -3 -5 -7 -26 -28 -37 0"
, " 533 -11 -13 -15 -26 -28 -37 0"
, " 77 -18 -20 -22 -26 -28 -37 0"
, " 780 -4 -5 -7 -31 -33 -37 0"
, " 700 -12 -13 -15 -31 -33 -37 0"
, " 629 -19 -20 -22 -31 -33 -37 0"
, " 729 -25 -26 -28 -31 -33 -37 0"
, " 671 -1 -6 -7 -14 -15 -40 0"
, " 267 -2 -6 -7 -21 -22 -40 0"
, " 416 -10 -14 -15 -21 -22 -40 0"
, " 512 -3 -6 -7 -27 -28 -40 0"
, " 398 -11 -14 -15 -27 -28 -40 0"
, " 133 -18 -21 -22 -27 -28 -40 0"
, " 109 -4 -6 -7 -32 -33 -40 0"
, " 589 -12 -14 -15 -32 -33 -40 0"
, " 347 -19 -21 -22 -32 -33 -40 0"
, " 509 -25 -27 -28 -32 -33 -40 0"
, " 161 -5 -6 -7 -36 -37 -40 0"
, " 152 -13 -14 -15 -36 -37 -40 0"
, " 503 -20 -21 -22 -36 -37 -40 0"
, " 8 -26 -27 -28 -36 -37 -40 0"
, " 390 -31 -32 -33 -36 -37 -40 0"
, " 150 -1 -2 -8 -10 -16 -23 0"
, " 463 -1 -3 -8 -11 -16 -29 0"
, " 600 -2 -3 -8 -18 -23 -29 0"
, " 645 -10 -11 -16 -18 -23 -29 0"
, " 136 -1 -4 -8 -12 -16 -34 0"
, " 786 -2 -4 -8 -19 -23 -34 0"
, " 268 -10 -12 -16 -19 -23 -34 0"
, " 141 -3 -4 -8 -25 -29 -34 0"
, " 882 -11 -12 -16 -25 -29 -34 0"
, " 839 -18 -19 -23 -25 -29 -34 0"
, " 984 -1 -5 -8 -13 -16 -38 0"
, " 582 -2 -5 -8 -20 -23 -38 0"
, " 373 -10 -13 -16 -20 -23 -38 0"
, " 232 -3 -5 -8 -26 -29 -38 0"
, " 628 -11 -13 -16 -26 -29 -38 0"
, " 192 -18 -20 -23 -26 -29 -38 0"
, " 811 -4 -5 -8 -31 -34 -38 0"
, " 980 -12 -13 -16 -31 -34 -38 0"
, " 480 -19 -20 -23 -31 -34 -38 0"
, " 796 -25 -26 -29 -31 -34 -38 0"
, " 247 -1 -6 -8 -14 -16 -41 0"
, " 521 -2 -6 -8 -21 -23 -41 0"
, " 906 -10 -14 -16 -21 -23 -41 0"
, " 53 -3 -6 -8 -27 -29 -41 0"
, " 476 -11 -14 -16 -27 -29 -41 0"
, " 710 -18 -21 -23 -27 -29 -41 0"
, " 863 -4 -6 -8 -32 -34 -41 0"
, " 987 -12 -14 -16 -32 -34 -41 0"
, " 815 -19 -21 -23 -32 -34 -41 0"
, " 910 -25 -27 -29 -32 -34 -41 0"
, " 851 -5 -6 -8 -36 -38 -41 0"
, " 926 -13 -14 -16 -36 -38 -41 0"
, " 383 -20 -21 -23 -36 -38 -41 0"
, " 317 -26 -27 -29 -36 -38 -41 0"
, " 936 -31 -32 -34 -36 -38 -41 0"
, " 989 -1 -7 -8 -15 -16 -43 0"
, " 517 -2 -7 -8 -22 -23 -43 0"
, " 629 -10 -15 -16 -22 -23 -43 0"
, " 468 -3 -7 -8 -28 -29 -43 0"
, " 224 -11 -15 -16 -28 -29 -43 0"
, " 952 -18 -22 -23 -28 -29 -43 0"
, " 196 -4 -7 -8 -33 -34 -43 0"
, " 115 -12 -15 -16 -33 -34 -43 0"
, " 545 -19 -22 -23 -33 -34 -43 0"
, " 373 -25 -28 -29 -33 -34 -43 0"
, " 769 -5 -7 -8 -37 -38 -43 0"
, " 850 -13 -15 -16 -37 -38 -43 0"
, " 583 -20 -22 -23 -37 -38 -43 0"
, " 981 -26 -28 -29 -37 -38 -43 0"
, " 982 -31 -33 -34 -37 -38 -43 0"
, " 502 -6 -7 -8 -40 -41 -43 0"
, " 567 -14 -15 -16 -40 -41 -43 0"
, " 690 -21 -22 -23 -40 -41 -43 0"
, " 675 -27 -28 -29 -40 -41 -43 0"
, " 504 -32 -33 -34 -40 -41 -43 0"
, " 382 -36 -37 -38 -40 -41 -43 0"
, " 586 -1 -2 -9 -10 -17 -24 0"
, " 200 -1 -3 -9 -11 -17 -30 0"
, " 466 -2 -3 -9 -18 -24 -30 0"
, " 903 -10 -11 -17 -18 -24 -30 0"
, " 262 -1 -4 -9 -12 -17 -35 0"
, " 832 -2 -4 -9 -19 -24 -35 0"
, " 181 -10 -12 -17 -19 -24 -35 0"
, " 755 -3 -4 -9 -25 -30 -35 0"
, " 666 -11 -12 -17 -25 -30 -35 0"
, " 397 -18 -19 -24 -25 -30 -35 0"
, " 720 -1 -5 -9 -13 -17 -39 0"
, " 602 -2 -5 -9 -20 -24 -39 0"
, " 78 -10 -13 -17 -20 -24 -39 0"
, " 261 -3 -5 -9 -26 -30 -39 0"
, " 201 -11 -13 -17 -26 -30 -39 0"
, " 109 -18 -20 -24 -26 -30 -39 0"
, " 849 -4 -5 -9 -31 -35 -39 0"
, " 789 -12 -13 -17 -31 -35 -39 0"
, " 899 -19 -20 -24 -31 -35 -39 0"
, " 682 -25 -26 -30 -31 -35 -39 0"
, " 519 -1 -6 -9 -14 -17 -42 0"
, " 408 -2 -6 -9 -21 -24 -42 0"
, " 284 -10 -14 -17 -21 -24 -42 0"
, " 137 -3 -6 -9 -27 -30 -42 0"
, " 946 -11 -14 -17 -27 -30 -42 0"
, " 397 -18 -21 -24 -27 -30 -42 0"
, " 641 -4 -6 -9 -32 -35 -42 0"
, " 392 -12 -14 -17 -32 -35 -42 0"
, " 65 -19 -21 -24 -32 -35 -42 0"
, " 531 -25 -27 -30 -32 -35 -42 0"
, " 877 -5 -6 -9 -36 -39 -42 0"
, " 337 -13 -14 -17 -36 -39 -42 0"
, " 907 -20 -21 -24 -36 -39 -42 0"
, " 693 -26 -27 -30 -36 -39 -42 0"
, " 158 -31 -32 -35 -36 -39 -42 0"
, " 982 -1 -7 -9 -15 -17 -44 0"
, " 499 -2 -7 -9 -22 -24 -44 0"
, " 597 -10 -15 -17 -22 -24 -44 0"
, " 981 -3 -7 -9 -28 -30 -44 0"
, " 25 -11 -15 -17 -28 -30 -44 0"
, " 272 -18 -22 -24 -28 -30 -44 0"
, " 734 -4 -7 -9 -33 -35 -44 0"
, " 323 -12 -15 -17 -33 -35 -44 0"
, " 962 -19 -22 -24 -33 -35 -44 0"
, " 605 -25 -28 -30 -33 -35 -44 0"
, " 667 -5 -7 -9 -37 -39 -44 0"
, " 482 -13 -15 -17 -37 -39 -44 0"
, " 852 -20 -22 -24 -37 -39 -44 0"
, " 123 -26 -28 -30 -37 -39 -44 0"
, " 807 -31 -33 -35 -37 -39 -44 0"
, " 241 -6 -7 -9 -40 -42 -44 0"
, " 876 -14 -15 -17 -40 -42 -44 0"
, " 378 -21 -22 -24 -40 -42 -44 0"
, " 789 -27 -28 -30 -40 -42 -44 0"
, " 976 -32 -33 -35 -40 -42 -44 0"
, " 817 -36 -37 -39 -40 -42 -44 0"
, " 540 -1 -8 -9 -16 -17 -45 0"
, " 570 -2 -8 -9 -23 -24 -45 0"
, " 332 -10 -16 -17 -23 -24 -45 0"
, " 562 -3 -8 -9 -29 -30 -45 0"
, " 721 -11 -16 -17 -29 -30 -45 0"
, " 388 -18 -23 -24 -29 -30 -45 0"
, " 99 -4 -8 -9 -34 -35 -45 0"
, " 788 -12 -16 -17 -34 -35 -45 0"
, " 553 -19 -23 -24 -34 -35 -45 0"
, " 690 -25 -29 -30 -34 -35 -45 0"
, " 906 -5 -8 -9 -38 -39 -45 0"
, " 919 -13 -16 -17 -38 -39 -45 0"
, " 654 -20 -23 -24 -38 -39 -45 0"
, " 160 -26 -29 -30 -38 -39 -45 0"
, " 356 -31 -34 -35 -38 -39 -45 0"
, " 512 -6 -8 -9 -41 -42 -45 0"
, " 594 -14 -16 -17 -41 -42 -45 0"
, " 985 -21 -23 -24 -41 -42 -45 0"
, " 242 -27 -29 -30 -41 -42 -45 0"
, " 171 -32 -34 -35 -41 -42 -45 0"
, " 9 -36 -38 -39 -41 -42 -45 0"
, " 456 -7 -8 -9 -43 -44 -45 0"
, " 446 -15 -16 -17 -43 -44 -45 0"
, " 133 -22 -23 -24 -43 -44 -45 0"
, " 451 -28 -29 -30 -43 -44 -45 0"
, " 64 -33 -34 -35 -43 -44 -45 0"
, " 168 -37 -38 -39 -43 -44 -45 0"
, " 637 -40 -41 -42 -43 -44 -45 0"
]
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************
This is Ipopt version 3.12.3, running with linear solver mumps.
NOTE: Other linear solvers might be more efficient (see Ipopt documentation).
Number of nonzeros in equality constraint Jacobian...: 0
Number of nonzeros in inequality constraint Jacobian.: 0
Number of nonzeros in Lagrangian Hessian.............: 1035
Total number of variables............................: 45
variables with only lower bounds: 0
variables with lower and upper bounds: 45
variables with only upper bounds: 0
Total number of equality constraints.................: 0
Total number of inequality constraints...............: 0
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 0
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
0 9.1452188e+03 0.00e+00 1.00e+02 0.0 0.00e+00 - 0.00e+00 0.00e+00 0
1 9.0186313e+03 0.00e+00 9.47e+01 -1.8 9.48e-03 4.0 1.00e+00 1.00e+00f 1
2 8.7524992e+03 0.00e+00 8.22e+01 -3.4 2.47e-02 3.5 1.00e+00 1.00e+00f 1
3 8.3950776e+03 0.00e+00 6.17e+01 -4.6 5.60e-02 3.0 1.00e+00 1.00e+00f 1
4 7.7652431e+03 0.00e+00 5.64e+01 -5.3 1.53e-01 2.6 1.00e+00 1.00e+00f 1
5 7.4592874e+03 0.00e+00 6.16e+01 -6.3 6.23e-02 3.0 1.00e+00 1.00e+00f 1
6 5.8944141e+03 0.00e+00 1.04e+02 -6.7 3.56e-01 2.5 1.00e+00 7.40e-01f 1
7 5.8740360e+03 0.00e+00 1.05e+02 -7.5 1.54e-01 2.9 1.00e+00 1.96e-02f 1
8 5.8735738e+03 0.00e+00 1.05e+02 -7.7 1.14e+00 2.5 1.00e+00 7.94e-05f 1
9 5.7812627e+03 0.00e+00 1.08e+02 -7.9 1.82e-01 2.9 1.00e+00 8.18e-02f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
10 5.7785699e+03 0.00e+00 8.42e+01 -7.7 8.44e-01 2.4 1.00e+00 4.85e-04f 1
11 5.4535868e+03 0.00e+00 9.04e+01 -7.0 1.51e-01 2.8 1.00e+00 2.97e-01f 1
12 5.4488058e+03 0.00e+00 1.22e+02 -6.8 1.08e+00 2.4 1.00e+00 6.51e-04f 1
13 5.0689035e+03 0.00e+00 8.77e+01 -6.8 1.62e-01 2.8 1.00e+00 3.06e-01f 1
14 5.0596907e+03 0.00e+00 1.84e+02 -6.1 2.16e+00 2.3 1.00e+00 7.65e-04f 1
15 4.9209935e+03 0.00e+00 8.30e+01 -5.6 2.05e-01 2.7 1.00e+00 9.86e-02f 1
16 4.8507090e+03 0.00e+00 8.06e+01 -6.0 6.11e-02 3.2 1.00e+00 1.63e-01f 1
17 4.7912215e+03 0.00e+00 7.79e+01 -6.4 2.21e-01 2.7 1.00e+00 4.48e-02f 1
18 4.6288658e+03 0.00e+00 8.08e+01 -6.3 6.61e-02 3.1 1.00e+00 3.64e-01f 1
19 4.6196708e+03 0.00e+00 8.10e+01 -6.7 2.55e-01 2.6 1.00e+00 6.34e-03f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
20 4.1413973e+03 0.00e+00 8.66e+01 -7.0 7.51e-02 3.1 1.00e+00 1.00e+00f 1
21 3.9765375e+03 0.00e+00 9.04e+01 -7.4 3.44e-01 2.6 1.00e+00 8.34e-02f 1
22 3.9748787e+03 0.00e+00 9.04e+01 -8.0 9.89e-02 3.0 1.00e+00 2.63e-03f 1
23 3.9689100e+03 0.00e+00 9.06e+01 -8.0 4.97e-01 2.5 1.00e+00 2.63e-03f 1
24 3.8139771e+03 0.00e+00 9.46e+01 -7.5 1.18e-01 3.0 1.00e+00 2.35e-01f 1
25 3.8123573e+03 0.00e+00 8.25e+01 -7.7 4.67e-01 2.5 1.00e+00 5.94e-04f 1
26 3.7628611e+03 0.00e+00 7.15e+01 -6.6 1.07e-01 2.9 1.00e+00 7.85e-02f 1
27 3.6717508e+03 0.00e+00 7.25e+01 -6.7 5.61e-01 2.4 1.00e+00 4.30e-02f 1
28 3.6337014e+03 0.00e+00 7.38e+01 -7.0 1.31e-01 2.9 1.00e+00 5.89e-02f 1
29 3.5348598e+03 0.00e+00 8.25e+01 -6.9 8.10e-01 2.4 1.00e+00 3.86e-02f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
30 3.0744093e+03 0.00e+00 9.52e+01 -7.4 1.65e-01 2.8 1.00e+00 6.19e-01f 1
31 3.0718015e+03 0.00e+00 1.84e+02 -7.0 1.99e+00 2.3 1.00e+00 5.12e-04f 1
32 3.0706967e+03 0.00e+00 6.26e+01 -7.5 1.21e-01 2.8 1.00e+00 1.61e-03f 1
33 2.8713092e+03 0.00e+00 6.41e+01 -7.6 4.24e-02 3.2 1.00e+00 7.94e-01f 1
34 2.8688572e+03 0.00e+00 6.41e+01 -8.2 1.44e-01 2.7 1.00e+00 3.17e-03f 1
35 2.8686737e+03 0.00e+00 6.41e+01 -7.7 4.92e-02 3.1 1.00e+00 6.87e-04f 1
36 2.8174388e+03 0.00e+00 6.47e+01 -7.3 1.66e-01 2.7 1.00e+00 6.05e-02f 1
37 2.8133454e+03 0.00e+00 6.47e+01 -7.5 5.47e-02 3.1 1.00e+00 1.50e-02f 1
38 2.7595425e+03 0.00e+00 6.51e+01 -7.1 1.77e-01 2.6 1.00e+00 6.25e-02f 1
39 2.7512107e+03 0.00e+00 6.50e+01 -7.4 6.19e-02 3.0 1.00e+00 2.92e-02f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
40 2.7094498e+03 0.00e+00 6.27e+01 -6.9 2.12e-01 2.6 1.00e+00 4.53e-02f 1
41 2.6973062e+03 0.00e+00 5.65e+01 -7.4 6.49e-02 3.0 1.00e+00 4.34e-02f 1
42 2.5384749e+03 0.00e+00 6.08e+01 -7.7 2.61e-01 2.5 1.00e+00 1.66e-01f 1
43 2.5366907e+03 0.00e+00 6.08e+01 -7.7 8.08e-02 2.9 1.00e+00 5.35e-03f 1
44 2.5349612e+03 0.00e+00 6.09e+01 -7.5 3.50e-01 2.4 1.00e+00 1.76e-03f 1
45 2.4790353e+03 0.00e+00 6.22e+01 -7.2 9.19e-02 2.9 1.00e+00 1.72e-01f 1
46 2.4735550e+03 0.00e+00 6.25e+01 -3.3 4.95e-01 2.4 1.00e+00 4.75e-03f 1
47 2.4321739e+03 0.00e+00 6.36e+01 -4.2 1.08e-01 2.8 1.00e+00 1.19e-01f 1
48 2.3919148e+03 0.00e+00 6.49e+01 -2.9 8.06e-01 2.3 1.00e+00 2.59e-02f 1
49 2.3832195e+03 0.00e+00 5.49e+01 -3.8 9.39e-02 2.8 1.00e+00 2.71e-02f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
50 2.0792297e+03 0.00e+00 6.38e+01 -1.6 4.76e-01 2.3 8.39e-01 2.25e-01f 1
51 2.0623058e+03 0.00e+00 6.39e+01 -2.5 1.33e-01 2.7 1.00e+00 3.89e-02f 1
52 1.8879220e+03 0.00e+00 8.33e+01 -0.6 1.27e+00 2.2 1.00e+00 6.83e-02f 1
53 1.7256209e+03 0.00e+00 5.79e+01 -1.2 1.39e-01 2.7 1.00e+00 3.90e-01f 1
54 1.5917907e+03 0.00e+00 1.01e+02 -0.9 8.84e-01 2.2 1.00e+00 8.55e-02f 1
55 1.4583312e+03 0.00e+00 3.57e+01 -1.2 8.75e-02 2.6 1.00e+00 6.11e-01f 1
56 1.3787903e+03 0.00e+00 1.27e+02 -0.1 9.04e-01 2.1 9.76e-01 1.20e-01f 1
57 1.2697840e+03 0.00e+00 2.60e+01 -0.8 7.05e-02 2.6 1.00e+00 8.47e-01f 1
58 1.0736508e+03 0.00e+00 3.71e+01 -1.2 5.01e-01 2.1 1.00e+00 3.48e-01f 1
59 1.0054276e+03 0.00e+00 3.49e+01 -2.1 1.28e-01 2.5 1.00e+00 3.43e-01f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
60 8.7135277e+02 0.00e+00 3.62e+01 -1.4 4.50e-01 2.0 1.00e+00 3.30e-01f 1
61 7.7222861e+02 0.00e+00 3.93e+01 -2.1 1.43e-01 2.5 1.00e+00 5.96e-01f 1
62 7.5731508e+02 0.00e+00 7.62e+01 -0.4 6.23e-01 2.0 1.00e+00 5.53e-02f 1
63 6.3399670e+02 0.00e+00 7.62e+01 -6.5 7.53e-01 1.5 4.86e-02 2.62e-01f 1
64 5.9472974e+02 0.00e+00 2.45e+01 -0.8 2.83e-01 1.9 1.00e+00 3.47e-01f 1
65 5.5165531e+02 0.00e+00 3.74e+01 -1.2 3.72e-01 1.5 1.00e+00 3.69e-01f 1
66 5.1903683e+02 0.00e+00 3.53e+01 -0.8 7.90e-01 1.0 6.65e-01 2.33e-01f 1
67 5.1813061e+02 0.00e+00 1.60e+01 -1.1 1.41e-01 1.4 1.00e+00 1.41e-02f 2
68 4.8925368e+02 0.00e+00 6.59e+00 -1.7 1.58e-01 0.9 1.00e+00 6.82e-01f 1
69 4.7763078e+02 0.00e+00 5.50e-01 -1.9 1.41e-02 1.4 1.00e+00 7.76e-01f 1
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
70 4.7044915e+02 0.00e+00 4.54e-02 -3.7 5.29e-03 0.9 1.00e+00 9.49e-01f 1
71 4.7000483e+02 0.00e+00 4.15e-04 -5.3 1.54e-04 0.4 1.00e+00 9.93e-01f 1
72 4.6999972e+02 0.00e+00 3.08e-06 -7.2 3.65e-06 -0.1 1.00e+00 1.00e+00f 1
Number of Iterations....: 72
(scaled) (unscaled)
Objective...............: 4.8023472167082303e+01 4.6999971916521366e+02
Dual infeasibility......: 3.0834318115646668e-06 3.0177161710806949e-05
Constraint violation....: 0.0000000000000000e+00 0.0000000000000000e+00
Complementarity.........: 6.8087217414247312e-08 6.6636108593106164e-07
Overall NLP error.......: 3.0834318115646668e-06 3.0177161710806949e-05
Number of objective function evaluations = 78
Number of objective gradient evaluations = 73
Number of equality constraint evaluations = 0
Number of inequality constraint evaluations = 0
Number of equality constraint Jacobian evaluations = 0
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations = 72
Total CPU secs in IPOPT (w/o function evaluations) = 0.138
Total CPU secs in NLP function evaluations = 1.604
EXIT: Optimal Solution Found.
SolveSucceeded
469.99971916521366
470.0000002057528
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment