Sleipnir
Public Member Functions
Sleipnir::CMeasureAutocorrelate Class Reference

Autocorrelates an underlying measure by rotating input vectors and returning the minimum result. More...

#include <measure.h>

Inheritance diagram for Sleipnir::CMeasureAutocorrelate:
Sleipnir::CMeasureImpl Sleipnir::IMeasure

Public Member Functions

 CMeasureAutocorrelate (const IMeasure *pMeasure, bool fMemory)
 Construct a new autocorrelation measure wrapping the given underlying measure.
double Measure (const float *adX, size_t iN, const float *adY, size_t iM, EMap eMap=EMapNone, const float *adWX=NULL, const float *adWY=NULL) const
 Calculate the measure between two given vectors with optional element weights.
const char * GetName () const
 Return the human-readable unique identifier of the measure type.
bool IsRank () const
 Return true if the measure requires rank-based integer inputs.
IMeasureClone () const
 Create a copy of the current measure object.

Detailed Description

Autocorrelates an underlying measure by rotating input vectors and returning the minimum result.

An autocorrelation measure takes an underlying measure U and two input vectors [X0, ..., XN] and [Y0, ..., YM] and returns the maximum of:

 U([X0, ..., XN], [Y0, ..., YM])
 U([X0, ..., XN], [Y1, ..., YM, Y0])
 U([X0, ..., XN], [Y2, ..., YM, Y0, Y1])
 ...
 U([X0, ..., XN], [YM, Y0, ..., YM-1])

This is useful for dealing with periodic signals in data (e.g. cell cycle microarrays).

Definition at line 307 of file measure.h.


Constructor & Destructor Documentation

Sleipnir::CMeasureAutocorrelate::CMeasureAutocorrelate ( const IMeasure pMeasure,
bool  fMemory 
) [inline]

Construct a new autocorrelation measure wrapping the given underlying measure.

Parameters:
pMeasureMeasure whose result should be autocorrelated.
fMemoryIf true, the new autocorrelation measure is responsible for releasing the underlying measure's memory.
Remarks:
If fMemory is true, the autocorrelation measure will delete pMeasure when it is destroyed; otherwise, it will only hold a reference.

Definition at line 323 of file measure.h.

Referenced by Clone().


Member Function Documentation

IMeasure* Sleipnir::CMeasureAutocorrelate::Clone ( ) const [inline, virtual]

Create a copy of the current measure object.

Returns:
Copy of the current measure object.
Remarks:
Caller is, of course, responsible for destroying the created object.

Implements Sleipnir::IMeasure.

Definition at line 336 of file measure.h.

References Sleipnir::IMeasure::Clone(), and CMeasureAutocorrelate().

const char* Sleipnir::CMeasureAutocorrelate::GetName ( ) const [inline, virtual]

Return the human-readable unique identifier of the measure type.

Returns:
The string identifier of the measure type.

Implements Sleipnir::IMeasure.

Definition at line 328 of file measure.h.

References Sleipnir::IMeasure::GetName().

bool Sleipnir::CMeasureAutocorrelate::IsRank ( ) const [inline, virtual]

Return true if the measure requires rank-based integer inputs.

Returns:
True if the measure requires rank-based input vectors.
Remarks:
The input vectors for rank measures should contain only floating point values with no fractional part; behavior is undefined if they don't.

Implements Sleipnir::IMeasure.

Definition at line 332 of file measure.h.

References Sleipnir::IMeasure::IsRank().

double Sleipnir::CMeasureAutocorrelate::Measure ( const float *  adX,
size_t  iN,
const float *  adY,
size_t  iM,
EMap  eMap = EMapNone,
const float *  adWX = NULL,
const float *  adWY = NULL 
) const [virtual]

Calculate the measure between two given vectors with optional element weights.

Parameters:
adXFirst array of values.
iNLength of first array.
adYSecond array of values.
iMLength of second array.
eMapWay in which returned value should be centered (implementation-specific).
adWXIf non-null, weights of elements in the first array.
adWYIf non-null, weights of elements in the second array.
Returns:
Measure calculated between the two input vectors and, optionally, weights.
Remarks:
Pretty much every implementation will puke if given bad input; bounds checking etc. is minimal.

Implements Sleipnir::IMeasure.

Definition at line 684 of file measure.cpp.

References Sleipnir::CMeta::GetNaN(), and Sleipnir::IMeasure::Measure().


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