VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkKMeansDistanceFunctorCalculator Class Reference

measure distance from k-means cluster centers using a user-specified expression More...

#include <vtkKMeansDistanceFunctorCalculator.h>

Inheritance diagram for vtkKMeansDistanceFunctorCalculator:
Inheritance graph
[legend]
Collaboration diagram for vtkKMeansDistanceFunctorCalculator:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkKMeansDistanceFunctor Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkKMeansDistanceFunctorCalculatorNewInstance () const
virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual void operator() (double &, vtkVariantArray *, vtkVariantArray *)
virtual void SetDistanceExpression (const char *)
virtual char * GetDistanceExpression ()
virtual void SetFunctionParser (vtkFunctionParser *)
virtual vtkFunctionParserGetFunctionParser ()

Static Public Member Functions

static
vtkKMeansDistanceFunctorCalculator
New ()
static int IsTypeOf (const char *type)
static
vtkKMeansDistanceFunctorCalculator
SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkKMeansDistanceFunctorCalculator ()
virtual ~vtkKMeansDistanceFunctorCalculator ()

Protected Attributes

char * DistanceExpression
int TupleSize
vtkFunctionParserFunctionParser

Detailed Description

measure distance from k-means cluster centers using a user-specified expression

This is a subclass of the default k-means distance functor that allows the user to specify a distance function as a string. The provided expression is evaluated whenever the parenthesis operator is invoked but this is much slower than the default distance calculation.

User-specified distance expressions should be written in terms of two vector variables named "x" and "y". The length of the vectors will be determined by the k-means request and all columns of interest in the request must contain values that may be converted to a floating point representation. (Strings and vtkObject pointers are not allowed.) An example distance expression is "sqrt( (x0-y0)^2 + (x1-y1)^2 )" which computes Euclidian distance in a plane defined by the first 2 coordinates of the vectors specified.

Tests:
vtkKMeansDistanceFunctorCalculator (Tests)

Definition at line 32 of file vtkKMeansDistanceFunctorCalculator.h.


Member Typedef Documentation

Reimplemented from vtkKMeansDistanceFunctor.

Definition at line 36 of file vtkKMeansDistanceFunctorCalculator.h.


Constructor & Destructor Documentation


Member Function Documentation

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkKMeansDistanceFunctor.

static int vtkKMeansDistanceFunctorCalculator::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkKMeansDistanceFunctor.

virtual int vtkKMeansDistanceFunctorCalculator::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkKMeansDistanceFunctor.

Reimplemented from vtkKMeansDistanceFunctor.

Reimplemented from vtkKMeansDistanceFunctor.

Reimplemented from vtkKMeansDistanceFunctor.

virtual void vtkKMeansDistanceFunctorCalculator::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkKMeansDistanceFunctor.

virtual void vtkKMeansDistanceFunctorCalculator::operator() ( double ,
vtkVariantArray ,
vtkVariantArray  
) [virtual]

Compute the distance from one observation to another, returning the distance in the first argument.

Reimplemented from vtkKMeansDistanceFunctor.

virtual void vtkKMeansDistanceFunctorCalculator::SetDistanceExpression ( const char *  ) [virtual]

Set/get the distance function expression.

Set/get the distance function expression.

Set/get the string containing an expression which evaluates to the distance metric used for k-means computation. The scalar variables "x0", "x1", ... "xn" and "y0", "y1", ..., "yn" refer to the coordinates involved in the computation.

Set/get the string containing an expression which evaluates to the distance metric used for k-means computation. The scalar variables "x0", "x1", ... "xn" and "y0", "y1", ..., "yn" refer to the coordinates involved in the computation.


Member Data Documentation

Definition at line 62 of file vtkKMeansDistanceFunctorCalculator.h.

Definition at line 63 of file vtkKMeansDistanceFunctorCalculator.h.

Definition at line 64 of file vtkKMeansDistanceFunctorCalculator.h.


The documentation for this class was generated from the following file: