00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef TJNUMERIC_H
00019 #define TJNUMERIC_H
00020
00021 #include <tjutils/tjutils.h>
00022
00032 int solve_cubic (double a, double b, double c,
00033 double *x0, double *x1, double *x2);
00034
00036
00037
00042 class RandomDist {
00043
00044 public:
00045 RandomDist();
00046 ~RandomDist();
00047
00051 double gaussian(double stdev) const;
00052
00056 double uniform() const;
00057
00058 private:
00059 void* rng;
00060 };
00061
00063
00067 class MinimizationFunction {
00068
00069 public:
00070
00074 virtual float evaluate(float) const = 0;
00075 };
00076
00077
00079
00080
00085 float minimize(MinimizationFunction& f, float low, float upp);
00086
00087
00090 #endif