"Fossies" - the Fresh Open Source Software Archive

Member "fityk-1.3.1/fityk/guess.h" (13 May 2016, 1447 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 "guess.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.3.0_vs_1.3.1.

    1 // This file is part of fityk program. Copyright 2001-2013 Marcin Wojdyr
    2 // Licence: GNU General Public License ver. 2+
    3 
    4 #ifndef FITYK_GUESS_H_
    5 #define FITYK_GUESS_H_
    6 
    7 #include <vector>
    8 #include <string>
    9 #include "fityk.h" // realt, FITYK_API
   10 
   11 namespace fityk {
   12 
   13 class Data;
   14 struct Settings;
   15 
   16 /// guessing initial parameters of functions
   17 class FITYK_API Guess
   18 {
   19 public:
   20     static const std::vector<std::string> linear_traits;
   21     static const std::vector<std::string> peak_traits;
   22     static const std::vector<std::string> sigmoid_traits;
   23 
   24     Guess(Settings const *settings) : settings_(settings) {}
   25 
   26     /// Use data points with indexes from lb to rb-1,
   27     /// substract the current model from the data, (optionally) with exception
   28     /// of function that has index `ignore_idx'.
   29     /// This exception is used in "Guess %f = ..." if %f is already defined.
   30     void set_data(const Data* data, const RealRange& range, int ignore_idx);
   31 
   32     /// returns values corresponding to linear_traits
   33     std::vector<double> estimate_linear_parameters() const;
   34     /// returns values corresponding to peak_traits
   35     std::vector<double> estimate_peak_parameters() const;
   36     /// returns values corresponding to sigmoid_traits
   37     std::vector<double> estimate_sigmoid_parameters() const;
   38 
   39 private:
   40     Settings const* settings_;
   41     std::vector<realt> xx_, yy_, sigma_;
   42 
   43     double find_hwhm(int pos, double *area) const;
   44 };
   45 
   46 } // namespace fityk
   47 #endif
   48