The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
Main Page
Data Structures
Files
File List
Globals
numerical.h
Go to the documentation of this file.
1
31
#pragma once
32
33
#include <stdbool.h>
34
36
typedef
uint64_t
seed_type
;
37
42
typedef
struct
_numerical_state
{
43
seed_type
seed
;
44
double
gset
;
45
bool
iset
;
46
}
numerical_state_t
;
47
48
void
numerical_init(
void
);
49
50
51
// without this stuff dijkstra on thousands of nodes would probably fail horribly:
52
// this is needed in order to lose less precision on hundreds of double additions
53
55
struct
_sum_helper_t
{
56
double
sum;
57
double
crt;
58
};
59
60
double
NeumaierSum
(
unsigned
cnt,
double
addendums[cnt]);
61
struct
_sum_helper_t
PartialNeumaierSum(struct _sum_helper_t sh, double addendum);
62
63
#define ValueSumHelper(a) (a.crt + a.sum)
64
65
#define CmpSumHelpers(a, b) ({\
66
double __a_s = a.sum + a.crt;\
67
double __b_s = b.sum + b.crt;\
68
(__a_s > __b_s) - (__b_s > __a_s);\
69
})
70
numerical_state_t
struct _numerical_state numerical_state_t
seed_type
uint64_t seed_type
Numerical seed type.
Definition:
numerical.h:36
NeumaierSum
double NeumaierSum(unsigned cnt, double addendums[cnt])
Definition:
numerical.c:432
_numerical_state::seed
seed_type seed
Definition:
numerical.h:43
_sum_helper_t
this represents a partial Neumaier sum
Definition:
numerical.h:55
_numerical_state
Definition:
numerical.h:42
_numerical_state::gset
double gset
Definition:
numerical.h:44
_numerical_state::iset
bool iset
Definition:
numerical.h:45
src
lib
numerical.h
Generated by
1.8.11