www.pudn.com > firev0.01.rar > gaussiandensity.hpp
/* This file is part of the FIRE -- Flexible Image Retrieval System FIRE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. FIRE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FIRE; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file gaussiandensity.hpp * @author Thomas Deselaers * @date Tue Jun 24 19:20:34 2003 * * @brief A class to represent a gaussian distribution. * */ #ifndef __gaussian_density_hpp #define __gaussian_density_hpp #includeclass GaussianDensity { public: /** * default constructor. * */ GaussianDensity() { elements=0; } /** * constructor, describing the dimensionality of the data to be * described. * * @param dim the dimensionality of the data. */ GaussianDensity(const unsigned int dim) { elements=0; mean=::std::vector (dim,0.0); sigma=::std::vector (dim,0.0); } /** * copy constructor. * * @param from object to be copied. */ GaussianDensity(const GaussianDensity& from) { elements=from.elements; mean=from.mean; sigma=from.sigma; } /** * copy operator. * * @param rhs * */ const GaussianDensity operator=(const GaussianDensity& rhs) { elements=rhs.elements; mean=rhs.mean; sigma=rhs.sigma; return *this; } ::std::vector mean; ::std::vector sigma; unsigned int elements; }; inline std::ostream & operator<<(::std::ostream& os, const GaussianDensity &src) { os << "GaussianDensity: elements=" << src.elements << " dim=" << src.mean.size() << ::std::endl; for(unsigned int i=0;i