function geoms = calc_geoms(w,x)
%
% geoms = calc_geoms(w,x)
%
% (C) GAl Chechik, 2004
  
  % Check argin 
  if size(x,2) ~= length(w), error('Inconsistent sizes') ; end; 
  
  % Init 
  w = w(:)'; % A row vector 
  n = size(x,1);
  geoms = zeros(1,n);
  nw = sqrt(w*w'); % L2 norm
  
  for i=1:n
    inds = ~isnan(x(i,:));
    wi = w(inds);
    geoms(i) = sqrt(wi * wi');
  end

  geoms = geoms / nw;
  
 return
end