function [missA,correctA,missB,correctB] = cross_classify(Tree,Atest,Btest)
% MSMT_CLASSIFY determines the number of points properly and not properly 
%	classified by the MSM-T algorithm.
%
%	[missA,correctA,missB,correctB] = msmt_classify(Tree,Atest,Btest)
%
%	missA: number of points of A misclassified
%	missB: number of points of B misclassified
%	correctA: number of points of A correctly classified
%	correctB: number of points of B correctly classified
%
%	Tree: matrix representing the decision tree generated by MSM-T.
%	Atest: matrix of test points from A
%	Btest: matrix of test points from B
%	NOTE: ASSUME A is such that Aw <= theta
%                    B is such that Bw > theta

missA = 0;
correctA = 0;
missB = 0;
correctB = 0;

% test each point of Atest
Aresults = msmt_split(Tree,Atest);

% determine missA, correct A:
for i = 1:size(Aresults,2)
	
	if (Aresults(i) == 0)	% correct
		correctA = correctA + 1;
	else			% incorrect
		missA = missA + 1;
	end
end

% test each point of Btest
Bresults = msmt_split(Tree,Btest);

for i = 1:size(Bresults,2)

	if (Bresults(i) == 1)	% correct
		correctB = correctB + 1;
	else
		missB = missB + 1;
	end
end



