TF++, Miscellaneous classes and modules in C++:
hack_blitztogrepg.h
Go to the documentation of this file.
1 
36 // include guard
37 #ifndef TF_HACK_BLITZTOGREPG_H_VERSION
38 
39 #define TF_HACK_BLITZTOGREPG_H_VERSION \
40  "TF_HACK_BLITZTOGREPG_H V1.1"
41 
42 #include<complex>
43 #include<blitz/array.h>
44 
45 namespace tfxx {
46 namespace hacks {
47 
55 void write_grepg_c(const blitz::Array<std::complex<float>, 2>& array,
56  const char* filename,
57  const double& dx=1., const double& dy=1.);
58 
66 void write_grepg_f(const blitz::Array<float, 2>& array,
67  const char* filename,
68  const double& dx=1., const double& dy=1.);
69 
77 template<class T>
78 void write_grepg(const blitz::Array<T, 2>& array,
79  const char* filename,
80  const double& dx=1., const double& dy=1.)
81 {
82  blitz::Array<std::complex<float>, 2>
83  carray(array.lbound(), array.shape(), blitz::fortranArray);
84  carray=blitz::cast<std::complex<float> >(array);
85  write_grepg_c(carray, filename, dx, dy);
86 }
87 
88 } // namespace hacks
89 } // namespace tfxx
90 
91 #endif // TF_HACK_BLITZTOGREPG_H_VERSION (includeguard)
92 
93 /* ----- END OF hack_blitztogrepg.h ----- */
void write_grepg_f(const blitz::Array< float, 2 > &array, const char *filename, const double &dx=1., const double &dy=1.)
create grepg file from float array
void write_grepg_c(const blitz::Array< std::complex< float >, 2 > &array, const char *filename, const double &dx=1., const double &dy=1.)
create grepg file from complex array
void write_grepg(const blitz::Array< T, 2 > &array, const char *filename, const double &dx=1., const double &dy=1.)
create grepg file from 2D array of any type
Namespace containing all code of library libtfxx.