src/GamIO/ML5AF.cc
/* These are the functions which will input an Array Flags sub-element in
   MATLAB ".mat" binary format, version 5.  Note that in a valid MATLAB MAT 
   file, a "Array Flags Sub-Element" is a combination of Tag + Data. The data
   will be 8 bytes where the 3rd byte are the Flags and the 4th byte the Class.
 
                Input           ML5AF	: MAT version 5 array flags SE (this)
                                fp      : Input file stream
				bigend  : Data storage endian type 
                                warn    : Warning output level
                                                0 = no warnings
                                                1 = warnings
                                               >1 = fatal warnings
                Output          void    : ML5AF is set from values found
                                          in the input stream
                Note                    : No care is taken to insure the
                                          tag is read from the top of a data
                                          element (as it should be in MATLAB)*/
These are the functions which will input an Array Flags sub-element in
MATLAB ".mat" binary format, version 5.  Note that in a valid MATLAB MAT
file, a "Array Flags Sub-Element" is a combination of Tag + Data. The data
will be 8 bytes where the 3rd byte are the Flags and the 4th byte the Class.


These are the functions which will input an Array Flags sub - element in MATLAB " . mat " binary format version 5 . Note that in a valid MATLAB MAT file a " Array Flags Sub - Element " is a combination of Tag + Data . The data will be 8 bytes where the 3rd byte are the Flags and the 4th byte the Class .
int MatLab5AF::read(std::fstream& fp, int bigend, int warn)
  {
  if(!MatLab5SE::read(fp, bigend, (warn)?1:0))	
    {                                           
    if(warn)                                    
      {                                         
      if(warn==1) MLAF5error(10, 1);
      else        MLAF5fatality(10);
      }
    return 0;
    } 						
  if(bigend) 					
    { 						
    Class = int(MLData[3]); 			
    Fs    = int(MLData[2]); 			
    }
  else 						
    { 						
    Fs    = int(MLData[1]);
    Class = int(MLData[0]);
    }
  return 1;
  }
int MatLab5AF :: read ( std :: fstream & fp , int bigend , int warn ) { if ( ! MatLab5SE :: read ( fp , bigend , ( warn ) ? 1 : 0 ) ) { if ( warn ) { if ( warn == 1 ) MLAF5error ( 10 , 1 ) ; else MLAF5fatality ( 10 ) ; } return 0 ; } if ( bigend ) { Class = int ( MLData [ 3 ] ) ; Fs = int ( MLData [ 2 ] ) ; } else { Fs = int ( MLData [ 1 ] ) ; Class = int ( MLData [ 0 ] ) ; } return 1 ; }
These are the functions which will input an Array Flags sub-element in
MATLAB ".mat" binary format, version 5.
These are the functions which will input an Array Flags sub - element in MATLAB " . mat " binary format version 5 .
// Read sub-element // If this has problems, then // we must deal with them // appropriately now // Now set array type (class) & // array flags.  These take up // 1 byte each & may need swap // Here if big -> little/big // (this is tested & works) // Here if little -> little/big // (this is tested & works)