]> git.donarmstrong.com Git - mothur.git/blob - macros.h
changing command name classify.shared to classifyrf.shared
[mothur.git] / macros.h
1 //
2 //  macros.h
3 //  rrf-fs-prototype
4 //
5 //  Created by Abu Zaher Faridee on 5/28/12.
6 //  Copyright (c) 2012 Schloss Lab. All rights reserved.
7 //
8
9 #ifndef RF_MACROS_H
10 #define RF_MACROS_H
11
12 #include "mothurout.h" 
13
14 /***********************************************************************/
15 class OptimumFeatureSubsetSelector{
16 public:
17   OptimumFeatureSubsetSelector(string selectionType = "log2"): selectionType(selectionType){
18   }
19   
20   int getOptimumFeatureSubsetSize(int numFeatures){
21
22     if (selectionType == "log2"){ return (int)ceil(log2(numFeatures)); }
23     else if (selectionType == "squareRoot"){ return (int)ceil(sqrt(numFeatures)); } 
24     return -1;
25   }
26 private:
27   string selectionType;
28 };
29
30 /***********************************************************************/
31   
32 #endif