src/GamIO/ML4DElem.cc
/* These are the functions which will input a data element in MATLAB ".mat"
   binary format, version 4.  Note that in a valid MATLAB MAT file a 
   "Data Element" is a combination of Tag + Data.
 
                Input           ML4DE   : MAT version 4 dim. array (this)
                                fp      : Input file stream
                                warn	: Warning output level
						0 = no warnings
						1 = warnings
                                               >1 = fatal warnings
                Output          void    : ML4DE is set from values found
                                          in the input stream
                Note                    : No care is taken to insure the
                                          dim. array is read from the top of
 					  a data element (as it should be 
					  in MATLAB)                         */
These are the functions which will input a data element in MATLAB ".mat"
binary format, version 4.  Note that in a valid MATLAB MAT file a
"Data Element" is a combination of Tag + Data.

Input           ML4DE   : MAT version 4 dim. array (this)
fp      : Input file stream
warn    : Warning output level
0 = no warnings
1 = warnings
>1 = fatal warnings
Output          void    : ML4DE is set from values found
in the input stream
Note                    : No care is taken to insure the
dim. array is read from the top of
a data element (as it should be
in MATLAB)
These are the functions which will input a data element in MATLAB " . mat " binary format version 4 . Note that in a valid MATLAB MAT file a " Data Element " is a combination of Tag + Data . Input ML4DE : MAT version 4 dim . array ( this ) fp : Input file stream warn : Warning output level 0 = no warnings 1 = warnings > 1 = fatal warnings Output void : ML4DE is set from values found in the input stream Note : No care is taken to insure the dim . array is read from the top of a data element ( as it should be in MATLAB )
int MatLab4DE::read(std::fstream& fp, int warn)
  {
  int TF = Tag.read(fp, (warn)?1:0);	
  TF *= ReadName(fp, (warn)?1:0);	
  TF *= ReadMx(fp, (warn)?1:0);		
  if(TF)
    {					
    if(warn)				
      {					
      if(warn==1) MLDE4error(10, 1);
      else        MLDE4fatality(10);
      }
    return 0;
    }
  return 1;
  }
int MatLab4DE :: read ( std :: fstream & fp , int warn ) { int TF = Tag . read ( fp , ( warn ) ? 1 : 0 ) ; TF *= ReadName ( fp , ( warn ) ? 1 : 0 ) ; TF *= ReadMx ( fp , ( warn ) ? 1 : 0 ) ; if ( TF ) { if ( warn ) { if ( warn == 1 ) MLDE4error ( 10 , 1 ) ; else MLDE4fatality ( 10 ) ; } return 0 ; } return 1 ; }
These are the functions which will input a data element in MATLAB ".mat"
binary format, version 4.
These are the functions which will input a data element in MATLAB " . mat " binary format version 4 .
// Read data element tag // Read data element name // Read data element data // If this has problems, then // we must deal with them // appropriately now