34 #define TF_HACK_BLITZTOGREPG_CC_VERSION \ 35 "TF_HACK_BLITZTOGREPG_CC V1.0 " 38 #include <tfxx/misc.h> 39 #include <tfxx/fortranio.h> 40 #include <tfxx/complexio.h> 41 #include <tfxx/blitzutil.h> 42 #include <tfxx/hack_blitztogrepg.h> 50 const double& dx=1.,
const double& dy=1.)
52 std::ofstream os(filename);
55 int nom=array.extent(blitz::firstDim);
56 int fom=array.lbound(blitz::firstDim);
57 int nslo=array.extent(blitz::secondDim);
58 int fslo=array.lbound(blitz::secondDim);
61 for (
int i=0; i<nom; i++)
62 { fos << float(3.14159265358979311*2.*(i+fom-1)*dx); }
63 for (
int i=0; i<nslo; i++) { fos << float(1.e-3*(i+fslo-1)*dy); }
65 for (
int i=0; i<nslo; i++)
67 for (
int j=0; j<nom; j++)
69 fos << array(j+fom,i+fslo);
80 const double& dx=1.,
const double& dy=1.)
83 blitz::Array<std::complex<float>, 2> tmp(blitz::fortranArray);
85 tmp=blitz::cast<std::complex<float> >(array);
write FORTRAN binary data ,This class writes FORTRAN binary data. FORTRAN binary data is always writt...
void end_block()
finish data block
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 setToSameDomain(blitz::Array< T, N > &array, const blitz::RectDomain< N > &domain, const blitz::GeneralArrayStorage< N > &storage=blitz::fortranArray)
create a second array spanning the same domain
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 file_magic_write(std::ostream &os, const char *const cmagic, const bool &fortranmode=false)
Write magic number to file. ,.
Namespace containing all code of library libtfxx.