function [B, elapse] = LSH_compress(X, model)
% LSH_compress: Compress process in Locality Sensitive Hashing
%
%    [B, elapse] = LSH_compress(X, model)
%
%              Input:
%                  X - Data matrix. Each row vector of data is a query point. 
%              model - Struct value in Matlab. The field in model is:
%                         U - The matrix record the random projection vectors
%
%             Output:
%                  B - The binary codes for query points
%             elapse - The compress time 
%
%   Examples:
%
%          [TestCode, TestTime] = LSH_compress(fTest, model); 
%
%   Reference:
%          M. Charikar. "Similarity estimation techniques from rounding algorithms". In STOC, pages 380-388, 2002.
%           
%      version 1.0 -- Feb/2012
%     
%      Written by Yue Lin (linyue29@gmail.com)

tmp_T = tic;
Ym = X * model.U;
B = (Ym > 0);
elapse = toc(tmp_T);

end
