tags 667417 patch
thanks

Hello,

#675181 is fixed, but wrapitk-python still FTBFS with gcc 4.7, now
because of a problem in insighttoolkit headers. Here's the patch.

Description: adapt headers to gcc 4.7
Author: Ilya Barygin <[email protected]>

--- insighttoolkit-3.20.1+git20120521.orig/Code/Review/Statistics/itkWeightedCentroidKdTreeGenerator.txx
+++ insighttoolkit-3.20.1+git20120521/Code/Review/Statistics/itkWeightedCentroidKdTreeGenerator.txx
@@ -117,13 +117,13 @@ WeightedCentroidKdTreeGenerator< TSample
   upperBound[partitionDimension] = partitionValue;
   const unsigned int beginLeftIndex = beginIndex;
   const unsigned int endLeftIndex   = medianIndex;
-  KdTreeNodeType* left = GenerateTreeLoop(beginLeftIndex, endLeftIndex, lowerBound, upperBound, level + 1);
+  KdTreeNodeType* left = this->GenerateTreeLoop(beginLeftIndex, endLeftIndex, lowerBound, upperBound, level + 1);
   upperBound[partitionDimension] = dimensionUpperBound;
 
   lowerBound[partitionDimension] = partitionValue;
   const unsigned int beginRightIndex = medianIndex+1;
   const unsigned int endRighIndex    = endIndex;
-  KdTreeNodeType* right = GenerateTreeLoop(beginRightIndex, endRighIndex, lowerBound, upperBound, level + 1);
+  KdTreeNodeType* right = this->GenerateTreeLoop(beginRightIndex, endRighIndex, lowerBound, upperBound, level + 1);
   lowerBound[partitionDimension] = dimensionLowerBound;
 
 
--- insighttoolkit-3.20.1+git20120521.orig/Code/Review/Statistics/itkStatisticsAlgorithm.txx
+++ insighttoolkit-3.20.1+git20120521/Code/Review/Statistics/itkStatisticsAlgorithm.txx
@@ -452,6 +452,49 @@ QuickSelect(TSubsample* sample,
 
 
 template< class TSubsample >
+inline int UnguardedPartition(TSubsample* sample, 
+                       unsigned int activeDimension,
+                       int beginIndex,
+                       int endIndex,
+                       typename TSubsample::MeasurementType pivotValue ) 
+{
+  typedef typename TSubsample::MeasurementType  MeasurementType;
+  while( true )
+    {
+    MeasurementType beginValue = 
+      sample->GetMeasurementVectorByIndex(beginIndex)[activeDimension];
+
+    while( beginValue < pivotValue )
+      {
+      ++beginIndex;
+
+      beginValue = sample->GetMeasurementVectorByIndex(beginIndex)[activeDimension];
+      }
+
+    --endIndex;
+
+    MeasurementType endValue = 
+      sample->GetMeasurementVectorByIndex(endIndex)[activeDimension];
+
+    while( pivotValue < endValue )
+      {
+      --endIndex;
+      endValue = sample->GetMeasurementVectorByIndex(endIndex)[activeDimension];
+      }
+
+    if( !(beginIndex < endIndex) )
+      {
+      return beginIndex;
+      }
+
+    sample->Swap( beginIndex, endIndex );
+
+    ++beginIndex;
+    }
+}
+
+
+template< class TSubsample >
 inline typename TSubsample::MeasurementType 
 NthElement(TSubsample* sample,
             unsigned int activeDimension,
@@ -497,49 +540,6 @@ NthElement(TSubsample* sample,
 }
 
 
-template< class TSubsample >
-inline int UnguardedPartition(TSubsample* sample, 
-                       unsigned int activeDimension,
-                       int beginIndex,
-                       int endIndex,
-                       typename TSubsample::MeasurementType pivotValue ) 
-{
-  typedef typename TSubsample::MeasurementType  MeasurementType;
-  while( true )
-    {
-    MeasurementType beginValue = 
-      sample->GetMeasurementVectorByIndex(beginIndex)[activeDimension];
-
-    while( beginValue < pivotValue )
-      {
-      ++beginIndex;
-
-      beginValue = sample->GetMeasurementVectorByIndex(beginIndex)[activeDimension];
-      }
-
-    --endIndex;
-
-    MeasurementType endValue = 
-      sample->GetMeasurementVectorByIndex(endIndex)[activeDimension];
-
-    while( pivotValue < endValue )
-      {
-      --endIndex;
-      endValue = sample->GetMeasurementVectorByIndex(endIndex)[activeDimension];
-      }
-
-    if( !(beginIndex < endIndex) )
-      {
-      return beginIndex;
-      }
-
-    sample->Swap( beginIndex, endIndex );
-
-    ++beginIndex;
-    }
-}
-
-
 template< class TSubsample >
 inline void InsertSort(TSubsample* sample, 
                        unsigned int activeDimension,

Reply via email to