src/GamIO/nrpt/Felix.cc
/* These are core routines for writing to a Felix serial file.  The do NO
   error checking or anything sophisticated.  
*/
These are core routines for writing to a Felix serial file.  The do NO
error checking or anything sophisticated.
These are core routines for writing to a Felix serial file . The do NO error checking or anything sophisticated .
void WriteFelixBlk(ofstream& fp, const row_vector& data, int nc, int nr, int rc)
  {
  int m = nr*sizeof(float)			
                          + sizeof(int);	
  fp.write((char*)&m, sizeof(int));			
  fp.write((char*)&nc, sizeof(int));			
  if(rc)					
    write(fp, data);				
  else
    {						
    float r;					
    for(int i=0; i<nc; i++)
      { 
      r = float(data.getRe(i));
      fp.write((char*)&r, sizeof(float));
      } 
    } 
  fp.write((char*)&m, sizeof(int));			
  }
void WriteFelixBlk ( ofstream & fp , const row_vector & data , int nc , int nr , int rc ) { int m = nr * sizeof ( float ) + sizeof ( int ) ; fp . write ( ( char * ) & m , sizeof ( int ) ) ; fp . write ( ( char * ) & nc , sizeof ( int ) ) ; if ( rc ) write ( fp , data ) ; else { float r ; for ( int i = 0 ; i < nc ; i ++ ) { r = float ( data . getRe ( i ) ) ; fp . write ( ( char * ) & r , sizeof ( float ) ) ; } } fp . write ( ( char * ) & m , sizeof ( int ) ) ; }
These are core routines for writing to a Felix serial file.
These are core routines for writing to a Felix serial file .
// Input                fp      : Output file pointer //                      data    : 1D data to be output //			nc      : Number of complex values //			nr      : Number of real values //                      rc      : flag for real versus complex //                                0:real, <0:imag, >0:complex // Note                         : No error checking herein  // Note				: Row vector function write is used. //				  It writes out floats: Re, Im. // Note				: The size is written preceeding and //				   following the data in keeping with //				   the FORTRAN (used by Felix) I/O. // Integer for FORTRAN blk size // 2*reals floating + 1 int // Total storage (for FORTRAN) // Output number complex pts. // Output entire complex vector // (vector typed): r,i,r,i.... // Output only reals, done // 1 at a time: r,r,r,r,r.... // Again total needed (FORTRAN)