Home > classes > @plist > eq.m

eq

PURPOSE ^

EQ overloads the == operator for plist objects.

SYNOPSIS ^

function result = eq(p1,p2)

DESCRIPTION ^

 EQ overloads the == operator for plist objects.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: EQ overloads the == operator for plist objects.
 
              Each parameter is checked (order must be the same).

 CALL:        result = eq(p1,p2)

 INPUTS:      p1,p2 - input plist objects

 OUTPUTS:     If the two plist objects are considered equal, result == 1,
              otherwise, result == 0.
 
 VERSION:     $Id: param.m,v 1.7 2007/08/17 11:22:11 ingo Exp $

 HISTORY:     29-08-2007 M Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function result = eq(p1,p2)
0002 
0003 % EQ overloads the == operator for plist objects.
0004 %
0005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0006 %
0007 % DESCRIPTION: EQ overloads the == operator for plist objects.
0008 %
0009 %              Each parameter is checked (order must be the same).
0010 %
0011 % CALL:        result = eq(p1,p2)
0012 %
0013 % INPUTS:      p1,p2 - input plist objects
0014 %
0015 % OUTPUTS:     If the two plist objects are considered equal, result == 1,
0016 %              otherwise, result == 0.
0017 %
0018 % VERSION:     $Id: param.m,v 1.7 2007/08/17 11:22:11 ingo Exp $
0019 %
0020 % HISTORY:     29-08-2007 M Hewitson
0021 %                 Creation
0022 %
0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0024 
0025 % Assume equality to begin with
0026 result = 1;
0027 
0028 %% check each param
0029 
0030 
0031 if length(p1.params) ~= length(p2.params)
0032   result = 0;
0033   return
0034 end
0035 
0036 for j=1:length(p1.params)
0037   
0038   if p1.params(j) ~= p2.params(j)
0039     result = 0;
0040     return
0041   end
0042   
0043 end
0044

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003