src/GamIO/ML5AF.cc
/* These are the functions which will output this sub-element in MATLAB ".mat"
   binary format, version 5.  This is done with a pair {tag,data}.  Both the
   tag & data will be written directly from these functions, bypassing the
   associated class structures which have no knowledge of GAMMA array types.

   Remember, the MATLAB MAT version 5 tag for this sub-element contains
   8-bytes with two important settings: 1.) data type & 2.) # of bytes.
   This will be written in compact form, i.e. the sub-element containing a
   total of eight bytes.  The first two bytes contain the # of bytes, the 2nd
   two bytes contain the data type, and  is placed in the first 4 bytes and 
   the number of bytes placed into the last 4 bytes (for non-compressed data 
   elements which we will always output...).  In this case, we output the 
   elements as doubles so that the data type should be MATLAB type miDOUBLE, 
   i.e. value 9.

                Input           ML5Re   : MAT version 5 reals SE (this)
                                fp      : Output file stream
                                mx      : GAMMA matrix
                                rv      : GAMMA row vector
                                cv      : GAMMA column vector
                Output          void    : Output file stream is modified
                                          by having the ML5Re written to it
                Note                    : No care taken herein to insure the
                                          sub-element is properly written.   */
These are the functions which will output this sub-element in MATLAB ".mat"
binary format, version 5.  This is done with a pair {tag,data}.  Both the
tag & data will be written directly from these functions, bypassing the
associated class structures which have no knowledge of GAMMA array types.

Remember, the MATLAB MAT version 5 tag for this sub-element contains
8-bytes with two important settings: 1.) data type & 2.) # of bytes.
This will be written in compact form, i.e. the sub-element containing a
total of eight bytes.  The first two bytes contain the # of bytes, the 2nd
two bytes contain the data type, and  is placed in the first 4 bytes and
the number of bytes placed into the last 4 bytes (for non-compressed data
elements which we will always output...).  In this case, we output the
elements as doubles so that the data type should be MATLAB type miDOUBLE,
i.e. value 9.


These are the functions which will output this sub - element in MATLAB " . mat " binary format version 5 . This is done with a pair { tag data } . Both the tag & data will be written directly from these functions bypassing the associated class structures which have no knowledge of GAMMA array types . Remember the MATLAB MAT version 5 tag for this sub - element contains 8 - bytes with two important settings : 1 . ) data type & 2 . ) # of bytes . This will be written in compact form i . e . the sub - element containing a total of eight bytes . The first two bytes contain the # of bytes the 2nd two bytes contain the data type and is placed in the first 4 bytes and the number of bytes placed into the last 4 bytes ( for non - compressed data elements which we will always output ... ) . In this case we output the elements as doubles so that the data type should be MATLAB type miDOUBLE i . e . value 9 .
int MatLab5AF::write(std::fstream& fp) const
  {
  MLTag.write(fp);				
  char Data[8];
  if(WeRBigEnd())				
    {						
    Data[3] = char(Class);			
    Data[2] = char(Fs);			
    }						
  else						
    {
    Data[0] = char(Class);			
    Data[1] = char(Fs);			
    }
  fp.write((char*)&Data, 8*sizeof(char));
  return 1;
  }
int MatLab5AF :: write ( std :: fstream & fp ) const { MLTag . write ( fp ) ; char Data [ 8 ] ; if ( WeRBigEnd ( ) ) { Data [ 3 ] = char ( Class ) ; Data [ 2 ] = char ( Fs ) ; } else { Data [ 0 ] = char ( Class ) ; Data [ 1 ] = char ( Fs ) ; } fp . write ( ( char * ) & Data , 8 * sizeof ( char ) ) ; return 1 ; }
These are the functions which will output this sub-element in MATLAB ".mat"
binary format, version 5.
These are the functions which will output this sub - element in MATLAB " . mat " binary format version 5 .
// First write the tag // Set array type (class) and // array flags.  These take up // one byte each & are witten // to file together as a 4 byte // integer.  So we may have to // untangle it if byte swapped // one byte each & are witten // to file together as a 4 byte