Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgFastLog Class Reference

#include <SgFastLog.h>

List of all members.

Detailed Description

Fast logarithm.

Computes a fast single precision logarithm based on a lookup table.

O. Vinyals, G. Friedland, N. Mirghafori: Revisiting a basic function on current CPUs: A fast logarithm implementation with adjustable accuracy.

The implementation assumes that the platform uses IEEE 754 floats.

Definition at line 21 of file SgFastLog.h.

Public Member Functions

 SgFastLog (int mantissaBits)
 ~SgFastLog ()
float Log (float val) const
 Get natural logarithm.

Private Member Functions

 SgFastLog (const SgFastLog &)
 Not implemented.
SgFastLogoperator= (const SgFastLog &)
 Not implemented.

Private Attributes

const int m_mantissaBitsDiff
float * m_lookupTable

Static Private Attributes

static const int MAX_MANTISSA_BITS = 23


union  IntFloat

Constructor & Destructor Documentation

SgFastLog::SgFastLog ( int  mantissaBits  ) 

Definition at line 28 of file SgFastLog.cpp.

References SgFastLog::IntFloat::m_float, SgFastLog::IntFloat::m_int, m_lookupTable, and m_mantissaBitsDiff.

SgFastLog::~SgFastLog (  ) 

Definition at line 44 of file SgFastLog.cpp.

References m_lookupTable.

SgFastLog::SgFastLog ( const SgFastLog  )  [private]

Not implemented.

Member Function Documentation

float SgFastLog::Log ( float  val  )  const

Get natural logarithm.

Definition at line 52 of file SgFastLog.h.

References SgFastLog::IntFloat::m_float, SgFastLog::IntFloat::m_int, m_lookupTable, m_mantissaBitsDiff, and MAX_MANTISSA_BITS.

Referenced by SgUctSearch::Log().

SgFastLog& SgFastLog::operator= ( const SgFastLog  )  [private]

Not implemented.

Member Data Documentation

float* SgFastLog::m_lookupTable [private]

Definition at line 43 of file SgFastLog.h.

Referenced by Log(), SgFastLog(), and ~SgFastLog().

const int SgFastLog::m_mantissaBitsDiff [private]

Definition at line 41 of file SgFastLog.h.

Referenced by Log(), and SgFastLog().

const int SgFastLog::MAX_MANTISSA_BITS = 23 [static, private]

Definition at line 39 of file SgFastLog.h.

Referenced by Log().

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

17 Jun 2010 Doxygen 1.4.7