ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
viennashe::math Namespace Reference

Namespace for all math specific code
More...

Namespaces

namespace  detail
 Implementations. Not intended to be used by a library user.
 

Classes

class  AssocLegendre
 Associated Legendre polynomial. More...
 
class  BindFirst
 Binds the first argument of a function of functor to a certain value. More...
 
class  BindSecond
 Binds the second argument of a function or functor to a certain value. More...
 
class  dense_matrix
 
class  IntAdaptiveRule
 Tag for an adaptive integration rule. More...
 
class  IntegrationBinder
 A binder for reducing an n-ary function to an n-1-ary function by integration over one variable. More...
 
class  IntGauss
 Gaussian integration rule. More...
 
class  IntMidPointRule
 Tag for the midpoint rule. More...
 
class  IntSimpsonRule
 Tag for the simpson rule. More...
 
class  IntTrapezoidalRule
 Tag for the trapezoidal rule. More...
 
class  iterate_not_found_exception
 Exception which is thrown if an iterate cannot be retrieved from the vector of iterates (unknowns) More...
 
struct  log_AssocLegendre
 Controls logging within the associated Legendre polynomial class. More...
 
struct  log_integrate
 Controls logging within the numerical integration routine. More...
 
struct  log_SphericalHarmonic_dTheta
 Controls logging for the derivative of spherical harmonics with respect to theta. More...
 
class  merseinne_twister_generator
 A pseudo-random number generator implementation using the merseinne twister MT 19937 cf. Makoto Matsumoto, Takuji Nishimura: Mersenne twister. "A 623-dimensionally equidistributed uniform pseudorandom number generator." ACM Transactions on Modeling and Computer Simulation 8, 1998. More...
 
class  normal_distribution
 
class  poisson_distribution
 A poisson (exponential) distribution of random numbers. More...
 
class  provided_solver_invalid_exception
 Exception which is thrown if a (linear) solver provided to some nonlinear solver is not valid (e.g. Nullpointer provided) More...
 
class  provided_updater_invalid_exception
 Exception which is thrown if an updater for a nonlinear solver is not valid (e.g. Nullpointer provided) More...
 
class  rand_generator_base
 The basic interface for pseudo-random number generators. More...
 
class  sparse_matrix
 Sparse matrix class based on a vector of binary trees for holding the entries. More...
 
class  spherical_harmonics_iterator
 Iteration over all spherical harmonics indices up to order L, with increasing indices l and m. More...
 
class  SphericalHarmonic
 A spherical harmonic. More...
 
class  SphericalHarmonic_dPhi
 Derivative of a spherical harmonic with respect to phi. More...
 
class  SphericalHarmonic_dTheta
 Derivative of a spherical harmonic with respect to theta. More...
 
class  SphericalHarmonic_dTheta_2
 Derivative of a spherical harmonic with respect to theta, alternative evaluation of theta-derivative. More...
 
class  std_rand_generator
 A pseudo-random number generator implementation based on std::rand() More...
 
class  truncated_solution_vector_size_exception
 Exception which is thrown if the size of a solution vector is truncated (too small or big) More...
 
class  uniform_distribution
 A uniform distribution of random numbers. More...
 

Typedefs

typedef detail::constants constants
 Convenience typedef for accessing mathematical constants, e.g. viennashe::math::constants::pi. More...
 

Enumerations

enum  harmonics_iteration_type { ALL_HARMONICS_ITERATION_ID = 0 , EVEN_HARMONICS_ITERATION_ID , ODD_HARMONICS_ITERATION_ID }
 An enumeration of spherical harmonics types (all, even, odd) ViennaSHE supports. More...
 

Functions

template<typename NumericT >
NumericT Bernoulli (NumericT x)
 The Bernoulli function f(x) = x / (exp(x) - 1). Avoids round-off errors near zero. More...
 
template<typename NumericT >
NumericT Bernoulli_dx (NumericT x)
 Derivative of the Bernoulli function. f'(x) = [exp(x) - 1 - x exp(x)] / (exp(x) - 1)^2. Avoids round-off errors near zero. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntMidPointRule)
 Integration of a function using the mid point rule. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntTrapezoidalRule)
 Integration of a function using the trapezoidal rule. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntSimpsonRule)
 Integration of a function using the simpson rule. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 1 >)
 Integration of a function using the Gauss rule, 1 evaluation node. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 2 >)
 Integration of a function using the Gauss rule, 2 evaluation nodes. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 3 >)
 Integration of a function using the Gauss rule, 3 evaluation nodes. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 4 >)
 Integration of a function using the Gauss rule, 4 evaluation nodes. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 5 >)
 Integration of a function using the Gauss rule, 5 evaluation nodes. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 6 >)
 Integration of a function using the Gauss rule, 6 evaluation nodes. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 7 >)
 Integration of a function using the Gauss rule, 7 evaluation nodes. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 8 >)
 Integration of a function using the Gauss rule, 8 evaluation nodes. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 9 >)
 Integration of a function using the Gauss rule, 9 evaluation nodes. More...
 
template<typename T >
double integrate (T const &f, double a, double b, IntGauss< 10 >)
 Integration of a function using the Gauss rule, 10 evaluation nodes. More...
 
template<typename T , typename U >
double integrate (T const &f, double a, double b, IntAdaptiveRule< U > adaptiverule, long recursion_depth=0)
 Integration of a function using an adaptive integration rule based on bisection of the integration interval. More...
 
template<typename T , typename IntRuleTag >
double integrate2D (double a1, double b1, double a2, double b2, T const &func2integrate, IntRuleTag)
 Convenience overload for two-dimensional integration. More...
 
template<typename VectorType >
VectorType::value_type norm_2 (VectorType const &v)
 
template<typename VectorType >
VectorType subtract (VectorType const &x, VectorType const &y)
 Helper routine for the generic vector subtraction z = x - y;. More...
 
template<typename NumericT , typename VectorT >
VectorT row_normalize_system (sparse_matrix< NumericT > &system_matrix, VectorT &rhs)
 Normalizes an equation system such that all diagonal entries are non-negative, and such that all 2-norms of the rows are unity. More...
 
template<typename NumericT >
std::ostream & operator<< (std::ostream &os, sparse_matrix< NumericT > const &system_matrix)
 Converts a sparse matrix (ublas, ViennaCL) to a string. Handy debugging facility. More...
 
template<typename NumericT , typename VectorType >
void check_types (sparse_matrix< NumericT > const &system_matrix, VectorType const &x)
 
template<typename NumericT , typename VectorType >
VectorType prod (sparse_matrix< NumericT > const &system_matrix, VectorType const &x)
 Computes A * x for a sparse A and a vector x. More...
 
double factorial (long n)
 Compute the factorial. More...
 
double doublefactorial (long n)
 Compute the double factorial, i.e. n(n-2)(n-4)... More...
 

Detailed Description

Namespace for all math specific code

Namespace containing mathematical tools.

Typedef Documentation

◆ constants

Convenience typedef for accessing mathematical constants, e.g. viennashe::math::constants::pi.

Definition at line 49 of file constants.hpp.

Enumeration Type Documentation

◆ harmonics_iteration_type

An enumeration of spherical harmonics types (all, even, odd) ViennaSHE supports.

Enumerator
ALL_HARMONICS_ITERATION_ID 
EVEN_HARMONICS_ITERATION_ID 
ODD_HARMONICS_ITERATION_ID 

Definition at line 158 of file forwards.h.

Function Documentation

◆ Bernoulli()

template<typename NumericT >
NumericT viennashe::math::Bernoulli ( NumericT  x)

The Bernoulli function f(x) = x / (exp(x) - 1). Avoids round-off errors near zero.

Definition at line 34 of file bernoulli.hpp.

◆ Bernoulli_dx()

template<typename NumericT >
NumericT viennashe::math::Bernoulli_dx ( NumericT  x)

Derivative of the Bernoulli function. f'(x) = [exp(x) - 1 - x exp(x)] / (exp(x) - 1)^2. Avoids round-off errors near zero.

Definition at line 49 of file bernoulli.hpp.

◆ check_types()

template<typename NumericT , typename VectorType >
void viennashe::math::check_types ( sparse_matrix< NumericT > const &  system_matrix,
VectorType const &  x 
)

Definition at line 308 of file linalg_util.hpp.

◆ doublefactorial()

double viennashe::math::doublefactorial ( long  n)
inline

Compute the double factorial, i.e. n(n-2)(n-4)...

Definition at line 52 of file spherical_harmonics.hpp.

◆ factorial()

double viennashe::math::factorial ( long  n)
inline

Compute the factorial.

Definition at line 42 of file spherical_harmonics.hpp.

◆ integrate() [1/14]

template<typename T , typename U >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntAdaptiveRule< U >  adaptiverule,
long  recursion_depth = 0 
)

Integration of a function using an adaptive integration rule based on bisection of the integration interval.

Definition at line 283 of file integrator.hpp.

◆ integrate() [2/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 1 >   
)

Integration of a function using the Gauss rule, 1 evaluation node.

Definition at line 140 of file integrator.hpp.

◆ integrate() [3/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 10 >   
)

Integration of a function using the Gauss rule, 10 evaluation nodes.

Definition at line 263 of file integrator.hpp.

◆ integrate() [4/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 2 >   
)

Integration of a function using the Gauss rule, 2 evaluation nodes.

Definition at line 147 of file integrator.hpp.

◆ integrate() [5/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 3 >   
)

Integration of a function using the Gauss rule, 3 evaluation nodes.

Definition at line 157 of file integrator.hpp.

◆ integrate() [6/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 4 >   
)

Integration of a function using the Gauss rule, 4 evaluation nodes.

Definition at line 168 of file integrator.hpp.

◆ integrate() [7/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 5 >   
)

Integration of a function using the Gauss rule, 5 evaluation nodes.

Definition at line 181 of file integrator.hpp.

◆ integrate() [8/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 6 >   
)

Integration of a function using the Gauss rule, 6 evaluation nodes.

Definition at line 196 of file integrator.hpp.

◆ integrate() [9/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 7 >   
)

Integration of a function using the Gauss rule, 7 evaluation nodes.

Definition at line 211 of file integrator.hpp.

◆ integrate() [10/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 8 >   
)

Integration of a function using the Gauss rule, 8 evaluation nodes.

Definition at line 228 of file integrator.hpp.

◆ integrate() [11/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntGauss< 9 >   
)

Integration of a function using the Gauss rule, 9 evaluation nodes.

Definition at line 245 of file integrator.hpp.

◆ integrate() [12/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntMidPointRule   
)

Integration of a function using the mid point rule.

Definition at line 118 of file integrator.hpp.

◆ integrate() [13/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntSimpsonRule   
)

Integration of a function using the simpson rule.

Definition at line 133 of file integrator.hpp.

◆ integrate() [14/14]

template<typename T >
double viennashe::math::integrate ( T const &  f,
double  a,
double  b,
IntTrapezoidalRule   
)

Integration of a function using the trapezoidal rule.

Definition at line 126 of file integrator.hpp.

◆ integrate2D()

template<typename T , typename IntRuleTag >
double viennashe::math::integrate2D ( double  a1,
double  b1,
double  a2,
double  b2,
T const &  func2integrate,
IntRuleTag   
)

Convenience overload for two-dimensional integration.

\int_{a1}^{b1} \int_{a2}^{b2} func2integrate(x,y) dy dx

Template Parameters
IntRuleTagThe integration rule to be used
Parameters
a1Lower integration bound for the first variable
b1Upper integration bound for the second variable
a2Lower integration bound for the first variable
b2Upper integration bound for the second variable
func2integrateThe integrand

Definition at line 357 of file integrator.hpp.

◆ norm_2()

template<typename VectorType >
VectorType::value_type viennashe::math::norm_2 ( VectorType const &  v)

Definition at line 37 of file linalg_util.hpp.

◆ operator<<()

template<typename NumericT >
std::ostream & viennashe::math::operator<< ( std::ostream &  os,
sparse_matrix< NumericT > const &  system_matrix 
)

Converts a sparse matrix (ublas, ViennaCL) to a string. Handy debugging facility.

Definition at line 285 of file linalg_util.hpp.

◆ prod()

template<typename NumericT , typename VectorType >
VectorType viennashe::math::prod ( sparse_matrix< NumericT > const &  system_matrix,
VectorType const &  x 
)

Computes A * x for a sparse A and a vector x.

Does not apply expression template fancyness, but this is not a performance-critical routine anyway...

Definition at line 385 of file linalg_util.hpp.

◆ row_normalize_system()

template<typename NumericT , typename VectorT >
VectorT viennashe::math::row_normalize_system ( sparse_matrix< NumericT > &  system_matrix,
VectorT &  rhs 
)

Normalizes an equation system such that all diagonal entries are non-negative, and such that all 2-norms of the rows are unity.

Definition at line 202 of file linalg_util.hpp.

◆ subtract()

template<typename VectorType >
VectorType viennashe::math::subtract ( VectorType const &  x,
VectorType const &  y 
)

Helper routine for the generic vector subtraction z = x - y;.

Does not use any expression template magic. This, however, is okay, as this function is in no way performance critical.

Definition at line 51 of file linalg_util.hpp.