#include "Gauss.h" #include #include using std::cout; using std::endl; Gauss::Gauss(const std::string& name, double mean, double width) : Function(name) { mean_ = mean; width_ = width; } double Gauss::value(double x) const { double pull = (x-mean_)/width_; double y = (1/sqrt(2.*3.14*width_)) * exp(-pull*pull/2.); return y; } double Gauss::integrate(double x1, double x2) const { cout << "Sorry. Gauss::integrate(x1,x2) not implemented yet..." << "returning 0. for now..." << endl; return 0; } void Gauss::print() const { cout << "Gaussian with name: " << name() << " mean: " << mean_ << " width: " << width_ << endl; }