title: Replace switch/case by #ifdef or something similar
body: <p>I'm trying to replace the <code>switch/case</code> structure by an other tool doing the same thing but with better performance ( less execution time ... ), I have in mind the <code>#ifdef</code> method but I have no idea how to use it in such situation: </p>
  
  <pre><code>float k_function(float *x,float *y,struct svm_model model)
  {
      int i;
      float sum=0.0;
      switch(model.model_kernel_type)  
      {
      case LINEAR :
          return result1;
      case POLY :
          return result2;
      case RBF :
          return result3;
      case SIGMOID :
          return result4;
      default :
          return 0;
      }
  }
  </code></pre>
  
  <p>PS :</p>
  
  <pre><code>typedef   enum   kernel_type   {LINEAR, POLY, RBF, SIGMOID};
  </code></pre>