C# Класс RobustArithmetic.Test.Util.ExpansionExtensions

Various checks and conditions related for arbitrary-precision double expansions, implementing the various conditions from Shewchuk's paper.
Показать файл Открыть проект

Открытые методы

Метод Описание
AreAdjacent ( double x, double y ) : bool

Shewchuk p. 3 "Two floating-point values x and y are adjacent if they overlap, if x overlaps 2y, or if 2x overlaps y."

AreNonAdjacent ( double x, double y ) : bool
AreNonOverlapping ( double x, double y ) : bool

"Two floating-point values x and y are nonoverlapping if there exist integers r and s such that x = r.2^s and |y| < 2^s, OR y = r.2^s and |x| < 2^s."

AreOverlapping ( double x, double y ) : bool
IsNonAdjacent ( this doubles ) : bool

S.p3 "An expansion is nonadjacent if no two of its components are adjacent."

IsNonOverlapping ( this doubles ) : bool

S.p3 "An expansion is nonoverlapping if all its components are mutually nonoverlapping."

IsSorted ( this doubles ) : bool

Checks that the components are "sorted in order of increasing magnitude, except that any of the components may be zero". This is a condition used in Shewchuk Theorem 10, p. 10.

IsStronglyNonOverlapping ( this doubles ) : bool

S.p12 "An expansion is strongly nonoverlapping if no two of its components are overlapping, no component is adjacent to two other components, and any pair of adjacent components have the property that both components can be expressed with a one-bit significand (that is, both are powers of two)."

IsZeroElim ( this doubles ) : bool

Checks whether an expansion has been zero-eliminated. Either the expansion must have exactly one element, which is 0.0, or the expansion must have no 0.0 elements.

Print ( this e, int elen, double scale ) : void

Приватные методы

Метод Описание
ArePowersOfTwo ( double>.this doubles ) : bool
GetAdjacent ( IEnumerable doubles ) : double>>.IEnumerable

Returns The order of adjacency is not important, so the order of entries in the returned tuple is not significant.

NonOverlaps ( this x, double y ) : bool

Описание методов

AreAdjacent() публичный статический Метод

Shewchuk p. 3 "Two floating-point values x and y are adjacent if they overlap, if x overlaps 2y, or if 2x overlaps y."
public static AreAdjacent ( double x, double y ) : bool
x double
y double
Результат bool

AreNonAdjacent() публичный статический Метод

public static AreNonAdjacent ( double x, double y ) : bool
x double
y double
Результат bool

AreNonOverlapping() публичный статический Метод

"Two floating-point values x and y are nonoverlapping if there exist integers r and s such that x = r.2^s and |y| < 2^s, OR y = r.2^s and |x| < 2^s."
public static AreNonOverlapping ( double x, double y ) : bool
x double
y double
Результат bool

AreOverlapping() публичный статический Метод

public static AreOverlapping ( double x, double y ) : bool
x double
y double
Результат bool

IsNonAdjacent() публичный статический Метод

S.p3 "An expansion is nonadjacent if no two of its components are adjacent."
public static IsNonAdjacent ( this doubles ) : bool
doubles this
Результат bool

IsNonOverlapping() публичный статический Метод

S.p3 "An expansion is nonoverlapping if all its components are mutually nonoverlapping."
public static IsNonOverlapping ( this doubles ) : bool
doubles this
Результат bool

IsSorted() публичный статический Метод

Checks that the components are "sorted in order of increasing magnitude, except that any of the components may be zero". This is a condition used in Shewchuk Theorem 10, p. 10.
public static IsSorted ( this doubles ) : bool
doubles this
Результат bool

IsStronglyNonOverlapping() публичный статический Метод

S.p12 "An expansion is strongly nonoverlapping if no two of its components are overlapping, no component is adjacent to two other components, and any pair of adjacent components have the property that both components can be expressed with a one-bit significand (that is, both are powers of two)."
public static IsStronglyNonOverlapping ( this doubles ) : bool
doubles this
Результат bool

IsZeroElim() публичный статический Метод

Checks whether an expansion has been zero-eliminated. Either the expansion must have exactly one element, which is 0.0, or the expansion must have no 0.0 elements.
public static IsZeroElim ( this doubles ) : bool
doubles this
Результат bool

Print() публичный статический Метод

public static Print ( this e, int elen, double scale ) : void
e this
elen int
scale double
Результат void