From 1ff422372bd8af2cda1773b43f15947932395b7b Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Thu, 10 Dec 2015 17:23:56 +0100
Subject: [PATCH] Fixing issue #12. The test done in the bindings for the
 acc_statistics method, does not work in 32 bits

---
 bob/learn/em/gmm_machine.cpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/bob/learn/em/gmm_machine.cpp b/bob/learn/em/gmm_machine.cpp
index 3d960b9..8e2d7ca 100644
--- a/bob/learn/em/gmm_machine.cpp
+++ b/bob/learn/em/gmm_machine.cpp
@@ -766,11 +766,10 @@ static PyObject* PyBobLearnEMGMMMachine_accStatistics(PyBobLearnEMGMMMachineObje
   //protects acquired resources through this scope
   auto input_ = make_safe(input);
 
-  blitz::Array<double,2>  blitz_test  = *PyBlitzArrayCxx_AsBlitz<double,2>(input);
-  if (blitz_test.extent(1)==0)
+  if (input->ndim == 1)
     self->cxx->accStatistics(*PyBlitzArrayCxx_AsBlitz<double,1>(input), *stats->cxx);
   else
-    self->cxx->accStatistics(blitz_test, *stats->cxx);
+    self->cxx->accStatistics(*PyBlitzArrayCxx_AsBlitz<double,2>(input), *stats->cxx);
 
 
   BOB_CATCH_MEMBER("cannot accumulate the statistics", 0)
@@ -803,11 +802,10 @@ static PyObject* PyBobLearnEMGMMMachine_accStatistics_(PyBobLearnEMGMMMachineObj
   //protects acquired resources through this scope
   auto input_ = make_safe(input);
 
-  blitz::Array<double,2>  blitz_test  = *PyBlitzArrayCxx_AsBlitz<double,2>(input);
-  if (blitz_test.extent(1)==0)
+  if (input->ndim==1)
     self->cxx->accStatistics_(*PyBlitzArrayCxx_AsBlitz<double,1>(input), *stats->cxx);
   else
-    self->cxx->accStatistics_(blitz_test, *stats->cxx);
+    self->cxx->accStatistics_(*PyBlitzArrayCxx_AsBlitz<double,2>(input), *stats->cxx);
 
   BOB_CATCH_MEMBER("cannot accumulate the statistics", 0)
   Py_RETURN_NONE;
-- 
GitLab