/*---------------------------------------------------------------------------*
 *                                   IT++			             *
 *---------------------------------------------------------------------------*
 * Copyright (c) 1995-2004 by Tony Ottosson, Thomas Eriksson, Pål Frenger,   *
 * Tobias Ringström, and Jonas Samuelsson.                                   *
 *                                                                           *
 * Permission to use, copy, modify, and distribute this software and its     *
 * documentation under the terms of the GNU General Public License is hereby *
 * granted. No representations are made about the suitability of this        *
 * software for any purpose. It is provided "as is" without expressed or     *
 * implied warranty. See the GNU General Public License for more details.    *
 *---------------------------------------------------------------------------*/

/*! 
  \file 
  \brief Vector quantizer trainer
  \author Thomas Eriksson

  1.4

  2004/10/19 13:47:03
*/

#ifndef __vqtrain_h
#define __vqtrain_h

#include "base/mat.h"
#include "base/array.h"

namespace itpp {

  /*! 
    \ingroup sourcecoding
    \brief Function for vector quantization training

    The following code illustrates how the VQ can be trained.

	\code
    VQ			Quantizer;
	mat			A;
	Array<vec>	database;

	// read vectors into database somehow
	...

	// train a vq
	A=vqtrain(database,1024,1000000);
	Quantizer.set_codebook(A);
    \endcode
  */

double kmeansiter(Array<vec> &DB, mat &codebook);
mat kmeans(Array<vec> &DB, int SIZE, int NOITER=9999, bool VERBOSE=true);
mat lbg(Array<vec> &DB, int SIZE, int NOITER=9999, bool VERBOSE=true);
mat vqtrain(Array<vec> &DB, int SIZE, int NOITER, double STARTSTEP=0.2, bool VERBOSE=true);

} // namespace itpp

#endif


syntax highlighted by Code2HTML, v. 0.9.1