Open Babel: OBSqrtTbl Class Reference

Public Member Functions

# OBSqrtTbl Class Reference

Square Root lookup table - given a distance squared returns distance. More...

`#include <openbabel/obutil.h>`

List of all members.

## Public Member Functions
| OBSqrtTbl ()
| OBSqrtTbl (const double max, const double incr)
| ~OBSqrtTbl ()
double | Sqrt (double d2) const
void | Init (double max, double incr)

## Detailed Description

Square Root lookup table - given a distance squared returns distance.

## Constructor & Destructor Documentation

OBSqrtTbl | ( | ) | `[inline]`

OBSqrtTbl | ( | const double | max,
|  | const double | incr
| ) |  | `[inline]`

Create a square root table to handle up to the square root of `max` (e.g., if you want the square root of 144, supply 12 for max)

Parameters:

  max | The maximum square root stored in the lookup table
  incr | The floating point resolution of the lookup table

~OBSqrtTbl | ( | ) | `[inline]`

## Member Function Documentation

double Sqrt | ( | double | d2 ) | const`[inline]`

Fast square root calculation using a lookup table.

Returns:
  Square root of `d2`

void Init | ( | double | max,
|  | double | incr
| ) |  | `[inline]`

Initialize the square root lookup table.

Parameters:

  max | The maximum square root stored in the lookup table (e.g., if you want the square root of 144, supply 12 for max)
  incr | The floating point resolution of the lookup table

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

- obutil.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines