Skip to content

Commit

Permalink
Checkpointing work. Refs #7847.
Browse files Browse the repository at this point in the history
1. Enable CreateLeBailFitInput.py to create a list of reflections
2. Make LebailFit and LeBailFuncion work with limit on maximum (HKL)
  • Loading branch information
wdzhou committed Sep 6, 2013
1 parent 27349f8 commit 3e0a5bf
Show file tree
Hide file tree
Showing 5 changed files with 452 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ namespace CurveFitting
/// Main for random walk process
void execRandomWalkMinimizer(size_t maxcycles, map<string, Parameter> &parammap);

/// Work on Markov chain to 'solve' LeBail function
void doMarkovChain(const map<string, Parameter> &parammap, const vector<double>& vecX, const vector<double> &vecPurePeak,
const vector<double> &vecBkgd, size_t maxcycles, const Rfactor &startR, int randomseed);

/// Set up Monte Carlo random walk strategy
void setupBuiltInRandomWalkStrategy();

Expand All @@ -218,9 +222,9 @@ namespace CurveFitting

/// Calculate diffraction pattern in Le Bail algorithm for MC Random walk
bool calculateDiffractionPattern(const MantidVec &vecX, const MantidVec &vecY,
bool inputraw, bool outputwithbkgd,
const MantidVec& vecBkgd, MantidVec& values,
Rfactor& rfactor);
bool inputraw, bool outputwithbkgd,
const MantidVec& vecBkgd, MantidVec& values,
Rfactor& rfactor);

/// Calculate powder diffraction statistic Rwp
//void calculatePowderPatternStatistic(const MantidVec &values, const vector<double> &background,
Expand All @@ -238,7 +242,7 @@ namespace CurveFitting

/// Book keep the (sopposed) best MC result
void bookKeepBestMCResult(map<string, Parameter> parammap,
vector<double> &bkgddata, Rfactor rfactor, size_t istep);
const vector<double> &bkgddata, Rfactor rfactor, size_t istep);

/// Apply the value of parameters in the source to target
void applyParameterValues(map<string, Parameter> &srcparammap,
Expand Down Expand Up @@ -409,6 +413,8 @@ namespace CurveFitting
int m_roundBkgd;
vector<double> m_bkgdParameterStepVec;

double m_peakCentreTol;

};

/// Auxiliary. Split composite function name to function index and parameter name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ namespace CurveFitting
bool hasProfileParameter(std::string paramname);

/// Check whether the newly set parameters are correct, i.e., all peaks are physical
bool isParameterValid() const;
bool isParameterValid(double maxfwhm=DBL_MAX) const;

/// Set peak position tolerance during importing/adding peaks
void setPeakCentreTolerance(double peakpostol, double tofmin, double tofmax);

/// Generate peaks, and add them to this composite function
void addPeaks(std::vector<std::vector<int> > peakhkls);
Expand Down Expand Up @@ -179,6 +182,8 @@ namespace CurveFitting

std::vector<double> heights;

double m_minTOFPeakCentre;
double m_maxTOFPeakCentre;
/*
double mL1;
double mL2;
Expand Down

0 comments on commit 3e0a5bf

Please sign in to comment.