function [yt,t] = vcm(xt, x, y, lambda, M, t)
%VCM	
%	xt: testing data
%	x, y: n*2 and n*1 (support vectors)
%	lambda: n*1
%	M: (1+x'*x)^M is the generalized inner-product.

lmy = lambda .* y;
if nargin < 6
	VCp = find(y > 0);
	VCm = find(y < 0);
	t = lmy .* ((1 + x*x(VCp(1),:)').^M + (1 + x*x(VCm(1),:)').^M);
	t = sum(t)/2;
end

yt = lmy' * (1 + x*xt').^M - t;