#include #include #include #include #include #include #include using namespace std; int main(int argc, char **argv) { TApplication michal("michal",0,0); ifstream infp("michal.dat"); if (infp == NULL) { cout << " cannot open " << endl; return 1; } // create an array unsigned int NN = 40; double *arr = new double[NN * NN]; double *lp = arr; // loop through the file and read numbers int ii = 0; while (infp.good()) { infp >> *lp++; ii++; } infp.close(); unsigned int NRows = NN * NN; TVectorD *data = new TVectorD(NRows); data -> SetElements(arr); cout << " Print data " << endl; data -> Print(); TImage *TestImage1 = TImage::Create(); if (!TestImage1) { cout << " Program cannot create an image .. " < SetImage(arr, NN, NN, 0); TCanvas *c1 = new TCanvas("c1"); TestImage1->Draw(); TImage *TestImage2 = TImage::Create(); if (!TestImage2) { cout << " Program cannot create an image .. " < SetImage(*data, NN, 0); TCanvas *c2 = new TCanvas("c2"); TestImage2->Draw(); michal.Run(); return 0; }