lupinix / rpms / scipy

Forked from rpms/scipy 6 years ago
Clone
Blob Blame History Raw
From 759988bdecafe3a0fe55f06eb5e6a4b97c4fc232 Mon Sep 17 00:00:00 2001
From: Pauli Virtanen <pav@iki.fi>
Date: Fri, 29 Mar 2013 19:15:53 +0200
Subject: [PATCH] BUG: optimize/lbfgsb: fix a code path printing even when
 iprint < 0

---
 scipy/optimize/lbfgsb/lbfgsb.f | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scipy/optimize/lbfgsb/lbfgsb.f b/scipy/optimize/lbfgsb/lbfgsb.f
index cc74b74..2406e39 100644
--- a/scipy/optimize/lbfgsb/lbfgsb.f
+++ b/scipy/optimize/lbfgsb/lbfgsb.f
@@ -3276,8 +3276,10 @@ subroutine subsm ( n, m, nsub, ind, l, u, nbd, x, d, xp, ws, wy,
  55   continue
       if ( dd_p .gt.zero ) then
          call dcopy( n, xp, 1, x, 1 )
-         write(6,*) ' Positive dir derivative in projection '
-         write(6,*) ' Using the backtracking step '
+         if (iprint .ge. 0) then
+            write(6,*) ' Positive dir derivative in projection '
+            write(6,*) ' Using the backtracking step '
+         endif
       else
          go to 911
       endif
From ea96f8697deea203675c44b3d24e427e552c4de7 Mon Sep 17 00:00:00 2001
From: Evgeni Burovski <evgeni@burovski.me>
Date: Sun, 16 Feb 2014 01:27:03 +0000
Subject: [PATCH] MAINT: silence a print in l-bfgs-b

---
 scipy/optimize/lbfgsb/lbfgsb.f | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scipy/optimize/lbfgsb/lbfgsb.f b/scipy/optimize/lbfgsb/lbfgsb.f
index 2406e39..9a92668 100644
--- a/scipy/optimize/lbfgsb/lbfgsb.f
+++ b/scipy/optimize/lbfgsb/lbfgsb.f
@@ -783,7 +783,7 @@ subroutine mainlb(n, m, x, l, u, nbd, f, g, factr, pgtol, ws, wy,
  666  continue
       call lnsrlb(n,l,u,nbd,x,f,fold,gd,gdold,g,d,r,t,z,stp,dnorm,
      +            dtd,xstep,stpmx,iter,ifun,iback,nfgv,info,task,
-     +            boxed,cnstnd,csave,isave(22),dsave(17))
+     +            boxed,cnstnd,csave,isave(22),dsave(17), iprint)
       if (info .ne. 0 .or. iback .ge. 20) then
 c          restore the previous iterate.
          call dcopy(n,t,1,x,1)
@@ -2450,12 +2450,12 @@ subroutine hpsolb(n, t, iorder, iheap)
       subroutine lnsrlb(n, l, u, nbd, x, f, fold, gd, gdold, g, d, r, t,
      +                  z, stp, dnorm, dtd, xstep, stpmx, iter, ifun,
      +                  iback, nfgv, info, task, boxed, cnstnd, csave,
-     +                  isave, dsave)
+     +                  isave, dsave, iprint)
 
       character*60     task, csave
       logical          boxed, cnstnd
       integer          n, iter, ifun, iback, nfgv, info,
-     +                 nbd(n), isave(2)
+     +                 nbd(n), isave(2), iprint
       double precision f, fold, gd, gdold, stp, dnorm, dtd, xstep,
      +                 stpmx, x(n), l(n), u(n), g(n), d(n), r(n), t(n),
      +                 z(n), dsave(13)
@@ -2547,7 +2547,9 @@ subroutine lnsrlb(n, l, u, nbd, x, f, fold, gd, gdold, g, d, r, t,
          if (gd .ge. zero) then
 c                               the directional derivative >=0.
 c                               Line search is impossible.
-            write(6,*)' ascent direction in projection gd = ', gd
+            if (iprint .ge. 0) then
+                write(6,*)' ascent direction in projection gd = ', gd
+            endif
             info = -4
             return
          endif