#line 1 "/user/cvsspst/ees1cg/RAVL/RAVL-0.7/PatternRec/DataSet/SampleVector.hh" // This file is part of RAVL, Recognition And Vision Library // Copyright (C) 2001, University of Surrey // This code may be redistributed under the terms of the GNU Lesser // General Public License (LGPL). See the lgpl.licence file for details or // see http://www.gnu.org/copyleft/lesser.html // file-header-ends-here #ifndef RAVL_SAMPLEVECTOR_HEADER #define RAVL_SAMPLEVECTOR_HEADER 1 //! rcsid="$Id: SampleVector.hh,v 1.10 2002/06/13 18:24:13 craftit Exp $" //! author="Kieron Messer" //! docentry="Ravl.Pattern Recognition.Data Set" //! lib=RavlPatternRec //! file="Ravl/PatternRec/DataSet/SampleVector.hh" #include "Ravl/PatternRec/Sample.hh" #include "Ravl/Vector.hh" #include "Ravl/Matrix.hh" namespace RavlN { class MatrixRUTC; class MeanCovarianceC; //! userlevel=Normal //: Sample of vectors. // This class expects all the vectors in the sample to be of the same // size. class SampleVectorC : public SampleC { public: SampleVectorC(SizeT maxSize=10) : SampleC(maxSize) {} //: Create a sample of data with a maximum size SampleVectorC(const SArray1dC & dat) : SampleC(dat) {} //: Create a sample of data from an array SampleVectorC(const SampleC &svec) : SampleC(svec) {} //: Construct from base class. UIntT VectorSize() const; //: Get the size of vectors in this sample. VectorC Mean() const; //: Find the mean vector of the sample. MeanCovarianceC MeanCovariance() const; //: Find the mean and covariance of the sample MatrixRUTC SumOuterProducts() const; //: Compute the sum of the outerproducts. MatrixC TMul(const SampleC &sam2) const; //: Compute the sum of the outerproducts. // sam2 must have the same size as this sample vector. MatrixRUTC SumOuterProducts(const SampleC &w) const; //: Compute the sum of the outerproducts weighting each with the corresponding value from 'w'. MatrixC TMul(const SampleC &sam2,const SampleC &w) const; //: Compute the sum of the outerproducts weighting each with the corresponding value from 'w'. // sam2 must have the same size as this sample vector. }; } #endif