1#ifndef INTARNA_PARTITIONARITHMETIC_H_
2#define INTARNA_PARTITIONARITHMETIC_H_
25 if (!(x>=0 && x<=std::numeric_limits<Z_type>::max())
26 || (x>0 && x<std::numeric_limits<Z_type>::min()))
27 throw std::range_error(
"partition arithmetic: numerical range exceeded");
35 if (a==0 || b==0)
return 0;
37 if (r==0)
throw std::range_error(
"partition arithmetic: product underflow");
42 if (b==0)
throw std::range_error(
"partition arithmetic: zero denominator");
44 if (a>0 && r==0)
throw std::range_error(
"partition arithmetic: quotient underflow");
49 if (r==0)
throw std::range_error(
"partition arithmetic: exponential underflow");
Definition PartitionArithmetic.h:11
static Z_type divide(const Z_type a, const Z_type b)
Definition PartitionArithmetic.h:40
static Z_type check(const Z_type x)
Definition PartitionArithmetic.h:24
static Z_type multiply(const Z_type a, const Z_type b)
Definition PartitionArithmetic.h:33
static Z_type add(const Z_type a, const Z_type b)
Definition PartitionArithmetic.h:30
static Z_type exp(const Z_type exponent)
Definition PartitionArithmetic.h:47
#define Z_exp
Definition general.h:90
Definition Accessibility.h:13
double Z_type
type for probabilities, RT and Boltzmann values
Definition general.h:88