Doxygen 1.9.1
Toolkit for Adaptive Stochastic Modeling and Non-Intrusive ApproximatioN: Tasmanian v8.2 (development)
Math functions and constants
Collaboration diagram for Math functions and constants:

Files

file  tsgMathUtils.hpp
 Math functions and constants.
 

Functions

int TasGrid::Maths::intlog2 (int i)
 Computes std::floor(std::log2(i)), but uses only integer operations.
 
int TasGrid::Maths::int2log2 (int i)
 Computes std::pow(2, std::floor(std::log2(i))), but uses only integer operations.
 
int TasGrid::Maths::int3log3 (int i)
 Computes std::pow(3, std::floor(std::log(i) / std::log(2))), but uses only integer operations.
 
int TasGrid::Maths::pow2 (int p)
 Computes std::pow(2, p), but uses only integer operations.
 
int TasGrid::Maths::pow3 (int p)
 Computes std::pow(3, p), but uses only integer operations.
 
double TasGrid::Maths::sign (double p)
 Returns +1 or -1 with the same sign as p.
 

Variables

constexpr double TasGrid::Maths::pi = 3.14159265358979323846
 Half-period of the std::sin() and std::cos() functions. More...
 
constexpr double TasGrid::Maths::num_tol = 1.E-12
 Numerical tolerance for various algorithms. More...
 

Detailed Description

Variable Documentation

◆ pi

constexpr double TasGrid::Maths::pi = 3.14159265358979323846
constexpr

Half-period of the std::sin() and std::cos() functions.

Borrowed from "math.h", let's hope they don't change the value in a future standard.

◆ num_tol

constexpr double TasGrid::Maths::num_tol = 1.E-12
constexpr

Numerical tolerance for various algorithms.

num_tol is used in many places:

  • as a stopping criteria for various iterative schemes (e.g., finding leja points)
  • drop criteria for eigenvalue solver related to Gauss rules
  • comparison between nodes to detect repeated points in non-nested rules (e.g., all odd Chebyshev rules include zero)
  • determining sparse matrix pattern, entries smaller than num_tol will be ignored (for wavelet grids)
  • drop criteria in estimating anisotropic coefficients (refinement or just the coefficients) surpluses or Legendre coefficients below 10^3 times num_tol will be ignored