
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% General description:
%%
%% This file contains demo Matlab scripts for subspace partitioning. This
%% is a part of the Raman spectroscopy project. A complete package for this
%% project can be downloaded at 
%%    http://mlsp.umbc.edu/codes/raman_codes.html
%%
%% Written by: Wei Wang
%% 8/27/2007
%%
%% Copyright(c) 2007 by
%% Machine Learning for Signal Processing Laboratory
%% University of Maryland, Baltimore County
%%
%% Permission to use, copy, modify, and distribute this software for any
%% purpose without fee is hereby granted, provided that this entire notice
%% is included in all copies of any software which is or includes a copy
%% or modification of this software and in all copies of the supporting
%% documentation for such software.
%% THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
%% WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR DOES NOT MAKE ANY
%% REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
%% OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all;
close all;

load('./TSP08_LibrarySpectra.mat');   %load in 'lbryMtrx'

threshold=0.9; % thereshold for library partitioning

JCSDAgentMaxID=30; % - the largest index of agent in JCSD spectrum library.
%                      Above this number are spectra of surface or
%                      intefernent materials, which should not be included
%                      in clusters.

[clusters, list_corr_pairs]=...
    JCSD_LibraryPartitioning(libs, threshold, JCSDAgentMaxID);
save partitioning_results.mat libs clusters list_corr_pairs;


