function [class] = gaussian_classify(DATA, MEANS, SIGS, PRIORS)
%
% Computes the density of each datapoint under each of the Gaussian classes.
%
% ---- Preconditions ---- 
% DATA: rows contain multidimensional datapoints (d columns)
% MEANS: the ith row is the mean of the ith model
% SIGS:  array of covariance matrices sigs(:,:,i) is the cov of ith model
% PRIOR: column vector with the prior of the ith model in the ith row.
% 
% ---- Postconditions ----
% class: a column vector where the nth row contains the classes of 
%       the datapoint in the nth row of data.
%
% ----- Description -----
% This function computes a density from a multigaussian model, where each
% gaussian has a different mean, covariance, and prior probability. In the
% case of one gaussian, the function will also work, naturally.


dens = gaussian_density(DATA, MEANS, SIGS, PRIORS);

class = zeros(size(dens));

[val ind] = max(dens');

for i = 1:size(class,1)
  class(i,ind(i)) = 1;
end

