123456789101112131415161718192021222324252627282930 |
- #ifndef GNUPLOT__HPP
- #define GNUPLOT__HPP
- #include <fstream>
- // montrer les points d'interpolation.
- template<class M> void gnuplotfile(const M& Points,string fich)
- {
- ofstream f;
- f.open(fich);
- for(typename M::const_iterator I=Points.begin();I!=Points.end();
- I++)
- {
- auto p=I->first;
- f<<p.first<<" "<<p.second<<endl;
- }
- f.close();
- }
- // montrer une "image"
- template<class real> void gnuplotfile(int nx,int ny,real* a,string fich)
- {
- ofstream f;
- f.open(fich);
- for(int j=0;j<ny;j++)
- {
- for(int i=0;i<nx;i++)
- f<<i<<" "<<j<<" "<<a[j*nx+i]<<endl;
- f<<" "<<endl;
- }
- f.close();
- }
- #endif
|