Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

SgFastLog Class Reference

Fast logarithm. More...

#include <SgFastLog.h>

List of all members.

Classes

union  IntFloat

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

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. http://www.icsi.berkeley.edu/pubs/techreports/TR-07-002.pdf

The implementation assumes that the platform uses IEEE 754 floats.

Definition at line 19 of file SgFastLog.h.


Constructor & Destructor Documentation

SgFastLog::SgFastLog ( int  mantissaBits  ) 
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 50 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 41 of file SgFastLog.h.

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

const int SgFastLog::m_mantissaBitsDiff [private]

Definition at line 39 of file SgFastLog.h.

Referenced by Log(), and SgFastLog().

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

Definition at line 37 of file SgFastLog.h.

Referenced by Log().


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


Sun Mar 13 2011 Doxygen 1.7.1