diff m-toolbox/classes/@minfo/clearSets.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@minfo/clearSets.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,28 @@
+% CLEARSETS Clear the sets and plists of the input minfo objects.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: CLEARSETS Clear the sets and plists of the input minfo
+%              objects.
+%
+% CALL:        objs = clearSets(objs)
+%              objs.clearSets()
+%
+% VERSION:     $Id: clearSets.m,v 1.2 2011/01/04 18:14:27 ingo Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function objs = clearSets(objs)
+  
+  % Decide on a deep copy or a modify
+  objs = copy(objs, nargout);
+  
+  for ii = 1:numel(objs)
+    objs(ii).sets = {};
+    objs(ii).plists = [];
+    
+    % Clear the sets and plists of the children
+    if ~isempty(objs(ii).children)
+      clearSets(objs(ii).children);
+    end
+    
+  end
+end