[opengm] 154/386: Fix tests after learnablefunction.hxx and l_potts.hxx were removed (but probably still present in installation destination of some developers)

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Aug 31 08:36:55 UTC 2016


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

ghisvail-guest pushed a commit to branch debian/master
in repository opengm.

commit 98a5bbbb80a2f9e82da7df332f8376e64922c699
Author: Carsten Haubold <carstenhaubold at googlemail.com>
Date:   Fri Dec 19 11:32:49 2014 +0100

    Fix tests after learnablefunction.hxx and l_potts.hxx were removed (but probably still present in installation destination of some developers)
---
 src/unittest/test_gm_learning_functions.cxx | 11 ++++++-----
 src/unittest/test_learnable_functions.cxx   | 24 ------------------------
 2 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/src/unittest/test_gm_learning_functions.cxx b/src/unittest/test_gm_learning_functions.cxx
index c78317e..653e0d6 100644
--- a/src/unittest/test_gm_learning_functions.cxx
+++ b/src/unittest/test_gm_learning_functions.cxx
@@ -1,7 +1,6 @@
 #include <vector>
 
 #include <opengm/functions/explicit_function.hxx>
-#include <opengm/functions/l_potts.hxx>
 #include <opengm/functions/potts.hxx>
 #include <opengm/functions/pottsn.hxx>
 #include <opengm/unittests/test.hxx>
@@ -9,7 +8,7 @@
 #include <opengm/operations/multiplier.hxx>
 #include <opengm/inference/bruteforce.hxx>
 #include <opengm/utilities/metaprogramming.hxx>
-
+#include <opengm/functions/learnable/lpotts.hxx>
 
 struct TestFunctor{
 
@@ -55,14 +54,14 @@ struct GraphicalModelTest {
       typedef typename opengm::meta::TypeListGenerator
          <
          opengm::ExplicitFunction<T,I,L>,
-         opengm::LPottsFunction<T,I,L>
+         opengm::functions::learnable::LPotts<T,I,L>
          >::type FunctionTypeList;
       typedef opengm::GraphicalModel<T, opengm::Minimizer, FunctionTypeList, opengm::DiscreteSpace<I, L> > GmType;
       typedef typename GmType::FunctionIdentifier Fid;
 
 
       typedef opengm::ExplicitFunction<T,I,L> EF;
-      typedef opengm::LPottsFunction<T,I,L> LPF;
+      typedef opengm::functions::learnable::LPotts<T,I,L> LPF;
 
 
       // graphical model
@@ -73,7 +72,9 @@ struct GraphicalModelTest {
       const size_t numweights = 1;
       opengm::learning::Weights<T> weights(numweights);
       weights.setWeight(0,5.0);
-      LPF lPotts(2,2,weights,0);
+      std::vector<size_t> weightIds(1, 0);
+      std::vector<T> features(1, 1.0);
+      LPF lPotts(weights,2,weightIds, features);
 
 
       I labels00[2]={0,0};
diff --git a/src/unittest/test_learnable_functions.cxx b/src/unittest/test_learnable_functions.cxx
index 49d7661..012f752 100644
--- a/src/unittest/test_learnable_functions.cxx
+++ b/src/unittest/test_learnable_functions.cxx
@@ -1,6 +1,5 @@
 #include <vector>
 
-#include "opengm/functions/learnablefunction.hxx"
 #include "opengm/functions/learnable/lpotts.hxx" 
 #include <opengm/unittests/test.hxx>
 
@@ -10,28 +9,6 @@ struct LearnableFunctionsTest {
   typedef size_t IndexType;
   typedef T      ValueType;
 
-  void testLearnableFeatureFunction(){
-    std::cout << " * Learnable Feature Function ..." << std::flush; 
-    // parameter
-    const size_t numparam = 1;
-    opengm::learning::Weights<ValueType> param(numparam);
-    param.setWeight(0,5.0);
-    
-    std::vector<LabelType> shape(2,3);
-    std::vector<size_t> pIds(1,0);
-    std::vector<ValueType> feat(1,1);
-    // function
-    opengm::LearnableFeatureFunction<ValueType,IndexType,LabelType> lfunc(param,shape,pIds,feat);
-
-    LabelType l[] ={0,0};
-    for(l[0]=0;l[0]<shape[0];++l[0]){
-      for(l[1]=0;l[1]<shape[1];++l[1]){
-	OPENGM_TEST(lfunc(l)==0);
-      }
-    }
-    std::cout << "OK" << std::endl; 
-  }
-
   void testLPotts(){
     std::cout << " * LearnablePotts ..." << std::endl; 
 
@@ -95,7 +72,6 @@ int main() {
    std::cout << "Learnable Functions test...  " << std::endl;
    {
       LearnableFunctionsTest<double>t;
-      t.testLearnableFeatureFunction();
       t.testLPotts();
    }
    std::cout << "done.." << std::endl;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opengm.git



More information about the debian-science-commits mailing list