PCL
pcl::Fact< T > Class Template Reference

Factorial function. More...

#include <Math.h>

Inherits pcl::FactorialCache.

Public Member Functions

Ln (int n) const noexcept
 
operator() (int n) const noexcept
 

Detailed Description

template<typename T>
class pcl::Fact< T >

We use a static lookup table to speed up for n <= 127.

Example of use:

double factorialOfEight = Fact<double>()( 8 ); // = 40320

The implementation of this class is thread-safe.

Deprecated:
This class is deprecated and subject to removal in a future version of PCL. For newly produced code, use the pcl::Factorial() and pcl::LnFactorial() functions instead.

Definition at line 760 of file Math.h.

Member Function Documentation

◆ Ln()

template<typename T >
T pcl::Fact< T >::Ln ( int  n) const
inlinenoexcept

Returns the natural logarithm of the factorial of n ≥ 0. For n <= 127 computes the natural logarithm of the factorial function directly. For n > 127 computes a series approximation, so that the function won't overflow even for very large arguments.

Definition at line 782 of file Math.h.

◆ operator()()

template<typename T >
T pcl::Fact< T >::operator() ( int  n) const
inlinenoexcept

Returns the factorial of n ≥ 0.

Definition at line 765 of file Math.h.


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