"Fossies" - the Fresh Open Source Software Archive

Member "fityk-1.3.1/fityk/NLfit.h" (13 May 2016, 924 Bytes) of package /linux/misc/fityk-1.3.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "NLfit.h" see the Fossies "Dox" file reference documentation.

    1 // This file is part of fityk program. Copyright 2001-2013 Marcin Wojdyr.
    2 // Licence: GNU General Public License ver. 2+
    3 
    4 /// wrapper around NLopt library, http://ab-initio.mit.edu/nlopt/
    5 /// which is a library for nonlinear optimization with a common interface
    6 /// for a number of different algorithms.
    7 
    8 #ifndef FITYK_NLFIT_H_
    9 #define FITYK_NLFIT_H_
   10 
   11 #if HAVE_CONFIG_H
   12 #  include <config.h>
   13 #endif
   14 
   15 #if HAVE_LIBNLOPT
   16 
   17 #include <nlopt.h>
   18 #include "fit.h"
   19 
   20 namespace fityk {
   21 
   22 class NLfit : public Fit
   23 {
   24 public:
   25     NLfit(Full* F, const char* name, nlopt_algorithm algorithm);
   26     ~NLfit();
   27     virtual double run_method(std::vector<realt>* best_a);
   28 
   29     // implementation (must be public to be called inside callback function)
   30     double calculate(int n, const double* par, double* grad);
   31 private:
   32     nlopt_algorithm algorithm_;
   33     nlopt_opt opt_;
   34 };
   35 
   36 } // namespace fityk
   37 #endif //HAVE_LIBNLOPT
   38 
   39 #endif // FITYK_NLFIT_H_
   40