GSI_Toolbox 1.0.0 A toolbox for Gas-Surface Interaction simulations

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Hermite< T > Class Template Reference

Class for computing Hermite polynomials and related operations. More...

`#include <Hermite_Tools.h>`

## Public Member Functions
| Hermite ()
| Default constructor for Hermite class.
| ~Hermite ()
| Destructor for Hermite class.
Matrix< T > | evaluate (Matrix< T > coefficients, Matrix< T > values)
| Evaluates the Hermite polynomial at specified values.
T | evaluate (Matrix< T > coefficients, T value)
| Evaluates the Hermite polynomial at a single value.
Matrix< T > | coefficients_deriv (Matrix< T > coefficients)
| Computes the derivative of the Hermite polynomial coefficients.
Matrix< T > | evaluate_deriv (Matrix< T > coefficients, Matrix< T > values)
| Evaluates the derivative of the Hermite polynomial at specified values.
T | evaluate_deriv (Matrix< T > coefficients, T value)
| Evaluates the derivative of the Hermite polynomial at a single value.
Matrix< T > | import_data (const char *file)
| Imports data for roots or weights from a file.
Matrix< T > | get_roots (unsigned int order)
| Retrieves the roots of the Hermite polynomial of specified order.
Matrix< T > | get_weights (unsigned int order)
| Retrieves the weights of the Hermite polynomial of specified order.
Matrix< T > | compute_coefficients (unsigned int order, T(*func)(T))
| Computes the coefficients for the Hermite polynomial using a given function.

## Detailed Description

template<typename T>
class Hermite< T >

Class for computing Hermite polynomials and related operations.

The Hermite class provides methods for evaluating Hermite polynomials, computing their derivatives, and importing data for roots and weights.

Template Parameters

  T | The data type used for computations (e.g., float, double).

## Constructor & Destructor Documentation

## ◆ Hermite()

template<typename T >

Hermite< T >::Hermite | ( |  | ) |

Default constructor for Hermite class.

Initializes the Hermite polynomial roots and weights by importing data.

Initializes the Hermite polynomial by importing roots and weights from data files.

## Member Function Documentation

## ◆ coefficients_deriv()

template<typename T >

Matrix< T > Hermite< T >::coefficients_deriv | ( | Matrix< T > | coefficients | ) |

Computes the derivative of the Hermite polynomial coefficients.

Computes the derivative of Hermite polynomial coefficients.

Parameters

  coefficients | Coefficients of the Hermite polynomial.

Returns
  Matrix<T> Coefficients of the derivative of the Hermite polynomial.

## ◆ compute_coefficients()

template<typename T >

Matrix< T > Hermite< T >::compute_coefficients | ( | unsigned int | order,
|  | T(* | func )(T) )

Computes the coefficients for the Hermite polynomial using a given function.

Computes the coefficients of the Hermite polynomial for a given function.

Parameters

  order | The order of the Hermite polynomial.
  func | Pointer to the function used to compute the coefficients.

Returns
  Matrix<T> The coefficients of the Hermite polynomial.

This function computes the coefficients of the Hermite polynomial of the specified order by evaluating the provided function at the roots of the polynomial and using the weights for integration. The coefficients are calculated based on these values.

Parameters

  order | The order of the Hermite polynomial.
  func | Pointer to the function to be used for computing the coefficients.

Returns
  Matrix<T> The computed coefficients of the Hermite polynomial.

## ◆ evaluate() [1/2]

template<typename T >

Matrix< T > Hermite< T >::evaluate | ( | Matrix< T > | coefficients,
|  | Matrix< T > | values )

Evaluates the Hermite polynomial at specified values.

Evaluates the Hermite polynomial at specified matrix values.

Parameters

  coefficients | Coefficients of the Hermite polynomial.
  values | Matrix of input values at which to evaluate the polynomial.

Returns
  Matrix<T> Resulting values of the evaluated polynomial.

## ◆ evaluate() [2/2]

template<typename T >

T Hermite< T >::evaluate | ( | Matrix< T > | coefficients,
|  | T | value )

Evaluates the Hermite polynomial at a single value.

Parameters

  coefficients | Coefficients of the Hermite polynomial.
  value | The input value at which to evaluate the polynomial.

Returns
  T The resulting value of the evaluated polynomial.

## ◆ evaluate_deriv() [1/2]

template<typename T >

Matrix< T > Hermite< T >::evaluate_deriv | ( | Matrix< T > | coefficients,
|  | Matrix< T > | values )

Evaluates the derivative of the Hermite polynomial at specified values.

Evaluates the derivative of the Hermite polynomial at specified matrix values.

Parameters

  coefficients | Coefficients of the Hermite polynomial.
  values | Matrix of input values at which to evaluate the derivative.

Returns
  Matrix<T> Resulting values of the evaluated derivative.

This function first computes the derivative of the Hermite polynomial coefficients and then evaluates the resulting derivative polynomial at the given input matrix values.

Parameters

  coefficients | Coefficients of the Hermite polynomial.
  values | Matrix of input values at which to evaluate the derivative.

Returns
  Matrix<T> The resulting values of the evaluated derivative.

## ◆ evaluate_deriv() [2/2]

template<typename T >

T Hermite< T >::evaluate_deriv | ( | Matrix< T > | coefficients,
|  | T | value )

Evaluates the derivative of the Hermite polynomial at a single value.

Parameters

  coefficients | Coefficients of the Hermite polynomial.
  value | The input value at which to evaluate the derivative.

Returns
  T The resulting value of the evaluated derivative.

This function first computes the derivative of the Hermite polynomial coefficients and then evaluates the resulting derivative polynomial at the given input value.

Parameters

  coefficients | Coefficients of the Hermite polynomial.
  value | The input value at which to evaluate the derivative.

Returns
  T The resulting value of the evaluated derivative.

## ◆ get_roots()

template<typename T >

Matrix< T > Hermite< T >::get_roots | ( | unsigned int | order | ) |

Retrieves the roots of the Hermite polynomial of specified order.

Retrieves the roots of the Hermite polynomial of the specified order.

Parameters

  order | The order of the Hermite polynomial.

Returns
  Matrix<T> The roots of the Hermite polynomial.

This function retrieves the roots from the precomputed data. If the order exceeds the maximum order, an error is printed, and an empty matrix is returned.

Parameters

  order | The order of the Hermite polynomial.

Returns
  Matrix<T> The roots of the Hermite polynomial for the specified order.

## ◆ get_weights()

template<typename T >

Matrix< T > Hermite< T >::get_weights | ( | unsigned int | order | ) |

Retrieves the weights of the Hermite polynomial of specified order.

Retrieves the weights of the Hermite polynomial of the specified order.

Parameters

  order | The order of the Hermite polynomial.

Returns
  Matrix<T> The weights of the Hermite polynomial.

This function retrieves the weights from the precomputed data. If the order exceeds the maximum order, an error is printed, and an empty matrix is returned.

Parameters

  order | The order of the Hermite polynomial.

Returns
  Matrix<T> The weights of the Hermite polynomial for the specified order.

## ◆ import_data()

template<typename T >

Matrix< T > Hermite< T >::import_data | ( | const char * | file | ) |

Imports data for roots or weights from a file.

Imports data (e.g., roots or weights) from a file.

Parameters

  file | The filename containing the data.

Returns
  Matrix<T> The imported data as a matrix.

The imported data is expected to be formatted with the first two values in the file representing the number of rows and columns, followed by the actual data values.

Parameters

  file | The filename containing the data.

Returns
  Matrix<T> The imported data as a matrix.

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

- src/Hermite_Tools.h