X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=macros.h;fp=macros.h;h=f95acbed9864506e08041765107339125e7fb273;hb=035f86272c776e1cccaa47021e26782e49cd41e7;hp=0000000000000000000000000000000000000000;hpb=96dbe925073caefaed6e6db85659c144a806aeb1;p=mothur.git diff --git a/macros.h b/macros.h new file mode 100755 index 0000000..f95acbe --- /dev/null +++ b/macros.h @@ -0,0 +1,32 @@ +// +// macros.h +// rrf-fs-prototype +// +// Created by Abu Zaher Faridee on 5/28/12. +// Copyright (c) 2012 Schloss Lab. All rights reserved. +// + +#ifndef rrf_fs_prototype_macros_h +#define rrf_fs_prototype_macros_h + +#include "mothurout.h" + +/***********************************************************************/ +class OptimumFeatureSubsetSelector{ +public: + OptimumFeatureSubsetSelector(string selectionType = "log2"): selectionType(selectionType){ + } + + int getOptimumFeatureSubsetSize(int numFeatures){ + + if (selectionType == "log2"){ return (int)ceil(log2(numFeatures)); } + else if (selectionType == "squareRoot"){ return (int)ceil(sqrt(numFeatures)); } + return -1; + } +private: + string selectionType; +}; + +/***********************************************************************/ + +#endif