function [similarity,cluster_assignments,points]=read_from_data_file(filePrefix,directory)
% function [similarity,cluster_assignments,points]=read_from_data_file(filePrefix,directory)
% Reads the similarity,cluster assignments and the points (if present)
% from the file "directory/filePrefix.mat". The data file must have been
% created by write_data_file. 
% If given just one argument it assumes the default value of "data" for
% the directory. 
  
  if nargin==1
	directory='data'; 
  end 
  filePrefix=strcat(directory,'/',filePrefix); 
  
  clear('similarity____local', 'cluster_assignment____local','points____local');

  dataFile=strcat(filePrefix,'.mat'); 
  load(dataFile  , 'similarity____local', 'cluster_assignment____local','points____local');
  similarity=similarity____local; 
  cluster_assignments=cluster_assignment____local;
  points=points____local;

  %sanity check 
  clear('similarity____local', 'cluster_assignment____local','points____local');
  
  
