Explorar o código

bug fix for quantization and empty dimensions

Alexander Freytag %!s(int64=9) %!d(string=hai) anos
pai
achega
032424e268
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      SortedVectorSparse.h

+ 5 - 0
SortedVectorSparse.h

@@ -260,6 +260,11 @@ template<class T> class SortedVectorSparse : NICE::Persistent{
                                      const bool & _getTransformedValue = false
                                    ) const
     {
+      if ( this->getNonZeros() == 0)
+      {
+        return  0.0;
+      }
+      
         uint idxDest ( round ( (this->getNonZeros() - 1) * _quantile)  );
         
         if ( _quantile > 0.5 )