basic.h

Note

The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded.

std::size_t ipow(std::size_t a, std::size_t n)

Return a to the power n. NOTE: Overflow is not checked! @param a (std::size_t)

Value
@param n (std::size_t)
Power

@return std::size_t

double rand()

Return a random number, uniformly distributed between [0.0, 1.0) @return double

void seed(std::size_t s)

Seed random number generator @param s (std::size_t)

Seed value
bool near(double x, double x0, double eps = DOLFIN_EPS)

Check whether x is close to x0 (to within DOLFIN_EPS) @param x (double)

First value
@param x0 (double)
Second value
@param eps (double)
Tolerance

@return bool

bool between(double x, std::pair<double, double> range)

Check whether x is between x0 and x1 (inclusive, to within DOLFIN_EPS) @param x (double)

Value to check
@param range (std::pair<double, double>)
Range to check

@return bool