function [Asmall,Abig,Bsmall,Bbig] = msmt_divvy(A,B,w,theta)
% MSMT_DIVVY determines which rows of A and B (i.e. points) that lie
%	on either side of the plane wx = theta (i.e. divvy's these
%	points up correctly).
%
%	[Asmall,Abig,Bsmall,Bbig] = msmt_divvy(A,B,w,theta)
%
% 	generates the vectors Asmall,Abig,Bsmall,Bbig as follows:
%	Asmall = { i : A(i,:)w <= e(theta) }
%	Abig   = { i : A(i,:)w >  e(theta) }
%	Bsmall = { i : B(i,:)w <= e(theta) }
%    	Bbig   = { i : B(i,:)w >  e(theta) }

% first, determine number of rows in A,B
m = size(A,1);
k = size(B,1);

% initialize vectors Asmall,Abig,Bsmall,Bbig
Asmall = [];
Bsmall = [];
Abig = [];
Bbig = [];

% determine the vectors Asmall and Abig:
for i = 1:m
	if (A(i,:)*w <= theta)
		Asmall = [Asmall,i];
	else
		Abig = [Abig,i];
	end
end

% determine the vectors Bsmall,Bbig:
for i = 1:k
	if (B(i,:)*w <= theta)
		Bsmall = [Bsmall,i];
	else
		Bbig = [Bbig,i];
	end
end
% that should do it.


