Răsfoiți Sursa

removed compiler warnings

Alexander Freytag 11 ani în urmă
părinte
comite
7fc06c0490

+ 1 - 1
FMKGPHyperparameterOptimization.cpp

@@ -837,7 +837,7 @@ void FMKGPHyperparameterOptimization::prepareVarianceApproximationRough()
 
 void FMKGPHyperparameterOptimization::prepareVarianceApproximationFine()
 {
-  if ( this->eigenMax.size() != this->nrOfEigenvaluesToConsiderForVarApprox) 
+  if ( this->eigenMax.size() != (uint) this->nrOfEigenvaluesToConsiderForVarApprox) 
   {
     std::cerr << "not enough eigenvectors computed for fine approximation of predictive variance. Compute missing ones!" << std::endl;
     this->updateEigenDecomposition(  this->nrOfEigenvaluesToConsiderForVarApprox ); 

+ 4 - 5
FastMinKernel.cpp

@@ -422,25 +422,24 @@ void FastMinKernel::hikUpdateLookupTable(double * T, const double & alphaNew, co
   double diffOfAlpha(alphaNew - alphaOld);
   
   // loop through all dimensions
-  for (int dim = 0; dim < this->d; dim++)
+  for ( int dim = 0; dim < this->d; dim++ )
   {  
     double x_i ( (X_sorted(dim,idx)) );
     
     //TODO we could also check wether x_i < tol, if we would store the tol explicitely
-    if (x_i == 0.0) //nothing to do in this dimension
+    if ( x_i == 0.0 ) //nothing to do in this dimension
       continue;
 
-    //TODO we could speed up this with first do a binary search for the position where the min changes, and then do two separate for-loops
+    //TODO we could speed up this by first doing a binary search for the position where the min changes, and then do two separate for-loops
     for (uint j = 0; j < hmax; j++)
     {
         double fval;
         int q_bin = q.quantize(x_i);
-        if (q_bin > j)
+        if ( (uint) q_bin > j )
           fval = prototypes[j];
         else
           fval = x_i;      
         
-//       double fval = std::min(prototypes[j],x_i);      
       T[ dim*hmax + j ] += diffOfAlpha*fval;
     }
   }

+ 3 - 7
GPHIKClassifier.cpp

@@ -161,14 +161,12 @@ void GPHIKClassifier::classify ( const SparseVector * example,  int & result, Sp
   
   scores.clear();
   
-  int classno = gphyper->classify ( *example, scores );
+  result = gphyper->classify ( *example, scores );
 
   if ( scores.size() == 0 ) {
     fthrow(Exception, "Zero scores, something is likely to be wrong here: svec.size() = " << example->size() );
   }
   
-  result = scores.maxElement();
-   
   if (uncertaintyPredictionForClassification)
   {
     if (varianceApproximation != NONE)
@@ -195,14 +193,12 @@ void GPHIKClassifier::classify ( const NICE::Vector * example,  int & result, Sp
   
   scores.clear();
   
-  int classno = gphyper->classify ( *example, scores );
+  result = gphyper->classify ( *example, scores );
 
   if ( scores.size() == 0 ) {
     fthrow(Exception, "Zero scores, something is likely to be wrong here: svec.size() = " << example->size() );
   }
-  
-  result = scores.maxElement();
-  
+    
   if (uncertaintyPredictionForClassification)
   {
     if (varianceApproximation != NONE)

+ 1 - 1
IKMLinearCombination.cpp

@@ -24,7 +24,7 @@ IKMLinearCombination::~IKMLinearCombination()
 {
   if ( this->matrices.size() != 0)
   {
-    for (int i = 0; i < this->matrices.size(); i++)
+    for (int i = 0; (uint)i < this->matrices.size(); i++)
       delete this->matrices[i];
   }
 }

+ 1 - 1
parameterizedFunctions/PFMKL.h

@@ -55,7 +55,7 @@ class PFMKL : public ParameterizedFunction
     int dummyCnt ( 0 );
     for (std::set<int>::const_iterator it = steps.begin(); it != steps.end(); it++, dummyCnt++)
     {
-      if ( index < *it)
+      if ( (int)index < *it)
         return x * m_parameters[dummyCnt];
     }
     //default value, should never be reached

+ 1 - 1
progs/completeEvaluationFastMinkernel.cpp

@@ -223,7 +223,7 @@ int main (int argc, char* argv[])
     
     Vector kstarSlow ( hikSlow.computeKernelVector(rand_feat_transposed, xstar_stl));
     xstar.resize(xstar_stl.size());
-    for ( int i = 0 ; i < xstar.size() ; i++ )
+    for ( int i = 0 ; (uint) i < xstar.size() ; i++ )
       xstar[i] = xstar_stl[i];
     double kSumSlowly = alphas.scalarProduct(kstarSlow);
     

+ 1 - 3
progs/toyExampleStoreRestore.cpp

@@ -157,9 +157,7 @@ int main (int argc, char* argv[])
   
   NICE::Timer t;
   double testTime (0.0);
-  
-  double uncertainty;
-  
+    
   int i_loopEnd  ( (int)dataTest.rows() );