Эх сурвалжийг харах

added empty, non-implemented function of ClassificationResult with sparse vectors

Alexander Freytag 9 жил өмнө
parent
commit
333f5d6dda

+ 23 - 7
cbaselib/ClassificationResult.cpp

@@ -39,14 +39,30 @@ ClassificationResult::ClassificationResult ( int _classno, double _score, int ma
   uncertainty = 0.0;
 }
 
-ClassificationResult::ClassificationResult ( int _classno, const FullVector & _scores )
+ClassificationResult::ClassificationResult ( int _classno, 
+                                             const FullVector & _scores 
+                                           )
 {
-  rejection_status = REJECTION_NONE;
-  classno = _classno;
-  scores = _scores;
-  classname = "unknown";
-  classno_groundtruth = -1;
-  uncertainty = 0.0;
+  this->rejection_status = REJECTION_NONE;
+  this->classno = _classno;
+  this->scores = _scores;
+  this->classname = "unknown";
+  this->classno_groundtruth = -1;
+  this->uncertainty = 0.0;
+}
+
+ClassificationResult::ClassificationResult ( int _classno, 
+                                             const SparseVector & _scores 
+                                           )
+{
+  throw("No conversion from SparseVector to FullVector available. Aborting!");
+  
+  this->rejection_status = REJECTION_NONE;
+  this->classno = _classno;  
+
+  this->classname = "unknown";
+  this->classno_groundtruth = -1;
+  this->uncertainty = 0.0;
 }
 
 ClassificationResult::~ClassificationResult()

+ 6 - 0
cbaselib/ClassificationResult.h

@@ -71,6 +71,12 @@ class ClassificationResult
     /** result of classification consists of most probable class @p classno
         and a score for each of the other classes */
     ClassificationResult ( int classno, const FullVector & scores );
+    
+    /** result of classification consists of most probable class @p classno
+        and a (sparse) score for each of the other classes */
+    ClassificationResult ( int _classno, 
+                           const NICE::SparseVector & _scores 
+                         );    
 
     /** simple destructor */
     virtual ~ClassificationResult();