aboutsummaryrefslogtreecommitdiffstats
path: root/models/gauss1d.hpp
diff options
context:
space:
mode:
authorastrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675>2009-11-08 13:03:54 +0000
committerastrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675>2009-11-08 13:03:54 +0000
commitda0171cf51100155677bbf353f5802e15714fa72 (patch)
tree173d47273ba1066815de6c9e14d1dede04301ab9 /models/gauss1d.hpp
parent066f0968350a0efa7f908f901940ffee3775cfb7 (diff)
downloadopt-utilities-da0171cf51100155677bbf353f5802e15714fa72.tar.bz2
git-svn-id: file:///home/svn/opt_utilities@91 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'models/gauss1d.hpp')
-rw-r--r--models/gauss1d.hpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/models/gauss1d.hpp b/models/gauss1d.hpp
index ad54510..1fb0b24 100644
--- a/models/gauss1d.hpp
+++ b/models/gauss1d.hpp
@@ -34,15 +34,14 @@ namespace opt_utilities
T N=get_element(param,0);
T x0=get_element(param,1);
T sigma=get_element(param,2);
- T y=(x-x0)/sigma;
+ T y=(x-x0)/2./sigma;
return N*exp(-y*y);
}
private:
std::string do_to_string()const
{
- return "Gaussian model\n"
- "y=N*exp(-(x-x0)^2/sigma^2\n";
+ return "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" class=\"equation\"><mi>f</mi><mrow><mo class=\"MathClass-open\">(</mo><mrow><mi>x</mi><mo class=\"MathClass-punc\">;</mo><mi>N</mi><mo class=\"MathClass-punc\">,</mo><msub><mrow><mi>x</mi></mrow><mrow><mn>0</mn></mrow></msub><mo class=\"MathClass-punc\">,</mo><mi>σ</mi></mrow><mo class=\"MathClass-close\">)</mo></mrow> <mo class=\"MathClass-rel\">=</mo> <mi>N</mi><msup><mrow><mi>e</mi></mrow><mrow><mo class=\"MathClass-bin\">−</mo><mfrac><mrow><msup><mrow><mrow><mo class=\"MathClass-open\">(</mo><mrow><mi>x</mi><mo class=\"MathClass-bin\">−</mo><msub><mrow><mi>x</mi></mrow><mrow><mn>0</mn></mrow></msub></mrow><mo class=\"MathClass-close\">)</mo></mrow></mrow><mrow><mn>2</mn></mrow></msup></mrow><mrow><mn>2</mn><msup><mrow><mi>σ</mi></mrow><mrow><mn>2</mn></mrow></msup></mrow></mfrac> </mrow></msup></math>";
}
};
}