00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "Minuit2/MnPlot.h"
00011
00012 namespace ROOT {
00013
00014 namespace Minuit2 {
00015
00016
00017 void mnplot(double* xpt, double* ypt, char* chpt, int nxypt, int npagwd, int npagln);
00018
00019 void MnPlot::operator()(const std::vector<std::pair<double,double> >& points) const {
00020
00021 std::vector<double> x; x.reserve(points.size());
00022 std::vector<double> y; y.reserve(points.size());
00023 std::vector<char> chpt; chpt.reserve(points.size());
00024
00025 for(std::vector<std::pair<double,double> >::const_iterator ipoint = points.begin(); ipoint != points.end(); ipoint++) {
00026 x.push_back((*ipoint).first);
00027 y.push_back((*ipoint).second);
00028 chpt.push_back('*');
00029 }
00030
00031 mnplot(&(x.front()), &(y.front()), &(chpt.front()), points.size(), Width(), Length());
00032
00033 }
00034
00035 void MnPlot::operator()(double xmin, double ymin, const std::vector<std::pair<double,double> >& points) const {
00036
00037 std::vector<double> x; x.reserve(points.size()+2);
00038 x.push_back(xmin);
00039 x.push_back(xmin);
00040 std::vector<double> y; y.reserve(points.size()+2);
00041 y.push_back(ymin);
00042 y.push_back(ymin);
00043 std::vector<char> chpt; chpt.reserve(points.size()+2);
00044 chpt.push_back(' ');
00045 chpt.push_back('X');
00046
00047 for(std::vector<std::pair<double,double> >::const_iterator ipoint = points.begin(); ipoint != points.end(); ipoint++) {
00048 x.push_back((*ipoint).first);
00049 y.push_back((*ipoint).second);
00050 chpt.push_back('*');
00051 }
00052
00053 mnplot(&(x.front()), &(y.front()), &(chpt.front()), points.size()+2, Width(), Length());
00054 }
00055
00056 }
00057
00058 }