File: mpfit_deriv.cpp

package info (click to toggle)
fityk 1.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,772 kB
  • sloc: cpp: 34,595; ansic: 4,676; python: 963; makefile: 384; sh: 119; xml: 91; java: 31; ruby: 27; perl: 25
file content (23 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (5)
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;
}