function [B, elapse] = DSH_compress(A, model)
%   This is a wrapper function of Density Sensitive Hashing testing.
%
%     [B, elapse] = DSH_compress(A, model)
%
%	      A: Rows of vectors of data points. Each row is sample point
%     model: The model generated by DSH_learn.
%
%	      B: The binary code of the input data A. Each row is sample point
%    elapse: The coding time (testing time).
%
%
%
%   Reference:
%
%   Zhongming Jin, Cheng Li, Yue Lin, Deng Cai: Density Sensitive Hashing.
%   IEEE Trans. Cybernetics 44(8): 1362-1371 (2014) 
%           
%           
%           
%   version 2.0 --Nov/2016 
%   version 1.0 -- Feb/2012
%     
%      Written by Yue Lin (linyue29@gmail.com)
%                 Deng Cai (dengcai AT gmail DOT com) 


res = repmat(model.intercept', size(A,1), 1);

tmp_T = tic;
Ym = A * model.U';
B = (Ym > res);
elapse = toc(tmp_T);

end
