File: mpfit_deriv.cpp

package info (click to toggle)
fityk 1.3.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 3,784 kB
  • sloc: cpp: 34,396; ansic: 4,673; python: 971; makefile: 366; sh: 117; java: 31; ruby: 27; perl: 25; xml: 16
file content (23 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#include "fityk/fityk.h"

// When the deriv_debug option is used in MPFIT
// both user-calculated and MPFIT-calculated numerical derivatives
// are printed to stdout. This test is half-manual.

namespace fityk { extern bool debug_deriv_in_mpfit; }

int main()
{
    fityk::debug_deriv_in_mpfit=true;
    fityk::Fityk* ftk = new fityk::Fityk;
    ftk->execute("set verbosity=-1");
    ftk->execute("set pseudo_random_seed=1234567");
    ftk->execute("M=40; x=n/5");
    ftk->execute("Y = 4.5 + 0.5*x + 37*exp(-ln(2)*((x-3.1)/0.7)^2)");
    ftk->execute("guess Linear; guess Gaussian");
    ftk->execute("set fitting_method=mpfit");
    ftk->execute("fit");
    delete ftk;
    return 0;
}