tjnumeric.h
1 /***************************************************************************
2  tjnumeric.h - description
3  -------------------
4  begin : Mon May 5 2003
5  copyright : (C) 2000-2015 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef TJNUMERIC_H
19 #define TJNUMERIC_H
20 
21 #include <tjutils/tjutils.h>
22 #include <tjutils/tjvector.h>
23 
33 int solve_cubic (double a, double b, double c,
34  double *x0, double *x1, double *x2);
35 
37 
38 
43 class RandomDist {
44 
45  public:
46  RandomDist();
47  ~RandomDist();
48 
52  double gaussian(double stdev) const;
53 
57  double uniform() const;
58 
59  private:
60  void* rng;
61 };
62 
64 
69 
70  public:
71 
75  virtual unsigned int numof_fitpars() const = 0;
76 
80  virtual float evaluate(const fvector&) const = 0;
81 };
82 
83 
85 
86 
91 fvector bruteforce_minimize1d(const MinimizationFunction& f, float low, float upp);
92 
93 
96 #endif
int solve_cubic(double a, double b, double c, double *x0, double *x1, double *x2)
double uniform() const
fvector bruteforce_minimize1d(const MinimizationFunction &f, float low, float upp)
double gaussian(double stdev) const