src/GamIO/ML5DA.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.
   The data type 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 32-bit
   integers, so the data type should be MATLAB type miINT32, i.e. value 5.

                Input           ML5DA   : MAT version 5 dimensions array (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 ML5DA 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.
The data type 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 32-bit
integers, so the data type should be MATLAB type miINT32, i.e. value 5.


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 . The data type 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 32 - bit integers so the data type should be MATLAB type miINT32 i . e . value 5 .
int MatLab5DA::write(std::fstream& fp) const
  {
  int TF = MLTag.write(fp);			
  int32_t LI;					
  for(int i=0; i<ND; i++)			
    {						
    LI = Sizes[i];
    fp.write((char*)&LI, sizeof(int32_t));
    }
  return TF;
  }
int MatLab5DA :: write ( std :: fstream & fp ) const { int TF = MLTag . write ( fp ) ; int32_t LI ; for ( int i = 0 ; i < ND ; i ++ ) { LI = Sizes [ i ] ; fp . write ( ( char * ) & LI , sizeof ( int32_t ) ) ; } return TF ; }
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 .
// Write the Tag (uncompressed) // Use long integer for output // Now write out all the array // dimensions as long integers