[pktools] 103/375: support negative weights in pkmosaic

Bas Couwenberg sebastic at xs4all.nl
Wed Dec 3 21:54:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch upstream-master
in repository pktools.

commit 52caa5ad64a4b282ce7e67568849c635e88955e9
Author: user <user at osgeolive.(none)>
Date:   Wed May 8 10:24:08 2013 +0200

    support negative weights in pkmosaic
---
 src/apps/pkmosaic.cc  |  4 ++--
 src/apps/pkopt_svm.cc | 11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/apps/pkmosaic.cc b/src/apps/pkmosaic.cc
index 75b907b..d09f8ad 100644
--- a/src/apps/pkmosaic.cc
+++ b/src/apps/pkmosaic.cc
@@ -661,8 +661,8 @@ int main(int argc, char *argv[])
                   val_new*=weight_opt[ifile];
                   storeBuffer[iband][ib].push_back(val_new);
                   assert(ifile>0);
-                  assert(weight_opt[ifile]>=0);
-                  assert(storeBuffer[iband][ib].back()>=0);
+                  // assert(weight_opt[ifile]>=0);
+                  // assert(storeBuffer[iband][ib].back()>=0);
                 }
                 break;
               }
diff --git a/src/apps/pkopt_svm.cc b/src/apps/pkopt_svm.cc
index 121b7a9..eeb8bde 100644
--- a/src/apps/pkopt_svm.cc
+++ b/src/apps/pkopt_svm.cc
@@ -560,7 +560,8 @@ int main(int argc, char *argv[])
     void* pProgressArg=NULL;
     GDALProgressFunc pfnProgress=GDALTermProgress;
     double progress=0;
-    pfnProgress(progress,pszMessage,pProgressArg);
+    if(!verbose_opt[0])
+      pfnProgress(progress,pszMessage,pProgressArg);
     double ncost=log(ccost_opt[1])/log(10)-log(ccost_opt[0])/log(10);
     double ngamma=log(gamma_opt[1])/log(10)-log(gamma_opt[0])/log(10);
     for(double ccost=ccost_opt[0];ccost<=ccost_opt[1];ccost*=10){
@@ -575,14 +576,16 @@ int main(int argc, char *argv[])
 	  minCost=ccost;
 	  minGamma=gamma;
 	  if(verbose_opt[0])
-	    std::cout << ccost << " " << gamma << error<< std::endl;
+	    std::cout << ccost << " " << gamma << " " << error<< std::endl;
 	}
 	progress+=1.0/ncost/ngamma;
-	pfnProgress(progress,pszMessage,pProgressArg);
+	if(!verbose_opt[0])
+	  pfnProgress(progress,pszMessage,pProgressArg);
       }
     }
     progress=1.0;
-    pfnProgress(progress,pszMessage,pProgressArg);
+    if(!verbose_opt[0])
+      pfnProgress(progress,pszMessage,pProgressArg);
     x[0]=minCost;
     x[1]=minGamma;
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git



More information about the Pkg-grass-devel mailing list