28 #ifndef CORE__NUMERICAL_TOOLS_HH 29 #define CORE__NUMERICAL_TOOLS_HH 84 double(*
f)(
double* ,
void *),
120 if (x>xmax)
return 0;
123 auto iaux=(int)
round(x*ixstep);
325 void Setup(
double min[],
329 double crossoverProb);
334 virtual bool Solve(
int maxGenerations);
341 virtual double EnergyFunction(
double testSolution[],
bool& bAtSolution) = 0;
374 void SelectSamples(
int candidate,
398 void Best1Exp(
int candidate);
399 void Rand1Exp(
int candidate);
400 void RandToBest1Exp(
int candidate);
401 void Best2Exp(
int candidate);
402 void Rand2Exp(
int candidate);
403 void Best1Bin(
int candidate);
404 void Rand1Bin(
int candidate);
405 void RandToBest1Bin(
int candidate);
406 void Best2Bin(
int candidate);
407 void Rand2Bin(
int candidate);
439 double ALegendreSphericalHarmonics(
int l,
int m,
double xr,
double yr,
double zr,
double rr);
double Energy() const
Call these functions after Solve() to get results.
void min(Image< double > &op1, const Image< double > &op2)
#define REPORT_ERROR(nerr, ErrormMsg)
Problem with matrix size.
StrategyFunction calcTrialSolution
int Generations() const
Return the number of generations.
#define DIRECT_A1D_ELEM(v, i)
void lubksb(const Matrix2D< T > &LU, Matrix1D< int > &indx, Matrix1D< T > &b)
Problem with matrix dimensions.
quaternion_type< T > normalize(quaternion_type< T > q)
void max(Image< double > &op1, const Image< double > &op2)
double getValue(double x) const
void ludcmp(const Matrix2D< T > &A, Matrix2D< T > &LU, Matrix1D< int > &indx, T &d)
int Population() const
Return population.
int Dimension() const
Return dimension.
void initialize(double xmax, int N, bool normalize=true)
double * Solution(void)
Return best solution.