Loading...
Searching...
No Matches
ExactReduction.h File Reference
#include <cmath>
#include <cstddef>
#include <Eigen/Core>

Go to the source code of this file.

Namespaces

namespace  eonc
 RAII resource manager for the ARTn C library with global synchronization.
namespace  eonc::exact

Functions

double eonc::exact::dot (const double *x, const double *y, std::size_t n)
 Round-to-nearest-even value of the exact sum of x[i] * y[i].
double eonc::exact::sum (const double *x, std::size_t n)
 Round-to-nearest-even value of the exact sum of x[i].
double eonc::exact::sumStrided (const double *x, std::size_t n, std::size_t stride)
 Same sum for x[i * stride].
double eonc::exact::orderedDot (const double *x, const double *y, std::size_t n)
 A fixed summation tree: four lanes (term i goes to lane i mod 4, each lane a left-to-right sum of rounded products), then (l0 + l1) + (l2 + l3).
template<typename A, typename B>
double eonc::exact::dot (const Eigen::MatrixBase< A > &x, const Eigen::MatrixBase< B > &y)
template<typename A, typename B>
double eonc::exact::orderedDot (const Eigen::MatrixBase< A > &x, const Eigen::MatrixBase< B > &y)
template<typename A>
double eonc::exact::squaredNorm (const Eigen::MatrixBase< A > &x)
template<typename A>
double eonc::exact::norm (const Eigen::MatrixBase< A > &x)
 sqrt of the correctly rounded squared norm; IEEE sqrt is itself correctly rounded, so this is reproducible as well.
template<typename A>
double eonc::exact::orderedNorm (const Eigen::MatrixBase< A > &x)
 sqrt of orderedDot(x, x): reproducible, not correctly rounded.
template<typename A>
A::PlainObject eonc::exact::normalized (const Eigen::MatrixBase< A > &x, double min_norm=1e-300)
 x / norm(x), or zero below min_norm (the safemath convention).