* optimize calculation of errors (matrix inversion)

* GUI: Re-execute script -> Recent scripts

* use optimization algorithms from NLopt library

* FFT data transformation using FFTW library,
  fft[-inv]-xx, where xx is re, im, amp, e.g. @n = fft-re(@3)

* convolution and deconvolution of two datasets or a dataset with Gaussian:
  convolve(@0, @1); convolve(@0, 2.3); deconvolve(@0,3.4)

* GUI: draw points (handles) for dragging peak width at half height

* GUI: definition mgr - checkbox - show in the list on toolbar

* GUI: definition mgr - show formula images from the manual, if available

* CLI/GUI: use sigaction() instead of signal() to handle SIGINT
  print a message from interrupt_handler()

* refactor sidebar; use wxDataViewCtrl for the lists at the sidebar,
  rewrite ListWithColors::populate(), add sorting by clicking on column
  header (use case: sort functions by centers)

* syntax enhancements:  $min = @*.min(y if a)
                        print all: F[*](x) # print all components as columns

* finish the powder diffraction add-on (Pawley fitting)

* add functions cot and coth

* allow all the functions from data transformation in variable/UDF definition

* GUI: there is ugly vertical line (a part of the fitted curve) in points
  where the value is undefined (e.g. in ReadShockley function for x=0).

* GUI: when dataset is changed and the active function (i.e. the function
  in the bottom of the sidebar) is not in the new active dataset, the active
  function should also be changed (to the function that was active last time
  this dataset was active)

* (?) GUI: possibility to plot horizontal/vertical lines on the main plot
  (for example to show theoretical peak positions in XRD or to mark simulation
  restarts in data from MD. Syntax: plot line x=42.2 label="foo"

* GUI: a simple (for the user) way to interrupt fitting. Requires two threads.

* plot histogram of resiudals:
  http://www.itl.nist.gov/div898/handbook/eda/section3/normprpl.htm

* confidence bands

* data smoothing (Savitzky-Golay and/or other methods)

* GUI: constraining parameters of two peak using the peak-top menu

* add a new function category: sigmoids/steps (now function can be guessed as
  "peak" and "linear"). (GUI): drawing drafts for the new category.

* splines: fitting, guessing, handling knots in the GUI

* GUI: add alpha channel to the toolbar icons

* user defined functions:
      - calculating limits, width, area, etc. for UDF
      - ?? use LLVM for faster calculation of user-defined functions

* Use a better approximation of Voigt function than the one used now.
  There are dozens of papers on Voigt calculation, mostly in JQSRT.

* info dpeak [range]: show parameters of selected data range assuming that
  this range contains a peak: area, center, FWHM, max, peak-area, backgr-area
  (like in the Xview program)

* more sophisticated algorithms for peak detection
    - compare methods from origin pkfind, peakfit, fitzpeak and other programs
    - research papers: http://dx.doi.org/10.1016/j.chroma.2004.11.073
                       http://dx.doi.org/10.1002/cem.1005
                       http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2631518/

* fitting: in addition to the least squares fit, add so-called robust fit 
  (it is called robust fit in the Numerical Recipes book), i.e. optimize
  assuming the error distribution is other then Gaussian, eg. Lorenzian...;
  there is also a literature about so called 'maximum-likelihood method'
  in which the exact Poisson error distribution is handled.

* fitting: box-constrained parameters (simple-variables)
           the constraints could be automatic for some function parameters,
	   e.g. "guess PseudoVoigt" could give shape with bounds <0,1>

