lupinix / rpms / scipy

Forked from rpms/scipy 6 years ago
Clone
Thomas Spura 0dc2264
From 759988bdecafe3a0fe55f06eb5e6a4b97c4fc232 Mon Sep 17 00:00:00 2001
Thomas Spura 0dc2264
From: Pauli Virtanen <pav@iki.fi>
Thomas Spura 0dc2264
Date: Fri, 29 Mar 2013 19:15:53 +0200
Thomas Spura 0dc2264
Subject: [PATCH] BUG: optimize/lbfgsb: fix a code path printing even when
Thomas Spura 0dc2264
 iprint < 0
Thomas Spura 0dc2264
Thomas Spura 0dc2264
---
Thomas Spura 0dc2264
 scipy/optimize/lbfgsb/lbfgsb.f | 6 ++++--
Thomas Spura 0dc2264
 1 file changed, 4 insertions(+), 2 deletions(-)
Thomas Spura 0dc2264
Thomas Spura 0dc2264
diff --git a/scipy/optimize/lbfgsb/lbfgsb.f b/scipy/optimize/lbfgsb/lbfgsb.f
Thomas Spura 0dc2264
index cc74b74..2406e39 100644
Thomas Spura 0dc2264
--- a/scipy/optimize/lbfgsb/lbfgsb.f
Thomas Spura 0dc2264
+++ b/scipy/optimize/lbfgsb/lbfgsb.f
Thomas Spura 0dc2264
@@ -3276,8 +3276,10 @@ subroutine subsm ( n, m, nsub, ind, l, u, nbd, x, d, xp, ws, wy,
Thomas Spura 0dc2264
  55   continue
Thomas Spura 0dc2264
       if ( dd_p .gt.zero ) then
Thomas Spura 0dc2264
          call dcopy( n, xp, 1, x, 1 )
Thomas Spura 0dc2264
-         write(6,*) ' Positive dir derivative in projection '
Thomas Spura 0dc2264
-         write(6,*) ' Using the backtracking step '
Thomas Spura 0dc2264
+         if (iprint .ge. 0) then
Thomas Spura 0dc2264
+            write(6,*) ' Positive dir derivative in projection '
Thomas Spura 0dc2264
+            write(6,*) ' Using the backtracking step '
Thomas Spura 0dc2264
+         endif
Thomas Spura 0dc2264
       else
Thomas Spura 0dc2264
          go to 911
Thomas Spura 0dc2264
       endif
Thomas Spura e0717a8
From ea96f8697deea203675c44b3d24e427e552c4de7 Mon Sep 17 00:00:00 2001
Thomas Spura e0717a8
From: Evgeni Burovski <evgeni@burovski.me>
Thomas Spura e0717a8
Date: Sun, 16 Feb 2014 01:27:03 +0000
Thomas Spura e0717a8
Subject: [PATCH] MAINT: silence a print in l-bfgs-b
Thomas Spura e0717a8
Thomas Spura e0717a8
---
Thomas Spura e0717a8
 scipy/optimize/lbfgsb/lbfgsb.f | 10 ++++++----
Thomas Spura e0717a8
 1 file changed, 6 insertions(+), 4 deletions(-)
Thomas Spura e0717a8
Thomas Spura e0717a8
diff --git a/scipy/optimize/lbfgsb/lbfgsb.f b/scipy/optimize/lbfgsb/lbfgsb.f
Thomas Spura e0717a8
index 2406e39..9a92668 100644
Thomas Spura e0717a8
--- a/scipy/optimize/lbfgsb/lbfgsb.f
Thomas Spura e0717a8
+++ b/scipy/optimize/lbfgsb/lbfgsb.f
Thomas Spura e0717a8
@@ -783,7 +783,7 @@ subroutine mainlb(n, m, x, l, u, nbd, f, g, factr, pgtol, ws, wy,
Thomas Spura e0717a8
  666  continue
Thomas Spura e0717a8
       call lnsrlb(n,l,u,nbd,x,f,fold,gd,gdold,g,d,r,t,z,stp,dnorm,
Thomas Spura e0717a8
      +            dtd,xstep,stpmx,iter,ifun,iback,nfgv,info,task,
Thomas Spura e0717a8
-     +            boxed,cnstnd,csave,isave(22),dsave(17))
Thomas Spura e0717a8
+     +            boxed,cnstnd,csave,isave(22),dsave(17), iprint)
Thomas Spura e0717a8
       if (info .ne. 0 .or. iback .ge. 20) then
Thomas Spura e0717a8
 c          restore the previous iterate.
Thomas Spura e0717a8
          call dcopy(n,t,1,x,1)
Thomas Spura e0717a8
@@ -2450,12 +2450,12 @@ subroutine hpsolb(n, t, iorder, iheap)
Thomas Spura e0717a8
       subroutine lnsrlb(n, l, u, nbd, x, f, fold, gd, gdold, g, d, r, t,
Thomas Spura e0717a8
      +                  z, stp, dnorm, dtd, xstep, stpmx, iter, ifun,
Thomas Spura e0717a8
      +                  iback, nfgv, info, task, boxed, cnstnd, csave,
Thomas Spura e0717a8
-     +                  isave, dsave)
Thomas Spura e0717a8
+     +                  isave, dsave, iprint)
Thomas Spura e0717a8
 
Thomas Spura e0717a8
       character*60     task, csave
Thomas Spura e0717a8
       logical          boxed, cnstnd
Thomas Spura e0717a8
       integer          n, iter, ifun, iback, nfgv, info,
Thomas Spura e0717a8
-     +                 nbd(n), isave(2)
Thomas Spura e0717a8
+     +                 nbd(n), isave(2), iprint
Thomas Spura e0717a8
       double precision f, fold, gd, gdold, stp, dnorm, dtd, xstep,
Thomas Spura e0717a8
      +                 stpmx, x(n), l(n), u(n), g(n), d(n), r(n), t(n),
Thomas Spura e0717a8
      +                 z(n), dsave(13)
Thomas Spura e0717a8
@@ -2547,7 +2547,9 @@ subroutine lnsrlb(n, l, u, nbd, x, f, fold, gd, gdold, g, d, r, t,
Thomas Spura e0717a8
          if (gd .ge. zero) then
Thomas Spura e0717a8
 c                               the directional derivative >=0.
Thomas Spura e0717a8
 c                               Line search is impossible.
Thomas Spura e0717a8
-            write(6,*)' ascent direction in projection gd = ', gd
Thomas Spura e0717a8
+            if (iprint .ge. 0) then
Thomas Spura e0717a8
+                write(6,*)' ascent direction in projection gd = ', gd
Thomas Spura e0717a8
+            endif
Thomas Spura e0717a8
             info = -4
Thomas Spura e0717a8
             return
Thomas Spura e0717a8
          endif