<commit_before>// @(#)root/mathcore:$Id$
// Authors: <NAME>, <NAME>   08/2005 

 /**********************************************************************
  *                                                                    *
  * Copyright (c) 2004 ROOT Foundation,  CERN/PH-SFT                   *
  *                                                                    *
  * This library is free software; you can redistribute it and/or      *
  * modify it under the terms of the GNU General Public License        *
  * as published by the Free Software Foundation; either version 2     *
  * of the License, or (at your option) any later version.             *
  *                                                                    *
  * This library is distributed in the hope that it will be useful,    *
  * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
  * General Public License for more details.                           *
  *                                                                    *
  * You should have received a copy of the GNU General Public License  *
  * along with this library (see file COPYING); if not, write          *
  * to the Free Software Foundation, Inc., 59 Temple Place, Suite      *
  * 330, Boston, MA 02111-1307 USA, or contact the author.             *
  *                                                                    *
  **********************************************************************/

#ifndef ROOT_Math_WrappedFunction
#define ROOT_Math_WrappedFunction

#ifndef ROOT_Math_IFunction
#include "IFunction.h"
#endif


namespace ROOT {
namespace Math {




struct NullTypeFunc1D {}; 

typedef double( * FreeFunctionPtr ) (double ); 

typedef double( * FreeMultiFunctionPtr ) (const double *); 

/**
   Template class to wrap any C++ callable object which takes one argument 
   i.e. implementing operator() (double x) in a One-dimensional function interface.
   It provides a ROOT::Math::IGenFunction-like signature

   Note: If you want to wrap just the reference (to avoid copying) you need to use 
   Func& or const Func & as template parameter.  The former should be used when the 
   operator() is not a const method of Func

   @ingroup  GenFunc

 */
template< typename Func =  FreeFunctionPtr   >
class WrappedFunction : public IGenFunction {


 public:

   /**
      construct from the pointer to the object and the member function
    */
   WrappedFunction( Func f ) : 
      fFunc( f ) 
   { /* no op */ }

   // use default  copy contructor and assignment operator

   /// clone (required by the interface)<commit_msg>from Axel: Help CINT parse functionpointer typedef  fixing Savannah #74108<commit_after>// @(#)root/mathcore:$Id$
// Authors: <NAME>, <NAME>   08/2005 

 /**********************************************************************
  *                                                                    *
  * Copyright (c) 2004 ROOT Foundation,  CERN/PH-SFT                   *
  *                                                                    *
  * This library is free software; you can redistribute it and/or      *
  * modify it under the terms of the GNU General Public License        *
  * as published by the Free Software Foundation; either version 2     *
  * of the License, or (at your option) any later version.             *
  *                                                                    *
  * This library is distributed in the hope that it will be useful,    *
  * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
  * General Public License for more details.                           *
  *                                                                    *
  * You should have received a copy of the GNU General Public License  *
  * along with this library (see file COPYING); if not, write          *
  * to the Free Software Foundation, Inc., 59 Temple Place, Suite      *
  * 330, Boston, MA 02111-1307 USA, or contact the author.             *
  *                                                                    *
  **********************************************************************/

#ifndef ROOT_Math_WrappedFunction
#define ROOT_Math_WrappedFunction

#ifndef ROOT_Math_IFunction
#include "IFunction.h"
#endif


namespace ROOT {
namespace Math {




struct NullTypeFunc1D {}; 

typedef double(*FreeFunctionPtr)(double);

typedef double(*FreeMultiFunctionPtr)(const double*); 

/**
   Template class to wrap any C++ callable object which takes one argument 
   i.e. implementing operator() (double x) in a One-dimensional function interface.
   It provides a ROOT::Math::IGenFunction-like signature

   Note: If you want to wrap just the reference (to avoid copying) you need to use 
   Func& or const Func & as template parameter.  The former should be used when the 
   operator() is not a const method of Func

   @ingroup  GenFunc

 */
template< typename Func =  FreeFunctionPtr   >
class WrappedFunction : public IGenFunction {


 public:

   /**
      construct from the pointer to the object and the member function
    */
   WrappedFunction( Func f ) : 
      fFunc( f ) 
   { /* no op */ }

   // use default  copy contructor and assignment operator

   /// clone (required by the interface)
{'fraction_non_alphanumeric': 0.11603843311160385, 'fraction_numerical': 0.010532150776053215, 'mean_word_length': 1.891559829059829, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4925940', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1214, 'n_words': 528}